Closed dcarosone closed 1 month ago
The wrapper is created in the package
postInstall = ''
# Soft-serve generates git-hooks at run-time.
# The scripts require git and bash inside the path.
wrapProgram $out/bin/soft \
--prefix PATH : "${lib.makeBinPath [ git bash ]}"
'';
but unfortunately the versioned wrapper expires, even if it's very simple and probably hasn't changed between versions (edit: I misread, it's not a shell wrapper, it's an updated binary, so versions will matter)
Sharing my solution here, I had to patch the source to make it relative so that soft-serve creates new hooks using the soft
binary:
To make it work at runtime, soft-serve's runtime environment has to contain soft
in its PATH
.
The path in already created hooks have to be updated manually.
Looking forward to the upstream fix landing, that looks much better
Its been over 6mo I think it's sensible to find working commit and just do a dated release on unstable
Describe the bug
soft-serve sets up a bunch of git hooks, presumably on repo creation. These embed the current nix store path to soft-serve, and don't get updated for new builds
Steps To Reproduce
Steps to reproduce the behavior:
git push
failing to find old store pathsExpected behavior
git push
to work as normalScreenshots
Additional context
the contents of the hook script failing above:
That store path is old and now gone, soft-serve appears to be up to 0.7.3, and have had intermediate upgrades for 0.7.1 and 0.7.2 which still exist as store paths, not yet gc'd.
In addition to failing now, it has presumably been using the wrong, old version for the intermediate time, which expains why it wasn't noticed sooner.
To fix this probably requires some internal changes to the soft-serve code to pick the right paths when generating the hooks, but also some method to remediate existing hooks on-disk.
Notify maintainers
@penguwin
Metadata
Please run
nix-shell -p nix-info --run "nix-info -m"
and paste the result."x86_64-linux"
Linux 6.1.62, NixOS, 24.05 (Uakari), 24.05.20231129.e92039b
yes
yes
nix-env (Nix) 2.18.1
""
/nix/store/cjvwy2rr87ir1nb6wvs9n6lvbnzlqrdg-source
Add a :+1: reaction to issues you find important.