What happened?
The Ninja backend derives object paths by replacing each source suffix with .o. Within one target, source files that share a basename but use different extensions therefore map to the same output.
For example, src/start.c and src/start.S both generate _build/obj/app/src/start.o. Ninja rejects the generated manifest because multiple build rules declare the same output, so valid mixed C and assembly targets cannot build.
Expected behavior
Object paths should retain enough of the complete source filename to remain unique while preserving target namespacing:
src/start.c → _build/obj/app/src/start.c.o
src/start.S → _build/obj/app/src/start.S.o
The compilation database should use the same object paths as the Ninja manifest.
Reproduction steps
- Define one executable target containing
src/start.c and src/start.S.
- Generate the Ninja build manifest.
- Inspect the object outputs or run
ninja -n.
- Observe that both compile rules declare
_build/obj/app/src/start.o, causing Ninja to reject the manifest with a duplicate-output error.
Version or commit
Upstream master before PR #133; reproduced at the parent of commit 5cc570d
Environment
Platform-independent Ninja manifest generation. Reproduced in the Python Ninja backend tests on Windows; the generated manifest was also checked with a real Ninja dry run.
Logs or diagnostics
Submission checks
What happened?
The Ninja backend derives object paths by replacing each source suffix with
.o. Within one target, source files that share a basename but use different extensions therefore map to the same output.For example,
src/start.candsrc/start.Sboth generate_build/obj/app/src/start.o. Ninja rejects the generated manifest because multiple build rules declare the same output, so valid mixed C and assembly targets cannot build.Expected behavior
Object paths should retain enough of the complete source filename to remain unique while preserving target namespacing:
src/start.c→_build/obj/app/src/start.c.osrc/start.S→_build/obj/app/src/start.S.oThe compilation database should use the same object paths as the Ninja manifest.
Reproduction steps
src/start.candsrc/start.S.ninja -n._build/obj/app/src/start.o, causing Ninja to reject the manifest with a duplicate-output error.Version or commit
Upstream master before PR #133; reproduced at the parent of commit 5cc570d
Environment
Platform-independent Ninja manifest generation. Reproduced in the Python Ninja backend tests on Windows; the generated manifest was also checked with a real Ninja dry run.
Logs or diagnostics
Submission checks