From: Janneke Nieuwenhuizen <janneke@gnu.org>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: 63789@debbugs.gnu.org
Subject: bug#63789: Native compilation broken on the Hurd (with patch)
Date: Fri, 02 Jun 2023 07:27:07 +0200 [thread overview]
Message-ID: <87ttvqmo2c.fsf@gnu.org> (raw)
In-Reply-To: <87edmu97je.fsf@gnu.org> ("Ludovic Courtès"'s message of "Thu, 01 Jun 2023 23:50:13 +0200")
Ludovic Courtès writes:
Hello,
> Janneke Nieuwenhuizen <janneke@gnu.org> skribis:
>
[..]
>>
>> (snippet
>> #~(begin
>> ;; XXX: The GCC test suite contains files with non-ASCII file
>> ;; names, which cannot be repacked by BOOTSTRAP-ORIGIN. Nor
>> ;; can it be deleted from Guile, so resort to this evil hack.
>> #$(origin-snippet (package-source gcc))
>> (system* #$(file-append coreutils-boot0 "/bin/rm") "-rf"
>> "gcc/testsuite/go.test/test/fixedbugs/issue27836.dir"))))))
>>
>>
>> This is problematic, because coreutils-boot0 doesn't build for the Hurd:
>> coreutils needs hurd headers, and our hurd-headers-boot0 depends
>> on...coreutils-boot0.
>>
>> Why was coreutils-boot0 used instead of the canonical
>> delete-file-recursively?
>
> That was my first reaction too :-), but it’s explained in the comment:
> there are non-ASCII file names that Guile fails to decode (throwing a
> decoding error at that point.)
Ah, I missed that. Makes sense.
> Seeing is believing so I had to try:
>
> applying '/gnu/store/5705r4ajxl8lav1hz9xm19w75zdcz1n2-gcc-5.0-libvtv-runpath.patch'...
> applying '/gnu/store/c2f49hzb4scsqaccfr8vf74f06z0yvp1-gcc-10-tree-sra-union-handling.patch'...
> find-files: gcc-11.3.0/gcc/testsuite/go.test/test/fixedbugs/issue27836.dir/Äfoo.go: No such file or directory
> Backtrace:
Ooh...
> When decoded as UTF-8, those file names look like this:
>
> $ export LC_ALL=en_US.UTF-8
> -rw-r--r-- rguenther/users 192 2022-04-21 07:58 gcc-11.3.0/gcc/testsuite/go.test/test/fixedbugs/issue27836.dir/Äfoo.go
> -rw-r--r-- rguenther/users 203 2022-04-21 07:58 gcc-11.3.0/gcc/testsuite/go.test/test/fixedbugs/issue27836.dir/Ämain.go
...interesting!
>> So, until we can correct the gcc-boot0 snippet problem in the next
>> rebuild cycle (how does that work now that we don't have core-updates
>> anymore?, I made coreutils-boot0 build on the Hurd. See the patch
>> below.
>
> Re “how does that work?”, good question! :-)
:-)
> We should get rid of that hack though.
[..]
>> * gnu/packages/commencement.scm (coreutils-boot0)[arguments]: When building
>> for the hurd, add new phase 'add-hurd_types.h' and use it. Add
>> "ac_cv_member_struct_stat_st_author=no" and -Wl,-rpath for %bootstrap-libc to
>> configure flags when building for the Hurd. Add make-flags with
>> "IGNORE_UNUSED_LIBRARIES_CFLAGS=" to avoid -Wl,--as-needed, which undoes
>> previous rpath option.
[..]
> Neat! This is probably okay but I wonder if we can either shrink this
> patch or use a different strategy.
>
> I tried a few things; I thought we could get ‘coreutils-boot0’ to build
> nothing but ‘rm’ (since the build failure the patch above works around
> is in ‘src/copy.c’), but my attempt below doesn’t work: it insists on
> building other things, including ‘src/copy.c’. I ran out of time but I
> think it should be possible to make it work.
Nice idea!
> Even better would have been ‘--enable-no-install-program=cp’ but
> ‘src/copy.c’ is still getting built.
>
> (Time passes…)
Hm...
> Just as I was about to give up, I looked at:
>
> guix graph -e '(@@ (gnu packages commencement) guile-final)' -s i586-gnu -M3 |xdot -
>
> and found the solution:
>
> diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm
> index 78cfa4acd0..de3728ae26 100644
> --- a/gnu/packages/commencement.scm
> +++ b/gnu/packages/commencement.scm
> @@ -2333,7 +2333,13 @@ (define gcc-boot0
> ;; names, which cannot be repacked by BOOTSTRAP-ORIGIN. Nor
> ;; can it be deleted from Guile, so resort to this evil hack.
> #$(origin-snippet (package-source gcc))
> - (system* #$(file-append coreutils-boot0 "/bin/rm") "-rf"
> + (system* #$(file-append (let-system system
> + ;; Work around
> + ;; <https://issues.guix.gnu.org/63789>.
> + (if (target-hurd? system)
> + %bootstrap-coreutils&co
> + coreutils-boot0))
> + "/bin/rm") "-rf"
> "gcc/testsuite/go.test/test/fixedbugs/issue27836.dir"))))))
> (arguments
> (cons*
> How does that sound? :-)
That's great, thanks! Using this now on my current wip-hurd and it's
working for me!
Greetings,
Janneke
> diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm
> index 78cfa4acd0..17745705f7 100644
Some nice tricks here, thanks for sharing!
--
Janneke Nieuwenhuizen <janneke@gnu.org> | GNU LilyPond https://LilyPond.org
Freelance IT https://www.JoyOfSource.com | Avatar® https://AvatarAcademy.com
next prev parent reply other threads:[~2023-06-02 5:28 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-29 16:46 bug#63789: Native compilation broken on the Hurd (with patch) Janneke Nieuwenhuizen
2023-06-01 21:50 ` Ludovic Courtès
2023-06-02 5:27 ` Janneke Nieuwenhuizen [this message]
2023-06-02 15:26 ` Ludovic Courtès
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87ttvqmo2c.fsf@gnu.org \
--to=janneke@gnu.org \
--cc=63789@debbugs.gnu.org \
--cc=ludo@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).