Merged
Conversation
…erties instead of source file flags
…andling and consolidating target properties
…s and update dependencies
… validation logic
Member
Author
|
Tests failed, working on it |
Member
Author
|
Introduced a bug where no tests are detected. Working on it |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
… file detection, and update .gitignore with common patterns
…gement and linking order
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR modernizes the CMake build system by replacing variable propagation through PARENT_SCOPE with INTERFACE library targets that serve as central configuration hubs. The refactoring centralizes build configuration through the alkos.kernel.config target and consolidates third-party dependencies under alkos.kernel.thirdparty.
- Replaced
PARENT_SCOPEvariable passing with property-based configuration throughINTERFACEtargets - Consolidated third-party dependencies into a single
alkos.kernel.thirdpartytarget - Modernized CRT object file handling while maintaining the existing linking order
Reviewed Changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| alkos/kernel/CMakeLists.txt | Main kernel configuration refactored to use properties and simplified CRT linking |
| alkos/kernel/arch/x86_64/CMakeLists.txt | Architecture variables converted to target properties instead of parent scope |
| alkos/kernel/arch/x86_64/kernel/CMakeLists.txt | CRT object creation split into separate targets and paths set as properties |
| alkos/kernel/thirdparty/CMakeLists.txt | Third-party library aggregation through interface target |
| alkos/cmake/ValidationHelpers.cmake | Added property validation function and improved variable checking |
| alkos/CMakeLists.txt | Top-level configuration retrieval from properties instead of variables |
| .github/actions/prepare_env/action.yaml | Fixed CI pipeline ordering to install toolchain before configuration |
| scripts/env/toolchain_versions.txt | Updated toolchain versions |
Comments suppressed due to low confidence (2)
scripts/env/toolchain_versions.txt:1
- binutils version 2.44 does not exist. The latest stable release is 2.43.1. Consider using an existing version.
binutils=2.44
scripts/env/toolchain_versions.txt:3
- GCC version 15.1.0 does not exist. The latest stable release is 14.2.0. Consider using an existing version.
gcc=15.1.0
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…or x86_64 and i386 architectures
… remove redundant properties
Jlisowskyy
approved these changes
Aug 10, 2025
Comment on lines
+76
to
+78
| # TODO: Immediately here, error checking should happen | ||
| # But the error checking itself fails!!! and for some reason | ||
| # alkos_ensure_property_defined() says the property is not defined |
kryczkal
added a commit
that referenced
this pull request
Oct 22, 2025
### CMake Refactoring Summary
This update modernizes the CMake build system by replacing
`PARENT_SCOPE` variable passing with `INTERFACE` library targets, which
act as central hubs for properties and dependencies.
**Key Improvements:**
* **Centralized Configuration:**
* The `alkos.kernel.config` `INTERFACE` library is now a central data
bus.
* Architecture-specific files set their properties directly on this
target.
* The top-level `CMakeLists.txt` queries this target, eliminating
complex variable management.
* The `alkos.kernel.deps` Intreface library was added as a public target
to for others to link to. This was supposed to be a fasade to hide the
custom linking order logic from other modules. (The .deps lib would just
be linked in the proper place by kernel). This is currently USELESS. It
was important when I tried to move towards a target_link_libraries
approach, but I failed. This will be important again if I try again. For
now it doesn't hurt so let it stay. I may retry some time in the future
to avoid the hardcoded crti.
* **Simplified Linker Logic:**
* Removed the fragile override of `CMAKE_CXX_LINK_EXECUTABLE`.
* `crti` and `crtn` are now `OBJECT` libraries, and their paths are
queried dynamically.
* The kernel executable links these objects in the correct order using
the standard `target_link_libraries`.
* **Streamlined Dependencies:**
* The `alkos.kernel.thirdparty` `INTERFACE` library aggregates all
third-party dependencies like `uACPI`.
* The main kernel links against this single target to pull in all
necessary third-party code.
* **Enhanced Helper Functions:**
* Added `alkos_ensure_property_defined` for robust property validation.
* Improved `alkos_ensure_defined` to handle both undefined and empty
variables.
* **Fixed Bug in CI/CD Pipeline**
* Pipeline configured alkos before installing toolchain. This somehow
worked. But after my changes to cmake, this doesn't work, so I reorderd
it to fix it.
# Failures
I tried to refactor the crti crtn logic. I failed. I was able to get to
a point where the crti objects are automatically found by cmake (no
hardcoded paths), and I was able to link it using target_link_libraries.
But i have no idea if the ordering was ensured. Kernel compiled but no
tests were detected. This is too much work for too little gain. I left
the hardcoded paths to be there and simply upgraded their propagation to
the .config library.
#159 Previous part
---------
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
CMake Refactoring Summary
This update modernizes the CMake build system by replacing
PARENT_SCOPEvariable passing withINTERFACElibrary targets, which act as central hubs for properties and dependencies.Key Improvements:
Centralized Configuration:
alkos.kernel.configINTERFACElibrary is now a central data bus.CMakeLists.txtqueries this target, eliminating complex variable management.alkos.kernel.depsIntreface library was added as a public target to for others to link to. This was supposed to be a fasade to hide the custom linking order logic from other modules. (The .deps lib would just be linked in the proper place by kernel). This is currently USELESS. It was important when I tried to move towards a target_link_libraries approach, but I failed. This will be important again if I try again. For now it doesn't hurt so let it stay. I may retry some time in the future to avoid the hardcoded crti.Simplified Linker Logic:
CMAKE_CXX_LINK_EXECUTABLE.crtiandcrtnare nowOBJECTlibraries, and their paths are queried dynamically.target_link_libraries.Streamlined Dependencies:
alkos.kernel.thirdpartyINTERFACElibrary aggregates all third-party dependencies likeuACPI.Enhanced Helper Functions:
alkos_ensure_property_definedfor robust property validation.alkos_ensure_definedto handle both undefined and empty variables.Fixed Bug in CI/CD Pipeline
Pipeline configured alkos before installing toolchain. This somehow worked. But after my changes to cmake, this doesn't work, so I reorderd it to fix it.
Failures
I tried to refactor the crti crtn logic. I failed. I was able to get to a point where the crti objects are automatically found by cmake (no hardcoded paths), and I was able to link it using target_link_libraries. But i have no idea if the ordering was ensured. Kernel compiled but no tests were detected. This is too much work for too little gain. I left the hardcoded paths to be there and simply upgraded their propagation to the .config library.
#159 Previous part