Comments (9)
Thanks for raising this! The next version of the installer lowers this from an error to a warning so the situation will be a bit better! Still, labelling this as a bug.
from nix-installer.
also use #!/usr/bin/env bash
not #!/bin/bash
from nix-installer.
The installer does not use #!/bin/bash
anywhere, and the relevant scripts also don't use a hashbang, please open a new issue if you have something unrelated, thanks!
from nix-installer.
I was thinking about this issue more and I think that skipping the self-test is not what we want, for shells that are links to other shells, we may want to avoid editing the shell profile all together.
I'd not want to place a user in a situation where we leave them with a broken sh
and simply skip the self-test on sh
.
That being said, the culprit of this issue is like stemming from /etc/profile.d/logic.sh
as stated in the error message. The nix-installer
does not edit that file, so unless the error message is reporting the wrong error, I do not think this issue is caused by the installer, but by an already broken sh
config?
from nix-installer.
Greetings from the same debian 11 machine which raised the error :)
/etc/profile.d/logic.sh
is a bash script:
#!/bin/bash
function extend_path_for_swipl {
local SWIPL="/usr/local/logic/swipl"
local BIN="${SWIPL}/bin"
if [[ -d "${BIN}" ]]; then
export PATH="${BIN}:${PATH}"
export SWIPL_HOME="$SWIPL"
fi
}
extend_path_for_swipl
unset extend_path_for_swipl
so I guess defining a "function" in it is legal.
It is not a debian thing, but stems from an installation of SWI prolog, it can be found here: https://www.swi-prolog.org/Download.html
No error would have occurred if not something had started /bin/sh -> /bin/dash.
This machine is like all my boxes somewhat modified to run /bin/zsh as the login shell for all accounts but root and postgres which run /bin/zsh-static. Most of the /bin/zsh accounts have a local zsh profile with command line completion for the task of the account.
So I can be pretty sure that I/my accounts/my machine did not start /bin/sh (which at the time pointed to /bin/dash).
The start of /bin/sh (which pointed to /bin/dash) may have happened from here
nix-installer/nix-installer.sh
Line 1 in 34d0b7e
or maybe by the elevation to root
`nix-installer` needs to run as `root`, attempting to escalate now via `sudo`...
Other candidates would be running things with sudo like
curl $URL | sudo sh
, by cron - IIRC all these stubbornly use /bin/sh
regardless of the users login shell set in /etc/passwd
.
I did not find any such things in the code, but then I am not firm enough in rust to guess what is in the sudo cstring.
from nix-installer.
It's my assumption that /etc/profile.d/logic.sh
existed (and thus sh
was broken) before the nix
install ever occured, so it being broken during self test makes sense since it was already broken.
Is this correct?
from nix-installer.
This ist definitely correct, I installed SWI Prolog in last winter after xmas, and nix in July.
from nix-installer.
So I spent a little bit of my sunday on that debian11 machine which triggered this issue:
- uninstalled nix
- uninstalled SWI Prolog
- made sure that there are no remnants in /etc and user profiles
- reverted to dash as
/bin/sh
- kept
/bin/zsh
and/bin/zsh-static
as login shells - did a system upgrade to the latest packages for debian 11
- rebooted
After that the installer worked as intended :)
Conclusion:
- it works with
/bin/sh -> dash
on unmodified systems - it works with
/bin/sh -> bash
even on modified systems - it does not work with
/bin/sh -> dash
on modified systems and leaves a non-functioning nix install
("modified" means that this machine has eight foreign repositories configured, and heavily personalized shell profiles. The SWI prolog installation was only a software package, and any of the installation could have written to /etc/profile.d/)
Maybe you should threat this like the test for Apple's ksh93 which I found in the installer.
I consider this thing "worksforme" now, but the mileage or stamina of others will vary.
from nix-installer.
If the user has a broken sh
before the install, it seems like the self test reporting that sh
is broken is expected, so I am not sure this is a bug or is in need of fixing. SWI prolog shipping a broken profile.d
for dash is neither the installers problem nor responsibility.
I really appreciate your report and help debugging the issue! It's good Nix is working for you now.
from nix-installer.
Related Issues (20)
- nix: symbol lookup error: /usr/lib64/libc.so.6: undefined symbol: __tunable_is_initialized, version GLIBC_PRIVATE HOT 2
- Error installing x86-64 Arch in OrbStack on Apple Silicon HOT 3
- bug: missing field `enterprise_edition` HOT 1
- 0.20.1 macOS 15 beta detection doesn't always work HOT 1
- <autogenerated-issue>
- New warning "warning: unknown experimental feature 'repl-flake'" after upgrading nix to 2.23.3 HOT 2
- Packaging nix-installer for openSUSE: How to set NIX_INSTALLER_TARBALL_PATH properly (and elegantly)? HOT 4
- README.md: NIX_INSTALLER_TARBALL_PATH needs to be set for "RUSTFLAGS="--cfg tokio_unstable" cargo run -- --help"
- <autogenerated-issue> HOT 1
- can't use flakes even if nix.conf is updated HOT 2
- Switching to fish shell after running installer with zsh breaks PATH? HOT 2
- Verify integrity of installer binaries in nix-installer.sh HOT 2
- error reinstalling nix on mac os after restoring a mac backup HOT 2
- Autogenerated issue running 0.20.2 from 0.16.1 HOT 1
- Autogenerated issue running 0.20.2 macos x86_64 HOT 4
- Fedora Silverblue: toolbx doesn't inherit nix-profile in PATH HOT 1
- Suggestion: in the plan json, specify the action name for every action, not only for `dyn Action` HOT 2
- <autogenerated-issue>
- nix 2.23.3 run cache performance regression HOT 5
- Not able to install on Mac OS using the installer HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nix-installer.