Re: How to use guix hash --serializer?
Hi Timothy, On Tue, 04 Jan 2022 at 20:44, Timothy Sample wrote: > Done! The commit is 8646f1f7a53d28f305f30420ad23b670159c53a9. Cool, thanks! Cheers, simon
Re: How to use guix hash --serializer?
Hi zimoun, zimoun writes: > Feel free to adjust with your commit name and push. :-) Done! The commit is 8646f1f7a53d28f305f30420ad23b670159c53a9. -- Tim
Re: How to use guix hash --serializer?
Thanks Tobias. I guess my thinking is that if you have a command line switch like -x that "excludes version control system directories" it could also exclude empty directories. Mortimer On Tue, Jan 4, 2022 at 4:07 PM zimoun wrote: > Hi, > > On Tue, 04 Jan 2022 at 15:44, Mortimer Cladwell > wrote: > > > looks like the difference, other than make/git related files are four > empty > > directories doc, scripts, shinyln and tests, so appears empty directories > > are not allowed? > > “guix hash” hashes all the bytes, not only the bytes tracked by Git. > > > > mbc@HP8300:~/projects/shinyln$ git --no-pager log -1 --oneline > > git status > > 9f06568 (HEAD -> master, origin/master) removed chmod statement > > On branch master > > Your branch is up to date with 'origin/master'. > > > > nothing to commit, working tree clean > > Oh, empty directories is not shown by “git status” and no option to > display them, if I read correctly. Ah, I did not known. > > Cheers, > simon >
Re: How to use guix hash --serializer?
Hi, On Tue, 04 Jan 2022 at 15:44, Mortimer Cladwell wrote: > looks like the difference, other than make/git related files are four empty > directories doc, scripts, shinyln and tests, so appears empty directories > are not allowed? “guix hash” hashes all the bytes, not only the bytes tracked by Git. > mbc@HP8300:~/projects/shinyln$ git --no-pager log -1 --oneline > git status > 9f06568 (HEAD -> master, origin/master) removed chmod statement > On branch master > Your branch is up to date with 'origin/master'. > > nothing to commit, working tree clean Oh, empty directories is not shown by “git status” and no option to display them, if I read correctly. Ah, I did not known. Cheers, simon
Re: How to use guix hash --serializer?
Martimer, Mortimer Cladwell 写道: looks like the difference, other than make/git related files are four empty directories doc, scripts, shinyln and tests, so appears empty directories are not allowed? They are allowed but they change the hash, just as any other difference would. Missing or extraneous directories are no less meaningful than files or permissions, etc., and can easily cause the build to fail (‘cd: blah: No such file or directory’, ‘mkdir: cannot create foo: File exists’) or otherwise behave very differently. Kind regards, T G-R signature.asc Description: PGP signature
Re: How to use guix hash --serializer?
Hi Timothy, On Tue, 04 Jan 2022 at 14:09, Timothy Sample wrote: > I’m pretty sure it’s a bug. Fortunately, with Disarchive 0.4.0, the > following (untested) patch should fix it: Yep! The tests require a minor adjustment adjusted too. See attached patch. Feel free to adjust with your commit name and push. :-) (I do not have commit rights.) Cheers, simon >From 6cc3b3b93912041112570d840f86f8c52467d316 Mon Sep 17 00:00:00 2001 From: zimoun Date: Tue, 4 Jan 2022 21:47:15 +0100 Subject: [PATCH] guix hash: Allow '--exclude-vcs' option using 'git' serializer. * guix/scripts/hash.scm (git-hash): Use '#:select?' with 'git-hash-directory'. * tests/guix-hash.sh: Adjust accordingly. --- guix/scripts/hash.scm | 2 +- tests/guix-hash.sh| 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/guix/scripts/hash.scm b/guix/scripts/hash.scm index d73e3d13dd..c44a4de9a4 100644 --- a/guix/scripts/hash.scm +++ b/guix/scripts/hash.scm @@ -69,7 +69,7 @@ (define directory? ((directory) #t) (else #f))) (if directory? - (git-hash-directory file algorithm) + (git-hash-directory file algorithm #:select? select?) (git-hash-file file algorithm))) diff --git a/tests/guix-hash.sh b/tests/guix-hash.sh index 854c493514..8b03c7985d 100644 --- a/tests/guix-hash.sh +++ b/tests/guix-hash.sh @@ -53,6 +53,7 @@ mkdir "$tmpdir/subdir" test `guix hash -S nar "$tmpdir"` = 10k1lw41wyrjf9mxydi0is5nkpynlsvgslinics4ppir13g7d74p test `guix hash -S nar "$tmpdir" -H sha512` = 301ra58c2vahczzxiyfin41mpyb0ljh4dh9zn3ijvwviaw1j40sfzw5skh9x945da88n3785ggifzig7acd6k72h0mpsc20m1f66m9n +test `guix hash -S git "$tmpdir"` = 1m9yxz99g7askm88h6hzyv4g2bfv57rp5wvwp3iq5ypsplq1xkkk test `guix hash -S git "$tmpdir" -H sha512` = 158b10d1bsdk4pm8ym9cg9ckfak1b0cgpw7365cl6s341ir380mh2f4ylicyh8khyrfnwq5cn9766d7m8fbfwwl94ndkv456v6a8knr # Deprecated --recursive option @@ -76,7 +77,7 @@ test `guix hash -S git $tmpdir` = 0ghlpca9xaswa1ay1g55dknwd9q899mi3ahfr43pq083v8 # ...but remains the same when using `-x' test `guix hash -S nar $tmpdir -x` = 10k1lw41wyrjf9mxydi0is5nkpynlsvgslinics4ppir13g7d74p -test `guix hash -S git $tmpdir -x` = 0ghlpca9xaswa1ay1g55dknwd9q899mi3ahfr43pq083v8wisjc7 +test `guix hash -S git $tmpdir -x` = 1m9yxz99g7askm88h6hzyv4g2bfv57rp5wvwp3iq5ypsplq1xkkk # Without '-r', this should fail. ! guix hash "$tmpdir" base-commit: 4c812db049d5c9f2c438748e180f9486ad221b0a -- 2.32.0
Re: How to use guix hash --serializer?
Thanks Tobias you are correct. My project is ~/projects/shinyln I repeat your suggestion of cloning a second copy into ~temp/shinyln, cd, git reset etc. I then compare the contents of the two 'clone' directories, see below looks like the difference, other than make/git related files are four empty directories doc, scripts, shinyln and tests, so appears empty directories are not allowed? Hi Simon, mbc@HP8300:~/projects/shinyln$ git --no-pager log -1 --oneline git status 9f06568 (HEAD -> master, origin/master) removed chmod statement On branch master Your branch is up to date with 'origin/master'. nothing to commit, working tree clean - Thanks! = output of find /home/mbc/projects/shinyln -type d -printf "%P\n" | sort > file1 find /home/mbc/temp/shinyln -type d -printf "%P\n" | sort | diff - file1 mbc@HP8300:~/temp$ cat file1 autom4te.cache build-aux doc .git .git/branches .git/hooks .git/info .git/logs .git/logs/refs .git/logs/refs/heads .git/logs/refs/remotes .git/logs/refs/remotes/origin .git/objects .git/objects/02 .git/objects/07 .git/objects/09 .git/objects/0a .git/objects/0c .git/objects/0d .git/objects/10 .git/objects/12 .git/objects/15 .git/objects/17 .git/objects/18 .git/objects/1a .git/objects/1e .git/objects/20 .git/objects/23 .git/objects/26 .git/objects/29 .git/objects/2e .git/objects/31 .git/objects/32 .git/objects/36 .git/objects/3e .git/objects/40 .git/objects/48 .git/objects/4c .git/objects/66 .git/objects/68 .git/objects/69 .git/objects/6d .git/objects/72 .git/objects/75 .git/objects/76 .git/objects/7f .git/objects/81 .git/objects/82 .git/objects/84 .git/objects/85 .git/objects/89 .git/objects/8b .git/objects/8d .git/objects/9b .git/objects/9e .git/objects/9f .git/objects/a1 .git/objects/a3 .git/objects/a4 .git/objects/aa .git/objects/b0 .git/objects/b5 .git/objects/b7 .git/objects/ba .git/objects/bc .git/objects/c8 .git/objects/ce .git/objects/d3 .git/objects/d4 .git/objects/d6 .git/objects/d8 .git/objects/d9 .git/objects/df .git/objects/e6 .git/objects/e9 .git/objects/ea .git/objects/f2 .git/objects/ff .git/objects/info .git/objects/pack .git/refs .git/refs/heads .git/refs/remotes .git/refs/remotes/origin .git/refs/tags scripts shinyln tests On Tue, Jan 4, 2022 at 3:21 PM zimoun wrote: > Hi Mortimer, > > On Tue, 04 Jan 2022 at 14:48, Mortimer Cladwell > wrote: > > > mbc@HP8300:~/projects$ cd shinyln/ > > mbc@HP8300:~/projects/shinyln$ guix hash -S nar -x . > > 1ykbpz6pqx0bkvfp3c60qfb9r0xvpmrs0ldlxm2qw0zd8f67lmaj > > Could you report: > > git --no-pager log -1 --oneline > git status > > ? > > > FYI from > https://guix.gnu.org/manual/en/html_node/Invoking-guix-hash.html > > at the bottom explaining --exclude-vcs: > > > > $ git clone http://example.org/foo.git > > $ cd foo > > $ guix hash -rx . > > > > Suggests (to me) that you go inside the directory to calculate hash, > > though as above seems not to matter. > > Yes, indeed. I tried outside without fulling checking. :-) > > > Cheers, > simon >
Re: How to use guix hash --serializer?
Hi Mortimer, On Tue, 04 Jan 2022 at 14:48, Mortimer Cladwell wrote: > mbc@HP8300:~/projects$ cd shinyln/ > mbc@HP8300:~/projects/shinyln$ guix hash -S nar -x . > 1ykbpz6pqx0bkvfp3c60qfb9r0xvpmrs0ldlxm2qw0zd8f67lmaj Could you report: git --no-pager log -1 --oneline git status ? > FYI from https://guix.gnu.org/manual/en/html_node/Invoking-guix-hash.html > at the bottom explaining --exclude-vcs: > > $ git clone http://example.org/foo.git > $ cd foo > $ guix hash -rx . > > Suggests (to me) that you go inside the directory to calculate hash, > though as above seems not to matter. Yes, indeed. I tried outside without fulling checking. :-) Cheers, simon
Re: How to use guix hash --serializer?
Hi Mortimer, This is no bug: expected hash: 1ykbpz6pqx0bkvfp3c60qfb9r0xvpmrs0ldlxm2qw0zd8f67lmaj actual hash: 10nfjllq28jrzxd4dfqm6xzx8f2g1m6p2vivzihxc7d3ac1imnk2 It really means you're not hashing what you think you're hashing and it won't matter which arguments you give ‘guix hash’: garbage in, garbage out :-) You probably have untracked files laying around. Reset your local checkout, or start again: /tmp λ git clone git://github.com/mbcladwell/shinyln.git Cloning into 'shinyln'... remote: Enumerating objects: 74, done. remote: Counting objects: 100% (74/74), done. remote: Compressing objects: 100% (48/48), done. remote: Total 74 (delta 34), reused 59 (delta 19), pack-reused 0 Receiving objects: 100% (74/74), 34.75 KiB | 444.00 KiB/s, done. Resolving deltas: 100% (34/34), done. /tmp λ cd shinyln /tmp/shinyln master λ git reset --hard 9f06568ffa61953ab48c93e1623d88b4e672af42 HEAD is now at 9f06568 removed chmod statement /tmp/shinyln master λ guix hash -S nar -x . 10nfjllq28jrzxd4dfqm6xzx8f2g1m6p2vivzihxc7d3ac1imnk2 The ‘-S git’ bug you found does not affect this. Kind regards, T G-R signature.asc Description: PGP signature
Re: How to use guix hash --serializer?
So I am seeing the result for guix hash -S . which is wrong, but when the bug is fixed I will get the results for guix hash -S -x . Is that what you are implying? Thanks Mortimer On Tue, Jan 4, 2022 at 2:48 PM Mortimer Cladwell wrote: > Thanks Tim, Simon, but that does not work for me. > > nar== > mbc@HP8300:~/projects$ guix hash -S nar -x ./shinyln > 1ykbpz6pqx0bkvfp3c60qfb9r0xvpmrs0ldlxm2qw0zd8f67lmaj > mbc@HP8300:~/projects$ cd shinyln/ > mbc@HP8300:~/projects/shinyln$ guix hash -S nar -x . > 1ykbpz6pqx0bkvfp3c60qfb9r0xvpmrs0ldlxm2qw0zd8f67lmaj > > git== > mbc@HP8300:~/projects/shinyln$ guix hash -S git -x . > 0lai57r0p11q041b3flriv56j6n8lizwb69yv7j396yiivkspv3x > mbc@HP8300:~/projects/shinyln$ cd .. > mbc@HP8300:~/projects$ guix hash -S git -x ./shinyln > 0lai57r0p11q041b3flriv56j6n8lizwb69yv7j396yiivkspv3x > > error during packaging= > building /gnu/store/2a2016wffiy0cwvayvsz64r1f88k05mg-git-checkout.drv... > \r:sha256 hash mismatch for > /gnu/store/w2sl6n4jnbhzs8qp1k4lff35h1yml2c4-git-checkout: > expected hash: 1ykbpz6pqx0bkvfp3c60qfb9r0xvpmrs0ldlxm2qw0zd8f67lmaj > actual hash: 10nfjllq28jrzxd4dfqm6xzx8f2g1m6p2vivzihxc7d3ac1imnk2 > > So seems like it doesn't matter whether I am inside or outside the > directory I get the same hash (reasonable). > Neither git nor nar provide the correct hash > > FYI from https://guix.gnu.org/manual/en/html_node/Invoking-guix-hash.html > at the bottom explaining --exclude-vcs: > > $ git clone http://example.org/foo.git > $ cd foo > $ guix hash -rx . > > Suggests (to me) that you go inside the directory to calculate hash, though > as above seems not to matter. > > Thanks > > Mortimer > > > > > > > > On Tue, Jan 4, 2022 at 2:09 PM Timothy Sample wrote: > >> Hi zimoun, >> >> zimoun writes: >> >> > Indeed, >> > >> > $ guix hash -S git foo -x >> > 0czq9304mdv9f2j6a8cdi9855sl8w595p06c1m8bn9pg391lhcal >> > $ guix hash -S git foo >> > 0czq9304mdv9f2j6a8cdi9855sl8w595p06c1m8bn9pg391lhcal >> > >> > Hum, I will check if it is expected. >> >> I’m pretty sure it’s a bug. Fortunately, with Disarchive 0.4.0, the >> following (untested) patch should fix it: >> >> >> Hope that helps! >> >> >> -- Tim >> >
Re: How to use guix hash --serializer?
Thanks Tim, Simon, but that does not work for me. nar== mbc@HP8300:~/projects$ guix hash -S nar -x ./shinyln 1ykbpz6pqx0bkvfp3c60qfb9r0xvpmrs0ldlxm2qw0zd8f67lmaj mbc@HP8300:~/projects$ cd shinyln/ mbc@HP8300:~/projects/shinyln$ guix hash -S nar -x . 1ykbpz6pqx0bkvfp3c60qfb9r0xvpmrs0ldlxm2qw0zd8f67lmaj git== mbc@HP8300:~/projects/shinyln$ guix hash -S git -x . 0lai57r0p11q041b3flriv56j6n8lizwb69yv7j396yiivkspv3x mbc@HP8300:~/projects/shinyln$ cd .. mbc@HP8300:~/projects$ guix hash -S git -x ./shinyln 0lai57r0p11q041b3flriv56j6n8lizwb69yv7j396yiivkspv3x error during packaging= building /gnu/store/2a2016wffiy0cwvayvsz64r1f88k05mg-git-checkout.drv... \r:sha256 hash mismatch for /gnu/store/w2sl6n4jnbhzs8qp1k4lff35h1yml2c4-git-checkout: expected hash: 1ykbpz6pqx0bkvfp3c60qfb9r0xvpmrs0ldlxm2qw0zd8f67lmaj actual hash: 10nfjllq28jrzxd4dfqm6xzx8f2g1m6p2vivzihxc7d3ac1imnk2 So seems like it doesn't matter whether I am inside or outside the directory I get the same hash (reasonable). Neither git nor nar provide the correct hash FYI from https://guix.gnu.org/manual/en/html_node/Invoking-guix-hash.html at the bottom explaining --exclude-vcs: $ git clone http://example.org/foo.git $ cd foo $ guix hash -rx . Suggests (to me) that you go inside the directory to calculate hash, though as above seems not to matter. Thanks Mortimer On Tue, Jan 4, 2022 at 2:09 PM Timothy Sample wrote: > Hi zimoun, > > zimoun writes: > > > Indeed, > > > > $ guix hash -S git foo -x > > 0czq9304mdv9f2j6a8cdi9855sl8w595p06c1m8bn9pg391lhcal > > $ guix hash -S git foo > > 0czq9304mdv9f2j6a8cdi9855sl8w595p06c1m8bn9pg391lhcal > > > > Hum, I will check if it is expected. > > I’m pretty sure it’s a bug. Fortunately, with Disarchive 0.4.0, the > following (untested) patch should fix it: > > > Hope that helps! > > > -- Tim >
Re: How to use guix hash --serializer?
Hi zimoun, zimoun writes: > Indeed, > > $ guix hash -S git foo -x > 0czq9304mdv9f2j6a8cdi9855sl8w595p06c1m8bn9pg391lhcal > $ guix hash -S git foo > 0czq9304mdv9f2j6a8cdi9855sl8w595p06c1m8bn9pg391lhcal > > Hum, I will check if it is expected. I’m pretty sure it’s a bug. Fortunately, with Disarchive 0.4.0, the following (untested) patch should fix it: diff --git a/guix/scripts/hash.scm b/guix/scripts/hash.scm index d73e3d13dd..c44a4de9a4 100644 --- a/guix/scripts/hash.scm +++ b/guix/scripts/hash.scm @@ -69,7 +69,7 @@ (define* (git-hash file #:optional ((directory) #t) (else #f))) (if directory? - (git-hash-directory file algorithm) + (git-hash-directory file algorithm #:select? select?) (git-hash-file file algorithm))) Hope that helps! -- Tim
Re: How to use guix hash --serializer?
Hi, On Tue, 4 Jan 2022 at 17:39, Mortimer Cladwell wrote: > (uri (git-reference > (url "git://github.com/mbcladwell/shinyln.git") > (commit "9f06568ffa61953ab48c93e1623d88b4e672af42"))) > (sha256 (base32 > "10nfjllq28jrzxd4dfqm6xzx8f2g1m6p2vivzihxc7d3ac1imnk2")) > $guix hash -rx . > 1ykbpz6pqx0bkvfp3c60qfb9r0xvpmrs0ldlxm2qw0zd8f67lmaj That's because you are inside the folder. Go outside $ guix hash -rx shinyln 10nfjllq28jrzxd4dfqm6xzx8f2g1m6p2vivzihxc7d3ac1imnk2 where shinyln is whatever the name of the folder where the Git repo is. > $guix hash --serializer=git -x . > 0lai57r0p11q041b3flriv56j6n8lizwb69yv7j396yiivkspv3x Here, you are using the Git serializer when Guix uses the Nar one. The correct is: guix hash -S nar -x shinyln > Appears that the -x switch has no effect. Indeed, $ guix hash -S git foo -x 0czq9304mdv9f2j6a8cdi9855sl8w595p06c1m8bn9pg391lhcal $ guix hash -S git foo 0czq9304mdv9f2j6a8cdi9855sl8w595p06c1m8bn9pg391lhcal Hum, I will check if it is expected. Cheers, simon
How to use guix hash --serializer?
Hi, Using guix package --install-from-file=guix.scm I determined the commit hash from the error message. The git-reference that works is: (uri (git-reference (url "git://github.com/mbcladwell/shinyln.git") (commit "9f06568ffa61953ab48c93e1623d88b4e672af42"))) (sha256 (base32 "10nfjllq28jrzxd4dfqm6xzx8f2g1m6p2vivzihxc7d3ac1imnk2")) In the local directory from where I issued git commit -am "my message" I try the following: $git log -n 1 commit 9f06568ffa61953ab48c93e1623d88b4e672af42 (HEAD -> master, origin/master) Author: mbcladwell Date: Tue Jan 4 09:08:09 2022 -0500 removed chmod statement $guix hash -rx . 1ykbpz6pqx0bkvfp3c60qfb9r0xvpmrs0ldlxm2qw0zd8f67lmaj $guix hash --serializer=git -x . 0lai57r0p11q041b3flriv56j6n8lizwb69yv7j396yiivkspv3x $guix hash --serializer=git . 0lai57r0p11q041b3flriv56j6n8lizwb69yv7j396yiivkspv3x Appears that the -x switch has no effect. -r and --serializer give different results. Neither result matches the (valid) error message hash. Where did I go wrong? Thanks Mortimer the .gitignore--- *.eps *.go *.log *.pdf *.png *.tar.xz *.tar.gz *.tmp *~ .#* \#*\# ,* /ABOUT-NLS /INSTALL /aclocal.m4 /autom4te.cache /build-aux/ar-lib /build-aux/compile /build-aux/config.guess /build-aux/config.rpath /build-aux/config.sub /build-aux/depcomp /build-aux/install-sh /build-aux/mdate-sh /build-aux/missing /build-aux/test-driver /build-aux/texinfo.tex /config.status /configure /doc/*.1 /doc/.dirstamp /doc/contributing.*.texi /doc/*.aux /doc/*.cp /doc/*.cps /doc/*.fn /doc/*.fns /doc/*.html /doc/*.info /doc/*.info-[0-9] /doc/*.ky /doc/*.pg /doc/*.toc /doc/*.t2p /doc/*.tp /doc/*.vr /doc/*.vrs /doc/stamp-vti /doc/version.texi /doc/version-*.texi /m4/* /pre-inst-env /test-env /test-tmp /tests/*.trs GPATH GRTAGS GTAGS Makefile Makefile.in config.cache stamp-h[0-9] tmp /.version /doc/stamp-[0-9]