guix-environment-container.sh test fails when building guix on tmpfs

  • Done
  • quality assurance status badge
Details
2 participants
  • Ting-Wei Lan
  • Ludovic Courtès
Owner
unassigned
Submitted by
Ting-Wei Lan
Severity
normal
T
T
Ting-Wei Lan wrote on 24 Nov 2015 16:57
(address . bug-guix@gnu.org)
1448380659.15506.20.camel@gmail.com
This problem happens on both guix 0.9.0 and master branch.

$tmpdir/mounts can be empty when running tests on tmpfs because
$mount_test_code ignores tmpfs. (`wc -l $tmpdir/mounts` is 0)
L
L
Ludovic Courtès wrote on 31 Jul 2016 18:54
(name . Ting-Wei Lan)(address . lantw44@gmail.com)(address . 22004-done@debbugs.gnu.org)
87mvkx4uju.fsf@gnu.org
Hello,

Ting-Wei Lan <lantw44@gmail.com> skribis:

Toggle quote (5 lines)
> This problem happens on both guix 0.9.0 and master branch.
>
> $tmpdir/mounts can be empty when running tests on tmpfs because
> $mount_test_code ignores tmpfs. (`wc -l $tmpdir/mounts` is 0)

Indeed; I believe commit 1250034d5aff14fe236aad9900233a2b6f8563bb fixes
it.

Sorry for not coming back to you earlier! Somehow this report didn’t
show up on our radar.

Thank you!

Ludo’.
Closed
T
T
Ting-Wei Lan wrote on 1 Aug 2016 06:43
bug#22004: guix-environment-container.sh test fails when building guix on tmpfs
(address . 22004@debbugs.gnu.org)
1470026589.19967.3.camel@gmail.com
I ran the test on core-updates branch, but it still failed.

Output in tests/guix-environment-container.log:

+ cat t-guix-environment-31068/mounts
/path/to/a/tmpfs/mountpoint/guix-build
++ wc -l
+ test 1 -eq 4
L
L
Ludovic Courtès wrote on 1 Aug 2016 15:13
(name . Ting-Wei Lan)(address . lantw44@gmail.com)(address . 22004@debbugs.gnu.org)
871t28skc6.fsf@gnu.org
Hi,

Ting-Wei Lan <lantw44@gmail.com> skribis:

Toggle quote (9 lines)
> I ran the test on core-updates branch, but it still failed.
>
> Output in tests/guix-environment-container.log:
>
> + cat t-guix-environment-31068/mounts
> /path/to/a/tmpfs/mountpoint/guix-build
> ++ wc -l
> + test 1 -eq 4

I’m at loss; on my machine I see:

Toggle snippet (7 lines)
+ cat t-guix-environment-18663/mounts
/home/ludo/src/guix
/home/ludo/src/guix/test-tmp/store/h0sb9ww7hzqcfnyiar5102amdzxm5hvy-bash
/home/ludo/src/guix/test-tmp/store/p7j32xzhdkd1h13d8kh1qw3jq7vbdbkp-guile-bootstrap-2.0
/home/ludo/src/guix/test-tmp/store/vqrqdk62gjyca4isl7qq5d0zxanwl5va-profile

Any idea what happens to the 3
/path/to/a/tmpfs/mountpoint/guix-build/test-tmp entries on your system?

Thanks,
Ludo’.
T
T
Ting-Wei Lan wrote on 24 Aug 2016 10:39
(name . Ludovic Courtès)(address . ludo@gnu.org)(address . 22004@debbugs.gnu.org)
1472027940.26857.5.camel@gmail.com
? ???2016-08-01 ? 15:13 +0200?Ludovic Courtès ???
Toggle quote (31 lines)
> Hi,
>
> Ting-Wei Lan <lantw44@gmail.com> skribis:
>
> >
> > I ran the test on core-updates branch, but it still failed.
> >
> > Output in tests/guix-environment-container.log:
> >
> > + cat t-guix-environment-31068/mounts
> > /path/to/a/tmpfs/mountpoint/guix-build
> > ++ wc -l
> > + test 1 -eq 4
>
> I’m at loss; on my machine I see:
>
> --8<---------------cut here---------------start------------->8---
> + cat t-guix-environment-18663/mounts
> /home/ludo/src/guix
> /home/ludo/src/guix/test-tmp/store/h0sb9ww7hzqcfnyiar5102amdzxm5hvy-
> bash
> /home/ludo/src/guix/test-tmp/store/p7j32xzhdkd1h13d8kh1qw3jq7vbdbkp-
> guile-bootstrap-2.0
> /home/ludo/src/guix/test-tmp/store/vqrqdk62gjyca4isl7qq5d0zxanwl5va-
> profile
> --8<---------------cut here---------------end--------------->8---
>
> Any idea what happens to the 3
> /path/to/a/tmpfs/mountpoint/guix-build/test-tmp entries on your
> system?

They are on tmpfs and the order of the two arguments of 'string-
prefix?' function seems to be wrong, so these 3 entries are ignored.

A simple fix:

Toggle diff (19 lines)
diff --git a/tests/guix-environment-container.sh b/tests/guix-environment-container.sh
index 12da950..d7c1b70 100644
--- a/tests/guix-environment-container.sh
+++ b/tests/guix-environment-container.sh
@@ -72,7 +72,7 @@ mount_test_code="
                   ;; correspond to a parent file system.
                   ((_ mount (or \"tmpfs\" \"proc\" \"sysfs\" \"devtmpfs\"
                                 \"devpts\" \"cgroup\" \"mqueue\") _ _ _)
-                   (and (string-prefix? mount (getcwd))
+                   (and (string-prefix? (getcwd) mount)
          mount))
                   ((_ mount _ _ _ _)
                    mount)))

After changing the order, guix-environment-container.sh passes.

>
> Thanks,
> Ludo’.
L
L
Ludovic Courtès wrote on 28 Aug 2016 16:05
(name . Ting-Wei Lan)(address . lantw44@gmail.com)(address . 22004-done@debbugs.gnu.org)
87oa4d2dle.fsf@gnu.org
Ting-Wei Lan <lantw44@gmail.com> skribis:
Toggle quote (20 lines)
> They are on tmpfs and the order of the two arguments of 'string-
> prefix?' function seems to be wrong, so these 3 entries are ignored.
>
> A simple fix:
>
> diff --git a/tests/guix-environment-container.sh b/tests/guix-environment-container.sh
> index 12da950..d7c1b70 100644
> --- a/tests/guix-environment-container.sh
> +++ b/tests/guix-environment-container.sh
> @@ -72,7 +72,7 @@ mount_test_code="
>                    ;; correspond to a parent file system.
>                    ((_ mount (or \"tmpfs\" \"proc\" \"sysfs\" \"devtmpfs\"
>                                  \"devpts\" \"cgroup\" \"mqueue\") _ _ _)
> -                   (and (string-prefix? mount (getcwd))
> +                   (and (string-prefix? (getcwd) mount)
>           mount))
>                    ((_ mount _ _ _ _)
>                     mount)))
>
> After changing the order, guix-environment-container.sh passes.
Good catch! Applied, thanks!
Ludo’.
Closed
?