-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Fix NixOS detection #87187
Fix NixOS detection #87187
Conversation
(rust-highfive has picked a reviewer for you, use r? to override) |
r? @nagisa Under what circumstances might |
I mentioned it in the code comment. It doesn't exist if you are using tmpfs root (use auto population of /etc on every boot). Generally I think
Not many outside installation but do have some. 🤔 Maybe I should also send a PR to nixpkgs to make it always present. |
Cool, I missed that when quickly looking through the PR. Would be great if this comment was moved to a commit message and/or the PR description. A code comment here is not particularly useful, I feel. There's no context to a person reading code (especially so the future) as to why the reference to
Sure, though I would argue that extensibility and generality is not really a concern here given that the following fixups are extremely NixOS specific. r=me once the PR description and/or commit messages are adjusted to include information about tmpfs nixos activations not having this file. |
Use `/etc/os-release` instead of `/etc/NIXOS`. The latter one does not exist on NixOS when using tmpfs as root.
a105754
to
919a8a5
Compare
@nagisa Fixed. |
@bors r+ Thanks! |
📌 Commit 919a8a5 has been approved by |
Fix NixOS detection Use `/etc/os-release` instead of `/etc/NIXOS` for detection. The latter one does not exist on NixOS when using tmpfs as root.
⌛ Testing commit 919a8a5 with merge db06c87bbb4c488f3fcab9df58f0ccd11cb21f3a... |
💥 Test timed out |
@bors retry |
…laumeGomez Rollup of 9 pull requests Successful merges: - rust-lang#87187 (Fix NixOS detection) - rust-lang#87206 (avoid temporary vectors/reuse iterators) - rust-lang#87230 (Fix docblock <table> overflow) - rust-lang#87273 (Recognize bounds on impls as const bounds) - rust-lang#87279 (Add comments explaining the unix command-line argument support.) - rust-lang#87301 (Fix typo in compile.rs) - rust-lang#87311 (Get back the more precise suggestion spans of old regionck) - rust-lang#87321 (Add long explanation for E0722) - rust-lang#87342 (Add long explanation for E0757) Failed merges: - rust-lang#87270 (Don't display <table> in item summary) r? `@ghost` `@rustbot` modify labels: rollup
Use
/etc/os-release
instead of/etc/NIXOS
for detection.The latter one does not exist on NixOS when using tmpfs as root.