GNU bug report logs -
#65225
‘guix shell --system=ALIEN’ builds for both systems
Previous Next
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
Hi everyone,
Actually, let me add a big erratum, since it appears I misread the
intention of gexp->derivation (and realized 2 minutes after writing the
previous email).
Josselin Poiret <dev <at> jpoiret.xyz> writes:
> --8<---------------cut here---------------start------------->8---
> (mlet* %store-monad ( ;; The following binding forces '%current-system' and
> ;; '%current-target-system' to be looked up at >>=
> ;; time.
> (graft? (set-grafting graft?))
>
> (system -> (or system (%current-system)))
> (target -> (if (eq? target 'current)
> (%current-target-system)
> target))
> ...)
> ...)
> --8<---------------cut here---------------end--------------->8---
>
> Well, the issue here is that such an mlet starts by translating the
> graft? binding into a >>= call, which ends up putting the rest of the
> translation into a function call that will *not* be called until the
> monadic value is run. That means that the system and target bindings
> afterwards are *not* looked up at call time but at monadic run time!
This is actually what the comment above hints at, I misunderstood its
meaning. It seems that this piece of code used to be (before 2015)
--8<---------------cut here---------------start------------->8---
(mlet* %store-monad ( ;; The following binding forces '%current-system' and
;; '%current-target-system' to be looked up at >>=
;; time.
(unused (return #f)
(system -> (or system (%current-system)))
(target -> (if (eq? target 'current)
(%current-target-system)
target))
...)
...)
--8<---------------cut here---------------end--------------->8---
probably at a time when (current-system) didn't exist. In turn, this
means that gexp->derivation intentionally delays getting the current
system to monadic run time. Thus, we probably need to pass an optional
#:system argument to the hooks that they can forward to
gexp->derivation to fix this “properly”
> IMO, this is way too complicated to keep in mind at all times, and there
> are bugs lurking under the surface absolutely everywhere, waiting for a
> corner case to be uncovered.
My comment still stands.
Best,
--
Josselin Poiret
[signature.asc (application/pgp-signature, inline)]
This bug report was last modified 1 year and 204 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.