Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

output filename collision between two builds of the same rustc_codegen_spirv crate #409

Closed
joshtriplett opened this issue Feb 9, 2021 · 3 comments
Labels
t: bug Something isn't working

Comments

@joshtriplett
Copy link

joshtriplett commented Feb 9, 2021

Building rust-gpu triggers rust-lang/cargo#6313 in Cargo:

warning: output filename collision.
The lib target `rustc_codegen_spirv` in package `rustc_codegen_spirv v0.2.0 (/home/josh/src/rust-gpu/crates/rustc_codegen_spirv)` has the same output filename as the lib target `rustc_codegen_spirv` in package `rustc_codegen_spirv v0.2.0 (/home/josh/src/rust-gpu/crates/rustc_codegen_spirv)`.
Colliding filename is: /home/josh/src/rust-gpu/target/release/deps/librustc_codegen_spirv.so
The targets should have unique names.
Consider changing their names to be unique or compiling them separately.
This may become a hard error in the future; see <https://github.com/rust-lang/cargo/issues/6313>.
warning: output filename collision.
The lib target `rustc_codegen_spirv` in package `rustc_codegen_spirv v0.2.0 (/home/josh/src/rust-gpu/crates/rustc_codegen_spirv)` has the same output filename as the lib target `rustc_codegen_spirv` in package `rustc_codegen_spirv v0.2.0 (/home/josh/src/rust-gpu/crates/rustc_codegen_spirv)`.
Colliding filename is: /home/josh/src/rust-gpu/target/release/librustc_codegen_spirv.so
The targets should have unique names.
Consider changing their names to be unique or compiling them separately.
This may become a hard error in the future; see <https://github.com/rust-lang/cargo/issues/6313>.

This may potentially be an issue in Cargo, at least in part; the linked issue mentions several ways this can happen. However, it seemed worth reporting here for tracking.

This seems consistently repeatable for me, just by running cargo build --release in the root of the rust-gpu repository checkout.

@joshtriplett joshtriplett added the t: bug Something isn't working label Feb 9, 2021
@joshtriplett
Copy link
Author

It looks like this happens when building multiple crates at once. Building just the wgpu runner, or just the ash runner, seems to work. Building both at once (cargo build --release -p example-runner-ash -p example-runner-wgpu, or just cargo build --release to build everything) hits this issue.

I also can't reproduce this on a slower build system with less parallelism, but I can reliably reproduce it on a 96-way build system.

@khyperia
Copy link
Contributor

khyperia commented Feb 9, 2021

Ah, we discovered a similar (or the same?) issue in #72 and reported it here rust-lang/cargo#8794 . I'll keep this open in case it's actually a different issue, and thanks for the context about issue 6313, I hadn't seen that!

(I believe that #72 is caused by building both debug and release versions of a crate at the same time (due to [build-dependencies] downgrading to debug) - repro in the reported cargo issue - but that might be incorrect, as I don't have a good understanding of what's happening)

@khyperia
Copy link
Contributor

khyperia commented Dec 8, 2021

I haven't seen this in a long while, and cargo build --release no longer repros for me, so, something changed, either in rust-gpu or cargo. No idea what, but, I guess closing as it no longer happens!

@khyperia khyperia closed this as completed Dec 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
t: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants