Skip to content

regression: can't find crate #128892

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

Closed
BoxyUwU opened this issue Aug 9, 2024 · 2 comments
Closed

regression: can't find crate #128892

BoxyUwU opened this issue Aug 9, 2024 · 2 comments
Labels
regression-from-stable-to-beta Performance or correctness regression from stable to beta. T-cargo Relevant to the cargo team, which will review and decide on the PR/issue. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Milestone

Comments

@BoxyUwU
Copy link
Member

BoxyUwU commented Aug 9, 2024

[INFO] [stdout] error[E0463]: can't find crate for `rasn_compiler_derive`
[INFO] [stdout]   --> /opt/rustwide/workdir/rasn-compiler-tests/src/helpers/mod.rs:14:13
[INFO] [stdout]    |
[INFO] [stdout] 14 |             rasn_compiler_derive::asn1!($asn1);
[INFO] [stdout]    |             ^^^^^^^^^^^^^^^^^^^^ can't find crate
@BoxyUwU BoxyUwU added T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. regression-from-stable-to-beta Performance or correctness regression from stable to beta. labels Aug 9, 2024
@rustbot rustbot added I-prioritize Issue: Indicates that prioritization has been requested for this issue. needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Aug 9, 2024
@BoxyUwU BoxyUwU removed the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Aug 9, 2024
@ehuss
Copy link
Contributor

ehuss commented Aug 10, 2024

I have a very strong suspicion this is due to this warning:

[INFO] [stderr] warning: output filename collision.
[INFO] [stderr] The lib target `rasn_compiler` in package `rasn-compiler v0.3.0 (/opt/rustwide/workdir/rasn-compiler)` has the same output filename as the lib target `rasn_compiler` in package `rasn-compiler v0.3.0 (/opt/rustwide/workdir/rasn-compiler)`.
[INFO] [stderr] Colliding filename is: /opt/rustwide/target/debug/deps/librasn_compiler.so
[INFO] [stderr] The targets should have unique names.
[INFO] [stderr] Consider changing their names to be unique or compiling them separately.

Because this workspace defines rasn-compiler as a cdylib, and rasn-compiler is used as both a regular and proc-macro dependency, and it is using cargo's resolver="2", the cdylib ends up getting built twice in parallel. One rustc process will stomp over the .so while the other is running.

This is a known bug in cargo, tracked in rust-lang/cargo#6313.

I'm not entirely certain why this is exhibiting as rasn_compiler_derive not found. I would not expect the .so filename collision to affect a proc-macro since the proc-macro should be loading the .rlib, not the .so (and the .rlib has a unique filename).

I cannot reproduce the can't find crate error on any version. I suspect this is not a regression.

@apiraino apiraino added T-cargo Relevant to the cargo team, which will review and decide on the PR/issue. and removed I-prioritize Issue: Indicates that prioritization has been requested for this issue. labels Aug 12, 2024
@Mark-Simulacrum Mark-Simulacrum added this to the 1.82.0 milestone Oct 11, 2024
@Mark-Simulacrum
Copy link
Member

I'm going go ahead and close as we think this isn't a regression.

@Mark-Simulacrum Mark-Simulacrum closed this as not planned Won't fix, can't repro, duplicate, stale Oct 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
regression-from-stable-to-beta Performance or correctness regression from stable to beta. T-cargo Relevant to the cargo team, which will review and decide on the PR/issue. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

5 participants