News for hackers. Stuff that matters.
Re:The Simplicity of Single-File Golang Deployments by candiddevmike on Wednesday March 22, 2023 @11:17AM (#35262341)
From what I have seen in major OSS projects like systemd and PostgreSQL, nothing seems to support static linking, to the point where some contributors get annoyed when you ask for it.

Seems like the C/C++ ecosystem will stay dynamically linked, even with a lot of the industry shifting towards statically linked, fat binaries as disk space is pretty cheap.

I wonder how much simpler Linux packaging would be if everything was statically linked...

Re:The Simplicity of Single-File Golang Deployments by bzzzt on Wednesday March 22, 2023 @11:39AM (#35262767)
Packaging would be simpler, but you probably have to update the whole OS and all your installed apps when a security update for a common library is released.
Re:The Simplicity of Single-File Golang Deployments by taeric on Wednesday March 22, 2023 @12:31PM (#35263533)
Not wrong; at the same time, I'm becoming less convinced this is relevant. Seems many security updates have to do with code paths that are not used in a large number of applications. Similarly, many of them are fixes on features that even more apps didn't want/need, but they got when they updated to get the last round of security fixes. :(

The docker world is a neat example of this. The stories of ${absurdly high percent} of containers having vulnerabilities only gets to claim that because of "unpatched libraries." If you reduce it to the number of containers with exploitable vulnerabilities, it is still non-zero, but not nearly as high.

Re:The Simplicity of Single-File Golang Deployments by nightfly on Wednesday March 22, 2023 @05:44PM (#35267477)
The problem is having to wait for all those applications to push updates when a vulnerability is found in a common library
Re:The Simplicity of Single-File Golang Deployments by taeric on Wednesday March 22, 2023 @08:04PM (#35268813)
That is the thing, though. For most applications, those vulnerabilities in a common library are not relevant. That is what I was talking about in saying that it is in code that isn't used by them.

You are, of course, right that it has the possibility of happening. But by and large, it doesn't happen there any more often than it does in the dynamically linked cases. And, by and large, the dynamically linked cases are often a lot more complicated to deploy. (Granted, deployment for either should be doable nowadays.)

The dream, of course, is you just patch the library and call it a day. The reality seems to usually be a circus check on every application that you have deployed to see if they are impacted anyway.

Re:The Simplicity of Single-File Golang Deployments by initplus on Wednesday March 22, 2023 @09:47PM (#35269508)
The solution to this is to make the build process as simple as possible. Then pushing updates has a much lower maintenance cost.

I can be confident I will be able to build >90% of go programs by cloning the repo and calling go build.

Re:The Simplicity of Single-File Golang Deployments by rangerelf on Wednesday March 22, 2023 @11:58AM (#35263071)
Simpler but small updates, like say openssl, become massive distro updates. There's a reason why everyone went with shared libs when they became stable.
Re:The Simplicity of Single-File Golang Deployments by iambvk on Wednesday March 22, 2023 @12:54PM (#35263852)
A system with shared libraries also needs an update for the security fixes. There is no avoiding the update step. However, the only difference is the size of the update. If update process is robust, size of the update shouldn't matter, isn't it?
Re:The Simplicity of Single-File Golang Deployments by dahfizz on Wednesday March 22, 2023 @05:50PM (#35267547)
It does matter. If there is a problem with openssl, just the openssl maintainers have to push an update and everything on your system is secure.

If everything is statically linked, you need to wait for every maintainer of every single program on your system to rebuild and push an update. You're basically guaranteed that there is always _something_ missing important patches

Re:The Simplicity of Single-File Golang Deployments by fdeee on Wednesday March 22, 2023 @08:18PM (#35268936)
The matter isn't the binary size of the update. It is the size of the crowd of people and parties involved in the update: For a bunch of statically linked applications, you need to involve all the application people/vendors. For a bunch of dynamically linked applications depending on a shared library, you (ideally) just need to involve the one library's people/vendor.

And "involve" might mean: wait for a bunch of unresponsive external parties to produce a new binary each for a security issue they might not care about. Of course on very different timelines, etc.

Re:The Simplicity of Single-File Golang Deployments by rvense on Wednesday March 22, 2023 @12:16PM (#35263345)
Docker images are static linking for the modern era.
Re:The Simplicity of Single-File Golang Deployments by jamesfinlayson on Wednesday March 22, 2023 @07:50PM (#35268692)
Funnily enough I was looking at an issue in my one of personal projects last night about asking me to statically link libstdc++ - it's something I was interested in doing because I spent way too long spinning my wheels on an issue caused by loading an outdated libstdc++.so.6, but I read that statically linking can cause issues if your code loads another library that dynamically links libstdc++... which I'm pretty sure my project does (it's a pass-through between an executable and another library). So I want to, but it sounds like if I do it might work but be fragile at best.