Lock paths can become too long when remote builders are involved #157

Closed
opened 2024-03-19 02:11:27 +00:00 by lunaphied · 5 comments
Owner

Running installChecks on dea029ff51 causes an error due to using the ridiculously long lockfile path of:

/build/nix-shell.CAf3tZ/nix-test/build-remote-trustless-should-pass-3/local/nix/var/nix/current-load/ssh-ng:__localhost?remote-program=_home_lunaphied_code_lix_.w_maint_backport_flake-lock-ux_tests_functional_nix-daemon-untrusting.sh&remote-store=_build_nix-shell.CAf3tZ_nix-test_build-remote-trustless-should-pass-3_remote%3Fsystem-features=foo%20bar%20baz-0

This should likely be replaced by a hash instead so that the name cannot become absurdly long.

Running `installChecks` on https://gerrit.lix.systems/plugins/gitiles/lix/+/dea029ff5141870bed84d4b578f3683280654d7d causes an error due to using the ridiculously long lockfile path of: ``` /build/nix-shell.CAf3tZ/nix-test/build-remote-trustless-should-pass-3/local/nix/var/nix/current-load/ssh-ng:__localhost?remote-program=_home_lunaphied_code_lix_.w_maint_backport_flake-lock-ux_tests_functional_nix-daemon-untrusting.sh&remote-store=_build_nix-shell.CAf3tZ_nix-test_build-remote-trustless-should-pass-3_remote%3Fsystem-features=foo%20bar%20baz-0 ``` This should likely be replaced by a hash instead so that the name cannot become absurdly long.
lunaphied added the
bug
label 2024-03-19 02:11:27 +00:00
Owner

Why does the entire remote builder configuration get encoded into a lockfile path in the first place??

Why does the entire remote builder configuration get encoded into a lockfile path in the first place??
Author
Owner
See https://git.lix.systems/lix-project/lix/src/branch/main/src/build-remote/build-remote.cc#L40 and https://git.lix.systems/lix-project/lix/src/branch/main/src/build-remote/build-remote.cc#L266
Owner

O_o

simply sha256 the normalized url and take some prefix or so

O_o simply sha256 the normalized url and take some prefix or so
Author
Owner

From Nixpkgs' definition of the Nix package:

  # socket path becomes too long otherwise
  preInstallCheck = lib.optionalString stdenv.isDarwin ''
    export TMPDIR=$NIX_BUILD_TOP
  ''

Wonder if this is relevant.

From Nixpkgs' definition of the Nix package: ```nix # socket path becomes too long otherwise preInstallCheck = lib.optionalString stdenv.isDarwin '' export TMPDIR=$NIX_BUILD_TOP '' ``` Wonder if this is relevant.
Owner

honestly we should just fix this in a generalized manner by hashing the path though (maybe minus one component? maybe print out the full name so you can find which process was doing it? just to not regress the ability to find who is holding a lock)

honestly we should just fix this in a generalized manner by hashing the path though (maybe minus one component? maybe print out the full name so you can find which process was doing it? just to not regress the ability to find who is holding a lock)
lunaphied was assigned by qyriad 2024-05-12 19:22:44 +00:00
jade added the
Area/remote-builds
label 2024-05-23 00:51:02 +00:00
lunaphied was unassigned by jade 2024-05-25 03:55:08 +00:00
jade self-assigned this 2024-05-25 03:55:12 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: lix-project/lix#157
No description provided.