From: ludo@gnu.org (Ludovic Courtès)
To: Mark H Weaver <mhw@netris.org>
Cc: guix-devel@gnu.org
Subject: Re: Detecting duplicate field initializers in guix record constructors
Date: Sun, 22 Apr 2018 22:01:02 +0200 [thread overview]
Message-ID: <87vacjgge9.fsf@gnu.org> (raw)
In-Reply-To: <87y3hh3rfo.fsf@netris.org> (Mark H. Weaver's message of "Sat, 21 Apr 2018 04:16:27 -0400")
Hello!
Mark H Weaver <mhw@netris.org> skribis:
> Recently, when doing a merge of 'master' into 'core-updates', I noticed
> that git's automatic merging sometimes results in duplicate field
> initializers being introduced, without any merge conflict being
> reported. This happens when a field is introduced independently in both
> 'core-updates' and 'master', but in different places within the
> constructor.
>
> So, I implemented duplicate field detection in (guix records).
> See below for my draft patches.
Excellent, I’ve been missing this for too long. :-)
> This revealed 9 occurrences of this error in my private branch, which is
> based on 'core-updates' with recent 'staging' and 'master' merged in.
Woow.
> I ran into another problem along the way. I found that after adding the
> duplicate field detection to (guix records), building Guix from a clean
> tree started failing with an apparently unrelated error. When the code
> in build-aux/compile-all.scm attempted to _load_ (guix scripts pack), it
> hit a fatal error, namely that 'gzip' was undefined, although it's
> clearly importing the right module. I guess this is somehow related to
> the cycles in our module dependency graph. I found that this problem
> could be prevented by moving $(GNU_SYSTEM_MODULES) above the modules in
> guix/{import,scripts} in MODULES in Makefile.am. The idea is that
> modules in guix/{import,scripts} sometimes import package modules, but
> never the other way around.
(Note: this was reported at <https://bugs.gnu.org/29774>.)
I still don’t quite get it. The #:use-module (gnu packages compression)
in (guix scripts pack) should lead to loading things in the right order,
no? Do you have a way to reproduce it?
> From 5e4422d81d4fd5581bce8f8b29f4c75864e37bd0 Mon Sep 17 00:00:00 2001
> From: Mark H Weaver <mhw@netris.org>
> Date: Thu, 19 Apr 2018 16:18:26 -0400
> Subject: [PATCH 1/3] DRAFT: build: Load $(GNU_SYSTEM_MODULES) before
> guix/{import,scripts}.
>
> This works around an issue where modules in guix/import and guix/scripts
> sometimes depend on package definitions at module load time.
>
> * Makefile.am (MODULES): Move $(GNU_SYSTEM_MODULES) above guix/import/* and
> guix/scripts/*.
Let’s discuss this separately for 29774.
> From 907cd4b4a485fbce7662c3149d8d4eeb0b4e7d0d Mon Sep 17 00:00:00 2001
> From: Mark H Weaver <mhw@netris.org>
> Date: Thu, 19 Apr 2018 16:41:45 -0400
> Subject: [PATCH 2/3] DRAFT: Fix duplicate field initializers in guix record
> constructors.
LGTM!
> From 45e26da1e4c8559b843034de3fd2edef89f5349c Mon Sep 17 00:00:00 2001
> From: Mark H Weaver <mhw@netris.org>
> Date: Thu, 19 Apr 2018 12:33:25 -0400
> Subject: [PATCH 3/3] DRAFT: records: Detect duplicate field initializers.
LGTM too. Could you add a test in tests/records.scm? There’s already a
couple of ‘syntax-error’ tests there.
Thank you!
Ludo’.
prev parent reply other threads:[~2018-04-22 20:01 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-21 8:16 Detecting duplicate field initializers in guix record constructors Mark H Weaver
2018-04-22 20:01 ` Ludovic Courtès [this message]
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=87vacjgge9.fsf@gnu.org \
--to=ludo@gnu.org \
--cc=guix-devel@gnu.org \
--cc=mhw@netris.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.