Skip to content

fix: avoid ninja object path collisions - #133

Open
aman-sharma-dev wants to merge 1 commit into
embeddedos-org:masterfrom
aman-sharma-dev:assessment-ebuild
Open

fix: avoid ninja object path collisions#133
aman-sharma-dev wants to merge 1 commit into
embeddedos-org:masterfrom
aman-sharma-dev:assessment-ebuild

Conversation

@aman-sharma-dev

@aman-sharma-dev aman-sharma-dev commented Sep 11, 2026

Copy link
Copy Markdown

Summary

Fix Ninja object-file path collisions when source files in the same target have the same basename but different extensions.

Previously, sources such as src/start.c and src/start.S both mapped to src/start.o, causing Ninja to reject the generated build graph due to duplicate outputs.

Object paths now preserve the source extension, producing start.c.o and start.S.o.

Type of Change

  • feat — New feature
  • fix — Bug fix
  • docs — Documentation only
  • style — Formatting, no code change
  • refactor — Code restructuring without behavior change
  • test — Add or fix tests
  • build — Build system or dependency changes
  • ci — CI/CD pipeline changes
  • perf — Performance improvement

Changes

  • Preserve source extensions when generating Ninja object-file paths.
  • Add regression coverage for same-basename sources with different extensions and generated output-path consistency.

Testing

  • Unit tests pass (ctest --test-dir build --output-on-failure)
  • Integration tests pass
  • Manual testing performed
  • New tests added for new functionality

Focused Ninja backend tests: 19 passed.

Ninja dry-run validation (ninja -n): passed.

Full Python test suite: 667 passed, 10 failed, 7 skipped. The 10 failures were reproduced against the original backend and are unrelated to this change.

Pre-Submission Checklist

  • Code compiles without warnings (-Wall -Wextra -Werror for C)
  • All existing tests pass
  • New tests added for new functionality
  • Documentation updated if API changed
  • Commit messages follow convention
  • Branch is rebased on latest master

Related Issues

N/A

Screenshots / Logs

N/A

Additional Notes

The full-suite failures are pre-existing and reproduce without this change.

Signed-off-by: aman-sharma-dev <amansharma.devloper@gmail.com>
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.

1 participant