Skip to content

repath-studio: also fetch git dependencies in FOD - #524015

Merged
nixpkgs-ci[bot] merged 1 commit into
NixOS:masterfrom
TomaSajt:repath-studio
May 30, 2026
Merged

repath-studio: also fetch git dependencies in FOD#524015
nixpkgs-ci[bot] merged 1 commit into
NixOS:masterfrom
TomaSajt:repath-studio

Conversation

@TomaSajt

Copy link
Copy Markdown
Contributor

Looking into the source code of clojure's CLI I was able to also make the FOD also fetch the git dependencies and store them in a way that's usable without network access.

This also simplifies the update script a bit.

I made originally made these changes in #516682, where the repo started using a LOT of git dependencies, which would have been difficult to one-by-one start patching.

Note: I called the new FOD clojureHome, because it's what is created inside the $HOME directory when resolving the dependencies.

Things done

@TomaSajt TomaSajt added the backport release-26.05 Backport PR automatically label May 25, 2026
@nixpkgs-ci nixpkgs-ci Bot added 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 1 This PR causes 1 package to rebuild on Linux. 2.status: merge-bot eligible This PR can be merged by commenting "@NixOS/nixpkgs-merge-bot merge". labels May 25, 2026
@phanirithvij

Copy link
Copy Markdown
Member

nixpkgs-review result

Generated using nixpkgs-review-gha

Command: nixpkgs-review pr 524015
Commit: 92124277edca50ee68ed31f1978c0a6965f7771f (subsequent changes)
Merge: 8e33b35c9f3cf0bf73856a58734a624bc546858f

Logs: https://github.com/phanirithvij/nixpkgs-review-gha/actions/runs/26403280691


x86_64-linux

✅ 1 package built:
  • repath-studio

aarch64-linux

✅ 1 package built:
  • repath-studio

x86_64-darwin

No rebuilds


aarch64-darwin

No rebuilds

@eljamm eljamm May 28, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I reverted the package hashes to the previous version:

repath-studio-0.4.13.patch

diff --git a/pkgs/by-name/re/repath-studio/package.nix b/pkgs/by-name/re/repath-studio/package.nix
index 015b4c217d19..667091ef643e 100644
--- a/pkgs/by-name/re/repath-studio/package.nix
+++ b/pkgs/by-name/re/repath-studio/package.nix
@@ -23,13 +23,13 @@
 }:
 buildNpmPackage (finalAttrs: {
   pname = "repath-studio";
-  version = "0.4.14";
+  version = "0.4.13";
 
   src = fetchFromGitHub {
     owner = "repath-studio";
     repo = "repath-studio";
     tag = "v${finalAttrs.version}";
-    hash = "sha256-El3gXpfNofHev84tpa0v16y2Sjdo6kmlm44hgHcinCk=";
+    hash = "sha256-YqBbhx5WDAElfNpPpSf1qXddK3kZhqGnHhXu/qVl1BA=";
   };
 
   patches = [
@@ -40,7 +40,7 @@ buildNpmPackage (finalAttrs: {
 
   makeCacheWritable = true;
 
-  npmDepsHash = "sha256-gOk/hHWGLwAxPIBqasoUzfszPv911afb/VLn7w7g5KE=";
+  npmDepsHash = "sha256-uTcHerTZwzeTFhjNs5ExgJU6u2fjDT5YlZemo3qNQOg=";
 
   nativeBuildInputs = [
     finalAttrs.passthru.clojureWithHome
@@ -196,7 +196,7 @@ buildNpmPackage (finalAttrs: {
 
       dontFixup = true;
 
-      outputHash = "sha256-wpE6MAWXxrDq3Y8a+rr9PhBz9Qnj23HB+a+eselUf4Y=";
+      outputHash = "sha256-rh9dcgk4qZkBDguUGFCE6ZcPnqBG/v4jlT8py1PUHYM=";
       outputHashMode = "recursive";
       outputHashAlgo = "sha256";
     };

and ran the update script, but it fails with:

repath-update.log

$ nix-update -u repath-studio
$ nix-instantiate --eval --json --strict /nix/store/04ld28pdbzy9x3ps5aaidlaf1d6bamxb-nix-update-1.15.0/lib/python3.13/site-packages/nix_update/eval.nix --argstr importPath /home/user/nixpkgs --argstr attribute '["repath-studio"]' --arg isFlake false --arg sanitizePositions true
$ nix-shell --extra-experimental-features 'flakes nix-command' /home/user/nixpkgs/maintainers/scripts/update.nix --argstr package repath-studio --argstr skip-prompt true
this derivation will be built:
  /nix/store/l1j56mj53x550k2si3w1f5pnfmrrlny9-packages.json.drv
building '/nix/store/l1j56mj53x550k2si3w1f5pnfmrrlny9-packages.json.drv'...

Going to be running update for following packages:
 - repath-studio-0.4.13


Running update for:
Enqueuing group of 1 packages
 - repath-studio-0.4.13: UPDATING ...
 - repath-studio-0.4.13: ERROR

--- SHOWING ERROR LOG FOR repath-studio-0.4.13 ----------------------

+ set -eou pipefail
+ token_args=
+ [[ -n '' ]]
++ curl -sL https://api.github.com/repos/repath-studio/repath-studio/releases/latest
++ jq -r .tag_name
+ latest_tag=v0.4.14
+ version=0.4.14
+ set +ue
+ [[ 0.4.13 == 0\.4\.14 ]]
+ set -ue
++ git rev-parse --show-toplevel
+ NIXPKGS_PATH=/home/user/nixpkgs
+++ dirname /home/user/nixpkgs/pkgs/by-name/re/repath-studio/update.sh
++ cd -- /home/user/nixpkgs/pkgs/by-name/re/repath-studio
++ pwd -P
+ PACKAGE_DIR=/home/user/nixpkgs/pkgs/by-name/re/repath-studio
+ PACKAGE_FILE=/home/user/nixpkgs/pkgs/by-name/re/repath-studio/package.nix
+ PATCH_CLJ_FILE=/home/user/nixpkgs/pkgs/by-name/re/repath-studio/pin-clojure.patch
+ pushd /home/user/nixpkgs
+ nix-update --version=0.4.14 repath-studio
+ popd
++ mktemp -d
+ TMPDIR=/tmp/nix-shell-3283903-3871424949/nix-shell-3284086-1268047038/nix-shell-3284272-3161139777/tmp.6svqZhmgak
+ trap 'rm -rf "$TMPDIR"' EXIT
+ pushd /tmp/nix-shell-3283903-3871424949/nix-shell-3284086-1268047038/nix-shell-3284272-3161139777/tmp.6svqZhmgak
++ nix-build --no-link /home/user/nixpkgs -A repath-studio.src
+ src=/nix/store/gfba7i658svv2kmkk828gx4w7pi7famd-source
+ cp /nix/store/gfba7i658svv2kmkk828gx4w7pi7famd-source/deps.edn deps.edn
+ workflow_file=/nix/store/gfba7i658svv2kmkk828gx4w7pi7famd-source/.github/workflows/desktop-app.yml
++ grep cli:
++ grep -A 10 'uses:.*setup-clojure' /nix/store/gfba7i658svv2kmkk828gx4w7pi7famd-source/.github/workflows/desktop-app.yml
++ head -n1
++ sed -E 's/.*cli:\s+([0-9]+\.[0-9]+\.[0-9]+).*/\1/'
+ clj_version=1.12.4
+ [[ -z 1.12.4 ]]
+ mkdir -p a b
+ cp deps.edn a/deps.edn
+ cp deps.edn b/deps.edn
+ sed -i '0,/:deps {/s|:deps {|:deps {org.clojure/clojure {:mvn/version "1.12.4"}\n        |' b/deps.edn
+ git diff --no-index --no-prefix a/deps.edn b/deps.edn
+ true
+ rm -rf a b
+ dummy_hash=sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=
+ sed -i 's|outputHash = ".*";|outputHash = "sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=";|' /home/user/nixpkgs/pkgs/by-name/re/repath-studio/package.nix
+ set +e
++ nix-build --no-link -A repath-studio.passthru.clojureHome /home/user/nixpkgs
++ grep got:
++ cut -d: -f2
++ sed 's| ||g'
+ new_clj_home_hash=
+ set -e
+ [[ -z '' ]]
+ echo 'Failed to get new clojure home hash.'
Failed to get new clojure home hash.
+ exit 1
+ rm -rf /tmp/nix-shell-3283903-3871424949/nix-shell-3284086-1268047038/nix-shell-3284272-3161139777/tmp.6svqZhmgak


--- SHOWING ERROR LOG FOR repath-studio-0.4.13 ----------------------
The update script for repath-studio-0.4.13 failed with exit code 1
Traceback (most recent call last):
  File "/nix/store/04ld28pdbzy9x3ps5aaidlaf1d6bamxb-nix-update-1.15.0/bin/.nix-update-wrapped", line 9, in <module>
    sys.exit(main())
             ~~~~^^
  File "/nix/store/04ld28pdbzy9x3ps5aaidlaf1d6bamxb-nix-update-1.15.0/lib/python3.13/site-packages/nix_update/__init__.py", line 475, in main
    package = update(options)
  File "/nix/store/04ld28pdbzy9x3ps5aaidlaf1d6bamxb-nix-update-1.15.0/lib/python3.13/site-packages/nix_update/update.py", line 198, in update
    run_update_script(package, opts)
    ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^
  File "/nix/store/04ld28pdbzy9x3ps5aaidlaf1d6bamxb-nix-update-1.15.0/lib/python3.13/site-packages/nix_update/update.py", line 138, in run_update_script
    run(
    ~~~^
        [
        ^
    ...<11 lines>...
        stdout=None,
        ^^^^^^^^^^^^
    )
    ^
  File "/nix/store/04ld28pdbzy9x3ps5aaidlaf1d6bamxb-nix-update-1.15.0/lib/python3.13/site-packages/nix_update/utils.py", line 54, in run
    return subprocess.run(
           ~~~~~~~~~~~~~~^
        command,
        ^^^^^^^^
    ...<5 lines>...
        env=env,
        ^^^^^^^^
    )
    ^
  File "/nix/store/0r6k8xa2kgqyp3r4v2w7yrb80ma2iawm-python3-3.13.12/lib/python3.13/subprocess.py", line 577, in run
    raise CalledProcessError(retcode, process.args,
                             output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['nix-shell', '--extra-experimental-features', 'flakes nix-command', '/home/user/nixpkgs/maintainers/scripts/update.nix', '--argstr', 'package', 'repath-studio', '--argstr', 'skip-prompt', 'true']' returned non-zero exit status 1.

pin-clojure.patch

b/deps.edn --- Clojure
Renamed from a/deps.edn to b/deps.edn
1    {:paths ["src"]
2     :deps {binaryage/devtools {:mvn/version "1.0.7"}
   2  :deps {org.clojure/clojure {:mvn/version "1.12.4"}
   4         camel-snake-kebab/camel-snake-kebab {:mvn/version "0.4.3"}
   5         clj-kdtree/clj-kdtree {:git/url "https://github.com/abscondment/clj-kdtree.git"
   6                                :sha "5ec321c5e8006db00fa8b45a8ed9eb0b8f3dd56d"
   7                                :deps/manifest :deps}

Edit: the issue was my git pager, producing an invalid patch. Could you please add --no-pager to the git diff command?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no such flag AFAICT.
Please send in the changes you think I should make as a change suggestion.

@eljamm eljamm May 28, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't suggest the change directly in GitHub since the line is not visible in the diff, but this is what I mean:

git --no-pager diff --no-index --no-prefix a/deps.edn b/deps.edn >"$PATCH_CLJ_FILE" || true

dontFixup = true;

outputHash = "sha256-fwKeKfOIAWj9HQdXpEafZuJz5jwXNKpkS0JmuP3FXo0=";
outputHash = "sha256-wpE6MAWXxrDq3Y8a+rr9PhBz9Qnj23HB+a+eselUf4Y=";

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After I rolled back hashes from the previous version and re-ran the update script, the pin-clojure.patch file became empty, thus changing this hash:

diff --git a/pkgs/by-name/re/repath-studio/package.nix b/pkgs/by-name/re/repath-studio/package.nix
index 015b4c217d19..f6f1eb3cb986 100644
--- a/pkgs/by-name/re/repath-studio/package.nix
+++ b/pkgs/by-name/re/repath-studio/package.nix
@@ -196,7 +196,7 @@ buildNpmPackage (finalAttrs: {
 
       dontFixup = true;
 
-      outputHash = "sha256-wpE6MAWXxrDq3Y8a+rr9PhBz9Qnj23HB+a+eselUf4Y=";
+      outputHash = "sha256-OT6z1tZPBoBG9iVsWTGiQYFljnIi2XQ1uqoQjn98ias=";
       outputHashMode = "recursive";
       outputHashAlgo = "sha256";
     };
diff --git a/pkgs/by-name/re/repath-studio/pin-clojure.patch b/pkgs/by-name/re/repath-studio/pin-clojure.patch
index a49fccbf0bf9..e69de29bb2d1 100644
--- a/pkgs/by-name/re/repath-studio/pin-clojure.patch
+++ b/pkgs/by-name/re/repath-studio/pin-clojure.patch
@@ -1,12 +0,0 @@
-diff --git a/deps.edn b/deps.edn
-index 158801e..91ea375 100644
---- a/deps.edn
-+++ b/deps.edn
-@@ -1,5 +1,6 @@
- {:paths ["src"]
-- :deps {binaryage/devtools {:mvn/version "1.0.7"}
-+ :deps {org.clojure/clojure {:mvn/version "1.12.4"}
-+        binaryage/devtools {:mvn/version "1.0.7"}
-         camel-snake-kebab/camel-snake-kebab {:mvn/version "0.4.3"}
-         clj-kdtree/clj-kdtree {:git/url "https://github.com/abscondment/clj-kdtree.git"
-                                :sha "5ec321c5e8006db00fa8b45a8ed9eb0b8f3dd56d"

@eljamm eljamm left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The clojureHome hash hasn't been updated, but I guess it's okay since the program is working fine and it'll be updated on next release anyways. Other than this, changes LGTM.

@NixOS/nixpkgs-merge-bot merge


nixpkgs-review result

Generated using nixpkgs-review.

Command: nixpkgs-review pr 524015
Commit: d9612069489a532dc532756c983077495f08e9b0


x86_64-linux

✅ 1 package built:
  • repath-studio

@nixpkgs-ci
nixpkgs-ci Bot added this pull request to the merge queue May 30, 2026
@nixpkgs-ci

nixpkgs-ci Bot commented May 30, 2026

Copy link
Copy Markdown
Contributor

@eljamm wants to merge this PR.

Requirements to merge this PR with @NixOS/nixpkgs-merge-bot merge:

  • ✅ PR targets a development branch.
  • ✅ PR touches only files of packages in pkgs/by-name/.
  • ✅ PR is at least one of:
  • ✅ PR is not a draft
  • ✅ eljamm is a member of @NixOS/nixpkgs-maintainers.
  • ✅ eljamm is a maintainer of all touched packages on the master branch.

✔️ Queued for merge (#306934)

@nixpkgs-ci nixpkgs-ci Bot added 12.approvals: 1 This PR was reviewed and approved by one person. 12.approved-by: package-maintainer This PR was reviewed and approved by a maintainer listed in any of the changed packages. labels May 30, 2026
Merged via the queue into NixOS:master with commit d3f84c1 May 30, 2026
29 checks passed
@nixpkgs-ci

nixpkgs-ci Bot commented May 30, 2026

Copy link
Copy Markdown
Contributor

Successfully created backport PR for release-26.05:

@github-actions github-actions Bot added the 8.has: port to stable This PR already has a backport to the stable release. label May 30, 2026
@phanirithvij phanirithvij added the 6.topic: NLNet / NGI The project is part of the NGI funding grant. https://nlnet.nl/NGI/ label Jun 20, 2026
@github-project-automation github-project-automation Bot moved this to Done in Nix@NGI Jul 17, 2026
@phanirithvij phanirithvij added this to NGI Jul 30, 2026
@github-project-automation github-project-automation Bot moved this to Needs Refinement in NGI Jul 30, 2026
@github-project-automation github-project-automation Bot moved this from Needs Refinement to Done in NGI Jul 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

2.status: merge-bot eligible This PR can be merged by commenting "@NixOS/nixpkgs-merge-bot merge". 6.topic: NLNet / NGI The project is part of the NGI funding grant. https://nlnet.nl/NGI/ 8.has: port to stable This PR already has a backport to the stable release. 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 10.rebuild-linux: 1 This PR causes 1 package to rebuild on Linux. 12.approvals: 1 This PR was reviewed and approved by one person. 12.approved-by: package-maintainer This PR was reviewed and approved by a maintainer listed in any of the changed packages. backport release-26.05 Backport PR automatically

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants