23 Oct 2024 |
K900 | That's kind of what the chroot store in very recent cppnix does | 15:50:19 |
KFears (tragedy arc) | Is it backported yet? Does it make sense for my use case? | 15:52:15 |
K900 | Not backported, not sure if it makes sense because it might need nested container nonsense | 15:52:41 |
KFears (tragedy arc) | I really wish there was like a technical document on why paths need to be hardcoded... | 15:55:16 |
KFears (tragedy arc) | This is such a painful and sudden gotcha | 15:55:26 |
K900 | It's literally everything | 15:55:42 |
K900 | Most things don't expect relative paths | 15:55:46 |
K900 | Especially self-relative paths | 15:55:54 |
KFears (tragedy arc) | I mean, shit, Nix patches ELF headers and messes with LD env vars | 15:59:00 |
KFears (tragedy arc) | I find it hard to think that paths are a harder problem | 15:59:22 |
KFears (tragedy arc) | So yeah, a design doc on why this makes sense would come in handy | 15:59:50 |
K900 | Well the glibc dynamic loader really doesn't like relative paths | 15:59:54 |
K900 | For one | 16:00:14 |
KFears (tragedy arc) | Anyway, do I just use the shared store from the host, and forget about trying to have separate stores in tmpdirs? | 16:00:34 |
KFears (tragedy arc) | I don't think it will be a problem for what I need, and the CppNix way of creating dummy derivations that do nothing and are spread over many files doesn't feel particularly attractive | 16:02:16 |
KFears (tragedy arc) | . о О (it would be really nice to have SDKs for programming languages to create temp stores, overlay stores and perform other Nix-related ops) | 16:11:45 |
| @navi:tchncs.de left the room. | 16:15:06 |
aloisw | In reply to @k900:0upti.me That's kind of what the chroot store in very recent cppnix does What do you mean by that exactly? | 16:58:42 |
| aktaboot changed their profile picture. | 19:54:03 |
puck | In reply to @kfears:matrix.org I mean, shit, Nix patches ELF headers and messes with LD env vars nix doesn't; nixpkgs does. the two are distinct; and the primary reason this can't be done sensibly is because store paths will end up in places that are e.g. length prefixed, or otherwise can't change length | 21:33:21 |
KFears (tragedy arc) | In reply to @puck:puck.moe nix doesn't; nixpkgs does. the two are distinct; and the primary reason this can't be done sensibly is because store paths will end up in places that are e.g. length prefixed, or otherwise can't change length Right, about the Nix/Nixpkgs stuff. But I still don't get the whole thing about length prefixing and stuff | 21:40:13 |
puck | well, "/nix/store" isn't the same length as "/tmp/pytest-of-nixchad/pytest-31/popen-gw2/test_trivial_shebang0/store" | 21:48:19 |
puck | patchelf does a lot of work (and not all of it perfect) to rewrite the store path | 21:48:31 |
puck | and e.g. nodejs can't work with rewritten paths at all | 21:48:37 |
KFears (tragedy arc) | I still don't get how this is such a gigantic problem but I guess there's nothing to do about it | 22:05:30 |
uep | you have to substitute the path into an executable, without changing the length and thus the offsets of all the following items, that would require re-linking everything and even knowing where the values that are offsets are | 22:42:27 |
puck | e.g. how would you update let path = "${storePath}"; in "the store path is ${builtins.stringLength path} characters long" | 22:48:37 |
KFears (tragedy arc) | In reply to @uep:matrix.org you have to substitute the path into an executable, without changing the length and thus the offsets of all the following items, that would require re-linking everything and even knowing where the values that are offsets are Ohhh. Right. Offsets... Well, that sounds bad, yeah | 22:50:38 |
24 Oct 2024 |
| baloo joined the room. | 02:12:02 |
EsperLily [she/her] | this is reminding me that when macOS switched to the read-only root filesystem we spent a while trying to decide if we could rewrite the entire store and all substitutes to a separate root that had the same length, e.g. /var/nix/s/ (i forget exactly what paths we considered) but we decided it was too much work and not necessarily reliable enough. we also considered just changing the store path on darwin for everyone and rebuilding the universe but nobody liked that either. so we ended up with the separate volume. | 07:30:33 |