Skip to content
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

bootstrap: add config option for nix patching #89426

Merged
merged 1 commit into from
Oct 5, 2021

Conversation

davidtwco
Copy link
Member

@davidtwco davidtwco commented Oct 1, 2021

On NixOS systems, bootstrap will patch rustc used in bootstrapping after checking /etc/os-release (to confirm the current distribution is NixOS). However, when using Nix on a non-NixOS system, it can be desirable for bootstrap to patch rustc. In this commit, a patch-binaries-for-nix option is added to config.toml, which allows for user opt-in to bootstrap's Nix patching.

r? @Mark-Simulacrum

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Oct 1, 2021
@Mark-Simulacrum
Copy link
Member

Hm, I would prefer that we have this as a config.toml flag (e.g., "patch-binaries-for-nix = true/false" or so). Would that work for you?

The reason to prefer an env variable is that you can set it in e.g. .bashrc or so and just get it for any rustc bootstrap, I suppose, but it feels a little icky to me to have configuration via that vector. Is there a way for us to detect that you're "wanting" to use nix that's not /etc/os-release? For example, maybe if .nix-deps exists or so we can assume we're on nix?

@Mark-Simulacrum Mark-Simulacrum added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Oct 2, 2021
@davidtwco davidtwco force-pushed the bootstrap-nix-toolchain-env-var branch from a1b785b to 98a8c1d Compare October 2, 2021 19:59
@davidtwco davidtwco changed the title bootstrap: add env var opt-in to nix patching bootstrap: add config option for nix patching Oct 2, 2021
On NixOS systems, bootstrap will patch rustc used in bootstrapping after
checking `/etc/os-release` (to confirm the current distribution is NixOS).
However, when using Nix on a non-NixOS system, it can be desirable for
bootstrap to patch rustc. In this commit, a `patch-binaries-for-nix`
option is added to `config.toml`, which allows for user opt-in to
bootstrap's Nix patching.

Signed-off-by: David Wood <[email protected]>
@davidtwco davidtwco force-pushed the bootstrap-nix-toolchain-env-var branch from 98a8c1d to e552c0d Compare October 2, 2021 20:01
@davidtwco davidtwco added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Oct 2, 2021
@davidtwco
Copy link
Member Author

Hm, I would prefer that we have this as a config.toml flag (e.g., "patch-binaries-for-nix = true/false" or so). Would that work for you?

This works for me, I’ve updated the PR with this approach.

@Mark-Simulacrum
Copy link
Member

@bors r+

We might eventually want to make an explicit false opt-out (with the default being conditional on platform, like before this PR), but seems OK for now. We haven't heard any asks to opt out anyway.

@bors
Copy link
Contributor

bors commented Oct 2, 2021

📌 Commit e552c0d has been approved by Mark-Simulacrum

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Oct 2, 2021
Manishearth added a commit to Manishearth/rust that referenced this pull request Oct 3, 2021
…nv-var, r=Mark-Simulacrum

bootstrap: add config option for nix patching

On NixOS systems, bootstrap will patch rustc used in bootstrapping after checking `/etc/os-release` (to confirm the current distribution is NixOS). However, when using Nix on a non-NixOS system, it can be desirable for bootstrap to patch rustc. In this commit, a `patch-binaries-for-nix` option is added to `config.toml`, which allows for user opt-in to bootstrap's Nix patching.

r? `@Mark-Simulacrum`
bors added a commit to rust-lang-ci/rust that referenced this pull request Oct 5, 2021
…arth

Rollup of 12 pull requests

Successful merges:

 - rust-lang#87631 (os current_exe using same approach as linux to get always the full ab…)
 - rust-lang#88234 (rustdoc-json: Don't ignore impls for primitive types)
 - rust-lang#88651 (Use the 64b inner:monotonize() implementation not the 128b one for aarch64)
 - rust-lang#88816 (Rustdoc migrate to table so the gui can handle >2k constants)
 - rust-lang#89244 (refactor: VecDeques PairSlices fields to private)
 - rust-lang#89364 (rustdoc-json: Encode json files with UTF-8)
 - rust-lang#89423 (Fix ICE caused by non_exaustive_omitted_patterns struct lint)
 - rust-lang#89426 (bootstrap: add config option for nix patching)
 - rust-lang#89462 (haiku thread affinity build fix)
 - rust-lang#89482 (Follow the diagnostic output style guide)
 - rust-lang#89504 (Don't suggest replacing region with 'static in NLL)
 - rust-lang#89535 (fix busted JavaScript in error index generator)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 94b72f4 into rust-lang:master Oct 5, 2021
@rustbot rustbot added this to the 1.57.0 milestone Oct 5, 2021
@davidtwco davidtwco deleted the bootstrap-nix-toolchain-env-var branch October 5, 2021 12:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants