| 30 Jul 2022 |
@linus:schreibt.jetzt | yeah that | 19:00:36 |
@elvishjerricco:matrix.org | ah fair enough | 19:00:42 |
@linus:schreibt.jetzt | and also running tests is really really easy currently | 19:00:59 |
@linus:schreibt.jetzt | change the code, nix-build nixos/tests/... | 19:01:08 |
K900 | That can be fixed if we expose make-initrd-ng as a top level package in nixpkgs | 19:01:46 |
K900 | Then we can overlay that from the make-initrd-ng repo | 19:01:55 |
K900 | And just run the same tests | 19:02:00 |
@elvishjerricco:matrix.org | yea. And it already is a top level package | 19:02:13 |
@elvishjerricco:matrix.org | Do we have any NixOS tests for building cross things? Or is cross considered not officially supported? | 19:08:27 |
@elvishjerricco:matrix.org | On an unrelated note, I think networkctl doesn't work if you don't have dbus, which makes messing with networking in initrd kind of annoying... Probably not worth including dbus over, but noteworthy | 19:25:40 |
K900 | There's something built on Hydra for mobile | 19:28:17 |
K900 | But I'm not sure how much or if there's any actual VM tests there | 19:28:30 |
| 31 Jul 2022 |
Mic92 | In reply to @janne.hess:helsinki-systems.de Mic92: do you have more insight on that? K900: It's reading the whole file into memory. | 05:41:17 |
Mic92 | See this: https://github.com/NixOS/patchelf/blob/master/src/patchelf.cc#L230 | 05:41:34 |
K900 | Oh yeah, I just meant that when it needs a value, it converts the endianness in place | 05:41:46 |
K900 | So if you miss calling the conversion function somewhere, it explodes in some subtle way | 05:42:56 |
Mic92 | I don't think rust would be a good choice at the time. patchelf is used in many package manager for bootstrapping and Rust would be a heavy bootstrap dependency | 05:43:30 |
Mic92 | It does not even use a sane build system like meson or cmake for the same reason. | 05:43:59 |
K900 | Yeah, that was more of a joke | 05:44:04 |
K900 | Rust also isn't really a (that) good fit for doing this kind of low level byte-twiddling | 05:45:08 |
K900 | Cause it is kind of inherently unsafe | 05:45:34 |
Mic92 | the endianess conversion is actually mostly done in this helper: https://github.com/NixOS/patchelf/blob/master/src/patchelf.cc#L97 so most of the code does not have to care about it. | 05:46:42 |
K900 | Yeah, but it has to care about calling the helper every time | 05:49:09 |
@elvishjerricco:matrix.org | So one thing I didn't think of during the strip discussion yesterday: The old initrd unconditionally strips. So the question about if we've been adding an undue binutils dependency for most people's rebuilds was moot :P | 12:51:45 |
K900 | But we can remove it now | 12:51:58 |
K900 | That's good | 12:52:02 |
@elvishjerricco:matrix.org | yea, that is an improvement | 12:52:04 |
@elvishjerricco:matrix.org | Finally ran the test I meant to yesterday. Looks like the goblin change reduces initrd build time (for a very simple initrd) from 3.47s to 2.67s. Neat | 14:51:20 |
@elvishjerricco:matrix.org | I should time the actual make-initrd-ng runtime, because I'm sure a ton of that time is cpio and the compressor | 14:53:43 |
@elvishjerricco:matrix.org | Oh, uh, lul, that's way more dramatic. Old:
real 1.09
user 0.56
sys 0.58
Goblin:
real 0.27
user 0.06
sys 0.20
Notice how much of that time is actual rust code running. Nice
| 15:00:03 |