Mark H Weaver
2018-04-21 08:16:27 UTC
Hello Guix,
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.
This revealed 9 occurrences of this error in my private branch, which is
based on 'core-updates' with recent 'staging' and 'master' merged in.
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.
I've attached three draft patches below. The first applies the
aforementioned workaround in Makefile.am. The second fixes the 9
occurrences of duplicate field initializers in my private branch. The
third modifies (guix records) to raise an error if duplicate fields are
found.
Comments and suggestions welcome.
Mark
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.
This revealed 9 occurrences of this error in my private branch, which is
based on 'core-updates' with recent 'staging' and 'master' merged in.
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.
I've attached three draft patches below. The first applies the
aforementioned workaround in Makefile.am. The second fixes the 9
occurrences of duplicate field initializers in my private branch. The
third modifies (guix records) to raise an error if duplicate fields are
found.
Comments and suggestions welcome.
Mark