repath-studio: also fetch git dependencies in FOD - #524015
Conversation
|
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
There is no such flag AFAICT.
Please send in the changes you think I should make as a change suggestion.
There was a problem hiding this comment.
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="; |
There was a problem hiding this comment.
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
left a comment
There was a problem hiding this comment.
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
|
@eljamm wants to merge this PR. Requirements to merge this PR with
|
|
Successfully created backport PR for |
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$HOMEdirectory when resolving the dependencies.Things done
passthru.tests.nixpkgs-reviewon this PR. See nixpkgs-review usage../result/bin/.