Skip to content

fix(cli): centralize backend resolution for configure - #40

Merged
srpatcha merged 2 commits into
embeddedos-org:masterfrom
prerna1001:codex/fix-configure-backend-resolution
Aug 27, 2026
Merged

fix(cli): centralize backend resolution for configure#40
srpatcha merged 2 commits into
embeddedos-org:masterfrom
prerna1001:codex/fix-configure-backend-resolution

Conversation

@prerna1001

Copy link
Copy Markdown
Contributor

Summary

This PR fixes ebuild configure so it respects explicit, configured, and auto-detected backends instead of always taking the native Ninja path.

Issue Addressed

ebuild configure did not follow the same backend-selection flow as ebuild build. Even when a project explicitly configured a backend or could be auto-detected as cmake, meson, cargo, make, or kbuild, configure always took the native Ninja path and generated build.ninja.

This created inconsistent CLI behavior and made configure less reliable for non-Ninja projects.

Proposed Approach and Implementation

  • centralized backend resolution into a shared helper used by both build and configure
  • added --backend support to ebuild configure so it matches the build command
  • made configure backend-aware:
    • ninja generates build.ninja and compile_commands.json
    • cmake and meson dispatch to backend configure steps
    • cargo, make, and kbuild return a clean no-op configure message
  • improved configure-related error handling in the same flow:
    • malformed YAML now returns a concise configuration error
    • external backend command failures now return cleaner CLI errors

Testing

Manual validation performed:

  • verified cmake auto-detection and configure flow
  • verified cmake CLI override over configured backend
  • verified native ninja generation path
  • verified cargo no-op configure behavior
  • verified invalid YAML returns a clean configuration error

Automated validation performed:

  • python3 -m pytest tests/ebuild/test_cli_backend_resolution.py -q
  • 17 passed

Additional Considerations / Limitations

Meson backend selection and configure dispatch were manually verified, but full local execution could not be completed because the meson executable was unavailable in the local environment.

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.

2 participants