Installing via nix profile
makes nix
command unusable #655
Labels
No labels
Affects/CppNix
Affects/Nightly
Affects/Only nightly
Affects/Stable
Area/build-packaging
Area/cli
Area/evaluator
Area/fetching
Area/flakes
Area/language
Area/lix ci
Area/nix-eval-jobs
Area/profiles
Area/protocol
Area/releng
Area/remote-builds
Area/repl
Area/repl/debugger
Area/store
bug
Context
contributors
Context
drive-by
Context
maintainers
Context
RFD
crash 💥
Cross Compilation
devx
docs
Downstream Dependents
E/easy
E/hard
E/help wanted
E/reproducible
E/requires rearchitecture
imported
Language/Bash
Language/C++
Language/NixLang
Language/Python
Language/Rust
Needs Langver
OS/Linux
OS/macOS
performance
regression
release-blocker
stability
Status
blocked
Status
invalid
Status
postponed
Status
wontfix
testing
testing/flakey
Topic/Large Scale Installations
ux
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: lix-project/lix#655
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
I tried installing Lix with
After this, running
nix
gave the following errors:which made it impossible to use
nix
, e.g. to removelix
.In the end I solved this when I found a nix binary in my Nix store that I could use to run
nix profile rollback
, but I don't know what I would have done without this. It was stressful.Someone on Matrix later informed me that
So I guess this is the issue I ran into? In any case I think a warning on https://lix.systems/install/ is warranted.
That's extremely weird. This error you're seeing should never happen, since in the nix system as a whole, shared libraries are referred to by their full paths in general.
I can tell you that in the environment this was broken, doing that nix profile install from nixpkgs-unstable but for cppnix will be broken in exactly the same way. This is extremely unlikely to be a Lix bug, unless the broken environment only affects executables built by clang or so, but I'm nonetheless sorry you had to deal with this breakage.
Most likely what you saw here is that you have LD_LIBRARY_PATH or LD_PRELOAD set (perhaps due to some kind of weird wrapper shenanigans in the shell or terminal you're using? check these environment variables), which forces the dynamic loader to load different versions of libraries than specified in the executables themselves, and specifically it's overriding libc++abi to an older version than Lix was built with, which is causing it to be very unhappy.
If this happens again you can get a usable nix by looking in /nix/var/nix/profiles. The default profile is the one that the daemon is from and also there's usually previous versions of that profile too.
Thanks for the quick response.
You're exactly right, I did all this in an environment where
LD_LIBRARY_PATH
was set. I was in a Python project and I used nix-ld in order to make some Python packages work properly (e.g. numpy). Outside of the environment,nix
does not raise the errors mentioned above.I'll admit I don't fully understand the technical reason behind the catastrophic failure you've given; hence I still think this warrants some docs or deeper fixing, but I'll let Lix developers be the judge. At the very least I'm glad there is closure on the cause of the issue.
Thanks again!
Unfortunately this happens to basically every other executable as well. The problem with LD_LIBRARY_PATH is that it's tried first before looking where the executable says to look. The dynamic loader does not have a "additional fallback paths" environment variable so you're just hosed here.
Since the only way we could really do this differently is to only ship static executables, and because it happens with every other executable too, I don't think we would be right to document it because in most scenarios where you have this issue, a pile of other stuff is busted too.