guix pull on aarch64-linux glibc derivation has incorrect output

  • Open
  • quality assurance status badge
Details
2 participants
  • Ludovic Courtès
  • Christopher Baines
Owner
unassigned
Submitted by
Christopher Baines
Severity
normal
C
C
Christopher Baines wrote on 9 Feb 2020 20:53
(address . bug-guix@gnu.org)
87d0an1qs7.fsf@cbaines.net
Hey,

When attempting to guix pull using the aarch64-linux system, I'm seeing
some issues with derivation outputs. I tried with a newer and older
commit, and the result is the same.


→ guix pull --commit=27b09f3ab11a30821a5ce0b071aac1bc6156497d --system=aarch64-linux --profile=/tmp/testprofile2
Updating channel 'guix' from Git repository at 'https://git.savannah.gnu.org/git/guix.git'...
Building from this channel:
Computing Guix derivation for 'aarch64-linux'... -
guix pull: error: derivation `/gnu/store/800ky8qa4az7yx36gsg9ak6bih3530qm-glibc-2.29.drv' has incorrect output `/gnu/store/8v34v81q86klja9rihaixkypcml5ad5j-glibc-2.29-debug', should be `/gnu/store/w3iq60ias1qlrjigbj75ssda09hwg21i-glibc-2.29-debug'


→ guix pull --commit=4cb7c3d6a0e6ee50f8f9f54243402560b8908378 --system=aarch64-linux --no-grafts --profile=/tmp/testprofile
Updating channel 'guix' from Git repository at 'https://git.savannah.gnu.org/git/guix.git'...
Building from this channel:
Computing Guix derivation for 'aarch64-linux'... /
guix pull: error: derivation `/gnu/store/800ky8qa4az7yx36gsg9ak6bih3530qm-glibc-2.29.drv' has incorrect output `/gnu/store/8v34v81q86klja9rihaixkypcml5ad5j-glibc-2.29-debug', should be `/gnu/store/w3iq60ias1qlrjigbj75ssda09hwg21i-glibc-2.29-debug'


Thanks,

Chris
-----BEGIN PGP SIGNATURE-----

iQKTBAEBCgB9FiEEPonu50WOcg2XVOCyXiijOwuE9XcFAl5AYyhfFIAAAAAALgAo
aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDNF
ODlFRUU3NDU4RTcyMEQ5NzU0RTBCMjVFMjhBMzNCMEI4NEY1NzcACgkQXiijOwuE
9Xcwag//egjC3xbsZaOmGRYh40Cnj/WV86qvio++thQ74SgJGM94wfGz1M2OxteF
bczmDVb2HOK9jObw7xWkEtQLIKFuT7IM6QAQ/5hFF0a2zpXS3+rwqAJWkdfhMlTj
bgKTibSrbw/HMPLZdXGa6+Ik4aAH6ehD0C6Mhj0eo93yGJ2XYGBouXSXmqUbrVzU
lHIBUnLw26K6aFTSUAsWhj9+JcaBoAt9kpppr/kZIZUCDcrnlGskTAHrmnsNS/2y
l4tEw96vOjo5u1txaI9ZRKg4r/XY2FUKnOvEbiVwAhlzbhVNTf3so9dm05VnIyJ6
wNzNViaMuNU9wVzzvrNnB45oY+WohX9A1fTh69Md6cVAJ33eAblJ2WXfrlg84rpm
NI6NCwfbdxsmmflfy7tOFAgHUN84rq/1hBax1J+oCQc+57aQ9adYt7qsd9oTtw32
ZIVplmGlqM6hIN8OMuEXKtX7krkJBQfDUChCVcyCvq4Y2NzZuWNr8V90ot5APgwt
PCQpxYrf5QzqzxoldLOnn1VCkdyvLfqpMiWKzMu+W5gjwi0zSjhk99rq19mmZuyK
D5oaYfjbktZty389962rLZFxHFUyaSarlyJqVvYbBYY8lg5DP0oQMx43xjcCTy3S
q87FavHWVsAufdIme3DW6EWC2Q0iY6TQTY/BG9+0gYZcKyjOLoY=
=Xudb
-----END PGP SIGNATURE-----

L
L
Ludovic Courtès wrote on 20 Apr 2020 00:14
(name . Christopher Baines)(address . mail@cbaines.net)(address . 39531@debbugs.gnu.org)
87pnc315t1.fsf@gnu.org
Hi,

Christopher Baines <mail@cbaines.net> skribis:

Toggle quote (12 lines)
> When attempting to guix pull using the aarch64-linux system, I'm seeing
> some issues with derivation outputs. I tried with a newer and older
> commit, and the result is the same.
>
>
> → guix pull --commit=27b09f3ab11a30821a5ce0b071aac1bc6156497d --system=aarch64-linux --profile=/tmp/testprofile2
> Updating channel 'guix' from Git repository at 'https://git.savannah.gnu.org/git/guix.git'...
> Building from this channel:
> guix https://git.savannah.gnu.org/git/guix.git 27b09f3
> Computing Guix derivation for 'aarch64-linux'... -
> guix pull: error: derivation `/gnu/store/800ky8qa4az7yx36gsg9ak6bih3530qm-glibc-2.29.drv' has incorrect output `/gnu/store/8v34v81q86klja9rihaixkypcml5ad5j-glibc-2.29-debug', should be `/gnu/store/w3iq60ias1qlrjigbj75ssda09hwg21i-glibc-2.29-debug'

The problem here is that we’re building the trampoline,
“compute-guix-derivation”, for AArch64. It builds if substitutes are
available (likely) and fails to build otherwise. And then we try to
execute it locally, and since your machine is not AArch64, it fails.

The first patch attached does what I thought was all it would take to
fix it. But then I realized that the second patch is needed so that
‘make-config.scm’ uses a Guile for the right system, same for
“module-import.drv” and so on.

Together, these two patches solve the problem (not retroactively
though), but we need to check the implications of changing the default
value of #:guile-for-build.

Thanks,
Ludo’.
From 366729d477960127424076bdac51e7c937857081 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= <ludo@gnu.org>
Date: Sun, 19 Apr 2020 23:14:56 +0200
Subject: [PATCH 1/2] build-self: Always build the trampoline for the current
system.

Previously we'd build 'compute-guix-derivation' for the target system.
Running it would then fail (unless qemu-binfmt support was set up or
something similar).

Reported by Christopher Baines <mail@cbaines.net>.

* build-aux/build-self.scm (load-path-expression): Add #:system and
honor it.
(gexp->script): Likewise.
(build-program): Pass #:system to 'gexp->script'.
---
build-aux/build-self.scm | 24 +++++++++++++++++-------
1 file changed, 17 insertions(+), 7 deletions(-)

Toggle diff (67 lines)
diff --git a/build-aux/build-self.scm b/build-aux/build-self.scm
index f86c79f0d0..58ecf20cf4 100644
--- a/build-aux/build-self.scm
+++ b/build-aux/build-self.scm
@@ -148,14 +148,17 @@
;;; 1ae16033f34cebe802023922436883867010850f (March 2018.)
;;;
-(define (load-path-expression modules path)
+(define* (load-path-expression modules path
+ #:key (system (%current-system)))
"Return as a monadic value a gexp that sets '%load-path' and
'%load-compiled-path' to point to MODULES, a list of module names. MODULES
are searched for in PATH."
(mlet %store-monad ((modules (imported-modules modules
- #:module-path path))
+ #:module-path path
+ #:system system))
(compiled (compiled-modules modules
- #:module-path path)))
+ #:module-path path
+ #:system system)))
(return (gexp (eval-when (expand load eval)
(set! %load-path
(cons (ungexp modules) %load-path))
@@ -165,12 +168,14 @@ are searched for in PATH."
(define* (gexp->script name exp
#:key (guile (default-guile))
- (module-path %load-path))
+ (module-path %load-path)
+ (system (%current-system)))
"Return an executable script NAME that runs EXP using GUILE, with EXP's
imported modules in its search path."
(mlet %store-monad ((set-load-path
(load-path-expression (gexp-modules exp)
- module-path)))
+ module-path
+ #:system system)))
(gexp->derivation name
(gexp
(call-with-output-file (ungexp output)
@@ -186,7 +191,8 @@ imported modules in its search path."
(write '(ungexp set-load-path) port)
(write '(ungexp exp) port)
(chmod port #o555))))
- #:module-path module-path)))
+ #:module-path module-path
+ #:system system)))
(define (date-version-string)
@@ -364,7 +370,11 @@ interface (FFI) of Guile.")
#$pull-version)
#:system system)
derivation-file-name))))))
- #:module-path (list source))))
+ #:module-path (list source)
+
+ ;; Always build the trampoline for the local system. The
+ ;; system being targeted will be passed as an argument.
+ #:system %system)))
(define (call-with-clean-environment thunk)
(let ((env (environ)))
--
2.26.0
From d35b68374543f9eed7dc1f49c73d49a31332e2b3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= <ludo@gnu.org>
Date: Sun, 19 Apr 2020 23:58:10 +0200
Subject: [PATCH 2/2] DRAFT gexp: #:guile-for-build defaults to a
system-dependent derivation.

Until now, the default #:guile-for-build would be Guile lowered to
whichever system was current when %GUILE-FOR-BUILD was set. This would
break when passing #:system to a value other than %CURRENT-SYSTEM.

* guix/gexp.scm (lower-gexp): #:guile-for-build defaults to #f.
(gexp->derivation): Likewise.
(imported-files/derivation): Likewise.
(imported-files): Likewise.
(imported-modules): Likewise.
(compiled-modules): Likewise.
---
guix/gexp.scm | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)

Toggle diff (60 lines)
diff --git a/guix/gexp.scm b/guix/gexp.scm
index 4ac0411da1..753da8cb4d 100644
--- a/guix/gexp.scm
+++ b/guix/gexp.scm
@@ -784,7 +784,7 @@ second element is the derivation to compile them."
(system (%current-system))
(target 'current)
(graft? (%graft?))
- (guile-for-build (%guile-for-build))
+ (guile-for-build #f)
(effective-version "2.2")
deprecation-warnings)
@@ -885,7 +885,7 @@ derivations--e.g., code evaluated for its side effects."
(env-vars '())
(modules '())
(module-path %load-path)
- (guile-for-build (%guile-for-build))
+ (guile-for-build #f)
(effective-version "2.2")
(graft? (%graft?))
references-graphs
@@ -1357,7 +1357,7 @@ to a tree suitable for 'interned-file-tree'."
#:key (name "file-import")
(symlink? #f)
(system (%current-system))
- (guile (%guile-for-build)))
+ (guile #f))
"Return a derivation that imports FILES into STORE. FILES must be a list
of (FINAL-PATH . FILE) pairs. Each FILE is mapped to FINAL-PATH in the
resulting store path. FILE can be either a file name, or a file-like object,
@@ -1406,7 +1406,7 @@ to the source files instead of copying them."
;; The following parameters make sense when creating
;; an actual derivation.
(system (%current-system))
- (guile (%guile-for-build)))
+ (guile #f))
"Import FILES into the store and return the resulting derivation or store
file name (a derivation is created if and only if some elements of FILES are
file-like objects and not local file names.) FILES must be a list
@@ -1426,7 +1426,7 @@ as returned by 'local-file' for example."
(define* (imported-modules modules
#:key (name "module-import")
(system (%current-system))
- (guile (%guile-for-build))
+ (guile #f)
(module-path %load-path))
"Return a derivation that contains the source files of MODULES, a list of
module names such as `(ice-9 q)'. All of MODULES must be either names of
@@ -1455,7 +1455,7 @@ last one is created from the given <scheme-file> object."
#:key (name "module-import-compiled")
(system (%current-system))
target
- (guile (%guile-for-build))
+ (guile #f)
(module-path %load-path)
(extensions '())
(deprecation-warnings #f))
--
2.26.0
C
C
Christopher Baines wrote on 20 Apr 2020 09:17
(name . Ludovic Courtès)(address . ludo@gnu.org)(address . 39531@debbugs.gnu.org)
874kte62yw.fsf@cbaines.net
Ludovic Courtès <ludo@gnu.org> writes:

Toggle quote (28 lines)
> Christopher Baines <mail@cbaines.net> skribis:
>
>> When attempting to guix pull using the aarch64-linux system, I'm seeing
>> some issues with derivation outputs. I tried with a newer and older
>> commit, and the result is the same.
>>
>>
>> → guix pull --commit=27b09f3ab11a30821a5ce0b071aac1bc6156497d --system=aarch64-linux --profile=/tmp/testprofile2
>> Updating channel 'guix' from Git repository at 'https://git.savannah.gnu.org/git/guix.git'...
>> Building from this channel:
>> guix https://git.savannah.gnu.org/git/guix.git 27b09f3
>> Computing Guix derivation for 'aarch64-linux'... -
>> guix pull: error: derivation `/gnu/store/800ky8qa4az7yx36gsg9ak6bih3530qm-glibc-2.29.drv' has incorrect output `/gnu/store/8v34v81q86klja9rihaixkypcml5ad5j-glibc-2.29-debug', should be `/gnu/store/w3iq60ias1qlrjigbj75ssda09hwg21i-glibc-2.29-debug'
>
> The problem here is that we’re building the trampoline,
> “compute-guix-derivation”, for AArch64. It builds if substitutes are
> available (likely) and fails to build otherwise. And then we try to
> execute it locally, and since your machine is not AArch64, it fails.
>
> The first patch attached does what I thought was all it would take to
> fix it. But then I realized that the second patch is needed so that
> ‘make-config.scm’ uses a Guile for the right system, same for
> “module-import.drv” and so on.
>
> Together, these two patches solve the problem (not retroactively
> though), but we need to check the implications of changing the default
> value of #:guile-for-build.

Hey,

Thanks for investigating :) I completely forget why I encountered this,
but it was probably around getting the channel instance derivations in
to the Guix Data Service, but I think I got that working, so I guess I
somehow avoided this issue.

Thanks,

Chris
-----BEGIN PGP SIGNATURE-----

iQKTBAEBCgB9FiEEPonu50WOcg2XVOCyXiijOwuE9XcFAl6dTHdfFIAAAAAALgAo
aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDNF
ODlFRUU3NDU4RTcyMEQ5NzU0RTBCMjVFMjhBMzNCMEI4NEY1NzcACgkQXiijOwuE
9XeWNg/8DDNPPZIBNh3C7fq0XQdHZXBZY60YV6mLGHFVd3pm87hFsTrUmji22rEI
QKw5Yq0wTlQs5JSPa4t8gVaJYV/8ZuAmqX6MVRgocFGTyuctILsYuLtGZbIVhaqz
5LK9H4V2o/pJpLXV0GnVk0UjxICX36e1ueKlfI4yUh1pSZDOsF5+QnvqJWb+LIX2
qqXvPDNcrwtdje+0aYHc+NxPQGLtrTpbfuo83/YnaasqHZEhRGTPwm6mYBWydyy8
9CUxY1RiXvGAzpe7/3dKq4iaop+rlegi0FyFWHSkXlqFg95i2hpm2jno0+Za3eWl
Whgo56CBWiknpKBAxsi3QwuszEWVsOe960V5SrNNKEHy9lPkQ5CUoBrvqKqpGhpZ
76u3QL5iouC+Iw1fAeGwtprrEnnWc9P2ph9DzCrjDjz4pslQoFPvZR8qPp7Myujk
B5frMAHoOsPIP4ZNaZWk9IHqi4E183DzZz+94hLvj/KBtymE1GzCSB1SKSvplctA
jSOAdvTdgMy7FncgeJJTQ38Mlqc4yG0ap+o1vjGth69ugTGg1xcqeO/DJMl/dqbF
VB2szekX8xwbolVhax/SJkR1RNrBURCEfSus7LLkNYcjkOo6qoBlKiUe0Cf+Vi9y
HJmbppRnO/dW0LQxYmTOKp6g6lDmaDpHNaS0dN+sj8Xhay0hPCM=
=cn5/
-----END PGP SIGNATURE-----

?
Your comment

Commenting via the web interface is currently disabled.

To comment on this conversation send an email to 39531@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 39531
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch