unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
* bug#63789: Native compilation broken on the Hurd (with patch)
@ 2023-05-29 16:46 Janneke Nieuwenhuizen
  2023-06-01 21:50 ` Ludovic Courtès
  0 siblings, 1 reply; 4+ messages in thread
From: Janneke Nieuwenhuizen @ 2023-05-29 16:46 UTC (permalink / raw)
  To: 63789

[-- Attachment #1: Type: text/plain, Size: 3084 bytes --]

Hi!

The commit

    56759d30d9a817a9c9221c9468a4c4a59c9a4713
    gnu: Switch to GCC 11.

introduced a gratuitous dependency on coreutils-boot0 to gcc-boot0 by
adding this atypical snippet

--8<---------------cut here---------------start------------->8---
        (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"))))))
--8<---------------cut here---------------end--------------->8---

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?

Anyway, as a first attempt, I tried adding

--8<---------------cut here---------------start------------->8---
(define gcc-boot0/hurd
  ;; gcc-boot0 adds a dependency on coreutils-boot0, which does not build on
  ;; the Hurd.  Move this origin definition to gcc-boot0 and remove
  ;; gcc-boot0/hurd in the next rebuild cycle.
  (package
    (inherit gcc-boot0)
    (source
     (bootstrap-origin
      (origin
        (inherit (package-source gcc))
        (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))
             (delete-file-recursively
              "gcc/testsuite/go.test/test/fixedbugs/issue27836.dir"))))))))
--8<---------------cut here---------------end--------------->8---

and use that in %boot1-inputs...but as gcc-boot0 is used in more places
that doesn't really work.

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.

Using this patch, I've just succeeded to build gcc-boot0:

--8<---------------cut here---------------start------------->8---
root@guixydevel ~/src/guix/wip-hurd# ./pre-inst-env guix build -e '(@@ (gnu packages commencement) gcc-boot0)' --verbosity=1
The following derivation will be built:
  /gnu/store/669gwbfc96k5r8rv06d4cd10q7kpnkqn-gcc-cross-boot0-11.3.0.drv

building /gnu/store/669gwbfc96k5r8rv06d4cd10q7kpnkqn-gcc-cross-boot0-11.3.0.drv...
/gnu/store/3hl61ndnzqjrr07rywh2mfw58k81jchy-gcc-cross-boot0-11.3.0-lib
/gnu/store/wbdza27aq1mab8blvswvd0g28n5pk982-gcc-cross-boot0-11.3.0
--8<---------------cut here---------------end--------------->8---

but now `guix build hello' seems to hang, so it a circular dependency
might have been introduced somewhere.  What a mess...

WDYT?

Greetings,
Janneke


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-gnu-commencement-coreutils-boot0-Fix-native-build-fo.patch --]
[-- Type: text/x-patch, Size: 21957 bytes --]

From 37f38eb35fff505da9bfad8cb1f5f250378f7648 Mon Sep 17 00:00:00 2001
Message-Id: <37f38eb35fff505da9bfad8cb1f5f250378f7648.1685370023.git.janneke@gnu.org>
From: Janneke Nieuwenhuizen <janneke@gnu.org>
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 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.
---
 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

diff --git a/gnu/local.mk b/gnu/local.mk
index 44aa0ba69b..d86a6763b2 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1018,6 +1018,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/converseen-hide-updates-checks.patch	\
   %D%/packages/patches/converseen-hide-non-free-pointers.patch	\
   %D%/packages/patches/cool-retro-term-wctype.patch		\
+  %D%/packages/patches/coreutils-boot0-hurd_types.patch		\
   %D%/packages/patches/coreutils-gnulib-tests.patch		\
   %D%/packages/patches/coq-fix-envvars.patch			\
   %D%/packages/patches/cppcheck-disable-char-signedness-test.patch	\
diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm
index a24c60ebf8..eb1377c01c 100644
--- a/gnu/packages/commencement.scm
+++ b/gnu/packages/commencement.scm
@@ -1997,24 +1997,46 @@ (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?)
+     (cons*
+      #:tests? #f
+      #:implicit-inputs? #f
+      #:guile %bootstrap-guile
+      (append
+       (if (target-hurd?)
+           (substitute-keyword-arguments (package-arguments coreutils)
+             ((#:configure-flags flags)
+              `(cons* "ac_cv_member_struct_stat_st_author=no"
+                      (string-append
+                       "LDFLAGS=-Wl,-rpath -Wl,"
+                       (assoc-ref %build-inputs "libc")
+                       "/lib")
+                      ,flags))
+             ((#:make-flags flags)
+              ''("IGNORE_UNUSED_LIBRARIES_CFLAGS="))
+             ((#:phases phases)
+              #~(modify-phases #$phases
+                  (add-after 'unpack 'add-hurd_types.h
+                    (lambda _
+                      (let ((patch-file
+                             #$(local-file
+                                (search-patch
+                                 "coreutils-boot0-hurd_types.patch"))))
+                        (invoke "patch" "--force" "-p1" "-i" patch-file)))))))
+           (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")
-                                      `())))
-           '())))))
+                                   "--enable-no-install-program="
+                                   ;; the defaults to not install.
+                                   "arch,coreutils,hostname"
+                                   ;; fails due to missing headers.
+                                   ",timeout,sort")
+                                 ,@(if (target-arm32?)
+                                       '("--disable-year2038")
+                                       '())))
+           '()))))))
 
 (define diffutils-boot0
   (package
diff --git a/gnu/packages/patches/coreutils-boot0-hurd_types.patch b/gnu/packages/patches/coreutils-boot0-hurd_types.patch
new file mode 100644
index 0000000000..ec694b9e77
--- /dev/null
+++ b/gnu/packages/patches/coreutils-boot0-hurd_types.patch
@@ -0,0 +1,82 @@
+This adds a minimal excerpt from hurd/hurd_types.h as src/hurd/hurd_types.h to
+break a potential bootstrap cycle.  We cannot add hurd-headers-boot0 as an
+input, because hurd-headers-boot0 depends on coreutils-boot0.
+
+The proper fix would be to remove the coreutils-boot0 dependency from the
+gcc-boot0 origin snippet and use `delete-file-recursively' instead.
+
+From f5b58dc60422d3e3ce65fc3e073c1d6f8ba46cc2 Mon Sep 17 00:00:00 2001
+From: Janneke Nieuwenhuizen <janneke@gnu.org>
+Date: Mon, 29 May 2023 14:47:33 +0200
+Subject: [PATCH] src: Add src/hurd/hurd_types.h to break bootstrap cycle.
+
+* src/hurd/hurd_types.h: New file.
+---
+ src/hurd/hurd_types.h | 55 +++++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 55 insertions(+)
+ create mode 100644 src/hurd/hurd_types.h
+
+diff --git a/src/hurd/hurd_types.h b/src/hurd/hurd_types.h
+new file mode 100644
+index 000000000..2b3e2fcbc
+--- /dev/null
++++ b/src/hurd/hurd_types.h
+@@ -0,0 +1,55 @@
++/* C declarations for Hurd server interfaces
++
++   Copyright (C) 1993-1996, 1998, 1999, 2001, 2002, 2010, 2014-2019
++   Free Software Foundation, Inc.
++
++   This file is part of the GNU Hurd.
++
++   The GNU Hurd is free software; you can redistribute it and/or modify
++   it under the terms of the GNU General Public License as published by
++   the Free Software Foundation; either version 2, or (at your option)
++   any later version.
++
++   The GNU Hurd is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++   GNU General Public License for more details.
++
++   You should have received a copy of the GNU General Public License
++   along with the GNU Hurd.  If not, see <http://www.gnu.org/licenses/>.  */
++
++#ifndef _HURD_TYPES_H
++#define _HURD_TYPES_H
++
++/* st_fstype in struct stat and fsys_stb_type in fsys_statfsbuf is one of: */
++#define FSTYPE_UFS     0x00000000 /* 4.x BSD Fast File System */
++#define FSTYPE_NFS     0x00000001 /* Network File System ala Sun */
++#define FSTYPE_GFS     0x00000002 /* GNU file system */
++#define FSTYPE_LFS     0x00000003 /* Logging File System ala Sprite */
++#define FSTYPE_SYSV    0x00000004 /* Old U*x filesystem ala System V */
++#define FSTYPE_FTP     0x00000005 /* Transparent FTP */
++#define FSTYPE_TAR     0x00000006 /* Transparent TAR */
++#define FSTYPE_AR      0x00000007 /* Transparent AR */
++#define FSTYPE_CPIO    0x00000008 /* Transparent CPIO */
++#define FSTYPE_MSLOSS  0x00000009 /* MS-DOS */
++#define FSTYPE_CPM     0x0000000a /* CP/M */
++#define FSTYPE_HFS     0x0000000b /* Don't ask */
++#define FSTYPE_DTFS    0x0000000c /* used by desktop to provide more info */
++#define FSTYPE_GRFS    0x0000000d /* GNU Remote File System */
++#define FSTYPE_TERM    0x0000000e /* GNU Terminal driver */
++#define FSTYPE_DEV     0x0000000f /* GNU Special file server */
++#define FSTYPE_PROC    0x00000010 /* /proc filesystem ala Version 9 */
++#define FSTYPE_IFSOCK  0x00000011 /* PF_LOCAL socket naming point */
++#define FSTYPE_AFS     0x00000012 /* Andrew File System 3.xx */
++#define FSTYPE_DFS     0x00000013 /* Distributed File Sys (OSF) == AFS 4.xx */
++#define FSTYPE_PROC9   0x00000014 /* /proc filesystem ala Plan 9 */
++#define FSTYPE_SOCKET  0x00000015 /* io_t that isn't a file but a socket */
++#define FSTYPE_MISC    0x00000016 /* generic trivfs server */
++#define FSTYPE_EXT2FS  0x00000017 /* Linux filesystem by Remy Card */
++#define FSTYPE_HTTP    0x00000018 /* Transparent HTTP */
++#define FSTYPE_MEMFS   0x00000019 /* In-core filesystem */
++#define FSTYPE_ISO9660 0x0000001a /* ISO9660 */
++#define FSTYPE_PCI     0x0000001b /* PCI filesystem */
++#define FSTYPE_ACPI    0x0000001c /* ACPI filesystem */
++
++#endif
+-- 
+2.40.1
+

base-commit: 7b00b155d8f474d493a22ff7cccbeec311b9bbc8
prerequisite-patch-id: b96b7fc07560b67bb954891c08b07874050bd815
prerequisite-patch-id: 661334c882030b404c16aa87af52696275d57f66
prerequisite-patch-id: 48af5fd9f6821f907331afb9657df63c8b14ec4b
prerequisite-patch-id: 27ee469438c657694caf0908fffb2dd04004b338
prerequisite-patch-id: faf77d8c8f5b334c592be0de177500c5ed48253d
prerequisite-patch-id: 4cf543b05e46babd5744f11a034b06a69a8f586d
prerequisite-patch-id: 3203da98fdcebf54be372d646376ac0c1ed3561d
prerequisite-patch-id: b302b87c50035242fa5842449a8502aa26650e46
prerequisite-patch-id: 8b731aee2f3632e6a6c154991a049ceba6471191
prerequisite-patch-id: a1ab14d78cd7ebeb490c31f627b9ae1fa61c2c80
prerequisite-patch-id: 49e32295a422d95c22a8ca4c8b5a3888a1f1c3d1
prerequisite-patch-id: fa0634162bbb2a3c681573cfa54ed14da3040140
prerequisite-patch-id: eff2e90da0ddb61cdc94d6eb083d79623a8f3b06
prerequisite-patch-id: 2501018d2afba9cc91e8f1f9725940e8f1c4ee83
prerequisite-patch-id: 280fe3f9c895825f4b0762ac60a52b358b605cf6
prerequisite-patch-id: eea541992403b758a104b5af27c8badae3baf2f4
prerequisite-patch-id: a6c0a342e46e36b906eee63d257fc0af6427b15a
prerequisite-patch-id: 1a2fe0f10be9134fb07bb38554117e0f19fe1707
prerequisite-patch-id: 7d5103573db8f4d608bd95b892a18fc6b24b4757
prerequisite-patch-id: 2c9b8e3516c69d9930890a365274be74d7dec6c3
prerequisite-patch-id: d8861b9abda988879d67b2541870a453dc7be77e
prerequisite-patch-id: ae35edf508ae2e7469ff949ebc8854df4e1ffbc1
prerequisite-patch-id: a1be1fe7e65cf971934ad3c67701c3b14ca519d7
prerequisite-patch-id: c50b89c0c9e5cd5bbcc0105923d9bd5526f472ca
prerequisite-patch-id: dcf223c4462a67f98274e2b378afbdb640299d40
prerequisite-patch-id: 7193aab88f198d8cbc6760702bdd4faaa0b5a106
prerequisite-patch-id: b2bbb543bfa2ad8ca8b75cb988b78ef15788aaab
prerequisite-patch-id: 47715253b05bbeb2296d837565d789d4f4cece1f
prerequisite-patch-id: fe888c22279f21ed573d97cb3c32fd750e64bc7f
prerequisite-patch-id: c083d6e7b08eec3f0954d5596505128a782109d6
prerequisite-patch-id: a77cce5da6fe87ee3e61d45bfe3195315ac1a3bc
prerequisite-patch-id: 3b252fe9479e356c6cfb871eea9ad460a915416b
prerequisite-patch-id: 7464ce27b2f36ce538f2dfd1560a0c4e6f073601
prerequisite-patch-id: 90b006b2c5ea686a9ce9a8a4121428e0305899a7
prerequisite-patch-id: 55705deea1dbe21c08590341520d791e0a834f3a
prerequisite-patch-id: 2ec7651ffafe201aee13039f1ee897aeef38620a
prerequisite-patch-id: 8cd269bb138d5dc79f41612cc18a2a4228e496d0
prerequisite-patch-id: 2e6bc6077534d8954f2ab9068749dc4108a85ff7
prerequisite-patch-id: be84acc08610f5733e484a725a208b89c7466602
prerequisite-patch-id: d1e78442c660bb1450164105310c2473c52e7c52
prerequisite-patch-id: 96a39877f8e21fd8a85dbd59f82f2e5697147bc0
prerequisite-patch-id: 068a494d14fe8f7a32c9572a94cf31459e3fb037
prerequisite-patch-id: 85b1f68a51008deca677e811fde9b29b6c15032e
prerequisite-patch-id: 9c4357ee94237511a6abeafaa7b9775e042b8de5
prerequisite-patch-id: 88118d60e5c823f06d66dd2f0533f1164b27acbf
prerequisite-patch-id: 384bc8886bffe4ccbbec8a0d1ab28d6b6084b21c
prerequisite-patch-id: cece1d586bbe314abab4bbe3f15b8299d9bcc0cd
prerequisite-patch-id: af099a015eb8ac396ea8d937f178c3bbf25083da
prerequisite-patch-id: 3aacc3d6b5c739573b2f9dd78c10f939f439167f
prerequisite-patch-id: d2fb05b6b2d56db8336f139b6306db6bb76ded2f
prerequisite-patch-id: 31695aaf8968f8204007acf156763e1b2ecf917a
prerequisite-patch-id: 49d979efa4b1a41929484f14d4b5c0dd8f21f5ba
prerequisite-patch-id: c6c977b826e398a9ebd1348d96acf560a450612f
prerequisite-patch-id: 491d9ffbeb3f43882128465c37ff5488e4c632e7
prerequisite-patch-id: 23a9f3aa13e30e8a6721f596b16bd85ee70ec2c3
prerequisite-patch-id: d3241549d78da53af38729a85b7929808845d6c7
prerequisite-patch-id: 78c1a029ca7c53a1fcb416d122493f84af07b304
prerequisite-patch-id: 02d981d60649b804752f7b80919d58edb741e262
prerequisite-patch-id: e6131a0105e714b43a362a715b621e9020614308
prerequisite-patch-id: 0faf15c9db3aabfc6a621cd1f69d83037a295f88
prerequisite-patch-id: 0ea4eec5324d23be536909870972a0adc0568762
prerequisite-patch-id: afa4f727e5f1d95e4bcbe7cda323038b0a20adf1
prerequisite-patch-id: eb15c6fe043ba091ff09421b800a5c64c6fadbc4
prerequisite-patch-id: 3e926d814690c5d141dfdd4b4e73610ab40bc705
prerequisite-patch-id: f40fbc063f8b0dcfe7ab163a2f88024e0c227c18
prerequisite-patch-id: a6331e2375e48f7b33e5188d45bc36aafccc91fa
prerequisite-patch-id: a66e65fb61a233ef27d193aa431de94562b8cd57
prerequisite-patch-id: a45b7540996ac9a1e12de02e1d5278b193acd8aa
prerequisite-patch-id: 336252fc9dfc52aa24e8505fc502928d10ce3181
prerequisite-patch-id: 27200425d13134cd13d50909ae8c0051464e8f54
prerequisite-patch-id: 255d49a4185a7b66db8c69b8b18e133e7b659d67
prerequisite-patch-id: a2e0e8c621eda0421bf4149982a2b3e08bac7033
prerequisite-patch-id: dbb134d66fc76750199688ba1bd32b24ccc4b2b1
prerequisite-patch-id: 19bcb1efc1e67fbdafc3ecee0298721a096816d3
prerequisite-patch-id: 630518c61c5de8a41481a6f617b8167999b7501c
prerequisite-patch-id: 3b1362b01bb2bb4893600ce0d6f5ae27456f13fe
prerequisite-patch-id: 1f163827836c5cf29da978c91bf574670a67adb8
prerequisite-patch-id: c1bbe29954e1655e045e7eae1e6548a0a918173c
prerequisite-patch-id: c333d68199f3d244b2b4b6db0a818564bf6093a5
prerequisite-patch-id: bdd15e0c8560fd1746cd2438010da548b348b0a9
prerequisite-patch-id: 5758218e08bfc71a81b208ea9b66081ee5d82de0
prerequisite-patch-id: b1ad8b53894b531291240c763a584ef75946c6bc
prerequisite-patch-id: ff64b29fbf19c172e651dd60b19977e94b687571
prerequisite-patch-id: 63f2bb2fee730b2d2877c3d9425b7dd3154dbadb
prerequisite-patch-id: d73808aeccb4802cd2d742e9b905a1060be435e1
prerequisite-patch-id: 3bb2c68f61077b84496c0a8809a48ac769e0fe7f
prerequisite-patch-id: 36cfcb34718d61b4193e24a4edb838b37907f0cb
prerequisite-patch-id: d30f224ccc74c419df33c960987c8951113a1670
prerequisite-patch-id: affa3cbfb5d6879ff11f4a7d030dc8796abcdd87
prerequisite-patch-id: 8e99169701284be360d303b8b24fa7d9a5754292
prerequisite-patch-id: 7a66fe96b5a30efabd331ccc038451ca2516a427
prerequisite-patch-id: 441c7a24e456631522572991244c49b48738d118
prerequisite-patch-id: 2ed5a5b07853d30d9575a144eecba2f4a86d0907
prerequisite-patch-id: b047430c30ba9ea274aea33a467cdb49d769884e
prerequisite-patch-id: 8a03c5e8bcd4c526b93c558d550725887f932e41
prerequisite-patch-id: 89400c29b4c30dfbe8492aff1751ca583397b4f0
prerequisite-patch-id: c068d5c98389992badbc1ab7714de4ee0921c09e
prerequisite-patch-id: 6de41cdca3442bf7ed5ec9b9b637cd708544b7d7
prerequisite-patch-id: 7eeadb75f4d144f35d7efcdc8378b27fe3c5e081
prerequisite-patch-id: 80aca78175e59e6de1a312a79337e9e841f41261
prerequisite-patch-id: 0e46f6ae7eb7a87dbe704fd2d7934bf9811b615d
prerequisite-patch-id: 611636fc38fe413039a494c4b900f60cf5dffa03
prerequisite-patch-id: 81152a28167c5753792b6ac435f46dd43dadcb13
prerequisite-patch-id: 99a98f6d0a97f74d541080a789602715964e162e
prerequisite-patch-id: 17991be339a2f7fdd69b8674cd193a592cbf3dc4
prerequisite-patch-id: 0513586ef61aef7195532855404afe1d3466242c
prerequisite-patch-id: c6070b7f04fe8616d12d62da921c9894b5c71a76
prerequisite-patch-id: f8c455a58ca730f66c0b589591fe9ee8e6733ec9
prerequisite-patch-id: 693421f009c957365346d143184d4a6d2b6cc727
prerequisite-patch-id: 1cdf7c68bd7c74ad9ec5bc9f4c129bfea1c11be3
prerequisite-patch-id: 099217b842eb48e79a59d2f2fa5c490602a056b8
prerequisite-patch-id: f23965b234cadbcc690f54e92180a0ac52d5db7e
prerequisite-patch-id: e5857f0a4bd5112443f90bb70188f62d23cb4183
prerequisite-patch-id: aaa2d82b279cebf88098a96f5d3271ec690dceb4
prerequisite-patch-id: 63e912653dfdadee75143008ce1c9f2a639b44c6
prerequisite-patch-id: 095f03f24e4dfe3692bca7feceedc05310f1bc97
prerequisite-patch-id: e14aa692ef4e2e069be249a88aaee7db4afeb8aa
prerequisite-patch-id: c3e6caa73c9acab3a688c0f9772f3e41c3fee683
prerequisite-patch-id: fbcf6a8e3550e9b8a7c18f67f02e1b82bae8e9e1
prerequisite-patch-id: 9d5499d6bc33d541bb0b4519b2cb9f404fee27cb
prerequisite-patch-id: 91e3ceed5e0502e3d92e343c191b52561f983bfa
prerequisite-patch-id: 41d1a36f721b9947542a6786f07ccf70968e9a2f
prerequisite-patch-id: 86f2d1a38f0e37569f7f8137ba1e613198c91c43
prerequisite-patch-id: 95f948376d7e747d7dd3e4ba23cddb587b17dada
prerequisite-patch-id: 8f871fea11a893f46200c5ce913f186f644676ba
prerequisite-patch-id: 4e9276dd27f5a0fbea1f87b3f8e2c5b1b413b468
prerequisite-patch-id: 5383b123921e5e09014c20e8c24172723ae93c03
prerequisite-patch-id: 71e04113564cf21297df3db17f79903eeeb8c3d1
prerequisite-patch-id: a8c48526e20f77ce6099b40e5cc78c420623090e
prerequisite-patch-id: 0d6d9d90956133e15e88e0841207cdd9f2da4260
prerequisite-patch-id: 1f6e628dc3861c33ffbe17f8581e1178b729b954
prerequisite-patch-id: 24c7014f95af29b20d61e41699442100f9f9cdda
prerequisite-patch-id: db308b1c39fb9b7ea77a2595a32fd8ec2f09df85
prerequisite-patch-id: d100c00aebbd8471a9886ae813ff3cea244b5139
prerequisite-patch-id: 87648b45656f8555cc6a633c88355d4fc24251cd
prerequisite-patch-id: 34fdbf06c49e0e12643cee018592bcde448b03fb
prerequisite-patch-id: 71492d07a460d2127f0ca3e79074b96ec0600dae
prerequisite-patch-id: 365c01108dbc214e0da77f7e86b28cadcde47c2c
prerequisite-patch-id: e864903614cd799d4efa78b2bf5949d969cc8b83
prerequisite-patch-id: 6b900621f04d1f16ab06c0bb69a7ddea70b3c1e0
prerequisite-patch-id: e8cc85ba90f929d1667f4b332b334a7a1d85ead6
prerequisite-patch-id: b92f1221d04fa5e8b0c67e9b2ebde85671673a19
prerequisite-patch-id: 8036b97f29f4e181c836a277bcf8f9d0a6b69d90
prerequisite-patch-id: 0d31991f2aeaab68c609fc8ca4286055cd86988c
prerequisite-patch-id: 804da8732d2c9b07f0b35f683226b731ee55e25f
prerequisite-patch-id: fe51d6314b54cfaa32cfaa9bf95b3f943c759465
prerequisite-patch-id: 5e3f9795cba8d97ab37b55fcb63a350c39f8c730
prerequisite-patch-id: e3c21cb3fd26347a317a8696625a9e74bc4a1fa2
prerequisite-patch-id: 8d3044ba8b424e3bd68a1c7e1e197cf882b50be5
prerequisite-patch-id: 5807b64f53658b123f3aad1d921e41822d833922
prerequisite-patch-id: b30fcb0acf847d05dc50fa0d9c172831137f0fd3
prerequisite-patch-id: 8e67e3ed93ee982f83f9f0c3a9d0ae2aa8b107dd
prerequisite-patch-id: 39ef6cc42688d806514087bb51fa4f3ad2346c0b
prerequisite-patch-id: 350ada556e8bf5c3f353de2d706cc65b2aad6ec3
prerequisite-patch-id: 0b8976feabc9ae7553e6806c79dc048b20f5afa3
prerequisite-patch-id: 1d892c6b36737f4fa6c98a376a5bd240d4f20921
prerequisite-patch-id: fcf1e96ff1e4b219d72910ac62e7fa7c15aa4edc
prerequisite-patch-id: 12c01806b669b53f92f9e5048d0678796b972e0c
prerequisite-patch-id: 686779fa483606cf0cc369a6bce56c067ac6492e
prerequisite-patch-id: 457030a85cb1ebff3a133cb822673803411528e3
prerequisite-patch-id: ac3cf405eac2afe984a5c4bc6c31f46734b0d16e
prerequisite-patch-id: 4b967cb66bf08b0a64a78d25237297b41aa76f03
prerequisite-patch-id: 3543b86b56555c8c9982506e5bbd77ba57579653
prerequisite-patch-id: 79e28d84f2b98c4147b14668d971b4dc9e1b3c5e
prerequisite-patch-id: 2056b44efb40f2f85b0320570a4e709257dd103a
prerequisite-patch-id: 93e43e1a1a4b5fb3e2af4432c292803ed7ce30a7
prerequisite-patch-id: bf9f6c2efa2216af0f1787dc1582e2cec821f19e
prerequisite-patch-id: 69acf79d4013ebdc3e7dfb4882bbe19498c820a5
prerequisite-patch-id: 900de3149fa074c39e463d859ccdf208ce120a76
prerequisite-patch-id: 196fd00997b26669da59cf6495fa390f42be05f4
prerequisite-patch-id: 8abd87da6210c054402d24e15d1b97d586f40815
prerequisite-patch-id: 5c561982f22f68875142001ea5ff12e4d205297e
prerequisite-patch-id: d8b8d605ae1bdff6a21466d03630142b976ba66b
prerequisite-patch-id: 8e48f249db6a690de197dc8374579b3794de3c88
prerequisite-patch-id: f642d0473e901d52cc03cf4865b99adc992d45bd
prerequisite-patch-id: 1122b34d719074190f7b33d0d67ff5d1d3e7f5db
prerequisite-patch-id: 1ce897362b190842dcd9a7877c705171fdd8ade4
prerequisite-patch-id: 20f0d87857211e3951ddbc86eea58150c0d8dcaf
prerequisite-patch-id: 22baa06d890ddd086562432ce444abd789eec2d0
prerequisite-patch-id: effedb461bf07207195201682fb9813fc17d6a85
prerequisite-patch-id: ab70003679195a1dd4a64c5c1213c6739d1acdea
prerequisite-patch-id: ec7d2e38795d4c81640b33dff7b3c26ac3042735
prerequisite-patch-id: d57c87225c6807cd6b5a49440d966ff82be2153d
prerequisite-patch-id: 22b233d97093f5e14419893ed434a9b12bec252c
prerequisite-patch-id: adc1a53f933b395000482937c3aea200e17868e4
prerequisite-patch-id: 2cd88e3482ee0b561700b9b665bc39a43b8d7ad1
prerequisite-patch-id: 25a2ac89a85ef047f409348d57ebe7abeb9fe9fd
prerequisite-patch-id: db75dca32b49336a1eecf6e23f88d300cecb4921
prerequisite-patch-id: c9a72ac043afbc123fd8f88d48882cfc23113fe1
prerequisite-patch-id: e51c974df61f6e45a0b6e378935a1e9d96e78b70
prerequisite-patch-id: 75fea1aad424875aa83d08decd7157d906089d17
prerequisite-patch-id: 68859ab1cc6f9c0fce73a6ab033290b20e7682ab
prerequisite-patch-id: 4c811409b89a2cd254d0e623d010f4a3c862b9c9
prerequisite-patch-id: 31692afc70ca5914e13be0641312ebeff74135fc
prerequisite-patch-id: 9174bbe91735dc9c6a808b029ed16a494753ff79
prerequisite-patch-id: 949fec4f42bcbdbd953996ca3d003cc42ae72e42
prerequisite-patch-id: 6f4b9e2b4f63f534ecc5af5867bad1eee3a90432
prerequisite-patch-id: e30fdd3cd7e9f42fb8773bcb6885dc9d200cb4f3
prerequisite-patch-id: 1252d1a4a294d4f70014348e16ce9f777cfa8f7c
prerequisite-patch-id: 1ca5f38c3c48de62b29a29611d0b4c70426aa392
prerequisite-patch-id: 8bf104d25fd46844d61b492af108b6ba8e14b5d4
prerequisite-patch-id: 338c112c7fd7d029a7aa2ee9a71983fd99aeafa1
prerequisite-patch-id: d29c78f4497bdd66c1c83566a1e9d63beebcc7d8
-- 
2.40.1


[-- Attachment #3: Type: text/plain, Size: 164 bytes --]


-- 
Janneke Nieuwenhuizen <janneke@gnu.org>  | GNU LilyPond https://LilyPond.org
Freelance IT https://www.JoyOfSource.com | Avatar® https://AvatarAcademy.com

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* bug#63789: Native compilation broken on the Hurd (with patch)
  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
  0 siblings, 1 reply; 4+ messages in thread
From: Ludovic Courtès @ 2023-06-01 21:50 UTC (permalink / raw)
  To: Janneke Nieuwenhuizen; +Cc: 63789

[-- Attachment #1: Type: text/plain, Size: 6829 bytes --]

Hello!

Janneke Nieuwenhuizen <janneke@gnu.org> 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.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.)

Seeing is believing so I had to try:

--8<---------------cut here---------------start------------->8---
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:
In srfi/srfi-1.scm:
 465: 19 [fold #<procedure 14397b0 at ice-9/ftw.scm:451:38 (subdir result+visited)> ...]
In ice-9/ftw.scm:
 452: 18 [#<procedure 14397b0 at ice-9/ftw.scm:451:38 (subdir result+visited)> # #]
 450: 17 [loop "gcc" "gcc-11.3.0" ...]
In srfi/srfi-1.scm:
 465: 16 [fold #<procedure 177df60 at ice-9/ftw.scm:451:38 (subdir result+visited)> ...]
In ice-9/ftw.scm:
 452: 15 [#<procedure 177df60 at ice-9/ftw.scm:451:38 (subdir result+visited)> # #]
 450: 14 [loop "testsuite" "gcc-11.3.0/gcc" ...]
In srfi/srfi-1.scm:
 465: 13 [fold #<procedure 20374e0 at ice-9/ftw.scm:451:38 (subdir result+visited)> ...]
In ice-9/ftw.scm:
 452: 12 [#<procedure 20374e0 at ice-9/ftw.scm:451:38 (subdir result+visited)> # #]
 450: 11 [loop "go.test" "gcc-11.3.0/gcc/testsuite" ...]
In srfi/srfi-1.scm:
 465: 10 [fold #<procedure 27d6a80 at ice-9/ftw.scm:451:38 (subdir result+visited)> ...]
In ice-9/ftw.scm:
 452: 9 [#<procedure 27d6a80 at ice-9/ftw.scm:451:38 (subdir result+visited)> # #]
 450: 8 [loop "test" "gcc-11.3.0/gcc/testsuite/go.test" ...]
In srfi/srfi-1.scm:
 465: 7 [fold #<procedure 208d060 at ice-9/ftw.scm:451:38 (subdir result+visited)> ...]
In ice-9/ftw.scm:
 452: 6 [#<procedure 208d060 at ice-9/ftw.scm:451:38 (subdir result+visited)> # #]
 450: 5 [loop "fixedbugs" "gcc-11.3.0/gcc/testsuite/go.test/test" ...]
In srfi/srfi-1.scm:
 465: 4 [fold #<procedure 1a92e40 at ice-9/ftw.scm:451:38 (subdir result+visited)> ...]
In ice-9/ftw.scm:
 452: 3 [#<procedure 1a92e40 at ice-9/ftw.scm:451:38 (subdir result+visited)> # #]
 474: 2 [loop "issue27836.dir" ...]
In guix/build/utils.scm:
 559: 1 [#<procedure dc3320 at guix/build/utils.scm:555:28 (file stat errno result)> "gcc-11.3.0/gcc/testsuite/go.test/test/fixedbugs/issue27836.dir/Äfoo.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=en_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/testsuite/go.test/test/fixedbugs/issue27836.go
drwxr-xr-x rguenther/users       0 2022-04-21 07:58 gcc-11.3.0/gcc/testsuite/go.test/test/fixedbugs/issue27836.dir/
-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
--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 “how does that work?”, good question! :-)

We should get rid of that hack though.

>>From 37f38eb35fff505da9bfad8cb1f5f250378f7648 Mon Sep 17 00:00:00 2001
> Message-Id: <37f38eb35fff505da9bfad8cb1f5f250378f7648.1685370023.git.janneke@gnu.org>
> From: Janneke Nieuwenhuizen <janneke@gnu.org>
> 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 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.
> ---
>  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 ‘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.

Even better would have been ‘--enable-no-install-program=cp’ but
‘src/copy.c’ is still getting built.

(Time passes…)

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:


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/x-patch, Size: 1055 bytes --]

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*

[-- Attachment #3: Type: text/plain, Size: 42 bytes --]


How does that sound? :-)

Ludo’.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #4: Type: text/x-patch, Size: 4025 bytes --]

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

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* bug#63789: Native compilation broken on the Hurd (with patch)
  2023-06-01 21:50 ` Ludovic Courtès
@ 2023-06-02  5:27   ` Janneke Nieuwenhuizen
  2023-06-02 15:26     ` Ludovic Courtès
  0 siblings, 1 reply; 4+ messages in thread
From: Janneke Nieuwenhuizen @ 2023-06-02  5:27 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 63789

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




^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#63789: Native compilation broken on the Hurd (with patch)
  2023-06-02  5:27   ` Janneke Nieuwenhuizen
@ 2023-06-02 15:26     ` Ludovic Courtès
  0 siblings, 0 replies; 4+ messages in thread
From: Ludovic Courtès @ 2023-06-02 15:26 UTC (permalink / raw)
  To: Janneke Nieuwenhuizen; +Cc: 63789-done

Hello!

Janneke Nieuwenhuizen <janneke@gnu.org> skribis:

> That's great, thanks!  Using this now on my current wip-hurd and it's
> working for me!

Awesome, pushed as 48c7e71cd7c3690203d4a8961a651cae090af83f!

Ludo’.




^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-06-02 15:27 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
2023-06-02 15:26     ` Ludovic Courtès

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).