News for hackers. Stuff that matters.
Re:Ubuntu 20.04 LTS’ snap obsession has snapped me off of it by Wowfunhappy on Saturday September 05, 2020 @11:37AM (#24384324)
> Might as well ship a pre-linked binary that just does system calls.

I actually think that’s exactly what we should do. Containers are an over-engineered solution for a problem that never needed to exist.

Dynamic linking doesn’t work unless you can live inside a distro maintainer’s special bubble for all your software. If you can exist in that bubble, great—I really like Debian for certain use-cases—but if you can't, the benefits of dynamic linking everything are clearly outweighed by the drawbacks.

Re:Ubuntu 20.04 LTS’ snap obsession has snapped me off of it by danieldk on Saturday September 05, 2020 @12:21PM (#24384706)
Dynamic linking doesn’t work unless you can live inside a distro maintainer’s special bubble for all your software. If you can exist in that bubble, great—I really like Debian for certain use-cases—but if you can't, the benefits of dynamic linking everything are clearly outweighed by the drawbacks.

Good luck patching that security vulnerability in all those static binaries without proper dependency tracking ;). Not that I am on a particular side of the fence, both have their downsides.

To me the problem are package managers from the '90ies that use a single global namespace, only allows UID 0 to install packages, and do not really provide reusable components.

Modern packaging systems like Nix and Guix allow users to install packages. Packages are non-conflicting, since they do not use a global namespace (so, you can have multiple versions or different build options). They provide a language and library that allows third-parties to define their own packages.

Not to say that they are the final say in packaging, but there is clearly a lot of room for innovation.

Snap and Flatpak are copying the packaging model of macOS, iOS, and Android. This is a perfectly legitimate approach (and IMO the execution of Flatpak is far better). But it is not for everyone -- e.g. if you prefer a more traditional Unix environment.

Re:Ubuntu 20.04 LTS’ snap obsession has snapped me off of it by skuhn on Saturday September 05, 2020 @04:46PM (#24386728)
Rolling out shared library updates to resolve security vulnerabilities is not without its own issues.

The big one, which surprisingly places still manage to fumble due to poor process controls or simple mistakes, is that you have to restart all running processes that use the library after you update it.

I actually prefer to deploy static builds of critical services for this reason, because you already have to know that you're running version 1 build 5 everywhere -- and if everything is build 5, then they all have the fix. You don't also have to check if the process was started after May 5th.

Re:Ubuntu 20.04 LTS’ snap obsession has snapped me off of it by yxhuvud on Saturday September 05, 2020 @01:03PM (#24385058)
> without proper dependency tracking

Well, there is nothing that says you can't have proper dependency tracking just because something is statically linked. The infrastructure isn't currently there [x], but it definitely is something that languages and language package managers could with each other and provide.

[x] But can be built, now that more and more languages have access to language package managers with proper dependency tracking. One way would be to create a standard for how to query a binary for what it depends on. Then a computer could have a central database of the dependencies of static binaries that is installed.

Re:Ubuntu 20.04 LTS’ snap obsession has snapped me off of it by danieldk on Saturday September 05, 2020 @02:09PM (#24385592)
Well, there is nothing that says you can't have proper dependency tracking just because something is statically linked.

Didn't say so. It is just easier with dynamic linking, because you can see what libraries (and versions) a binary is linked against.

But can be built, now that more and more languages have access to language package managers with proper dependency tracking.

Actually, approaches such as Nix' buildRustCrate (where every transitive crate dependency is represented as as a Nix derivation) + declarative package management offer this today.

But with curl | bash or traditional package managers, which are most widely used today, this is kind of dependency tracking hard/ad-hoc.

But can be built, now that more and more languages have access to language package managers with proper dependency tracking.

But then a static C library is used and nobody knows where it came from. Even if you look at the Rust ecosystem, which generally does things well when it comes to dependency handling, crates are all over the place when it comes to native libraries. I have seen everything from crates that use a system library (or something discoverable via pkg-config), via crates that have the library sources as a git submodule and build them as part of the build-script, to crates that download precompiled library from some shared Dropbox link.

Another fun example from another language ecosystem. numpy uses OpenBLAS. They compile their binary wheels on CI. However, OpenBLAS itself is retrieved as a precompiled binary from another project [1]. However, the rabbit hole goes deeper. In case OpenBLAS is built for macOS, a precompiled disk image is retrieved from yet another repository [2]. This disk image is added to that repository, but comes from yet another place.

This is all sort of the opposite the lessons to take from Reflections on Trusting Trust and the bootstrapping that the Guix folks try to do.

Anyway, with the mindset that most developers have, we will never have proper dependency tracking.

[1] https://github.com/MacPython/openblas-libs

[2] https://github.com/MacPython/gfortran-install/tree/d430fe6e3...

[3] http://coudert.name/software/gfortran-4.9.0-Mavericks.dmg.

Re:Ubuntu 20.04 LTS’ snap obsession has snapped me off of it by rkagerer on Saturday September 05, 2020 @11:58AM (#24384508)
I agree. Are there any major disadvantages to that, aside from size and having to wait for each application to update its own dependancies?
Re:Ubuntu 20.04 LTS’ snap obsession has snapped me off of it by nycticorax on Saturday September 05, 2020 @12:25PM (#24384745)
The 'horror story' people always mention, which is a special case of "having to wait for each application to update its own dependencies", is that if there's a security vulnerability in a much-used library, you have to wait for each application maintainer to update their application, rather than simply having the distribution maintainer update the shared library. I'm not sure I agree that this would be worse than the current situation...
Re:Ubuntu 20.04 LTS’ snap obsession has snapped me off of it by marcthe12 on Saturday September 05, 2020 @01:30PM (#24385304)
No plugins or switching implementations. This mainly affects stuff like opencl, opengl, vulkan, qt, Apache, PHP & PAM.

A few this could be solved (esp PAM and GPU ones) by making the full thing work over IPC. Already opengl is a pain to work in generic containers.

Re:Ubuntu 20.04 LTS’ snap obsession has snapped me off of it by MiroF on Saturday September 05, 2020 @12:45PM (#24384919)
Are there any major disadvantages to a nuclear winter, besides that everyone would die and the environment would be destroyed?
Re:Ubuntu 20.04 LTS’ snap obsession has snapped me off of it by nycticorax on Saturday September 05, 2020 @01:03PM (#24385061)
I just honestly don't understand this. On Windows and Mac (the OSes that 99% of the planet uses on the desktop), this is exactly how things work. The OS provides a set of APIs. If an application author needs a library that isn't in the OS, they have to ship it themselves. If a vulnerability in that library comes to light, they have to fix it and ship an updated version of your application. If it's a commonly used library, a lot of application authors are going to have to ship updates.

Why couldn't this work for a Linux-based OS? Honest question.

Re:Ubuntu 20.04 LTS’ snap obsession has snapped me off of it by zajio1am on Saturday September 05, 2020 @06:41PM (#24387426)
On Windows and Mac, there is Microsoft / Apple who decides what is set of OS APIs, and everything outside is external library.

In Linux, there is no such authority and therefore no sharp line separating 'core OS' and 'external library'. It is just conglomerate of Linux kernel and independently developed tools and libraries (where each of them is more-or-less optional).

Re:Ubuntu 20.04 LTS’ snap obsession has snapped me off of it by mixmastamyk on Saturday September 05, 2020 @01:35PM (#24385348)
That way leads to high numbers of boxes with vulnerabilities, which may be "fine" for non-technical folks. That's not the audience linux serves however.
Re:Ubuntu 20.04 LTS’ snap obsession has snapped me off of it by nycticorax on Saturday September 05, 2020 @05:25PM (#24386958)
I don't think it's at all clear that it would lead to high numbers of boxes with vulnerabilities. Is it clear that a Mac is more vulnerable than a desktop Linux box, if you control for for the technical sophistication of the person maintaining it? I don't think that's at all clear.
Re:Ubuntu 20.04 LTS’ snap obsession has snapped me off of it by mixmastamyk on Saturday September 05, 2020 @10:27PM (#24388498)
While it's not guaranteed they'll be installed, the vast majority of linux desktops get security updates, including for all normally installed applications. That's a pretty big advantage over a manual update strategy.
Re:Ubuntu 20.04 LTS’ snap obsession has snapped me off of it by saalweachter on Saturday September 05, 2020 @05:48PM (#24387116)
It does seem like there could be a, well, canonical set of common libraries of specified version-ranges for a particular version of a particular distribution which are dynamically linked and with updates pushed by the distro maintainer, and if the application developer needed something else it would be statically linked.
Re:Ubuntu 20.04 LTS’ snap obsession has snapped me off of it by stryan on Saturday September 05, 2020 @01:41PM (#24385398)
I think the point is it "could" work on Linux, but a significant portion of devs consider that to be be a bad method of solving the problem.
Re:Ubuntu 20.04 LTS’ snap obsession has snapped me off of it by tracker1 on Sunday September 06, 2020 @02:20AM (#24389403)
If you have a BSD app that uses an LGPL library, congratulations, your app is now (L)GPL... let alone a differently licensed other library, and now your app can no longer be distributed/licensed.