GNU bug report logs - #48541
[PATCH] gnu: Fix build for ldc.

Previous Next

Package: guix-patches;

Reported by: Roel Janssen <roel <at> gnu.org>

Date: Thu, 20 May 2021 16:09:02 UTC

Severity: normal

Tags: patch

Done: Ludovic Courtès <ludo <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 48541 in the body.
You can then email your comments to 48541 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#48541; Package guix-patches. (Thu, 20 May 2021 16:09:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Roel Janssen <roel <at> gnu.org>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Thu, 20 May 2021 16:09:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Roel Janssen <roel <at> gnu.org>
To: guix-patches <at> gnu.org
Subject: [PATCH] gnu: Fix build for ldc.
Date: Thu, 20 May 2021 18:08:31 +0200
[Message part 1 (text/plain, inline)]
Dear Guix,

I looked into why our LDC package fails to build, and it seems that all 
tests that make use of "ptrace" fail because the build environment 
doesn't allow it.
So I disabled these tests by removing the relevant files, and completed 
a successful build.

If there is a way to provide the build environment with the ability to 
use ptrace, and if that is preferred to removing tests, then please let 
me know so I can prepare another patch.

Kind regards,
Roel Janssen


[0001-gnu-Fix-build-for-ldc.patch (text/x-patch, attachment)]

Information forwarded to guix-patches <at> gnu.org:
bug#48541; Package guix-patches. (Fri, 21 May 2021 10:10:01 GMT) Full text and rfc822 format available.

Message #8 received at 48541 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Roel Janssen <roel <at> gnu.org>
Cc: 48541 <at> debbugs.gnu.org
Subject: Re: bug#48541: [PATCH] gnu: Fix build for ldc.
Date: Fri, 21 May 2021 12:09:07 +0200
Hi Roel,

Roel Janssen <roel <at> gnu.org> skribis:

> I looked into why our LDC package fails to build, and it seems that
> all tests that make use of "ptrace" fail because the build environment 
> doesn't allow it.
> So I disabled these tests by removing the relevant files, and
> completed a successful build.
>
> If there is a way to provide the build environment with the ability to
> use ptrace, and if that is preferred to removing tests, then please
> let me know so I can prepare another patch.

The build environment doesn’t prevent the use of ptrace per se, AFAIK.
However, some systems may have /proc/sys/kernel/yama/ptrace_scope set to
1 (as a system-level setting), which prevents ptracing one’s own
processes, unless they’re a child.

I thought this could have been the reason but I see that ldc fails to
build on berlin, where ptrace_scope is 0 (it’s Guix System), so maybe
there’s something else.  Unfortunately the build log at
<https://ci.guix.gnu.org/build/290794/log/raw> doesn’t show anything.

Do you have more info about these failures?

>>From 191aa4cc2f131453d9ffc902d72dbe16307aa0c0 Mon Sep 17 00:00:00 2001
> From: Roel Janssen <roel <at> gnu.org>
> Date: Thu, 20 May 2021 18:04:05 +0200
> Subject: [PATCH] gnu: Fix build for ldc.
>
> * gnu/packages/dlang.scm (ldc): Disable tests that use ptrace.
> ---
>  gnu/packages/dlang.scm | 10 ++++++++++
>  1 file changed, 10 insertions(+)
>
> diff --git a/gnu/packages/dlang.scm b/gnu/packages/dlang.scm
> index da3b818c26..33be779ba3 100644
> --- a/gnu/packages/dlang.scm
> +++ b/gnu/packages/dlang.scm
> @@ -240,6 +240,16 @@ bootstrapping more recent compilers written in D.")
>                 (delete-file "tests/compilable/ctfe_math.d")
>                 (delete-file "tests/debuginfo/nested_gdb.d")
>                 (delete-file "tests/debuginfo/classtypes_gdb.d")
> +               ;; the following tests need special permissions for ptrace:
> +               (delete-file "tests/d2/dmd-testsuite/runnable/b18504.d")
> +               (delete-file "tests/d2/dmd-testsuite/runnable/gdb14225.d")
> +               (delete-file "tests/d2/dmd-testsuite/runnable/gdb14276.d")
> +               (delete-file "tests/d2/dmd-testsuite/runnable/gdb14313.d")
> +               (delete-file "tests/d2/dmd-testsuite/runnable/gdb14330.d")

In the interim, perhaps you can commit it with a link to this issue
and/or additional info about the problem?

Thanks,
Ludo’.




Information forwarded to guix-patches <at> gnu.org:
bug#48541; Package guix-patches. (Fri, 21 May 2021 10:25:02 GMT) Full text and rfc822 format available.

Message #11 received at 48541 <at> debbugs.gnu.org (full text, mbox):

From: Roel Janssen <roel <at> gnu.org>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 48541 <at> debbugs.gnu.org
Subject: Re: bug#48541: [PATCH] gnu: Fix build for ldc.
Date: Fri, 21 May 2021 12:24:00 +0200
[Message part 1 (text/plain, inline)]
Hi Ludo’,

Thank you for looking at the patch so quickly! :)

On Fri, 2021-05-21 at 12:09 +0200, Ludovic Courtès wrote:
> Hi Roel,
> 
> Roel Janssen <roel <at> gnu.org> skribis:
> 
> > I looked into why our LDC package fails to build, and it seems that
> > all tests that make use of "ptrace" fail because the build
> > environment 
> > doesn't allow it.
> > So I disabled these tests by removing the relevant files, and
> > completed a successful build.
> > 
> > If there is a way to provide the build environment with the ability
> > to
> > use ptrace, and if that is preferred to removing tests, then please
> > let me know so I can prepare another patch.
> 
> The build environment doesn’t prevent the use of ptrace per se, AFAIK.
> However, some systems may have /proc/sys/kernel/yama/ptrace_scope set
> to
> 1 (as a system-level setting), which prevents ptracing one’s own
> processes, unless they’re a child.
> 
> I thought this could have been the reason but I see that ldc fails to
> build on berlin, where ptrace_scope is 0 (it’s Guix System), so maybe
> there’s something else.  Unfortunately the build log at
> <https://ci.guix.gnu.org/build/290794/log/raw> doesn’t show anything.
> 
> Do you have more info about these failures?
> 

I attached the test suite's logs for the failed tests. The complete log
can be found in 'build/Testing/Temporary/LastTest.log' of the build
directory of a failed build.  It is too large to attach though.

The log shows the following:
------
Test runnable/b18504.d failed.  The logged output:
/tmp/guix-build-ldc-1.10.0.drv-0/build/bin/ldmd2 -conf= -m64 -Irunnable
-g -g -link-defaultlib-debug  -od../../../../build/dmd-testsuite-
debug/runnable -of../../../../build/dmd-testsuite-
debug/runnable/b18504_0  runnable/b18504.d 
gdb ../../../../build/dmd-testsuite-debug/runnable/b18504_0 --batch -x
../../../../build/dmd-testsuite-debug/runnable/b18504_0.gdb
warning: Could not trace the inferior process.
warning: ptrace: Operation not permitted
../../../../build/dmd-testsuite-debug/runnable/b18504_0.gdb:2: Error in
sourced command file:
During startup program exited with code 127.

------

> > > From 191aa4cc2f131453d9ffc902d72dbe16307aa0c0 Mon Sep 17 00:00:00
> > > 2001
> > From: Roel Janssen <roel <at> gnu.org>
> > Date: Thu, 20 May 2021 18:04:05 +0200
> > Subject: [PATCH] gnu: Fix build for ldc.
> > 
> > * gnu/packages/dlang.scm (ldc): Disable tests that use ptrace.
> > ---
> >  gnu/packages/dlang.scm | 10 ++++++++++
> >  1 file changed, 10 insertions(+)
> > 
> > diff --git a/gnu/packages/dlang.scm b/gnu/packages/dlang.scm
> > index da3b818c26..33be779ba3 100644
> > --- a/gnu/packages/dlang.scm
> > +++ b/gnu/packages/dlang.scm
> > @@ -240,6 +240,16 @@ bootstrapping more recent compilers written in
> > D.")
> >                 (delete-file "tests/compilable/ctfe_math.d")
> >                 (delete-file "tests/debuginfo/nested_gdb.d")
> >                 (delete-file "tests/debuginfo/classtypes_gdb.d")
> > +               ;; the following tests need special permissions for
> > ptrace:
> > +               (delete-file "tests/d2/dmd-
> > testsuite/runnable/b18504.d")
> > +               (delete-file "tests/d2/dmd-
> > testsuite/runnable/gdb14225.d")
> > +               (delete-file "tests/d2/dmd-
> > testsuite/runnable/gdb14276.d")
> > +               (delete-file "tests/d2/dmd-
> > testsuite/runnable/gdb14313.d")
> > +               (delete-file "tests/d2/dmd-
> > testsuite/runnable/gdb14330.d")
> 
> In the interim, perhaps you can commit it with a link to this issue
> and/or additional info about the problem?
> 

I'd like to resolve the build failure quickly indeed.  Perhaps we can
have one more look in the attached logs before I push a (wrong)
solution prematurely.

> Thanks,
> Ludo’.
> 

[LastTest-stripped.log (text/x-log, attachment)]

Information forwarded to guix-patches <at> gnu.org:
bug#48541; Package guix-patches. (Fri, 21 May 2021 14:58:02 GMT) Full text and rfc822 format available.

Message #14 received at 48541 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Roel Janssen <roel <at> gnu.org>
Cc: 48541 <at> debbugs.gnu.org
Subject: Re: bug#48541: [PATCH] gnu: Fix build for ldc.
Date: Fri, 21 May 2021 16:57:01 +0200
Hi!

Roel Janssen <roel <at> gnu.org> writes:

> I attached the test suite's logs for the failed tests. The complete log
> can be found in 'build/Testing/Temporary/LastTest.log' of the build
> directory of a failed build.  It is too large to attach though.
>
> The log shows the following:
> ------
> Test runnable/b18504.d failed.  The logged output:
> /tmp/guix-build-ldc-1.10.0.drv-0/build/bin/ldmd2 -conf= -m64 -Irunnable
> -g -g -link-defaultlib-debug  -od../../../../build/dmd-testsuite-
> debug/runnable -of../../../../build/dmd-testsuite-
> debug/runnable/b18504_0  runnable/b18504.d 
> gdb ../../../../build/dmd-testsuite-debug/runnable/b18504_0 --batch -x
> ../../../../build/dmd-testsuite-debug/runnable/b18504_0.gdb
> warning: Could not trace the inferior process.
> warning: ptrace: Operation not permitted
> ../../../../build/dmd-testsuite-debug/runnable/b18504_0.gdb:2: Error in
> sourced command file:
> During startup program exited with code 127.
>
> ------

Interesting.  Looking at ptrace(2), it’s not supposed to fail with EPERM
in the build environment, unless again that’s because of the Yama thing
I mentioned.  What’s the value of /proc/sys/kernel/yama/ptrace_scope on
your build machine?

So I’d say: adjust the comment with a link to
<https://issues.guix.gnu.org/48541>, saying that ptrace(2) fails with
EPERM, and push it.

We can always improve later if/when we find more info.

Thanks,
Ludo’.




Information forwarded to guix-patches <at> gnu.org:
bug#48541; Package guix-patches. (Fri, 21 May 2021 16:11:01 GMT) Full text and rfc822 format available.

Message #17 received at 48541 <at> debbugs.gnu.org (full text, mbox):

From: Roel Janssen <roel <at> gnu.org>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 48541 <at> debbugs.gnu.org
Subject: Re: bug#48541: [PATCH] gnu: Fix build for ldc.
Date: Fri, 21 May 2021 18:10:06 +0200
On Fri, 2021-05-21 at 16:57 +0200, Ludovic Courtès wrote:
> Hi!
> 
> Roel Janssen <roel <at> gnu.org> writes:
> 
> > I attached the test suite's logs for the failed tests. The complete
> > log
> > can be found in 'build/Testing/Temporary/LastTest.log' of the build
> > directory of a failed build.  It is too large to attach though.
> > 
> > The log shows the following:
> > ------
> > Test runnable/b18504.d failed.  The logged output:
> > /tmp/guix-build-ldc-1.10.0.drv-0/build/bin/ldmd2 -conf= -m64 -
> > Irunnable
> > -g -g -link-defaultlib-debug  -od../../../../build/dmd-testsuite-
> > debug/runnable -of../../../../build/dmd-testsuite-
> > debug/runnable/b18504_0  runnable/b18504.d 
> > gdb ../../../../build/dmd-testsuite-debug/runnable/b18504_0 --batch
> > -x
> > ../../../../build/dmd-testsuite-debug/runnable/b18504_0.gdb
> > warning: Could not trace the inferior process.
> > warning: ptrace: Operation not permitted
> > ../../../../build/dmd-testsuite-debug/runnable/b18504_0.gdb:2:
> > Error in
> > sourced command file:
> > During startup program exited with code 127.
> > 
> > ------
> 
> Interesting.  Looking at ptrace(2), it’s not supposed to fail with
> EPERM
> in the build environment, unless again that’s because of the Yama
> thing
> I mentioned.  What’s the value of /proc/sys/kernel/yama/ptrace_scope
> on
> your build machine?
> 

Interesting indeed.  Then I don't know why it fails.
It is set to 0 on my build machine.

> So I’d say: adjust the comment with a link to
> <https://issues.guix.gnu.org/48541>, saying that ptrace(2) fails with
> EPERM, and push it.
> 
> We can always improve later if/when we find more info.
> 

I adjusted the comment in the recipe, and pushed in
082988afac8ddac7525b40fb7ef8da7ff40f8ad3.
Thanks for the quick reviewing!

> 
> Thanks,
> Ludo’.
> 






bug closed, send any further explanations to 48541 <at> debbugs.gnu.org and Roel Janssen <roel <at> gnu.org> Request was from Ludovic Courtès <ludo <at> gnu.org> to control <at> debbugs.gnu.org. (Sat, 29 May 2021 18:20:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 27 Jun 2021 11:24:07 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 304 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.