4 ms·
Good luck finding actually portable linux software, unless it bakes in every dependency.
by zymhan 5y ago
Good luck finding actually portable linux software, unless it bakes in every dependency.
- IceWreck 5y agoAppImages are portable, mostly. They run out of the box on Fedora, Debian, Ubuntu and others.
- maven29 5y agoAppImage does exactly that?
- zymhan 5y agoSure, in theory. I've had appimages that would only run on a specific Linux distro and version. It doesn't seem like an automatic fix.
- Spivak 5y agoLots of software does that these days because it’s the standard way to distribute stuff in Go and Rust. So much software is just dependent on kernel and architecture. Terraform is a good example of a moderately complex piece of software distributed that way.
- kaladin-jasnah 5y agoAre you talking about statically-linked binaries?
- charcircuit 5y agoYou can just put the dependencies in the same folder in most cases.
- dotancohen 5y ago...and then compile it. This site provides binaries.
- charcircuit 5y agoDependencies as in .so files. I'm not sure what your point was.
- AnIdiotOnTheNet 5y agoIt isn't nearly as trivial as you imply. First you have to track down every shared lib and every shared lib that lib depends on, then you have to create a launcher script that specifies LD_LIBRARY_PATH and possibly also launches with a particular ld.so to ensure compatibility. If the application dynamically loads any libraries via API instead of the ELF you might need something like seccomp to intercept and rewrite paths in syscalls or screw around with user namepsacing. And that's just the tip of the iceberg when it comes to portablizing Linux applications.
- charcircuit 5y agoAnd it's not as simple as just statically compiling all your dependencies into the final executable either.
- ninkendo 5y agoYou can link with the -rpath flag to hardcode an RPATH into the executable, which is essentially an LD_LIBRARY_PATH specified by the executable itself. It can be a relative path too, if you want to put the binary and its required .so’s in the same prefix. But yeah, this isn’t common to do in the Linux world, unfortunately, because it’s expected that binaries and libraries live in distinct places on the filesystem, rather than bundling them together into an app bundle like on macOS.
- AnIdiotOnTheNet 5y agoYeah, and thanks to Nix you can use PatchELF[0] to change the rpath on a binary too. Point being that for users it is not a straight-forward process to make a Linux application portable. Thanks to Linux Desktop's lackadaisical approach to userspace ABI compatibility it isn't necessarily that easy for developers either. [0] https://github.com/NixOS/patchelf https://github.com/NixOS/patchelf
- razemio 5y agoHow do you want to make something portable without adding all dependencies? Am I missing something?
- swiftcoder 5y agoOn windows you can rely on a very stable set of microsoft-provided dependencies. Across multiple linux distros, not so much. End up having to link the whole kitchen sink to work across repos (and there's a fair testing burden on the developer to make sure that actually works).
- eska 5y agoIf that’s the case, then why do all installers install dependencies such as one of the many C++ or C# runtimes, current DirectX, etc? They also bring along all of their DLLs. So this doesn’t ring true.
- AnIdiotOnTheNet 5y agoBecause those things have decided to use dependencies that are not provided by the base system, and because Microsoft has made some questionable decisions regarding C runtimes, DirectX, and the like. The point is, I can always depend on user32.dll, kernel32.dll, and a bunch of other Windows API to be there and to still be compatible with how I'm calling it[0] 20 years from now. Linux is too fragmented and user space libraries break compatibility too often for that. [0] in the vast majority of cases
- matt_heimer 5y agoLike Docker?
- zymhan 5y agoThat is in fact baking in all the dependencies. Just, in a docker image! _cue Seinfeld_ Not that there's anything wrong with that
- corndoge 5y agohttps://www.magicermine.com/ https://www.magicermine.com/
- datavirtue 5y agoJava apps run just fine.
- ninkendo 5y agoThe last time I remember running any Java apps on Linux, they’d actually be launched by a launcher script that hardcodes a bunch of paths to look for a java installation and, a huge fraction of the time would get it wrong. Or they’d require a bunch of their own .jars and look for them in an installation path that isn’t easily relocatable. Or they’d bundle their own Java and turn into an even bigger nightmare. I definitely don’t remember it being just fine.
- charcircuit 5y agoUsually you can just get away with java -jar program.jar