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

Rollup of 12 pull requests #89549

Merged
merged 29 commits into from
Oct 5, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
cb4519e
os current_exe using same approach as linux to get always the full ab…
devnexen Jul 30, 2021
ce450f8
Use the 64b inner:monotonize() implementation not the 128b one for aa…
AGSaidi Sep 4, 2021
f83853e
refactor: VecDeques PairSlices fields to private
DeveloperC286 Sep 25, 2021
e18a8ef
Don't ignore impls for primitive types
hkmatsumoto Aug 28, 2021
e46fc9d
Encode json files with UTF-8
hkmatsumoto Sep 29, 2021
98dde56
haiku thread affinity build fix
devnexen Oct 2, 2021
e552c0d
bootstrap: add config option for nix patching
davidtwco Oct 1, 2021
8cbcc89
Fix ICE caused by non_exaustive_omitted_patterns struct lint
DevinR528 Oct 1, 2021
f7a8980
Reorder etc check for non_exhaustive_omitted_patterns
DevinR528 Oct 2, 2021
3d83ff6
Add ui test for empty fields for omitted_patterns lint
DevinR528 Oct 2, 2021
b06409e
Rename etc -> has_rest_pat
DevinR528 Oct 2, 2021
fb0b1a5
Follow the diagnostic output style guide
hkmatsumoto Oct 3, 2021
a0cc9bb
Add a test to detect overlapping entries in overview tables
dns2utf8 Sep 10, 2021
677fb6b
Show how many tests are running in parallel
dns2utf8 Sep 11, 2021
e599e2d
Move from grid layout to table based layout because of browser limits…
dns2utf8 Sep 11, 2021
fdd8a0d
Don't suggest replacing region with 'static in NLL
Aaron1011 Oct 3, 2021
ccd2be5
fix busted JavaScript in error index generator
notriddle Oct 4, 2021
0fb0122
Rollup merge of #87631 - :solarish_upd_fs, r=joshtriplett
Manishearth Oct 5, 2021
7a09755
Rollup merge of #88234 - hkmatsumoto:rustdoc-impls-for-primitive, r=j…
Manishearth Oct 5, 2021
dd223d5
Rollup merge of #88651 - AGSaidi:monotonize-inner-64b-aarch64, r=dtolnay
Manishearth Oct 5, 2021
52d3afa
Rollup merge of #88816 - dns2utf8:rustdoc_test_gui_2k_constants, r=Gu…
Manishearth Oct 5, 2021
eeadc9d
Rollup merge of #89244 - DeveloperC286:pair_slices_fields_to_private,…
Manishearth Oct 5, 2021
27b84a9
Rollup merge of #89364 - hkmatsumoto:encode-json-with-utf-8, r=Mark-S…
Manishearth Oct 5, 2021
87f782e
Rollup merge of #89423 - DevinR528:reachable-fields, r=Nadrieril
Manishearth Oct 5, 2021
94b72f4
Rollup merge of #89426 - davidtwco:bootstrap-nix-toolchain-env-var, r…
Manishearth Oct 5, 2021
a23d7f0
Rollup merge of #89462 - devnexen:haiku_thread_aff_build_fix, r=nagisa
Manishearth Oct 5, 2021
04314a6
Rollup merge of #89482 - hkmatsumoto:patch-diagnostics, r=joshtriplett
Manishearth Oct 5, 2021
bf62c6d
Rollup merge of #89504 - Aaron1011:rpit-nll-static, r=nikomatsakis
Manishearth Oct 5, 2021
068683b
Rollup merge of #89535 - notriddle:notriddle/error-index-generator-js…
Manishearth Oct 5, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
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.

Signed-off-by: David Wood <[email protected]>
  • Loading branch information
davidtwco committed Oct 2, 2021
commit e552c0d86baebdf594b9cacebbcf5207e57207d5
6 changes: 6 additions & 0 deletions config.toml.example
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,12 @@ changelog-seen = 2
# this setting's very existence, are all subject to change.)
#print-step-rusage = false

# Always patch binaries for usage with Nix toolchains. If `true` then binaries
# will be patched unconditionally. If `false` or unset, binaries will be patched
# only if the current distribution is NixOS. This option is useful when using
# a Nix toolchain on non-NixOS distributions.
#patch-binaries-for-nix = false

# =============================================================================
# General install configuration options
# =============================================================================
Expand Down
28 changes: 16 additions & 12 deletions src/bootstrap/bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -594,19 +594,23 @@ def fix_bin_or_dylib(self, fname):
if ostype != "Linux":
return

# Use `/etc/os-release` instead of `/etc/NIXOS`.
# The latter one does not exist on NixOS when using tmpfs as root.
try:
with open("/etc/os-release", "r") as f:
if not any(line.strip() == "ID=nixos" for line in f):
return
except FileNotFoundError:
return
if os.path.exists("/lib"):
return
# If the user has asked binaries to be patched for Nix, then
# don't check for NixOS or `/lib`, just continue to the patching.
if self.get_toml('patch-binaries-for-nix', 'build') != 'true':
# Use `/etc/os-release` instead of `/etc/NIXOS`.
# The latter one does not exist on NixOS when using tmpfs as root.
try:
with open("/etc/os-release", "r") as f:
if not any(line.strip() == "ID=nixos" for line in f):
return
except FileNotFoundError:
return
if os.path.exists("/lib"):
return

# At this point we're pretty sure the user is running NixOS
nix_os_msg = "info: you seem to be running NixOS. Attempting to patch"
# At this point we're pretty sure the user is running NixOS or
# using Nix
nix_os_msg = "info: you seem to be using Nix. Attempting to patch"
print(nix_os_msg, fname)

# Only build `.nix-deps` once.
Expand Down
1 change: 1 addition & 0 deletions src/bootstrap/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,7 @@ struct Build {
install_stage: Option<u32>,
dist_stage: Option<u32>,
bench_stage: Option<u32>,
patch_binaries_for_nix: Option<bool>,
}

/// TOML representation of various global install decisions.
Expand Down