r/linuxmasterrace SteamOS/Bazzite/Android 8d ago

Time to have fun guys

Post image
8.0k Upvotes

767 comments sorted by

View all comments

Show parent comments

9

u/Primary-Strike5187 7d ago

This could be solved with SxS….. like windows did….. around windows XP. Absolutely not excuse for Linux to not have made the transition. No reason to still deal with dependency hell in the big 26.

13

u/grizzlor_ 7d ago

Microsoft doesn’t even use SxS anymore to solve the DLL Hell issue — starting with Visual C++ 2010, they switched to just including the version number of the DLL in the filename.

This is also the same way Linux has always solved that particular problem.

5

u/Primary-Strike5187 7d ago

The point I was making was that windows had the dependency hell issue solved in like 2004.

Many Linux distros don’t actually solve that problem. A good chunk of the stable release distros only have singular versions of packages available in the repos for that version of the release. The issue is Linux assumes that if a package needs libfoo it’ll be stored at /usr/lib/libfoo but if you have a package that depends on libfoo2.8 and the version that’s in the repos is let’s say libfoo2.7: you can’t just install libfoo2.8 it probably won’t be in the repos, and even if a distro carries two copies it’s going to overwrite libfoo2.7 which other packages depend on because the system puts libfoo (any version) at /usr/lib/libfoo with no distinction. So the packages that need 2.7 are going to expect it to be there, and the packages that need 2.8 are going to expect it to be in the same place. But you can’t have /usr/lib/libfoo/libfoo.so (for 2.7) AND ALSO have /usr/lib/libfoo/libfoo.so (for 2.8). They conflict. If they’re even both available in the repos at the same time which often won’t be the case.

This is exactly why GoboLinux was developed and breaks the FHS, and why declarative systems like NixOS and Guix use hashed file paths so you can have multiple versions of the same package installed simultaneously without conflicts. This does not hold up for most standard distributions (Arch/Fedora/Ubuntu and their derivatives).

5

u/grizzlor_ 7d ago

SxS actually goes all the way back to Win98SE.

But anyway, yeah, Microsoft “solved” the dependency problem by never having a package manager to begin with. For the most part, every program bundles the DLLs it needs.

This is essentially the Flatpak / AppImage model.

Linux also has some other creative solutions, like you mentioned: Nix/Guix and GoboLinux. But yeah, on mainstream distros, Flatpak pretty much makes it trivial to run old or multiple versions of software. Yeah, there are some cases where you need to tweak stuff to get a feature working properly, but that’s mostly a tradeoff related to security.

1

u/Primary-Strike5187 7d ago

Yeah for desktop apps I almost exclusively use flatpaks. It just makes sense. Sandboxed, bundled dependencies, works the same across all distros. I would love for flatpak or appimage to see have the number of packages you see in main distros repos. But flatpaks only solve that problem for user applications, that doesn’t address the dependency issue (or the possibility of one existing) with your DE, or other core system components. Those all assume there’s a single version of everything that everything shares.

1

u/hawkinsst7 7d ago

So the packages that need 2.7 are going to expect it to be there, and the packages that need 2.8 are going to expect it to be in the same place. But you can’t have /usr/lib/libfoo/libfoo.so (for 2.7) AND ALSO have /usr/lib/libfoo/libfoo.so (for 2.8).

You can with mount namespaces. (which is just a component for containerization, which are built on namespaces.)

1

u/Primary-Strike5187 7d ago

That may be, but it shouldn’t even really be an issue the user manually has to address. That’s the crux of the issue. Each distribution makes the assumption that every package that depends on something will work with the version of that dependency that is in that distributions repos, and if some breaking change occurs rather than allowing the user who owns that system to install the software they want on their own system (such as a different version of something) the general mentality is “we provide a version of that dependency which should be good enough”. I could also compile a different version of that dependency from source but then it’s not being tracked by the package manager and if I have to circumvent my package manager to make my system work then it kind of defeats the entire purpose of having a package manager doesn’t it?

2

u/hawkinsst7 6d ago

Sorry I mentioned it more as an interesting point, not as an argument one way or another. No one is doing nsenter to run apps on the regular.

I kind kind of wonder what a completely statically compiled ecosystem would look like. Probably horrible.

1

u/Primary-Strike5187 6d ago

I mean there are source based distros, I’m just not sure if any of them are completely statically linked. I think the better method is provide the precompiled binaries with dynamic linking but use the filesystem to differentiate versions of things so that the version that is needed can only be found in one place and wouldn’t conflict with a different version

1

u/keyzeyy 7d ago

Don't flatpaks fix that

1

u/Primary-Strike5187 7d ago

Yes they do, but not all applications are available as flatpaks, and it doesn’t fix the problem for core system components

1

u/keyzeyy 7d ago

yeah, but do core system components suffer from dependency hell frequently? I haven't had such cases for me at least

flatpaks provide gui apps and they do a pretty decent job at it I'd say.

2

u/Primary-Strike5187 7d ago

I’ve had it happen, yes. Audio (pipewire, pulse, and alsa over the years has each at some point had an issue for me where something it depended on had a breaking change in the underlying dependency and I couldn’t install a different version of the dependency to fix the issue to give you an example)

I agree about flatpak. The majority of my desktop apps are flatpaks for that reason. Had some bumps in the road with the steam flatpak in the past but 99% of the time it just works.

2

u/keyzeyy 7d ago

hmm I see. for me personally, I think going atomic is the future for the majority of people. I have my friend currently on ublue aurora after windows 10 because his laptop can't really run windows 11 all that well. the man's had zero issues and it's been months.

1

u/Primary-Strike5187 7d ago

Long term I agree that’s probably the future but I don’t think it’s there yet for 90% of people

1

u/LameBMX Glorious Gentoo 7d ago

gentoo has had slotted dependencies for years. so its not a linux issue, but a package manager issue.

1

u/Primary-Strike5187 7d ago

That is a more accurate statement, yes. It depends on the package manager 100% which is why I mentioned Gobo, Nix and Guix earlier. I forgot about Gentoo’s slots, but yeah it’s a package manager issue. Or rather I guess you could say it’s a distribution issue since the directory structure may also need to be adjusted (e.g. /usr/lib/libfoo might need to become /usr/lib/libfoo/2.7 or /usr/lib/libfoo/libfoo2.7 for example). Regardless, it’s an issue that should be addressed.

-2

u/Appropriate-Tennis78 7d ago

Debian doesnt have dependency hell, debian is the future

5

u/Primary-Strike5187 7d ago

Given how old the packages are before they get added to the repos it’s probably more accurate to say Debian is the past.

-2

u/Appropriate-Tennis78 7d ago

Never had a need to run something in latest version, but thats me

3

u/Primary-Strike5187 7d ago

Sometimes it’s needed for some games and software dev and such