-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Allow setting CFG_DISABLE_UNSTABLE_FEATURES to 0 #106767
Conversation
Two locations check whether this build-time environment variable is defined. Allowing it to be explicitly disabled with a "0" value is useful, especially for integrating with external build systems.
(rustbot has picked a reviewer for you, use r? to override) |
Hey! It looks like you've submitted a new PR for the library teams! If this PR contains changes to any Examples of
|
Can you say more about the motivation here? In general it seems a little suspicious to be compiling these checks in a way that something else is trying to enable feature gating and you're aiming to override that. Can you link/name the build system in question, perhaps? |
This is not the issue at play. Rather, it's to let a build system keep track of all environment variables needed for a target. The goal is just dependency correctness. The specific issue is integrating with GN, Chromium's build system. A GN Rust target definition can set environment variables for its GN's invokes |
Are you trying to compile rustc or libtest during a GN-managed build? These variables are only read at compile-time of rustc itself, not by regular invocations of rustc. Part of my confusion is that there are many more such variables in rustc, I think, and presumably not all of them are being managed by rustc. -- Regardless of whether this solves your particular use case, I think I'm OK merging this PR -- wanting to always set an environment variable seems largely reasonable. I would caution that in an ideal world, this would be left at 1 (i.e., you do not enable unstable features by default in GN/Chromium), and instead rely on RUSTC_BOOTSTRAP and -Zallow-features to more selectively enable features (if needed at all). |
Yes, building
Maybe this is an ad-hoc solution but this was the only env dependency reported by
We use a nightly or dev toolchain, so normally this would not be defined when building libtest. We have no intention to use this outside of the libtest build. |
@bors r+ |
Rollup of 9 pull requests Successful merges: - rust-lang#105552 (Add help message about function pointers) - rust-lang#106583 (Suggest coercion of `Result` using `?`) - rust-lang#106767 (Allow setting CFG_DISABLE_UNSTABLE_FEATURES to 0) - rust-lang#106823 (Allow fmt::Arguments::as_str() to return more Some(_).) - rust-lang#107166 (rustc_metadata: Support non-`Option` nullable values in metadata tables) - rust-lang#107213 (Add suggestion to remove if in let..else block) - rust-lang#107223 (`sub_ptr()` is equivalent to `usize::try_from().unwrap_unchecked()`, not `usize::from().unwrap_unchecked()`) - rust-lang#107227 (`new_outside_solver` -> `evaluate_root_goal`) - rust-lang#107232 (rustdoc: simplify settings popover DOM, CSS, JS) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Instead of hard-coding these into gnrt, which necessitates rebuilding it for any cfg changes, this adds a gnrt_config.toml to supply these options at runtime. This CL also adds a couple libc cfgs required as of the latest Rust roll, and adds an env definition for libtest (which was blocked on rust-lang/rust#106767). Bug: 1368806 Change-Id: I542485b9cbed3f2a6fa7c2e72cb9df65da417281 Cq-Include-Trybots: luci.chromium.try:android-rust-arm-dbg,android-rust-arm-rel,linux-rust-x64-dbg,linux-rust-x64-rel Change-Id: I542485b9cbed3f2a6fa7c2e72cb9df65da417281 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4261814 Reviewed-by: danakj <danakj@chromium.org> Commit-Queue: Collin Baker <collinbaker@chromium.org> Cr-Commit-Position: refs/heads/main@{#1107012}
Instead of hard-coding these into gnrt, which necessitates rebuilding it for any cfg changes, this adds a gnrt_config.toml to supply these options at runtime. This CL also adds a couple libc cfgs required as of the latest Rust roll, and adds an env definition for libtest (which was blocked on rust-lang/rust#106767). Bug: 1368806 Change-Id: I542485b9cbed3f2a6fa7c2e72cb9df65da417281 Cq-Include-Trybots: luci.chromium.try:android-rust-arm-dbg,android-rust-arm-rel,linux-rust-x64-dbg,linux-rust-x64-rel Change-Id: I542485b9cbed3f2a6fa7c2e72cb9df65da417281 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4261814 Reviewed-by: danakj <danakj@chromium.org> Commit-Queue: Collin Baker <collinbaker@chromium.org> Cr-Commit-Position: refs/heads/main@{#1107012} NOKEYCHECK=True GitOrigin-RevId: 8cc20b86395addd1afd7fb806b3bb62722b481f2
Two locations check whether this build-time environment variable is defined. Allowing it to be explicitly disabled with a "0" value is useful, especially for integrating with external build systems.