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

Debbugs page

Ting-Wei Lan wrote 9 years ago
(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)
Ludovic Courtès wrote 9 years ago
(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
Ting-Wei Lan wrote 9 years ago
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
Ludovic Courtès wrote 9 years ago
(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’.
Ting-Wei Lan wrote 9 years ago
(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’.
Ludovic Courtès wrote 9 years ago
(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
?
Your comment

This issue is archived.

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

To respond to this issue using the mumi CLI, first switch to it
mumi current 22004
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
You may also tag this issue. See list of standard tags. For example, to set the confirmed and easy tags
mumi command -t +confirmed -t +easy
Or, remove the moreinfo tag and set the help tag
mumi command -t -moreinfo -t +help