unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Phil <phil@beadling.co.uk>
To: Ricardo Wurmus <rekado@elephly.net>
Cc: "guix-devel@gnu.org" <guix-devel@gnu.org>
Subject: Re: Parallel guix builds can trample?
Date: Wed, 12 Jan 2022 09:37:53 +0000	[thread overview]
Message-ID: <871r1dguq6.fsf@beadling.co.uk> (raw)
In-Reply-To: <87r19d5pcw.fsf@elephly.net>

Hi - more details below.

Ricardo Wurmus writes:

>
> How are you using Guix with this?  Do you generate Guix package
> expressions?  Do you use “guix build --with-commit”?
>

The situation is like this - if we had a directory of clones of my
channel:

- pr-1
- pr-2
- pr-3
- pr-4
... and so on

Initially all the clones are taken from the master branch of my
channel and are all identical - but we change the version and commit to
match the head of each PR branch as per below.

Each clone looks like this:
- pr-1
      - my-package.scm
- pr-2
      - my-package.scm
and so on....

Each my-package.scm has a package like below - the inital packages are all
identical, but my system effectively seds the version and commit values
like the below.  These values are never committed back to master they
are used only as local channels to build each PR to test each build
still passes.

(define-public my-package
  (package
    (name "my-package")
    (version "this-is-different-for-each-pr")  ;; replace master version
    (source
      (git-checkout
        (url "ssh://same@repo:7999/same/repo.git")
        (commit "this-is-different-for-each-pr") ;; replace master version 
everything else remains the same in the package....


At this point we have lots of local channels referencing different commits, in
the same package, ready to build - so I spawn them all simultaneously -
the equivalent pseudo-shell that I will mock up today would be:

# define some sort of return code array:
RC=[]

for dir in pr-dirs
  RC[${dir}]=`guix build -K -L ${dir} my-package & 2>&1 > /tmp/${dir}.log`  # note the ampersand
wait

for rc in $RC
  if $rc.value != 0:
    report the failure of build $rc.key

What I'm seeing occasionally is that the logs and return code for say directory pr-1
and appearing in the guix build for pr-3 or pr-6 instead.

We know this becuse the code is different enough in pr-1 that it's logs
are unique across all the PRs.  We can also check the source code if the
build fails using --keep-failed to show it doesn't match the commit id
in the package used to build it.

Hopefully that makes sense?  I can post the actual shell script once
I've written the mock.


  reply	other threads:[~2022-01-12  9:38 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-11 21:26 Parallel guix builds can trample? Phil
2022-01-11 23:16 ` Ricardo Wurmus
2022-01-12  7:00   ` Philip Beadling
2022-01-12  8:27     ` Ricardo Wurmus
2022-01-12  9:37       ` Phil [this message]
2022-01-17 17:23         ` Phil Beadling
2022-01-17 17:44           ` Maxime Devos
2022-01-18  9:28             ` Phil
2022-01-18  9:36               ` Maxime Devos
2022-01-18 14:59             ` Ludovic Courtès
2022-01-18 10:10       ` Phil
2022-01-18 12:53         ` Phil Beadling

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

  List information: https://guix.gnu.org/

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

  git send-email \
    --in-reply-to=871r1dguq6.fsf@beadling.co.uk \
    --to=phil@beadling.co.uk \
    --cc=guix-devel@gnu.org \
    --cc=rekado@elephly.net \
    /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 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).