-
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
Tracking issue for -Z features=host_dep #7915
Comments
Yes please. I've encountered an issue related to this already when a proc-macro enabled many features in the |
UPDATE: never mind, this is a red herring. the proc macro itself was referencing I just ran into the proc macro problem trying to use
It would definitely be super duper handy to be able to use proc macros that link against
@valarauca it looks like some people discussed proc macros in the comments, but #4866 itself was about Perhaps it's worth opening a new issue? |
I would also be interested in having |
Add proc-macro to index, and new feature resolver. This adds the "pm" field to the index so that Cargo can detect which packages contain a proc-macro without downloading the package. The second commit builds on that to support proc-macros in the new "de-unification" of the new feature resolver. This prevents dependencies shared between proc-macros and other dependency kinds from having features unified. cc #7915
proc-macro support has been added in #8028, and should be in the latest nightly (2020-03-27). proc-macros and build dependencies are unified (since they are all "host" artifacts), but shouldn't affect anything else. Also, the option has been renamed to |
This is a complete overhaul of the way platform-specific dependencies are handled. Based on my experimentation and reading the Cargo source code, I believe that this is now correct. Doing so also required feature graph construction to be updated, so the feature graph construction is ready for the new feature resolver, and is now platform-sensitive as well. The APIs for the feature graph are still to come, but making the data model be full-fidelity allows for both the current and new feature resolvers to be implemented. For more about the new feature resolver, see: * https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#features * rust-lang/cargo#7914 * rust-lang/cargo#7915 * rust-lang/cargo#7916
This is a complete overhaul of the way platform-specific dependencies are handled. Based on my experimentation and reading the Cargo source code, I believe that this is now correct. Doing so also required feature graph construction to be updated, so the feature graph construction is ready for the new feature resolver, and is now platform-sensitive as well. The APIs for the feature graph are still to come, but making the data model be full-fidelity allows for both the current and new feature resolvers to be implemented. For more about the new feature resolver, see: * https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#features * rust-lang/cargo#7914 * rust-lang/cargo#7915 * rust-lang/cargo#7916
This is a complete overhaul of the way platform-specific dependencies are handled. Based on my experimentation and reading the Cargo source code, I believe that this is now correct. Doing so also required feature graph construction to be updated, so the feature graph construction is ready for the new feature resolver, and is now platform-sensitive as well. The APIs for the feature graph are still to come, but making the data model be full-fidelity allows for both the current and new feature resolvers to be implemented. Now that target logic is internalized in guppy, cargo-guppy no longer needs to do its own evaluation. For more about the new feature resolver, see: * https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#features * rust-lang/cargo#7914 * rust-lang/cargo#7915 * rust-lang/cargo#7916
This is a complete overhaul of the way platform-specific dependencies are handled. Based on my experimentation and reading the Cargo source code, I believe that this is now correct. Doing so also required feature graph construction to be updated, so the feature graph construction is ready for the new feature resolver, and is now platform-sensitive as well. The APIs for the feature graph are still to come, but making the data model be full-fidelity allows for both the current and new feature resolvers to be implemented. Now that target logic is internalized in guppy, cargo-guppy no longer needs to do its own evaluation. For more about the new feature resolver, see: * https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#features * rust-lang/cargo#7914 * rust-lang/cargo#7915 * rust-lang/cargo#7916
This is a complete overhaul of the way platform-specific dependencies are handled. Based on my experimentation and reading the Cargo source code, I believe that this is now correct. Doing so also required feature graph construction to be updated, so the feature graph construction is ready for the new feature resolver, and is now platform-sensitive as well. The APIs for the feature graph are still to come, but making the data model be full-fidelity allows for both the current and new feature resolvers to be implemented. Now that target logic is internalized in guppy, cargo-guppy no longer needs to do its own evaluation. For more about the new feature resolver, see: * https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#features * rust-lang/cargo#7914 * rust-lang/cargo#7915 * rust-lang/cargo#7916
This is a complete overhaul of the way platform-specific dependencies are handled. Based on my experimentation and reading the Cargo source code, I believe that this is now correct. Doing so also required feature graph construction to be updated, so the feature graph construction is ready for the new feature resolver, and is now platform-sensitive as well. The APIs for the feature graph are still to come, but making the data model be full-fidelity allows for both the current and new feature resolvers to be implemented. Now that target logic is internalized in guppy, cargo-guppy no longer needs to do its own evaluation. For more about the new feature resolver, see: * https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#features * rust-lang/cargo#7914 * rust-lang/cargo#7915 * rust-lang/cargo#7916
I created this "project" as a slightly contrived example.
Results:
I hope this is a valid tests. The idea is The results seem positive. Thanks for the work on this! |
This is a complete overhaul of the way platform-specific dependencies are handled. Based on my experimentation and reading the Cargo source code, I believe that this is now correct. Doing so also required feature graph construction to be updated, so the feature graph construction is ready for the new feature resolver, and is now platform-sensitive as well. The APIs for the feature graph are still to come, but making the data model be full-fidelity allows for both the current and new feature resolvers to be implemented. Now that target logic is internalized in guppy, cargo-guppy no longer needs to do its own evaluation. For more about the new feature resolver, see: * https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#features * rust-lang/cargo#7914 * rust-lang/cargo#7915 * rust-lang/cargo#7916
This is a complete overhaul of the way platform-specific dependencies are handled. Based on my experimentation and reading the Cargo source code, I believe that this is now correct. Doing so also required feature graph construction to be updated, so the feature graph construction is ready for the new feature resolver, and is now platform-sensitive as well. The APIs for the feature graph are still to come, but making the data model be full-fidelity allows for both the current and new feature resolvers to be implemented. Now that target logic is internalized in guppy, cargo-guppy no longer needs to do its own evaluation. For more about the new feature resolver, see: * https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#features * rust-lang/cargo#7914 * rust-lang/cargo#7915 * rust-lang/cargo#7916
This is a complete overhaul of the way platform-specific dependencies are handled. Based on my experimentation and reading the Cargo source code, I believe that this is now correct. Doing so also required feature graph construction to be updated, so the feature graph construction is ready for the new feature resolver, and is now platform-sensitive as well. The APIs for the feature graph are still to come, but making the data model be full-fidelity allows for both the current and new feature resolvers to be implemented. Now that target logic is internalized in guppy, cargo-guppy no longer needs to do its own evaluation. For more about the new feature resolver, see: * https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#features * rust-lang/cargo#7914 * rust-lang/cargo#7915 * rust-lang/cargo#7916
This is a complete overhaul of the way platform-specific dependencies are handled. Based on my experimentation and reading the Cargo source code, I believe that this is now correct. Doing so also required feature graph construction to be updated, so the feature graph construction is ready for the new feature resolver, and is now platform-sensitive as well. The APIs for the feature graph are still to come, but making the data model be full-fidelity allows for both the current and new feature resolvers to be implemented. Now that target logic is internalized in guppy, cargo-guppy no longer needs to do its own evaluation. For more about the new feature resolver, see: * https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#features * rust-lang/cargo#7914 * rust-lang/cargo#7915 * rust-lang/cargo#7916
This feature is working great for an embedded project I'm working on. Like others, I was hitting no_std and bindgen conflict. It's really great to see this feature! Thanks! |
Seems like this has been merged. Had to search a bit how to use it, so for anyone else who's using this - here's a way to enable the flag in
|
Updates to use the `group` crate. See: RustCrypto/traits#287. This crate has a hard `rand_core` dependency so this commit gets rid of the `rand` features across the board and makes them mandatory. (Even if we don't end up shipping the `group` crate this release, that's probably for the best to keep the number of features down) This commit additionally splits out `no_std` build testing into `tests/*_no_std` Cargo projects. This is a workaround until the Cargo resolver is fixed upstream: rust-lang/cargo#7915 rust-lang/cargo#7916
Updates to use the `group` crate. See: RustCrypto/traits#287. This crate has a hard `rand_core` dependency so this commit gets rid of the `rand` features across the board and makes them mandatory. (Even if we don't end up shipping the `group` crate this release, that's probably for the best to keep the number of features down) This commit additionally splits out `no_std` build testing into `tests/*_no_std` Cargo projects. This is a workaround until the Cargo resolver is fixed upstream: rust-lang/cargo#7915 rust-lang/cargo#7916
Updates to use the `group` crate. See: RustCrypto/traits#287. This crate has a hard `rand_core` dependency so this commit gets rid of the `rand` features across the board and makes them mandatory. (Even if we don't end up shipping the `group` crate this release, that's probably for the best to keep the number of features down) This commit additionally splits out `no_std` build testing into `tests/*_no_std` Cargo projects. This is a workaround until the Cargo resolver is fixed upstream: rust-lang/cargo#7915 rust-lang/cargo#7916
When stable? |
Works great. Would like to see this too. |
Hi @ehuss, three days ago (2021-01-05) I noticed some unstable CI build where I use Error Log
Instance 1: https://github.com/jonasbb/serde_with/runs/1669122665#step:5:139 The error occurs on both Ubuntu and Windows, but is non-deterministic. I think the first PR where I noticed that is jonasbb/serde_with#238 but I re-run the failed tests and now I cannot find the old logs. Before that point in time I haven't seen the issue before. |
Implementation: #7820
Documentation: https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#features
Summary
-Z features=host_dep
causes the feature resolver to prevent features enabled on build dependencies or proc-macros from being enabled for normal dependencies. For example:When building the build script, the
log
crate will be built with thestd
feature. When building the library of your package, it will not enable the feature.Unresolved issues
cargo metadata
--target
is not used). Projects can add features to re-unify if they want, but it may not be clear or obvious what to add and when. We may need something that identifies these duplicate dependencies, and give suggestions on how to unify them. Or, we may need to make this opt-in somehow so the user needs to make this an explicit decision.The text was updated successfully, but these errors were encountered: