-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
per-package-target unifies features which can conflict with other targets #9521
Comments
Hmmm… Haven't investigated the linked code much yet, but based on the description I'd guess this is a side-effect of the second checkbox at #9406: Based on an overall look at the code, I'd think:
So I'll triage it on the tracking issue as one instance of the second checkbox, thank you for having filed this and linked there :) |
I think this is somewhat a duplicate of #4463, which is unfortunately not easy to resolve. |
I think I ran into a similar issue before when I was trying this feature. What ended up working for me was making sure I specify a target for each crate, even if it should be the default. So |
I also hit this. I have a host application that depends on |
Fwiw I worked around this by using cargo-make. Example:
... I could also make each of these their own separate git repo/crate. But I'd still lose the workspace ability to ensure dependencies are the same. I found that Cargo has resolver = "2" (a new resolver that includes more things in the dependency/build graph for each package) but it didn't work. It seems that Cargo is trying hard to be considerate to the developer and ensure that only the minimal set of packages are compiled per workspace member. I appreciate that, but I wonder if we also need an option that says - just create a separate full build graph for each member. I realize this would increase initial compile times, but it would always work. Crazy? |
Problem
'cargo build --verbose' seems to indicate that rustc is compiling for the wrong target.
Steps
3.Note the rustc error compiling the void (1.0.2) crate
...
std
is required byvoid
because it does not declare#![no_std]
Partial Workaround
However, this doesn't work with vscode.
Sadly then I can't build the raspberry pi 4 target.
Notes
It seems positive that all build targets (x86, thumbv7em-none-eabihf, thumbv7m-none-eabi, armv7-unknown-linux-musleabihf) work perfectly if I run 'cargo build' from their respective workspace package dirs. (slight graph miscalculation when compiled from the root of the workspace?)
I note that the void crate is designed to work with std and no-std. However, the rustc error might indicate that rustc needs to have a slightly more robust check to detect how the void crate uses cfg or cfg_attr to support both environments?
Output of
cargo version
:cargo 1.54.0-nightly (e931e47 2021-05-24)
The text was updated successfully, but these errors were encountered: