[cbuild2cmake] Improve zephyr module generation#473
Conversation
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
|
Coverage Impact This PR will not change total coverage. Modified Files with Diff Coverage (1)
🛟 Help
|
There was a problem hiding this comment.
Pull request overview
Reworks zephyr module file generation so that output paths are anchored to the current working directory (where generation runs) rather than the solution input root, making output deterministic and workspace-driven. Also simplifies the Kconfig Source: field and stabilizes pack ordering in the generated sources.cmake.
Changes:
- Introduce
ZephyrMaker.BaseDir(set fromos.Getwd()) and replacem.SolutionRootwith it in all output path computations (module.yml, Kconfig, CMakeLists.txt, sources.cmake, copied constructed files, and pack-path relative computation). - Replace the relative
Source:path in Kconfig with justfilepath.Base(zephyrLayer.Clayer.File). - Iterate
PackPathsviasortedmap.AsSortedMapto produce deterministic pack ordering in the generated CMake.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| pkg/maker/zephyr.go | Adds BaseDir, switches output anchoring from SolutionRoot to BaseDir, simplifies Kconfig source line, and sorts pack iteration. |
| pkg/maker/zephyr_test.go | Sets BaseDir in unit tests, updates expected Kconfig Source: value, adds an os.Chdir to the integration test, and adds a pack-ordering assertion. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
04d3d7b to
d28d688
Compare

Fixes
Changes
Checklist