15 Oct 2024 |
Atemu | I believe | 07:25:08 |
Atemu | It never went through normalisation | 07:25:30 |
Atemu | "Alive" is perhaps the wrong term here. "Not actually realised yet from the perspective of Nix" would probably be more fitting | 07:26:42 |
Atemu | If you nix-store --verify-path it, Nix should tell you that the path doesn't exist | 07:28:46 |
Atemu | And indeed if you try to realise such a path, Nix will substitute or build it | 07:31:39 |
| dish [Fox/It/She] changed their display name from Pyrox [ It/She/They/Xem ] to dish [Fox/It/She]. | 07:36:18 |
Paul Meyer (katexochen) | In reply to @katexochen:matrix.org No explanation how the writable file ended up in the image, no. I'd have to look deeper into the hardlink optimization. Maybe there is a race with creating the link under /nix/store/.links and the build failing? Then any file from a successful derivation could be hardlinked against a writable file. I searched for writable files that are hardlinked into a derivation that doesn't have a .lock, and it seems like there is none, so my theory doesn't work out:
#!/usr/bin/env bash
while read -r file; do
links=$(stat -c %h "$file")
if [[ "$links" -le 1 ]]; then
echo "No links for $file"
continue
fi
inode=$(stat -c %i "$file")
while read -r linkedFile; do
if [[ "$linkedFile" == "$file" ]]; then
continue
fi
linkedDrv=$(echo "$linkedFile" | cut -d'/' -f1-4)
if [[ -e "${linkedDrv}.lock" ]]; then
echo "Lock file exists for $linkedDrv"
continue
fi
echo "$linkedFile"
done < <(find /nix/store -type f -inum "$inode" 2>/dev/null)
done < <(find /nix/store -type f -perm -u+w ! -perm -g+w ! -perm -o+w 2>/dev/null)
| 07:53:37 |
Paul Meyer (katexochen) | Not sure where to look next | 07:54:19 |
Atemu | Look for what exactly? I'm not following. | 07:55:02 |
Paul Meyer (katexochen) | For an explanation how a writable file ended up in a realised derivation/in the image. | 07:59:02 |
Paul Meyer (katexochen) | * For an explanation how a writable file ended up in a realised derivation/in the image (on one system, and not on another) | 08:00:36 |
Paul Meyer (katexochen) | This is what we are trying to debug (from an uki/repart nixos image):
❯ diffoscope f*/initrd_0
--- f-btrfs/initrd_0
+++ f-ext/initrd_0
│┄ comprises of 1 embedded members
├── .cpio file embedded at offset 0
│ ├── file list
│ │ @@ -981,15 +981,15 @@
│ │ -r--r--r-- 0 0 0 2274 1970-01-01 00:00:01.000000 ./nix/store/frngrlq2xa2szv4bx91jkymv0dy9akmx-kbd-2.6.4/share/keymaps/sun/sunt5-uk.map.gz
│ │ -r--r--r-- 0 0 0 4926 1970-01-01 00:00:01.000000 ./nix/store/frngrlq2xa2szv4bx91jkymv0dy9akmx-kbd-2.6.4/share/keymaps/sun/sunt5-us-cz.map.gz
│ │ -r--r--r-- 0 0 0 1706 1970-01-01 00:00:01.000000 ./nix/store/frngrlq2xa2szv4bx91jkymv0dy9akmx-kbd-2.6.4/share/keymaps/sun/sunt6-uk.map.gz
│ │ drwxr-xr-x 0 0 0 0 1970-01-01 00:00:01.000000 ./nix/store/fvsswlqh6pc2f5x9qvahm4qbjgjlp86j-linux-pam-1.6.1/
│ │ drwxr-xr-x 0 0 0 0 1970-01-01 00:00:01.000000 ./nix/store/fvsswlqh6pc2f5x9qvahm4qbjgjlp86j-linux-pam-1.6.1/lib/
│ │ lrwxrwxrwx 0 0 0 16 1970-01-01 00:00:01.000000 ./nix/store/fvsswlqh6pc2f5x9qvahm4qbjgjlp86j-linux-pam-1.6.1/lib/libpam.so.0 -> libpam.so.0.85.1
│ │ -rwxrwxrwx 0 0 0 67608 1970-01-01 00:00:01.000000 ./nix/store/fvsswlqh6pc2f5x9qvahm4qbjgjlp86j-linux-pam-1.6.1/lib/libpam.so.0.85.1
│ │ --rw-r--r-- 0 0 0 0 1970-01-01 00:00:01.000000 ./nix/store/gq7vys7yw9gsrrk5jzp4qx1glc15hwlp-initrd-kmod-blacklist-ubuntu
│ │ +-r--r--r-- 0 0 0 0 1970-01-01 00:00:01.000000 ./nix/store/gq7vys7yw9gsrrk5jzp4qx1glc15hwlp-initrd-kmod-blacklist-ubuntu
| 08:02:31 |
Atemu | I see | 08:11:22 |
Atemu | What's that last line about btw? +-r--r--r-- | 08:11:40 |
Atemu | Is it actually RW in the image? | 08:11:51 |
Paul Meyer (katexochen) | Last two lines are the diff between the two images (looks a bit confusing without color)
| 08:20:16 |
Atemu | Ahh that makes sense | 08:21:22 |
Atemu | The path is writeable on the build system though, right? | 08:21:37 |
Paul Meyer (katexochen) | Yes, I'm pretty sure it was writable on my local system. But I cleaned up that path and couldn't find a way to reproduce that yet. | 08:29:42 |
Atemu | As mentioned before, there have been cases reported before where some system daemons remount /nix/store. I don't have the issue handy but I'm sure you can find it. Make sure you're not running any of those. | 08:32:52 |
16 Oct 2024 |
| h7x4 joined the room. | 11:31:34 |
18 Oct 2024 |
| @sammy:cherrykitten.dev left the room. | 08:36:59 |
19 Oct 2024 |
| jwillikers joined the room. | 12:09:21 |
21 Oct 2024 |
| @tolgaerok:matrix.org left the room. | 04:35:43 |
emily | do we make __DATE__ reproducible OOTB? | 19:33:31 |
22 Oct 2024 |
Pol | It is by default | 09:07:09 |
Pol | * It is by default (IIRC) | 09:07:22 |
| @rnhmjoj:maxwell.ydns.eu left the room. | 12:40:01 |
23 Oct 2024 |
| noi0103 joined the room. | 13:53:13 |
24 Oct 2024 |
| jopejoe1 [4094] set a profile picture. | 07:35:08 |