Skip to content

Always use os-release rather than /lib to detect NixOS (bootstrap) #115090

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 1 commit into from
Aug 22, 2023

Conversation

eopb
Copy link
Contributor

@eopb eopb commented Aug 22, 2023

Two users over on zulip bumped into issues where NixOS wasn't being properly detected.

I believe this was caused by the presence of /lib on their machines. /lib is not standard on NixOS but can still be created by users or scripts.

We are already checking /etc/os-release. The presence of ID=nixos in it's output should be trustworthy and we shouldn't then go on to also check for /lib.

@rustbot
Copy link
Collaborator

rustbot commented Aug 22, 2023

r? @ozkanonur

(rustbot has picked a reviewer for you, use r? to override)

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) labels Aug 22, 2023
Copy link
Contributor

@kadiwa4 kadiwa4 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@eopb
Copy link
Contributor Author

eopb commented Aug 22, 2023

@rustbot author

@rustbot rustbot 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 Aug 22, 2023
[Two users over on zulip](https://rust-lang.zulipchat.com/#narrow/stream/122651-general/topic/Bootstrapping.20on.20NixOS) bumped into issues where NixOS wasn't being properly detected.

I believe this was caused by the presence of `/lib` on their machines. `/lib` is not standard on NixOS but can still be created by users or scripts.

We are already checking `/etc/os-release`. The presence of `ID=nixos` in it's output should be trustworthy and we shouldn't then go on to also check for `/lib`.
@eopb eopb force-pushed the dont-check-lib-bootstrap branch from eab7700 to 0e070aa Compare August 22, 2023 10:07
@eopb
Copy link
Contributor Author

eopb commented Aug 22, 2023

@rustbot review

@rustbot rustbot 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 Aug 22, 2023
@eopb eopb changed the title Always use os-release rather than /lib to detect NixOS (bootstrap.py) Always use os-release rather than /lib to detect NixOS (bootstrap) Aug 22, 2023
Copy link
Member

@onur-ozkan onur-ozkan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix!

@onur-ozkan
Copy link
Member

@bors r+ rollup

@bors
Copy link
Collaborator

bors commented Aug 22, 2023

📌 Commit 0e070aa has been approved by ozkanonur

It is now in the queue for this repository.

@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 Aug 22, 2023
bors added a commit to rust-lang-ci/rust that referenced this pull request Aug 22, 2023
…mpiler-errors

Rollup of 6 pull requests

Successful merges:

 - rust-lang#114959 (fix rust-lang#113702 emit a proper diagnostic message for unstable lints passed from CLI)
 - rust-lang#115011 (Warn on elided lifetimes in associated constants (`ELIDED_LIFETIMES_IN_ASSOCIATED_CONSTANT`))
 - rust-lang#115077 (Do not emit invalid suggestion in E0191 when spans overlap)
 - rust-lang#115087 (Add disclaimer on size assertion macro)
 - rust-lang#115090 (Always use `os-release` rather than `/lib` to detect `NixOS` (bootstrap))
 - rust-lang#115101 (triagebot: add dependency licensing pings)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 634ab60 into rust-lang:master Aug 22, 2023
@rustbot rustbot added this to the 1.74.0 milestone Aug 22, 2023
@eopb eopb deleted the dont-check-lib-bootstrap branch August 22, 2023 18:56
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants