2xsaiko

joined 2 years ago
[–] 2xsaiko@discuss.tchncs.de 2 points 3 weeks ago

Distributions are not the problem. Most just package upstream libraries as-is (plus/minus some security patches). Hence why programs built for another distro will a lot of the time just run as is on a contemporary distro given the necessary dependencies are installed, perhaps with some patching of the library paths (plenty of packages in nixpkgs which just use precompiled deb packages as a source, as an extreme example because nixpkgs has a very different file layout).

Try a binary built for an old enough Ubuntu version on a new Ubuntu version however...

[–] 2xsaiko@discuss.tchncs.de 29 points 3 weeks ago (8 children)

And yet, ancient Windows binaries will still (mostly) run and macOS allows you to compile for older system version compatibility level to some extent (something glibc alone desperately needs!). This is definitely a solvable problem.

Linus keeps saying “you never break userspace” wrt the kernel, but userspace breaks userspace all the time and all people say is that there’s no other way.

[–] 2xsaiko@discuss.tchncs.de 1 points 4 weeks ago

Is this after it becomes unresponsive? I'm not seeing anything suspicious except maybe some D-Bus activation errors but those shouldn't do anything like that. Does the mouse cursor still move? Anything in dmesg after it starts doing that? What about CPU or memory usage? Can you switch to another TTY?

[–] 2xsaiko@discuss.tchncs.de 3 points 4 weeks ago (3 children)

Yes, that is true. And yet, there are C++ LGPL libraries which as you say do in principle have the same problem. It should be safe if you're careful about not using generics in the library's public interface, or at least only generic code that is essentially just stubs calling the real logic. (I haven't actually tried this myself tbh.)

In general any kind of inlined code is always a problem when doing this, even C can have this with macros, or "static final" integer constants in Java.

I should have definitely mentioned this and Rust's ABI stability though, yeah. As for that, keeping the same compiler version is generally not a problem since all of them are available.

[–] 2xsaiko@discuss.tchncs.de 6 points 4 weeks ago (5 children)

Plasma certainly does not depend on Flatpak. What do you get from journalctl --user -b 0 after logging in?

[–] 2xsaiko@discuss.tchncs.de 6 points 4 weeks ago

There are two ways of using library code in an executable program: dynamically linked libraries – also shared libraries – (these are DLL files on Windows, so files on Linux, dylib files on Mac), and statically linking libraries, which are embedded into the program executable at build time (specifically the link step which is generally the last).

Dynamically linked libraries just store a reference to the library file name, and when the program is run, the dynamic linker searches for these library files on disk and loads them into the program memory, whereas as I already said above statically linked libraries already are part of the program executable code so nothing special has to be done there at runtime.

This has nothing to do with bin packages inherently, which usually use at least a couple dynamically linked libraries anyway (libc at least). In fact every Rust program dynamically links to libc by default as at least glibc is impossible afaik to statically link. Some of them ship dynamic libraries along with the program binary (you see this a lot with Qt since it is pretty hard to link statically), some of them link their dependencies statically, some just expect the system to have certain versions of shared libraries available.

The special thing about Rust is that it really does not want you to output dynamically linked Rust libraries and link them to Rust programs, at least if they're not inside the same project, since it does not have a stable interface for Rust code to Rust code calls (and a couple other reasons). This means you cannot ship a Rust shared library as a system package that programs in other packages can link against, like you can with for example C or Swift languages. Every dependency has to be built inside the same project the final executable is also in.

library code licensed under it must be able to be replaced.

Does this mean you need to be able to make a reproducible build? Or need to be able to swap code for something else? Wouldn’t that inherently break a program?

It does not mean you need to make a reproducable build, it just means users must be able to modify the LGPL licensed parts. For example, the library loads a file from a specific path that you want to change, you must be able to change that path by editing the library source code. This is trivial if it's a shared library since you can just build your own where the path is changed and tell the dynamic linker to load that instead of the original, but with a closed-source statically linked binary you cannot easily change it if it does not provide the object files. These are essentially mostly final compiled code produced from source code files but not yet linked together into an executable, and significantly the LGPL parts are isolated files which can be swapped out with your own and then linked together again.

Doing this does not inherently break a program as long as the interface of the library (like function names, parameter types, general behavior of the code) stays compatible with the original one shipped with the program.

[–] 2xsaiko@discuss.tchncs.de 4 points 4 weeks ago (1 children)

FWIW static linking is also fine with LGPL (see my comment).

[–] 2xsaiko@discuss.tchncs.de 14 points 4 weeks ago (10 children)

Specifically for libraries licensed as LGPL, a lot of the time with Rust I hear the justification that it forces anything using it to also be (L)GPL, because Rust always links libraries statically^1^ into the final binary and therefore does not meet the requirement of the LGPL that library code licensed under it must be able to be replaced.

This is absolutely not the case however, precompiled binaries can just ship all the object files it is linked from along with it so users can replace the object files of the LGPL library with their own custom version, or just the source code for open-source software, which also meets the requirement of course.

^1^ something I could rant about for hours as this is lowkey one of the two things that ruins Rust for me but I digress

[–] 2xsaiko@discuss.tchncs.de 8 points 4 weeks ago

It's certainly not a universal thing either, no other language I know does it.

Once I asked on linguistics (or maybe English language) stackexchange about the origins of it, but it got deleted as duplicate of a related but definitely different question. Most satisfying stackexchange interaction

[–] 2xsaiko@discuss.tchncs.de -2 points 1 month ago* (last edited 1 month ago) (1 children)

I use LLVM because it's good, but I would like it even more if it was GPL and I agree with OP's comment as well.

However, you're literally the guy that replies "oh, so you hate oranges" to people that say "I like apples" or however that meme goes. How about you don't completely twist people's justifications into something they never said.

edit: It comes down to that I have no say in whether other people want to allow their code to be exploited by corporations nor does it make a practical difference to me in what I can do with it, all I can do is say "you're an idiot" to them.

view more: ‹ prev next ›