all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "(" <paren@disroot.org>
To: Felix Lechner <felix.lechner@lease-up.com>
Cc: guix-devel@gnu.org
Subject: Re: Using (recursive #t) in (origin git-reference)
Date: Tue, 20 Jun 2023 19:40:09 +0100	[thread overview]
Message-ID: <87v8fi55m9.fsf@disroot.org> (raw)
In-Reply-To: <CAFHYt56723mtp_vd=ih1jLVYstTBBq+_Q4zHmf8i-LEF2=zGTQ@mail.gmail.com>

Felix Lechner via "Development of GNU Guix and the GNU System distribution." <guix-devel@gnu.org> writes:
> Is there a trick to fetching Git submodules with (recursive? #t)? It
> does not seem to work with the package definition below.
>
> The code uses Ekaitz's proposed Zig build system. [1] Thank you!

Not sure whether or not you've already done this, but when you're doing
``(recursive? #t)'' the hash will be for the source code with submodules
checked out, so you need to fetch them all in your ``git clone'' before
doing ``guix hash -rx .''.

(If you've already tried building it without the RECURSIVE?, then this
issue will go unnoticed, as the derivation paths for these two objects:

  (origin
    (method git-fetch)
    (uri (git-reference
          (url "…")
          (commit (string-append "v" version))))
    …)

  (origin
    (method git-fetch)
    (uri (git-reference
          (url "…")
          (commit (string-append "v" version))
          (recursive? #t)))
    …)

are *exactly the same*, as the output path is the hash, followed by a
dash, followed by whatever's given in FILE-NAME.  Thus, they are treated
as exactly the same object, making rebuilding pointless in Guix's eyes,
because you've already got that "same" output in your store from the
first build without RECURSIVE?.

This is also, funnily enough, why it's not a great idea to first copy
another origin's hash, then try to build, in the hopes of getting the
actual hash from the "expected hash: …" message; if you haven't changed
the FILE-NAME, or haven't included one, the output path will be exactly
the same as the original package's, meaning that one will be used as the
source if you happen to have it in your store! [IIUC, of course.])

That being said, you may know all this and have already taken it into
account, in which case I'm not sure what's going on here :)

  -- (


  reply	other threads:[~2023-06-20 18:52 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-20 18:11 Using (recursive #t) in (origin git-reference) Felix Lechner via Development of GNU Guix and the GNU System distribution.
2023-06-20 18:40 ` ( [this message]
2023-06-20 19:33   ` Felix Lechner via Development of GNU Guix and the GNU System distribution.
2023-06-20 19:47     ` John Kehayias
2023-06-20 19:50       ` (

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87v8fi55m9.fsf@disroot.org \
    --to=paren@disroot.org \
    --cc=felix.lechner@lease-up.com \
    --cc=guix-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.