-
Notifications
You must be signed in to change notification settings - Fork 286
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
Put windows deps in (default-included) feature #766
Comments
Is there an issue about this in cargo repo ? |
rust-lang/cargo#1197 is very close. |
The fix I have is #767 , which takes my project from not building on Yocto to building on Yocto, I think without hurting anyone else's builds on Windows or Unix. |
#767 being merged addresses the issue. |
Hey @jhartzell42 I'm looking at @TimonPost's comment on https://github.com/crossterm-rs/crossterm/pull/943/files#r1845623030 about the changes that you made here and trying to understand what the underlying problem was. The windows deps appearing in the lockfile is intended cargo behavior, as the lockfile doesn't specify which dependencies to use, only which versions of them to use if called for by the manifest. The I'm curious why the contents of the lock file caused problems in your build process. Is Yocto doing something special? |
Digging a bit deeper meta-rust/cargo-bitbake#58 suggests that removing the windows deps from the Yocto side is the correct thing to do, instead of marking the correctly specified deps as optional and behind a feature flag like this. It's possible I'm misunderstanding this in some way... |
In #766 / #767, a windows feature flag was added to solve an issue with the way that Yocto package generation was working. This is not actually a problem with Crossterm, but with the Yocto package generation tooling which adds all the dependencies for all features, even if they are not relevant to the target platform. This is a bug in the Yocto / meta-rust / bitbake tooling and not in Crossterm. For more information, see <meta-rust/cargo-bitbake#58>. The fix for this on the Yocto side is to remove dependencies that are conditional on windows. This commit removes the windows feature flag as it's not needed. This is a breaking change for any apps which were specifically using the windows feature flag. If you were using this feature flag, you will need to update your Cargo.toml to remove it. The necessary dependencies are still included in the Cargo.toml file, so you should not need to make any other changes.
#948 reverts this change. @jhartzell42 can you please confirm that this doesn't have problems (I think it's the correct thing to do, but would like do check that there's not something I'm missing). |
I don't work on the Yocto project anymore and don't have access to it and cannot troubleshoot, unfortunately. |
Thanks for the reply. My understanding is that the problem you saw was in generating package config right, i.e. dev / config time problems not a hard fail right? No problem if you can't recall. |
Due to idiosyncrasies of how cargo resolves dependencies, all the Windows dependencies show up in Cargo.lock files even on Linux -- and in Yocto builds, which is making our build process more difficult. Features do not have the same issue.
There should be a "windows" feature, included by default to avoid breaking existing clients, that can be explicitly disabled if the windows dependencies are not going to be used. This will make building easier on Yocto and other build systems.
I am willing to (and going to) write a PR for this; I'm just adding an issue first for discussion in principle.
The text was updated successfully, but these errors were encountered: