Test failure in tests/packages.scm after merging master into core-updates

  • Done
  • quality assurance status badge
Details
2 participants
  • Ludovic Courtès
  • Marius Bakke
Owner
unassigned
Submitted by
Marius Bakke
Severity
normal
Merged with
M
M
Marius Bakke wrote on 7 Apr 2020 13:31
(address . bug-guix@gnu.org)
87ftdfo7lf.fsf@devup.no
On the current "core-updates" branch (commit
a533c5a1835cbeafaf595c4474e2ce6adde7de8d), one test starts to fail if
commits 190ddfe21e3d87719733d12fb9b5eb176125a49f and
a187cc562890895ad41dfad00eb1d5c4a4b00936 are applied:

Toggle snippet (19 lines)
test-name: package-transitive-supported-systems, implicit inputs
location: tests/packages.scm:362
source:
+ (test-equal
+ "package-transitive-supported-systems, implicit inputs"
+ %supported-systems
+ (let ((p (dummy-package
+ "foo"
+ (build-system gnu-build-system)
+ (supported-systems
+ `("does-not-exist" "foobar" ,@%supported-systems)))))
+ (parameterize
+ ((%current-system "armhf-linux"))
+ (package-transitive-supported-systems p))))
expected-value: ("x86_64-linux" "i686-linux" "armhf-linux" "aarch64-linux" "mips64el-linux" "i586-gnu")
actual-value: ("x86_64-linux" "i686-linux")
result: FAIL

After some trial and error I found that simply removing the test added
by commit a187cc562890895ad41dfad00eb1d5c4a4b00936 will make the above
test pass!

Moving the test further down the file (after the one above) will _also_
succeed. Apparently there is some side effect caused by running the new
test that leaks into the test mentioned above.

For completeness, here is the new test that makes the above fail.

Toggle snippet (38 lines)
test-name: transaction-upgrade-entry, grafts
location: tests/packages.scm:151
source:
+ (test-assert
+ "transaction-upgrade-entry, grafts"
+ (with-build-handler
+ (const 'failed!)
+ (parameterize
+ ((%graft? #t))
+ (let* ((old (dummy-package "foo" (version "1")))
+ (bar (dummy-package
+ "bar"
+ (version "0")
+ (replacement old)))
+ (new (dummy-package
+ "foo"
+ (version "1")
+ (inputs `(("bar" ,bar)))))
+ (tx (mock ((gnu packages)
+ find-best-packages-by-name
+ (const (list new)))
+ (transaction-upgrade-entry
+ %store
+ (manifest-entry
+ (inherit (package->manifest-entry old))
+ (item (string-append
+ (%store-prefix)
+ "/"
+ (make-string 32 #\e)
+ "-foo-1")))
+ (manifest-transaction)))))
+ (and (match (manifest-transaction-install tx)
+ ((($ <manifest-entry> "foo" "1" "out" item))
+ (eq? item new)))
+ (null? (manifest-transaction-remove tx)))))))
actual-value: #t
result: PASS
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCgAdFiEEu7At3yzq9qgNHeZDoqBt8qM6VPoFAl6MZIwACgkQoqBt8qM6
VPppswgAkO0w+VlKLDhsNDuGoGvhJyxLXj3uNiu+Aa/MPmUZ4JVfn7KR6A6GE78k
IqRl6iI4bqEPq7R/2sKAm7hEiGvVW29IuqqJrO6u0hTeRU4tmjnTRl132HoXw6jr
nRXVyFwHLxDOrmME2f8IaPOc0Lne0UWDJR/bYs9E4gobr6s5RMyKBi9R+ECULQvK
kGpnbOSgBHm9/2l+zCX6DUS2yn1+nJcH51rk4hhF9S8gz0mnDmQhDErkl5AB8oeM
2qAdUy/4wtmjgpggzv1ACe4rmaDtOxFTr95gNzL0mkerb16OWutu1ymee3VQyKjr
Np1BZse+9p3xpq7DPjyDcV2CtytFLw==
=P/+/
-----END PGP SIGNATURE-----

M
M
Marius Bakke wrote on 10 Apr 2020 14:35
(address . control@debbugs.gnu.org)
878sj3jz7k.fsf@devup.no
merge 40535 40482
thanks
L
L
Ludovic Courtès wrote on 11 Apr 2020 00:36
(name . Marius Bakke)(address . mbakke@fastmail.com)(address . 40482-done@debbugs.gnu.org)
87imi7ufxr.fsf@gnu.org
Hello,

Marius Bakke <mbakke@fastmail.com> skribis:

Toggle quote (28 lines)
> On the current "core-updates" branch (commit
> a533c5a1835cbeafaf595c4474e2ce6adde7de8d), one test starts to fail if
> commits 190ddfe21e3d87719733d12fb9b5eb176125a49f and
> a187cc562890895ad41dfad00eb1d5c4a4b00936 are applied:
>
> test-name: package-transitive-supported-systems, implicit inputs
> location: tests/packages.scm:362
> source:
> + (test-equal
> + "package-transitive-supported-systems, implicit inputs"
> + %supported-systems
> + (let ((p (dummy-package
> + "foo"
> + (build-system gnu-build-system)
> + (supported-systems
> + `("does-not-exist" "foobar" ,@%supported-systems)))))
> + (parameterize
> + ((%current-system "armhf-linux"))
> + (package-transitive-supported-systems p))))
> expected-value: ("x86_64-linux" "i686-linux" "armhf-linux" "aarch64-linux" "mips64el-linux" "i586-gnu")
> actual-value: ("x86_64-linux" "i686-linux")
> result: FAIL
>
>
> After some trial and error I found that simply removing the test added
> by commit a187cc562890895ad41dfad00eb1d5c4a4b00936 will make the above
> test pass!

This is fixed by e85d4cecbe253e59a8a2a42b6ce427d96ff10534.

This has to do with memoization of things that are actually
system-dependent. This is why you’d see this side effect: in one case,
the first thing memoized would be the armhf graph, in the other case it
would be the x86_64 one.

Concretely,

guix build coreutils -s x86_64-linux -s armhf-linux

would return the right derivation for x86_64 and a bogus one for armhf
(one that depends on Mes, Gash, etc.).

Thanks,
Ludo’.
Closed
?