this post was submitted on 18 Oct 2023
18 points (100.0% liked)

nixos

1262 readers
1 users here now

All about NixOS - https://nixos.org/

founded 4 years ago
 

Could be areas of improvement as well

you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 3 points 1 year ago (1 children)

Yesterday, I ran into an issue where two versions of Qt couldn't run at the same time. This problem has been mentioned by a few people before, with no solutions offered for users. In my case, I was trying to start a nix shell with the rpi-imager. Thankfully, I was able to use the cli, but this was still unexpected and I was under the impression that nix was supposed to fix problems like this.

[–] [email protected] 3 points 1 year ago (1 children)

This is something that Nix cannot fix. Essentially the symbol namespaces in Linux are flat, so if you load two versions of the same library (or two different libraries exposing the symbols even) the first one wins. This is in contrast to eg. Windows where symbols are organized in a tree structure, which has advantages like fewer conflicts, but also comes with disadvantages of its own (eg. it would not be easy to implements something like LD_PRELOAD on such a structure). So on Linux, this is by design / works as intended.

For a bit of background information, you can have a read of https://github.com/NixOS/nixpkgs/issues/31189

[–] [email protected] 0 points 1 year ago (1 children)

Why is this only an issue on NixOS, then? I can't find a single instance of this issue on another distro.

Here is the relevant github issue: https://github.com/NixOS/nixpkgs/issues/37864

[–] [email protected] 3 points 1 year ago (2 children)

Because other distros usually can't have multiple versions of the same library to begin with.

[–] [email protected] 1 points 1 year ago (1 children)

They could, but they usually don't, because of reasons like this. On "classical" distros, library updates are done much more reluctantly because an update to a share library does not trigger a complete rebuild of the system. So the solution is not technical, it's organizational more often than not.

That being said, the statement that symbol conflicts do not exist on other distros is plainly not true.

[–] [email protected] 1 points 1 year ago* (last edited 1 year ago) (1 children)

That being said, the statement that symbol conflicts do not exist on other distros is plainly not true.

I have never claimed such a thing.

Classical distros have exactly one instance of a library ABI's .so in most cases which is usually the only place where any given symbol is defined.

You could technically provoke a symbol conflict using LD_PRELOAD and the like but it's not something you commonly run into because package upgrades always replace the previous version entirely.

You could technically have multiple conflicting sos on classical distros too by prefixing a more detailed version but you don't; doing such things kinda what differentiates Nix from classical package management.

This QT issue in particular was an impurity (working outside of Nix' pure model; not as intended) caused by "installing" qt libraries into your environment imperatively (which isn't something you should do anyways) that was solved a couple years ago.

[–] [email protected] 1 points 1 year ago

I have never claimed such a thing.

I switched context there quite a but. That part was directed at the underlying tone of the thread that implies that "other distros do not have these kind of conflict". Should have put that in a separate reply to make it clearer. Please excuse the confusion 🙂

[–] [email protected] 1 points 1 year ago (1 children)

If these these applications can coexist in other distros, and they can only have one version of Qt, then that means packages in NixOS are overly strict about library versions. I don't really care what the underlying reason is for this issue, I just know it's an issue exclusive to NixOS that frustrates me.

[–] [email protected] 2 points 1 year ago

No, the actual issue was an impurity (not working in Nix' pure model). Impurity is a bug; it was fixed years ago.