Subject: bug#21803: guitarix non-reproducible hard to reproduce

From: zimoun <[email-masked]>
Date: Fri, 15 Nov 2019 20:46:13 +0100

Dear,

Resume:
The command "guix build guitarix" downloads from ci.guix.gnu.org.
Then "guix build guitarix --no-grafts -K --check" rebuilds locally.
The two differ of one symlink.

--8<---------------cut here---------------start------------->8---
diff -r --no-dereference
/gnu/store/16g7l26rpwhza7fm5jm3lz1ycavky9yl-guitarix-0.38.1
/gnu/store/16g7l26rpwhza7fm5jm3lz1ycavky9yl-guitarix-0.38.1-check
File /gnu/store/16g7l26rpwhza7fm5jm3lz1ycavky9yl-guitarix-0.38.1/lib/libgxw.so
is a symbolic link while file
/gnu/store/16g7l26rpwhza7fm5jm3lz1ycavky9yl-guitarix-0.38.1-check/lib/libgxw.so
is a regular file
--8<---------------cut here---------------end--------------->8---

Inspect:

After more than 10 attempts to reproduce the behaviour where the plain
binary is replaced by the symlink, it never happens locally, so I
conclude that the bug is really hard to track. Kind of bad luck. :-)

My intuition is: the non-determinism comes from the WAF configuration
files (./waf or wscript or wafadmin/).

The process conditionally enters in functions such as "do_install" or
"symlink_as", so maybe something is hidden by Python module "os" or
similar. Moreover, note that wscript:l.990 "add_group()" is used after
"add_subdirs('libgxw/gxw')".

Basically, the output of "--check" is:

--8<---------------cut here---------------start------------->8---
[...]
* installing build/default/libgxw/gxw/libgxw.so as
/gnu/store/16g7l26rpwhza7fm5jm3lz1ycavky9yl-guitarix-0.38.1/lib/libgxw.so.0.1
* symlink /gnu/store/16g7l26rpwhza7fm5jm3lz1ycavky9yl-guitarix-0.38.1/lib/libgxw.so.0
(-> libgxw.so.0.1)
* symlink /gnu/store/16g7l26rpwhza7fm5jm3lz1ycavky9yl-guitarix-0.38.1/lib/libgxw.so
(-> libgxw.so.0.1)
* installing build/default/libgxw/gxw/libgxw.so as
/gnu/store/16g7l26rpwhza7fm5jm3lz1ycavky9yl-guitarix-0.38.1/lib/libgxw.so
* installing build/default/libgxwmm/gxwmm/libgxwmm.so as
/gnu/store/16g7l26rpwhza7fm5jm3lz1ycavky9yl-guitarix-0.38.1/lib/libgxwmm.so.0.1
[...]
--8<---------------cut here---------------end--------------->8---

Here the step (3rd *) "symlink
/gnu/store/...-guitarix-0.38.1/lib/libgxw.so (-> libgxw.so.0.1)" is
overridden by the next one "installing
build/default/libgxw/gxw/libgxw.so as
/gnu/store/...-guitarix-0.38.1/lib/libgxw.so".

Replaying with "guix environment guitarix" then from
"/tmp/guix-build-guitarix-0.38.1.drv-0", the classical "./waf
configure --prefix=install" and "./waf build" "./waf install". In this
case, one symlink is not done and the other one is overriden by the
next step.

--8<---------------cut here---------------start------------->8---
[...]
* installing build/default/libgxw/gxw/libgxw.so as
/tmp/guix-build-guitarix-0.38.1.drv-0/guitarix-0.38.1/install/lib/libgxw.so.0.1
* symlink /tmp/guix-build-guitarix-0.38.1.drv-0/guitarix-0.38.1/install/lib/libgxw.so
(-> libgxw.so.0.1)
* installing build/default/libgxw/gxw/libgxw.so as
/tmp/guix-build-guitarix-0.38.1.drv-0/guitarix-0.38.1/install/lib/libgxw.so
* installing build/default/libgxwmm/gxwmm/libgxwmm.so as
/tmp/guix-build-guitarix-0.38.1.drv-0/guitarix-0.38.1/install/lib/libgxwmm.so.0.1
[...]
--8<---------------cut here---------------end--------------->8---

Interestingly, the 3 last-last evaluations by Cuirass is of the kind "--check".

https://ci.guix.gnu.org/build/1818089/details
https://ci.guix.gnu.org/build/1871705/details
https://ci.guix.gnu.org/build/1903552/details

Therefore, if we were comparing on November 3rd, we would conclude
differently. ;-)

However, the last evaluation is creating the symlink without overriding it.

https://ci.guix.gnu.org/build/1920646/details

--8<---------------cut here---------------start------------->8---
[...]
* installing build/default/libgxw/gxw/libgxw.so as
/gnu/store/16g7l26rpwhza7fm5jm3lz1ycavky9yl-guitarix-0.38.1/lib/libgxw.so.0.1
* symlink /gnu/store/16g7l26rpwhza7fm5jm3lz1ycavky9yl-guitarix-0.38.1/lib/libgxw.so.0
(-> libgxw.so.0.1)
* symlink /gnu/store/16g7l26rpwhza7fm5jm3lz1ycavky9yl-guitarix-0.38.1/lib/libgxw.so
(-> libgxw.so.0.1)
* installing build/default/libgxwmm/gxwmm/libgxwmm.so as
/gnu/store/16g7l26rpwhza7fm5jm3lz1ycavky9yl-guitarix-0.38.1/lib/libgxwmm.so.0.1
[...]
--8<---------------cut here---------------end--------------->8---

Well, even this bug is annoying speaking about reproducibility --
because it it not the *exact* same installation -- it is mitigated by
the fact that the same binary is symlinked or not. I will revisit this
bug when WAF will fully use Python 3.

All the best,
simon