From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: Detecting duplicate field initializers in guix record constructors Date: Sun, 22 Apr 2018 22:01:02 +0200 Message-ID: <87vacjgge9.fsf@gnu.org> References: <87y3hh3rfo.fsf@netris.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:59858) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fALAb-0004Ss-BI for guix-devel@gnu.org; Sun, 22 Apr 2018 16:01:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fALAX-0001H0-7H for guix-devel@gnu.org; Sun, 22 Apr 2018 16:01:09 -0400 Received: from hera.aquilenet.fr ([185.233.100.1]:44660) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fALAX-0001Fd-0t for guix-devel@gnu.org; Sun, 22 Apr 2018 16:01:05 -0400 In-Reply-To: <87y3hh3rfo.fsf@netris.org> (Mark H. Weaver's message of "Sat, 21 Apr 2018 04:16:27 -0400") List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: Mark H Weaver Cc: guix-devel@gnu.org Hello! Mark H Weaver 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=E2=80=99ve 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 .) I still don=E2=80=99t quite get it. The #:use-module (gnu packages compres= sion) 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 > 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/* a= nd > guix/scripts/*. Let=E2=80=99s discuss this separately for 29774. > From 907cd4b4a485fbce7662c3149d8d4eeb0b4e7d0d Mon Sep 17 00:00:00 2001 > From: Mark H Weaver > Date: Thu, 19 Apr 2018 16:41:45 -0400 > Subject: [PATCH 2/3] DRAFT: Fix duplicate field initializers in guix reco= rd > constructors. LGTM! > From 45e26da1e4c8559b843034de3fd2edef89f5349c Mon Sep 17 00:00:00 2001 > From: Mark H Weaver > 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=E2=80=99s alre= ady a couple of =E2=80=98syntax-error=E2=80=99 tests there. Thank you! Ludo=E2=80=99.