unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
* bug#67594: Cannot reproduce hash calculation of erlang package
@ 2023-12-03  1:55 Leo Famulari
  2023-12-08 17:19 ` Simon Tournier
  0 siblings, 1 reply; 2+ messages in thread
From: Leo Famulari @ 2023-12-03  1:55 UTC (permalink / raw)
  To: 67594

As reported on #guix by jeremyc [0], the standard method for calculating
the hash of a Git checkout is not working as expected for the Erlang
package [1].

Currently, our Erlang package has this source block:

------
    (version "25.3.2")
    (source (origin
              (method git-fetch)
              ;; The tarball from http://erlang.org/download contains many
              ;; pre-compiled files, so we use this snapshot of the source
              ;; repository.
              (uri (git-reference
                    (url "https://github.com/erlang/otp")
                    (commit (string-append "OTP-" version))))
              (file-name (git-file-name name version))
              (sha256
               (base32
                "092lym5a181gz89nscw7kqhw1wa6qvgcpkj80q4i9p79mxmsr1nj"))
              (patches (search-patches "erlang-man-path.patch"))))
------

So, I clone otp.git, check out the tag, and calculate the hash according
to the manual:

------
$ git clone https://github.com/erlang/otp                                                                                                 
Cloning into 'otp'...
remote: Enumerating objects: 491375, done.
remote: Counting objects: 100% (102345/102345), done.
remote: Compressing objects: 100% (3576/3576), done.
remote: Total 491375 (delta 100266), reused 99037 (delta 98766), pack-reused 389030
Receiving objects: 100% (491375/491375), 485.70 MiB | 14.17 MiB/s, done.
Resolving deltas: 100% (396274/396274), done.
Updating files: 100% (12078/12078), done.
$ cd otp
$ git checkout OTP-25.3.2                                                                                                                 
Note: switching to 'OTP-25.3.2'.          
 
You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:

  git switch -c <new-branch-name>

Or undo this operation with:

  git switch -

Turn off this advice by setting config variable advice.detachedHead to false

HEAD is now at 0418c10ec3 Updated OTP version
$ guix hash -x --serializer=nar .
05m2fixgfn2gcisz13zp002hy5i8580ayai3lqs77q8gwzdb22mz
------

It's not the same hash as in the package definition.

Additionally, I used '--check' to make sure I'm not crazy. I commented
out the patch that we apply to the otp.git, and then used this command,
which returned successfully:

------
$ ./pre-inst-env guix build --no-grafts erlang -S --no-substitutes --no-offload --check
------

What's up? Are me and jeremyc missing something here?

[0]
http://logs.guix.gnu.org/guix/2023-12-03.log#020056

[1]
https://git.savannah.gnu.org/cgit/guix.git/tree/gnu/packages/erlang.scm?id=06ebc45e15f2a1bd4526a5a716eed657c902a0c1#n48




^ permalink raw reply	[flat|nested] 2+ messages in thread

* bug#67594: Cannot reproduce hash calculation of erlang package
  2023-12-03  1:55 bug#67594: Cannot reproduce hash calculation of erlang package Leo Famulari
@ 2023-12-08 17:19 ` Simon Tournier
  0 siblings, 0 replies; 2+ messages in thread
From: Simon Tournier @ 2023-12-08 17:19 UTC (permalink / raw)
  To: Leo Famulari, 67594

Hi,

On Sat, 02 Dec 2023 at 20:55, Leo Famulari <leo@famulari.name> wrote:

>     (source (origin
>               (method git-fetch)
>               ;; The tarball from http://erlang.org/download contains many
>               ;; pre-compiled files, so we use this snapshot of the source
>               ;; repository.
>               (uri (git-reference
>                     (url "https://github.com/erlang/otp")
>                     (commit (string-append "OTP-" version))))
>               (file-name (git-file-name name version))
>               (sha256
>                (base32
>                 "092lym5a181gz89nscw7kqhw1wa6qvgcpkj80q4i9p79mxmsr1nj"))

> $ git clone https://github.com/erlang/otp                                                                                                 
> $ cd otp
> $ git checkout OTP-25.3.2                                                                                                                 
> HEAD is now at 0418c10ec3 Updated OTP version
> $ guix hash -x --serializer=nar .
> 05m2fixgfn2gcisz13zp002hy5i8580ayai3lqs77q8gwzdb22mz

> It's not the same hash as in the package definition.

Indeed, and I think the issue is coming from that:

     ./lib/dialyzer/test/options1_SUITE_data/my_include/CVS

It is another case of bug#65979 [1].  Because there is both .git and
CVS, the current implementation of vcs-file? is confused and so exclude
some folders when it should not.

This is fixed by <https://issues.guix.gnu.org/66961#7> that I will push
shortly the last revision v4. :-)

--8<---------------cut here---------------start------------->8---
$ ./pre-inst-env guix hash -x --serializer=nar /tmp/otp
092lym5a181gz89nscw7kqhw1wa6qvgcpkj80q4i9p79mxmsr1nj
--8<---------------cut here---------------end--------------->8---


1: https://issues.guix.gnu.org/issue/65979

Cheers,
simon




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-12-08 17:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-03  1:55 bug#67594: Cannot reproduce hash calculation of erlang package Leo Famulari
2023-12-08 17:19 ` Simon Tournier

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).