Hacker News new | ask | show | jobs
by civodul 1099 days ago
Good point. It's telling that many Nix vs. Guix discussions focus on three topics: DSL, popularity, and non-free packages. Few people talk about package quality control even though it's rather crucial for day-to-day use.

A while back I wrote about what it means to package something like PyTorch with the kind of quality control Guix has: https://hpc.guix.info/blog/2021/09/whats-in-a-package/

1 comments

I'm not at all living in the Guix world, so please forgive my ignorance here. (I actually kind of gave up on the dumpster fire that are native binaries and happily live in my JVM bubble these days) But based on your article, I think you can take things a bit further to their natural conclusion

The last step is dealing with CMake. You can actually produce correct/reproduceabile crossplatform, crossarchicture builds WITH diamond dependencies and all that jazz if you integrate with the Hunter dependency manager. I think it's the only way you can get to a point where you don't end up with redundant dependencies at different version numbers

I wrote this high-level article about it years ago: https://kxygk.github.io/hunterintro.html

I mean, I actually frankly don't see a clear line between CMake "build orchestration" tools and dependency managers like Guix. Ideally Guix would just take over the function of CMake entirely - but it's missing crucial pieces. I think fundamentally you have 90% of the pieces there. You've already specified the whole dependency tree and dealt with linking/paths. The last 10% is extracting what CMake calls the "toolchain file" - ie. the specification for how you what you build done (target OS, architecture, compiler, linker and compilation/linking flags).

Ultimately it feels like with a bit more abstraction GUIX could be a truly crossplatform build/package manager. One could imagine for instance passing it a -debug flag and having it propagate to all dependencies and build your whole world with symbols. Debugging would become "full stack". Or passing in another flag and building one huge static binary with all dependencies and then doing PGO on it. Building crossplatform would become a breeze. Introducing a new architecture would be simply a matter of specifying a new toolchain file

I spent way too much time on reproduceabile CMake builds. We had our library reprucibly building for a huge amount of targets from Windows to iPhone 9 with a dozen dependencies that had diamond dependencies and it all worked beautifully. But I was kind of horrified that almost nobody in the C/C++ world really care about this. The tools were there and no one was using them (granted Hunter, while easy to use, has a bit of learning curve)

Ultimately I think it's something that needs to be solved at a "higher level" of the package manager bc cross language monsters like PyTorch are the norm now a days