-
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
Issue with Workspace and Crate features #14362
Comments
Could you provide
Thank you. |
Hello
rustc 1.77.2, but I doubt the toolchain impacts this problem, it's more of a Cargo problem.
The build should have failed when building within the workspace.
We have code portions that should only exist within some features.
Any build command will do. |
One answer to our problem, is to do |
I'm not sure this actually falls in a Cargo Issue. The conclusion is the Cargo Workspace does not behave like I thought it would, and that our CI script solely relied on build at the root of the workspace. But i'm pretty sure this behavior is kind of problematic or at least, needs to be emphasized somewhere. This behavior only impacts complex workspaces, like ours, tokio and other similar |
Should behave the same except for loading of Its still not quite clear what problem you are having but it sounds like its related to feature unification. When Cargo builds, it takes all selected packages (whether implicit or explicitly selected) and merges the enabled features together to do a single build of every dependency rather than a build per selected package. People tend to work around this by either selecting specific packages or by having a "cargo workspace hack" which is a code-genned workspace member that every package depends on to force on a set of dependency features in a consistent way across the entire dependency tree. See also
|
Clearly does not ! I reworked the CI script and cd in each individual packages
totally ! 100 %. The problem is we have a -cli app (high level) that requires "--all-features" to local packages. It is problematic though that -p $pkg does not trigger a simpler build anyways
Which is totally understandable and kind of answers the question. When we request a Default build in our workspace, the -cli application Default is the most demanding Default case, and winds up activating --all-features in other packages. Bottom line, we're unable to test "Default builds" without moving to inner packages, in our scenario. This is totally tied to our very setup, if we did not have -cli application, we would not have such an issue for example
Thank you very much ! |
I can't add much more without concrete reproduction steps.
As in you are doing
The cargo plugin |
The reproduction steps, consists in creating a basic Main application from the code I gave, and running
not exactly, doing
need to take a lookt at this |
I put in all the quotes to make sure context is fully there. I'm not seeing how creating a basic "main" is relevant to those steps. Please write out explicit reproduction steps of a
I'm not guess its not literally doing So then this sounds like its just a matter of feature unifcation for the packages you are selecting to build which is covered by some of those other issues I linked earlier, right? |
No git cloning involved. It's about using one of our libs, which is said to build fine in default mode (because it does pass within the workspace) Here's a reproducible example, that only requires to "copy pasting" echo "[package]" >> Cargo.toml
echo "name = \"tester\"" >> Cargo.toml
echo "[dependencies]" >> Cargo.toml
echo "rinex = { git = \"https://github.com/georust/rinex\", rev = \"70242aa09551f12ea511ea36b528210ee33a022a\" }" >> Cargo.toml
mkdir src
touch src/main.rs
echo "fn main() {}" >> src/main.rs
cargo build |
That is, I assume, reproduction steps for the issue. I was asking about reproduction steps for |
Just fly-by. Two issues with clear reproduction steps for reference:
Since this seems to be a comparison between two different invocations of |
Problem
Hello, we're running into severe troubles in the RINEX workspace, which has quite a few build options and integrates inner dependencies (path = "../" within the workspace).
My explanation is that Cargo picks up the worst case scenario, in terms of dependencies and it kills the capabilities to detect issues that exist with for example a simple
build -r
while actually runningbuild -r
within the workspace.The worst case scenario (in terms of dependencies) in our case, is the top level -cli application, which requires pretty much --all-features in the local libs.
Steps
Download the RINEX workspace commit 70242aa09551f12ea511ea36b528210ee33a022a for example.
The CI did pass, because building within the workspace does pass.
Now try this
Possible Solution(s)
No response
Notes
No response
Version
No response
The text was updated successfully, but these errors were encountered: