News for hackers. Stuff that matters.
Re:Nix Survival Mode: macOS upgrades won't break Nix anymore by Nullabillity on Thursday October 26, 2023 @08:02AM (#38024420)
I haven't kept up actively with core proposals, so I don't know. But I'd doubt it since there's no way to do this generically.. even if you rewrite all paths referring to /foo to instead refer to /bar, that wouldn't cover hashed strings, and would be difficult to do in a way that would make binary formats happy (even if you pad it, `/foo\0\0\0` and `/foo` aren't universally equivalent).
Re:Nix Survival Mode: macOS upgrades won't break Nix anymore by JamesSwift on Thursday October 26, 2023 @12:15PM (#38027712)
Yeah seems like a nightmare since so much of the auto-magic that nix does to fix binaries (shebang rewriting and ELF .so patching) does so by injecting absolute paths (to /nix/store). So all of those would need to be reshimmed for your entire system

EDIT: theres also work being done to move to content-addressed nix store, in which case changing these things would invalidate the content hash

Re:Nix Survival Mode: macOS upgrades won't break Nix anymore by tgamblin on Friday October 27, 2023 @09:59AM (#38038501)
In Spack we rewrite strings in binaries, strings in text files (including shebangs), and RPATH/RUNPATH values. It's not hard to find store prefixes in binaries -- they have hashes in them so they're easy to identify. It's hard to lengthen them -- things in text files and in ELF fields can be made longer, but to make strings longer you need to find all references to them, which is impractical. So we build with long paths.

Relocating is really only a matter of relocating prefixes.

I am not sure how it would affect a content-addressed nix store, but I'm also not 100% sure why you want a content-addressed nix store. Addressing by the derivation hash (which is also what Spack does) lets you find valid build substitutes... would you index that separately for a content-addressed store?

Is the goal to allow multiple versions of non-reproducible builds in the same store?

Re:Nix Survival Mode: macOS upgrades won't break Nix anymore by JamesSwift on Friday October 27, 2023 @05:20PM (#38044117)
I'm not 100% sure, but I know one benefit of content-addressed derivations is that they are secure by default. i.e. if the hash matches the build is trusted vs the traditional need to have separate "trusted signatures" and signing workflow to whitelist particular builders.
Re:Nix Survival Mode: macOS upgrades won't break Nix anymore by Nullabillity on Monday October 30, 2023 @09:02AM (#38068969)
How do you reliably modify length-prefixed strings? Terminated strings? Delimited strings? Partial strings? Checksummed strings?