Skip to content

deps: resolve bidirectional thread_system dependency risk#254

Merged
kcenon merged 5 commits into
mainfrom
feature/resolve-bidirectional-dependency-252
Dec 26, 2025
Merged

deps: resolve bidirectional thread_system dependency risk#254
kcenon merged 5 commits into
mainfrom
feature/resolve-bidirectional-dependency-252

Conversation

@kcenon

@kcenon kcenon commented Dec 26, 2025

Copy link
Copy Markdown
Owner

Summary

  • Add CMake conflict detection for bidirectional dependency between logger_system and thread_system
  • Document recommended configuration patterns in THREAD_SYSTEM.md
  • Add integration tests for dependency configuration scenarios

Changes

CMake Conflict Detection

  • Add check_bidirectional_dependency_risk() function that detects when both LOGGER_USE_THREAD_SYSTEM and BUILD_WITH_LOGGER_SYSTEM are enabled
  • Emit detailed warning with recommended configuration

Documentation Updates

  • Add "Dependency Configuration" section to THREAD_SYSTEM.md (EN/KO)
  • Include dependency flow diagram showing both integration directions
  • Document recommended configuration matrix for different use cases
  • Add safe configuration examples with CMake flags

Integration Tests

  • Add thread_system_integration_test.cpp with tests for:
    • Compile-time detection verification
    • Backend state management
    • Enable/disable cycle safety
    • Logger operation in standalone mode

Related Issues

Test Plan

  • Verify CMake warning appears when both flags are enabled
  • Run integration tests in standalone mode (LOGGER_USE_THREAD_SYSTEM=OFF)
  • Run integration tests with thread_system (LOGGER_USE_THREAD_SYSTEM=ON)
  • Verify documentation renders correctly

Add CMake function check_bidirectional_dependency_risk() that:
- Detects when both LOGGER_USE_THREAD_SYSTEM and BUILD_WITH_LOGGER_SYSTEM are enabled
- Inspects thread_system target for BUILD_WITH_LOGGER_SYSTEM compile definition
- Emits detailed warning with recommended configuration

This addresses Issue #252 by providing early warning for circular
dependency risk between logger_system and thread_system.

Refs: #252
Update THREAD_SYSTEM.md (EN/KO) with:
- Dependency flow diagram showing both integration directions
- Recommended configuration matrix for different use cases
- Safe configuration examples with CMake flags
- CMake conflict detection documentation
- Related issue references (#252)

Refs: #252
Add thread_system_integration_test.cpp with tests for:
- Compile-time detection (has_thread_system_support)
- Default backend state verification
- Enable/disable cycle safety
- Submit task behavior in both modes
- Logger standalone mode operation
- Conditional integration pattern

Tests run in both LOGGER_HAS_THREAD_SYSTEM enabled and disabled builds.

Refs: #252
Add thread_system linking to integration tests CMakeLists.txt to
provide include paths required by thread_system_integration.h when
LOGGER_HAS_THREAD_SYSTEM is defined.

Refs: #252
Update thread_system_integration tests to handle cases where thread
pool creation fails (common in CI coverage builds with resource
constraints). Tests now skip gracefully instead of failing.

Refs: #252
@kcenon kcenon merged commit 49fd0bc into main Dec 26, 2025
29 checks passed
@kcenon kcenon deleted the feature/resolve-bidirectional-dependency-252 branch December 26, 2025 13:37
kcenon added a commit that referenced this pull request Apr 13, 2026
* feat(cmake): add bidirectional dependency detection for thread_system

Add CMake function check_bidirectional_dependency_risk() that:
- Detects when both LOGGER_USE_THREAD_SYSTEM and BUILD_WITH_LOGGER_SYSTEM are enabled
- Inspects thread_system target for BUILD_WITH_LOGGER_SYSTEM compile definition
- Emits detailed warning with recommended configuration

This addresses Issue #252 by providing early warning for circular
dependency risk between logger_system and thread_system.

Refs: #252

* docs: add dependency configuration section for bidirectional risk

Update THREAD_SYSTEM.md (EN/KO) with:
- Dependency flow diagram showing both integration directions
- Recommended configuration matrix for different use cases
- Safe configuration examples with CMake flags
- CMake conflict detection documentation
- Related issue references (#252)

Refs: #252

* test: add integration tests for thread_system dependency configuration

Add thread_system_integration_test.cpp with tests for:
- Compile-time detection (has_thread_system_support)
- Default backend state verification
- Enable/disable cycle safety
- Submit task behavior in both modes
- Logger standalone mode operation
- Conditional integration pattern

Tests run in both LOGGER_HAS_THREAD_SYSTEM enabled and disabled builds.

Refs: #252

* fix(test): link thread_system in integration tests when enabled

Add thread_system linking to integration tests CMakeLists.txt to
provide include paths required by thread_system_integration.h when
LOGGER_HAS_THREAD_SYSTEM is defined.

Refs: #252

* fix(test): handle thread pool creation failure gracefully

Update thread_system_integration tests to handle cases where thread
pool creation fails (common in CI coverage builds with resource
constraints). Tests now skip gracefully instead of failing.

Refs: #252
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

deps: Resolve bidirectional thread_system dependency risk

1 participant