7 ms·
I just installed Fedora 27 in a VM out of curiosity. As far as I can tell from a quick glance, it looks like these Rust executables (ternimal, tokei) staticall
by simmons 9y ago
I just installed Fedora 27 in a VM out of curiosity. As far as I can tell from a quick glance, it looks like these Rust executables (ternimal, tokei) statically link their dependent Rust crates (including the Rust standard library), which is the typical approach to building Rust programs. I do wonder if someday we'll see distributions arranging a common dependency realm (as much as possible) among their Rust programs so that shared libraries can be used to reduce the total memory and storage footprint.
- solarkraft 9y agoUnfortunately this doesn't seem to be something developers are very interested in nowadays. While it would improve the overall system it would also hurt the solid compatibility and introduce further headaches for the user, possibly being attributed to the software. Would be nice if it did happen, though.
- arghwhat 9y agoI would very much prefer if it did not happen. It does not really bring any benefits, but only brings horrors. Go and Rust both live in a statically linked state of bliss that should not be tainted. http://harmful.cat-v.org/software/dynamic-linking/ http://harmful.cat-v.org/software/dynamic-linking/
- simmons 9y agoI agree. There are certainly many cases where static linking makes a lot of sense. The redundancy of statically linking a few self-contained applications can be negligible and the reduced administrative burden can be a great value. But a hypothetical future Rust-heavy distribution, with hundreds of programs, may be an exception. I sometimes wonder what a lightweight "Rusty" distribution for consumer electronics applications might look like. You can go a long way with the Busybox monolithic binary approach, but that might be a pain for development and software updates at some point.
- steveklabnik 9y agoInteresting, giving the package search a look, I thought they were dynamically linked. Debian has a “debcargo” tool to turn crates.io packages into Debian ones so that they can do this.
- newnewpdro 9y agoIt's kind of funny how GNU/Linux used to intentionally have everything statically-linked that was involved in bringing up the system and needed for a rescue recovery session, so you could still administer a system even if your dynamic shared libraries were hosed. Now I see people tout statically-linked binaries as if it's some kind of new thing brought by Golang and Rust. Though this may be a result of modern glibc being somewhat hostile towards and incompatible with static linking, so maybe the blame should fall on GNU for that one. Netscape used to distribute statically-linked binaries for a number of *nix platforms as a way to avoid this problem all the way back in the 90s. All it needed was an X display server and stable kernel interfaces. Eventually GNU/Linux changed to the point that everything was dynamically linked to the point that only `sln`, a statically linked `ln` was all you had to work with in lieu of a working dynamic linker to fix the system.
- jburgess777 9y agosln is on the way out too... https://www.spinics.net/lists/fedora-devel/msg241326.html https://www.spinics.net/lists/fedora-devel/msg241326.html
- newnewpdro 9y agoI wonder why the distros don't ship a static-core alternative package for all this stuff statically-linked, for people who actually care about improving the odds of recovering their systems in the face of random filesystem corruption which may break dynamic linking or fat fingered commands run as root. Zbyszek's comment about systems being cattle is very telling. What the hell are the these guys running on their laptops/desktops? I can see that attitude if you're only considering GNU/Linux as a substrate for running cloud instances and containers, but I use GNU/Linux as my main personal operating system on systems I absolutely do not view as cattle. Grrrr.
- jburgess777 9y agoI think the assumption today is that is easy to boot from some alternative media (usb/cdrom/pxe) into what used to be called a "live cd" (like Knoppix). Once there you can mount your existing partitions and attempt to fix any issues. The Fedora CDs have provided a "rescue" option since as long as I can remember and this attempts to find and mount your existing installation. There is also a rescue option in the grub boot list but I have never needed to use it. The Fedora docs also describe two further rescue and emergency modes available from the grub menu: https://docs.fedoraproject.org/f27/system-administrators-guide/kernel-module-driver-configuration/Working_with_the_GRUB_2_Boot_Loader.html#sec-Booting_to_Rescue_Mode https://docs.fedoraproject.org/f27/system-administrators-gui...
- sinh 9y agoIIRC this is thought as a deliberate temporary solution because Rust does not yet has a stable ABI. There is no fundamental obstacle to build dynamically linked (shared) libraries in Rust.