-
Notifications
You must be signed in to change notification settings - Fork 104
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
Nightly target-specific feature selection not supported #234
Comments
Hey, does the I struggle to find a way to specify only specify a feature for a specific platform with just Also, There should be no reason to hand edit generated files. Definitely interested in cases where you feel that's necessary. |
Maybe rust-lang/cargo#1197 would also be relevant here? |
Sorry for the noise - this looks to be mostly a misunderstanding on my part. The Rust code I use is compiled into a Python module, and the Python distribution rules require that openssl is statically linked on Linux. Thinking it would be better to continue to use the system library on macOS, I had updated my Cargo.toml file to be: [target.'cfg(linux)'.dependencies.reqwest]
version = "0.10"
features = ["json", "socks", "stream", "native-tls-vendored"]
[target.'cfg(not(linux))'.dependencies.reqwest]
version = "0.10"
features = ["json", "socks", "stream"] This resulted in the Linux build statically linking openssl, and we were using the nightly compiler at the time for other reasons, so I had thought the problem solved. Re-reading that link above, I realize that I had neglected to enable itarget, and so had probably just been vendoring on all platforms instead. Whoops. I now see that for simple feature lists not gated by platform, cargo raze is adjusting the crate_features argument to match what is in Cargo.toml. So the only issue here is that cargo raze doesn't support the nightly target-specific resolution rules that are off by default, and that's probably a niche enough feature that it's not worth worrying about at the moment. |
You could leave this open as a feature request 😄 |
Didn't want to clutter up the tracker with something nobody else may ever ask for :-) If someone else finds this and has the same issue, I can open it again. |
Hi there,
Is my understanding correct that currently the only way to select specific features from a crate is to manually edit the generated remote/.BUILD.bazel file, removing the unwanted features from the list? I currently am using a Cargo.toml file that specifies different features for different platforms, and am wondering whether such a thing can be accomplished with Bazel now that #212 has landed.
The text was updated successfully, but these errors were encountered: