all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Ludovic Courtès" <ludo@gnu.org>
To: Janneke Nieuwenhuizen <janneke@gnu.org>
Cc: 64708@debbugs.gnu.org
Subject: [bug#64708] [PATCH 0/8] Fix cross build and native build for the Hurd.
Date: Tue, 18 Jul 2023 23:13:58 +0200	[thread overview]
Message-ID: <87lefcgbxl.fsf_-_@gnu.org> (raw)
In-Reply-To: <161bab138845fe307ec92b8fea181e00ece86e58.1689685375.git.janneke@gnu.org> (Janneke Nieuwenhuizen's message of "Tue, 18 Jul 2023 15:14:59 +0200")

Janneke Nieuwenhuizen <janneke@gnu.org> skribis:

> From: Ludovic Courtès <ludo@gnu.org>
>
> * gnu/packages/commencement.scm (git-fetch-from-tarball): New procedure.

I guess this one is very weird so it deserves an explanation.

The problems we’re trying to solve are:

  1. We cannot use ‘git-fetch’ at this point because that’d introduce a
     circular dependency: <https://issues.guix.gnu.org/63331>.

  2. Downloading a cgit-generated tarball is unsafe: the tarball might
     be modified when cgit is updated or whatever, leading to a hash
     mismatch that we wouldn’t be able to resolve (well,
     disarchive.guix.gnu.org might be able to add an entry for that
     tarball, but then there’s currently no fallback in case of hash
     mismatch: <https://issues.guix.gnu.org/28659>).

So we need to obtain our Git checkouts by some other mean.  There are
further complications:

  3. We could use (web client), but without (gnutls) since it’s
     unavailable at this stage.

  4. We cannot use (guix swh) as is because Guile-JSON doesn’t build
     with Guile 2.0, which is what we have here.

The trick below is the only way I could think of to reconcile these
issues: it essentially stacks two fixed-output derivation.  The first
one downloads that auto-generated tarball (bad!), and the second one
extracts the contents of that tarball using ‘tar’ from
‘%bootstrap-coreutils&co’.  The output of the second one is identical to
what ‘git-fetch’ would give us (or ‘swh-download’).

That makes it more robust.  It also allows ‘guix lint -c archival’ to do
its work and similarly (well, almost) for ‘build-package-metadata.scm’,
the program that builds <https://guix.gnu.org/sources.json>, which SWH
periodically ingests.

Pfeww, long story.

> +(define* (git-fetch-from-tarball tarball)

Maybe add this docstring:

    "Return an <origin> method equivalent to 'git-fetch', except that it
  fetches the checkout from TARBALL, a tarball containing said
  checkout.

  The purpose of this procedure is to work around bootstrapping issues:
  'git-fetch' depends on Git, which is much higher in the dependency
  graph."

> +             (setenv "PATH"
> +                     #+(file-append %bootstrap-coreutils&co "/bin"))
> +             (invoke (string-append #+tar "/bin/tar")
> +                     "xf" #$tarball)

This should be: (invoke "tar" "xf" #$tarball).
Otherwise we’d get a cyclic dependency with ‘tar’.

(I didn’t notice because there’s a bug where ‘-s’ is ignored here:

  ./pre-inst-env guix build -e '(@@ (gnu packages commencement) mig-boot0)' \
    -s i586-gnu -Sd

)

OK with these changes!

Ludo’.




  reply	other threads:[~2023-07-18 21:15 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-18 13:11 [bug#64708] [PATCH 0/8] Fix cross build and native build for the Hurd Janneke Nieuwenhuizen
2023-07-18 13:14 ` [bug#64708] [PATCH 1/8] gnu: commencement: Add autoconf-boot0 Janneke Nieuwenhuizen
2023-07-18 13:14 ` [bug#64708] [PATCH 2/8] gnu: commencement: Add automake-boot0 Janneke Nieuwenhuizen
2023-07-18 13:14 ` [bug#64708] [PATCH 3/8] gnu: commencement: Add git-fetch-from-tarball utility Janneke Nieuwenhuizen
2023-07-18 21:13   ` Ludovic Courtès [this message]
2023-07-19  9:11     ` [bug#64708] [PATCH 0/8] Fix cross build and native build for the Hurd Josselin Poiret via Guix-patches via
2023-07-18 13:15 ` [bug#64708] [PATCH 4/8] gnu: commencement: gnumach-headers-boot0: Update to 1.8+git20221224 Janneke Nieuwenhuizen
2023-07-18 21:16   ` [bug#64708] [PATCH 0/8] Fix cross build and native build for the Hurd Ludovic Courtès
2023-07-18 21:31     ` Janneke Nieuwenhuizen
2023-07-18 22:21       ` Ludovic Courtès
2023-07-19  5:00         ` Janneke Nieuwenhuizen
2023-07-18 13:15 ` [bug#64708] [PATCH 5/8] gnu: commencement: mig-boot0: Update to 1.8+git20230520 Janneke Nieuwenhuizen
2023-07-18 21:17   ` [bug#64708] [PATCH 0/8] Fix cross build and native build for the Hurd Ludovic Courtès
2023-07-18 13:15 ` [bug#64708] [PATCH 6/8] gnu: commencement: hurd-headers-boot0: Update to 0.9.git20230216 Janneke Nieuwenhuizen
2023-07-18 13:15 ` [bug#64708] [PATCH 7/8] gnu: commencement: hurd-minimal-boot0: " Janneke Nieuwenhuizen
2023-07-18 13:15 ` [bug#64708] [PATCH 8/8] gnu: mig: Update to 1.8+git20230520 Janneke Nieuwenhuizen
2023-07-18 21:20   ` [bug#64708] [PATCH 0/8] Fix cross build and native build for the Hurd Ludovic Courtès
2023-07-18 21:38     ` Janneke Nieuwenhuizen
2023-07-19  9:08       ` Josselin Poiret via Guix-patches via
2023-07-19  9:32         ` Janneke Nieuwenhuizen
2023-07-18 21:23 ` Ludovic Courtès
2023-07-19  5:53   ` bug#64708: " Janneke Nieuwenhuizen

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=87lefcgbxl.fsf_-_@gnu.org \
    --to=ludo@gnu.org \
    --cc=64708@debbugs.gnu.org \
    --cc=janneke@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.