-
Notifications
You must be signed in to change notification settings - Fork 105
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
Enable extra features for popular crates #289
Comments
Have you tried default_gen_buildrs = true? At least for my use case, that allowed me to get rid of most of manual flag specifications I was needing before. |
Yeah, I've found |
@dae Yes, it looks that this undocumented feature is indeed what I was looking for. Thanks a lot! We can close this, unless we want to discuss enabling |
In general, build.rs files are harmful to hermetic builds, and defaulting to true leaves a giant whole for arbitrary code execution, so leaving that as false by default is the safer option. |
Is there no way to allow the build scripts to run in a sandboxed environment such that it's no longer harmful? I lot of |
@dfreese which brings back my original though of maybe enabling this for some hand-selected popular/trusted crates? e.g. both |
If cargo-raze were to do that, it would then need to keep the provided flags up to date when the upstream projects changed, which may be a bit of a maintenance burden. |
Sorry if that wasn't clear, but in my previous comment I was talking about automatically enabling
in their |
I feel like the following: # Start with the default shell env, which contains any --action_env
# settings passed in on the command line.
env = dict(ctx.configuration.default_shell_env) is the root of most of the problems with Note: This is more of a question about |
That was only added a month ago: If it's introduced problems for you, perhaps you could continue the conversion over there? |
I made bazelbuild/rules_rust#490 To be clear. I'm not asserting that's an issue. I want to better understand the claim from @dfreese that edit: wordsmithing |
This was more-or-less solved by #325. |
Some of the crates use
build.rs
to detect and enable extra features based on:libc
crate: https://github.com/rust-lang/libc/blob/master/build.rs,log
crate: https://github.com/rust-lang/log/blob/master/build.rs (see: Log 0.4.8 and 0.3.9 generation issue --cfg=atomic_cas #110).which forces every user of
cargo-raze
to independently discover and manually enable those features, which more often than not results in missed features and/or suboptimal builds.Right now, my
Cargo.toml
includes:even though that crates doesn't directly depend on
libc
, and maintaining those rules for all transitive dependencies is definitely prone to errors.Unfortunately, those features are detected by running code, and not declared, so I'm not sure if we can automatically extract those features, but perhaps we could include rules for some of the popular crates when features are gated only on rust version and target platform?
cc @acmcarther @UebelAndre
The text was updated successfully, but these errors were encountered: