From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id cEGSJd8SeWSMzAAASxT56A (envelope-from ) for ; Thu, 01 Jun 2023 23:51:27 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id 6BSxJN8SeWQyLwAAG6o9tA (envelope-from ) for ; Thu, 01 Jun 2023 23:51:27 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 02E088B4B for ; Thu, 1 Jun 2023 23:51:27 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q4qCG-0004KR-NY; Thu, 01 Jun 2023 17:51:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q4qCE-00047W-SJ for bug-guix@gnu.org; Thu, 01 Jun 2023 17:51:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1q4qCE-0008L0-Jh for bug-guix@gnu.org; Thu, 01 Jun 2023 17:51:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1q4qCE-0004zM-CK for bug-guix@gnu.org; Thu, 01 Jun 2023 17:51:02 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#63789: Native compilation broken on the Hurd (with patch) Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Thu, 01 Jun 2023 21:51:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63789 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: Janneke Nieuwenhuizen Cc: 63789@debbugs.gnu.org Received: via spool by 63789-submit@debbugs.gnu.org id=B63789.168565623819142 (code B ref 63789); Thu, 01 Jun 2023 21:51:02 +0000 Received: (at 63789) by debbugs.gnu.org; 1 Jun 2023 21:50:38 +0000 Received: from localhost ([127.0.0.1]:38641 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q4qBp-0004yf-Qt for submit@debbugs.gnu.org; Thu, 01 Jun 2023 17:50:38 -0400 Received: from eggs.gnu.org ([209.51.188.92]:40428) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q4qBl-0004y9-7r for 63789@debbugs.gnu.org; Thu, 01 Jun 2023 17:50:36 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q4qBe-00087G-31; Thu, 01 Jun 2023 17:50:26 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=ObJ68l/LiAZdGH4PoQugd22YRH+pQDHOe8xNZfbmysA=; b=J4GYENJ0RdlZxR+A0/Tj 41zCGMDBCpY+JVXwsVE03DB+sfw1VF/Uu49sblBy22LsDbUVELSSJDPiz5wc1QitAQUnxkkJZw7qm 67aqIsgYwuu1Lvf3OZ+rmFKUP8NeIY5d+dWlZ3Git3IGTFcJ1A94tmJsoglyqI+rLnJmpN3KZ++3E 8hB+naiXEF4/cbBpR2eQUzdTZWZAsjy23IQIFKJPU9FeoPkWJ/zhnwqCbmWINH6jFjN3G8U+029bT bzlJUHONwxkPVMqIjw+d0aZhCya0AE9UECutePrdaHGhTBuaMCeXpo/5pzZn9v0yfEP68m7w62znB iul4WEqAoU7kKA==; Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q4qBT-0005wx-Ij; Thu, 01 Jun 2023 17:50:25 -0400 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <87edmzozko.fsf@gnu.org> Date: Thu, 01 Jun 2023 23:50:13 +0200 In-Reply-To: <87edmzozko.fsf@gnu.org> (Janneke Nieuwenhuizen's message of "Mon, 29 May 2023 18:46:31 +0200") Message-ID: <87edmu97je.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: bug-guix-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN ARC-Seal: i=1; s=key1; d=yhetil.org; t=1685656287; a=rsa-sha256; cv=none; b=CWygK5c47+mo731d/frxGND47Tmp+dUyArsxTCs1Je3giE+fAQFzNVE8zYKELxmpMY8zK8 Hw+0rIOdPyy2Dl72S95pQO6I+3TxTKn2Ux7pXlELjdzAxBViTRd+OPFTa9cdtpAlTMPuBb NghEEV4jn/aewn/idDouugCDQ+8oG7k4tiAeLK4ptGxffhk3FQtUmVDqVpfFirvMuKdZyJ qFLwYp8ErwOuV88W/ysMTwyLt4XjpZ0PXZqUNbuDHbOxPrYbKV7wT4sqDZutr4sTWef6+S uMmpAmsocXnx6lLkoZzcawzdKDG90ZqA32PsnN9aMAP5fKo8AxEPMKvvY6Vibw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=J4GYENJ0; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1685656287; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:resent-cc:resent-from:resent-sender: resent-message-id:in-reply-to:in-reply-to:references:references: list-id:list-help:list-unsubscribe:list-subscribe:list-post: dkim-signature; bh=ObJ68l/LiAZdGH4PoQugd22YRH+pQDHOe8xNZfbmysA=; b=OJ3XQvvdEFtk/PjUBhXV4bXvF4sg96Ifg4s4DT46JcTPwZ5LkzLmzJyQKKdQ+qROsJyAu0 EKlQLHXBXt7O3db38MArZzZA2zXDSdnB1Ru+G1YBXno4huBXcompJ/7CfylvZZ6uDhTyj3 bVT/xuV7JFMx2KTsd3BtMj1p92gaVm8SosBxUnvBu2UrnejdDJKTrdegqkj7Z3YvHpSOPH l2xyx+ed7OeZqR1oYEOq85UpwnmB1SKKZ+uAGLK2gEYRXYhD19GGwRxdv7YvIDIzkFCN/G 2CxYgAfKBznsG16bV+UKFjSKxSXmz7B8477zak6VhlMi1RV1I1IuCvW5gB/qiw== Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=J4GYENJ0; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org" X-Migadu-Scanner: scn0.migadu.com X-Migadu-Spam-Score: -4.37 X-Spam-Score: -4.37 X-Migadu-Queue-Id: 02E088B4B X-TUID: ul0sOJNi2snA --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hello! Janneke Nieuwenhuizen skribis: > The commit > > 56759d30d9a817a9c9221c9468a4c4a59c9a4713 > gnu: Switch to GCC 11. > > introduced a gratuitous dependency on coreutils-boot0 to gcc-boot0 by > adding this atypical snippet > > (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.di= r")))))) > > > 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=E2=80=99s explained in the comme= nt: there are non-ASCII file names that Guile fails to decode (throwing a decoding error at that point.) Seeing is believing so I had to try: --8<---------------cut here---------------start------------->8--- applying '/gnu/store/5705r4ajxl8lav1hz9xm19w75zdcz1n2-gcc-5.0-libvtv-runpat= h.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/= =C3=84foo.go: No such file or directory Backtrace: In srfi/srfi-1.scm: 465: 19 [fold # ...] In ice-9/ftw.scm: 452: 18 [# # #] 450: 17 [loop "gcc" "gcc-11.3.0" ...] In srfi/srfi-1.scm: 465: 16 [fold # ...] In ice-9/ftw.scm: 452: 15 [# # #] 450: 14 [loop "testsuite" "gcc-11.3.0/gcc" ...] In srfi/srfi-1.scm: 465: 13 [fold # ...] In ice-9/ftw.scm: 452: 12 [# # #] 450: 11 [loop "go.test" "gcc-11.3.0/gcc/testsuite" ...] In srfi/srfi-1.scm: 465: 10 [fold # ...] In ice-9/ftw.scm: 452: 9 [# # #] 450: 8 [loop "test" "gcc-11.3.0/gcc/testsuite/go.test" ...] In srfi/srfi-1.scm: 465: 7 [fold # ...] In ice-9/ftw.scm: 452: 6 [# # #] 450: 5 [loop "fixedbugs" "gcc-11.3.0/gcc/testsuite/go.test/test" ...] In srfi/srfi-1.scm: 465: 4 [fold # ...] In ice-9/ftw.scm: 452: 3 [# # #] 474: 2 [loop "issue27836.dir" ...] In guix/build/utils.scm: 559: 1 [# "gcc-11.3.0/gcc/testsuite/go.test/test/fixedbugs/issue27836.dir/= =C3=84foo.go" ...] In unknown file: ?: 0 [scm-error misc-error #f "~A" ("find-files failed") #f] ERROR: In procedure scm-error: ERROR: find-files failed builder for `/gnu/store/p2wypjic1f26w2gk6dihn3inzfv426i4-gcc-11.3.0.tar.xz.= drv' failed with exit code 1 --8<---------------cut here---------------end--------------->8--- When decoded as UTF-8, those file names look like this: --8<---------------cut here---------------start------------->8--- $ export LC_ALL=3Den_US.UTF-8 $ tar tvf $(guix build "/gnu/store/pfc1094f3vdc74a6pls7b54m949y5gff-gcc-11.= 3.0.tar.xz.drv") |grep issue27836 -rw-r--r-- rguenther/users 191 2022-04-21 07:58 gcc-11.3.0/gcc/testsuit= e/go.test/test/fixedbugs/issue27836.go drwxr-xr-x rguenther/users 0 2022-04-21 07:58 gcc-11.3.0/gcc/testsuit= e/go.test/test/fixedbugs/issue27836.dir/ -rw-r--r-- rguenther/users 192 2022-04-21 07:58 gcc-11.3.0/gcc/testsuit= e/go.test/test/fixedbugs/issue27836.dir/=C3=84foo.go -rw-r--r-- rguenther/users 203 2022-04-21 07:58 gcc-11.3.0/gcc/testsuit= e/go.test/test/fixedbugs/issue27836.dir/=C3=84main.go --8<---------------cut here---------------end--------------->8--- > 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 =E2=80=9Chow does that work?=E2=80=9D, good question! :-) We should get rid of that hack though. >>>From 37f38eb35fff505da9bfad8cb1f5f250378f7648 Mon Sep 17 00:00:00 2001 > Message-Id: <37f38eb35fff505da9bfad8cb1f5f250378f7648.1685370023.git.jann= eke@gnu.org> > From: Janneke Nieuwenhuizen > Date: Mon, 29 May 2023 10:34:42 +0200 > Subject: [PATCH] gnu: commencement: coreutils-boot0: Fix native build for= the > Hurd. > > * gnu/packages/patches/coreutils-boot0-hurd_types.patch: New file. > * gnu/local.mk (dist_patch_DATA): Add it. > * gnu/packages/commencement.scm (coreutils-boot0)[arguments]: When buildi= ng > for the hurd, add new phase 'add-hurd_types.h' and use it. Add > "ac_cv_member_struct_stat_st_author=3Dno" and -Wl,-rpath for %bootstrap-l= ibc to > configure flags when building for the Hurd. Add make-flags with > "IGNORE_UNUSED_LIBRARIES_CFLAGS=3D" to avoid -Wl,--as-needed, which undoes > previous rpath option. > --- > gnu/local.mk | 1 + > gnu/packages/commencement.scm | 56 +++++++++---- > .../patches/coreutils-boot0-hurd_types.patch | 82 +++++++++++++++++++ > 3 files changed, 122 insertions(+), 17 deletions(-) > create mode 100644 gnu/packages/patches/coreutils-boot0-hurd_types.patch 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 =E2=80=98coreutils-boot0=E2=80= =99 to build nothing but =E2=80=98rm=E2=80=99 (since the build failure the patch above w= orks around is in =E2=80=98src/copy.c=E2=80=99), but my attempt below doesn=E2=80=99t w= ork: it insists on building other things, including =E2=80=98src/copy.c=E2=80=99. I ran out o= f time but I think it should be possible to make it work. Even better would have been =E2=80=98--enable-no-install-program=3Dcp=E2=80= =99 but =E2=80=98src/copy.c=E2=80=99 is still getting built. (Time passes=E2=80=A6) 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: --=-=-= Content-Type: text/x-patch Content-Disposition: inline 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 + ;; . + (if (target-hurd? system) + %bootstrap-coreutils&co + coreutils-boot0)) + "/bin/rm") "-rf" "gcc/testsuite/go.test/test/fixedbugs/issue27836.dir")))))) (arguments (cons* --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable How does that sound? :-) Ludo=E2=80=99. --=-=-= Content-Type: text/x-patch Content-Disposition: inline diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm index 78cfa4acd0..17745705f7 100644 --- a/gnu/packages/commencement.scm +++ b/gnu/packages/commencement.scm @@ -1997,24 +1997,41 @@ (define coreutils-boot0 `(("make" ,gnu-make-boot0) ,@(%bootstrap-inputs+toolchain))) (arguments - `(#:tests? #f - #:implicit-inputs? #f - #:guile ,%bootstrap-guile - ,@(package-arguments coreutils) - ;; The %bootstrap-glibc for aarch64 and armhf doesn't have - ;; $output/include/linux/prctl.h which causes some binaries - ;; to fail to build with coreutils-9.0+. - ,@(if (target-arm?) - `(#:configure-flags '(,(string-append - "--enable-no-install-program=" - ;; the defaults to not install. - "arch,coreutils,hostname" - ;; fails due to missing headers. - ",timeout,sort") - ,@(if (target-arm32?) - `("--disable-year2038") - `()))) - '()))))) + (substitute-keyword-arguments (package-arguments coreutils) + ((#:tests? _ #t) + #f) + ((#:implicit-inputs? _ #t) + #f) + ((#:guile _ #f) + %bootstrap-guile) + ((#:configure-flags flags ''()) + ;; The %bootstrap-glibc for aarch64 and armhf doesn't have + ;; $output/include/linux/prctl.h which causes some binaries + ;; to fail to build with coreutils-9.0+. + (if (target-arm?) + `'(,(string-append "--enable-no-install-program=" + ;; the defaults to not install. + "arch,coreutils,hostname" + ;; fails due to missing headers. + ",timeout,sort") + ,@(if (target-arm32?) + `("--disable-year2038") + `())) + ''())) + ((#:phases phases '%standard-phases) + (if (target-hurd?) + `(modify-phases ,phases + (add-after 'unpack 'build-nothing-but-rm + ;; XXX: Normally we wouldn't depend on coreutils-boot0 for + ;; GNU/Hurd; unfortunately, it is used for the gcc-boot0 + ;; snippet below. Since the snippet needs nothing but 'rm', + ;; build just that (thus avoiding build errors in other + ;; programs). + (lambda _ + (substitute* "Makefile.in" + (("^bin_PROGRAMS = .*") + "bin_PROGRAMS = src/rm\n"))))) + phases)))))) (define diffutils-boot0 (package diff --git a/guix/packages.scm b/guix/packages.scm index e26602d589..0802d863b1 100644 --- a/guix/packages.scm +++ b/guix/packages.scm @@ -944,6 +944,13 @@ (define* (patch-and-repack source patches (locales (lookup-input "locales")) (comp (and=> (compressor source-file-name) lookup-input)) (patches (map instantiate-patch patches))) + (define fail-on-error? + #t + #;(let-system (system target) + (pk 'fail? system (->bool (or locales + target + (not (string-prefix? "-gnu" system))))))) + (define build (with-imported-modules '((guix build utils)) #~(begin @@ -986,7 +993,7 @@ (define* (patch-and-repack source patches (format port "~a~%" name)) (find-files directory #:directories? #t - #:fail-on-error? #t))))) + #:fail-on-error? #$fail-on-error?))))) (apply invoke #+(file-append tar "/bin/tar") "cvfa" output --=-=-=--