Describe the bug
This is fairly non-critical, as there is a simple workaround (at least where I encountered it), but still:
When specifying a log URL for remote builds, the name of a lockfile that nix creates will be longer than 255 bytes, making it fail on many(/most?) filesystems. The base64-ssh-public-host-key quite easily makes the URL long.
Specifically, I was using --builders 'ssh://root@65.109.176.33?compress=true&ssh-key=/tmp/vps-worker-lineage-builder-tmp-keys/login&base64-ssh-public-host-key=c3NoLWVkMjU1MTkgQUFBQUMzTnphQzFsWkRJMU5URTVBQUFBSUJ2ZGJzNFd4MXVaVnNIeDdGOFdnajNpZmRlT2NqQ0x0ODBEYk4reFVJZSsgd29ya2VySG9zdAo= i686-linux,x86_64-linux /tmp/vps-worker-lineage-builder-tmp-keys/login 4 - nixos-test,benchmark,big-parallel,kvm - c3NoLWVkMjU1MTkgQUFBQUMzTnphQzFsWkRJMU5URTVBQUFBSUJ2ZGJzNFd4MXVaVnNIeDdGOFdnajNpZmRlT2NqQ0x0ODBEYk4reFVJZSsgd29ya2VySG9zdAo='.
In this case, one can simply shorten the URL by removing the ssh-key and/or base64-ssh-public-host-key arguments, since that information is in the later args of the builder spec as well. I has the URL in the long, here redundant, form because I was also using it as the arg to --store and --from/--to.
Steps To Reproduce
- Have
/nix/var/nix/ on an FS with a file name length limit of about 255 bytes (ext-2/3/4, ZFS, ...).
- Run
nix -j0 --builders-use-substitutes --builders 'ssh://root@65.109.176.33?compress=true&ssh-key=/tmp/vps-worker-lineage-builder-tmp-keys/login&base64-ssh-public-host-key=c3NoLWVkMjU1MTkgQUFBQUMzTnphQzFsWkRJMU5URTVBQUFBSUJ2ZGJzNFd4MXVaVnNIeDdGOFdnajNpZmRlT2NqQ0x0ODBEYk4reFVJZSsgd29ya2VySG9zdAo= i686-linux,x86_64-linux /tmp/vps-worker-lineage-builder-tmp-keys/login 4 - nixos-test,benchmark,big-parallel,kvm - c3NoLWVkMjU1MTkgQUFBQUMzTnphQzFsWkRJMU5URTVBQUFBSUJ2ZGJzNFd4MXVaVnNIeDdGOFdnajNpZmRlT2NqQ0x0ODBEYk4reFVJZSsgd29ya2VySG9zdAo=' buildnixpkgs#something-not-in-the-local-store-yet`
- See error
Expected behavior
Nix should probably hash the URL before creating the lockfile, and maybe include the first X bytes o the hostname.
nix-env --version output
nix (Nix) 2.12.0
Additional context
Add any other context about the problem here.
Priorities
👎
Describe the bug
This is fairly non-critical, as there is a simple workaround (at least where I encountered it), but still:
When specifying a log URL for remote builds, the name of a lockfile that nix creates will be longer than 255 bytes, making it fail on many(/most?) filesystems. The
base64-ssh-public-host-keyquite easily makes the URL long.Specifically, I was using
--builders 'ssh://root@65.109.176.33?compress=true&ssh-key=/tmp/vps-worker-lineage-builder-tmp-keys/login&base64-ssh-public-host-key=c3NoLWVkMjU1MTkgQUFBQUMzTnphQzFsWkRJMU5URTVBQUFBSUJ2ZGJzNFd4MXVaVnNIeDdGOFdnajNpZmRlT2NqQ0x0ODBEYk4reFVJZSsgd29ya2VySG9zdAo= i686-linux,x86_64-linux /tmp/vps-worker-lineage-builder-tmp-keys/login 4 - nixos-test,benchmark,big-parallel,kvm - c3NoLWVkMjU1MTkgQUFBQUMzTnphQzFsWkRJMU5URTVBQUFBSUJ2ZGJzNFd4MXVaVnNIeDdGOFdnajNpZmRlT2NqQ0x0ODBEYk4reFVJZSsgd29ya2VySG9zdAo='.In this case, one can simply shorten the URL by removing the
ssh-keyand/orbase64-ssh-public-host-keyarguments, since that information is in the later args of the builder spec as well. I has the URL in the long, here redundant, form because I was also using it as the arg to--storeand--from/--to.Steps To Reproduce
/nix/var/nix/on an FS with a file name length limit of about 255 bytes (ext-2/3/4, ZFS, ...).nix -j0 --builders-use-substitutes --builders 'ssh://root@65.109.176.33?compress=true&ssh-key=/tmp/vps-worker-lineage-builder-tmp-keys/login&base64-ssh-public-host-key=c3NoLWVkMjU1MTkgQUFBQUMzTnphQzFsWkRJMU5URTVBQUFBSUJ2ZGJzNFd4MXVaVnNIeDdGOFdnajNpZmRlT2NqQ0x0ODBEYk4reFVJZSsgd29ya2VySG9zdAo= i686-linux,x86_64-linux /tmp/vps-worker-lineage-builder-tmp-keys/login 4 - nixos-test,benchmark,big-parallel,kvm - c3NoLWVkMjU1MTkgQUFBQUMzTnphQzFsWkRJMU5URTVBQUFBSUJ2ZGJzNFd4MXVaVnNIeDdGOFdnajNpZmRlT2NqQ0x0ODBEYk4reFVJZSsgd29ya2VySG9zdAo=' buildnixpkgs#something-not-in-the-local-store-yet`Expected behavior
Nix should probably hash the URL before creating the lockfile, and maybe include the first X bytes o the hostname.
nix-env --versionoutputnix (Nix) 2.12.0
Additional context
Add any other context about the problem here.
Priorities
👎