unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* progress report on updating the Hurd packages
@ 2023-02-23 10:59 zamfofex
  2023-02-24 12:57 ` [bug#51770] " Joshua Branson via Guix-patches via
  0 siblings, 1 reply; 2+ messages in thread
From: zamfofex @ 2023-02-23 10:59 UTC (permalink / raw)
  To: guix-devel@gnu.org

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

Hello, everyone! I just wanted to be able to report my progress with updating the Hurd packages.

I have been able to get past my previous issues with building GMP, I think, but it seems that the glibc in Guix is still too outdated for the whole endeavor to succeed.

I could either update the glibc package again or simply apply a patch to it (since the change needed seems to be small enough), but that would take quite a while waiting for things to build, and I’m not sure I’m up for it at the moment.

I plan to pick this effort back up again at some point, but at the moment I’m a bit tired of having to wait for packages to build for multiple days. But if anyone wants to pick up where I left off, I will upload a ‘git diff’ with my current changes. (Applicable to ‘core-updates’.)

Here is some more insight based on my conversations on #hurd:

- https://logs.guix.gnu.org/hurd/2023-02-20.log
- https://logs.guix.gnu.org/hurd/2023-02-21.log

If anyone wants to take this work meanwhile, please do let me know somehow so that we don’t end up duplicating effort!

Thanks for everyone’s amazing work on the Hurd and on Guix!

[-- Attachment #2: hurd.diff --]
[-- Type: application/octet-stream, Size: 15445 bytes --]

diff --git a/gnu/packages/base.scm b/gnu/packages/base.scm
index 558abf8..e8bbcc0 100644
--- a/gnu/packages/base.scm
+++ b/gnu/packages/base.scm
@@ -1562,3 +1562,4 @@ (define-public (%final-inputs)
     (module-ref iface '%final-inputs)))
 
 ;;; base.scm ends here
+
diff --git a/gnu/packages/gcc.scm b/gnu/packages/gcc.scm
index 5e2783d..c1bf744 100644
--- a/gnu/packages/gcc.scm
+++ b/gnu/packages/gcc.scm
@@ -688,7 +688,8 @@ (define-public gcc-11
               "0fdclcwf728wbq52vphfcjywzhpsjp3kifzj3pib3xcihs0z4z5l"))
             (patches (search-patches "gcc-9-strmov-store-file-names.patch"
                                      "gcc-5.0-libvtv-runpath.patch"
-                                     "gcc-10-tree-sra-union-handling.patch"))
+                                     "gcc-10-tree-sra-union-handling.patch"
+                                     "libstdc++-hurd.diff"))
             (modules '((guix build utils)))
             (snippet gcc-canadian-cross-objdump-snippet)))
 
diff --git a/gnu/packages/hurd.scm b/gnu/packages/hurd.scm
index 1dcec3e..1cd0b38 100644
--- a/gnu/packages/hurd.scm
+++ b/gnu/packages/hurd.scm
@@ -6,6 +6,7 @@
 ;;; Copyright © 2020, 2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
 ;;; Copyright © 2020 Ricardo Wurmus <rekado@elephly.net>
 ;;; Copyright © 2020 Rene Saavedra <pacoon@protonmail.com>
+;;; Copyright © 2021–2023 zamfofex <zamfofex@twdb.moe>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -61,13 +62,9 @@ (define (hurd-system?)
   "Return true if the current system is the Hurd."
   (and=> (%current-system) target-hurd?))
 
-(define (hurd-source-url version)
-  (string-append "mirror://gnu/hurd/hurd-"
-                 version ".tar.gz"))
-
 (define-public gnumach-headers
-   (let ((commit "097f9cf735ffa1212b828682ad92f0f6c5f1c552")
-         (revision "1"))
+   (let ((commit "990f549999310abc2a47ebc6f7782d2e05ae8c96")
+         (revision "2"))
      (package
        (name "gnumach-headers")
        (version (git-version "1.8" revision commit))
@@ -80,7 +77,7 @@ (define-public gnumach-headers
            (file-name (git-file-name "gnumach" version))
            (sha256
             (base32
-             "0q36z7k02bykrld90zaxbhyzxlmwlqqs4divgir6ix38zsp6icqk"))))
+             "0vbxbz78lgn1y16avjp855lrppxbaxfbyg390jn5r7c5n9xvz6y9"))))
        (build-system gnu-build-system)
        (arguments
         `(#:phases
@@ -109,42 +106,46 @@ (define-public gnumach-headers
        (license gpl2+))))
 
 (define-public mig
-  (package
-    (name "mig")
-    (version "1.8")
-    (source
-     (origin
-      (method url-fetch)
-      (uri (string-append "mirror://gnu/mig/mig-"
-                          version ".tar.gz"))
-      (sha256
-       (base32
-        "1gyda8sq6b379nx01hkpbd85lz39irdvz2b9wbr63gicicx8i706"))))
-    (build-system gnu-build-system)
-    ;; Flex is needed both at build and run time.
-    (inputs (list gnumach-headers flex perl))
-    (native-inputs
-     (list flex bison))
-    (arguments `(#:tests? #f
-                 #:phases
-                 (modify-phases %standard-phases
-                   (add-after 'install 'patch-non-shebang-references
-                     (lambda* (#:key build inputs outputs #:allow-other-keys)
-                       (let ((perl (assoc-ref inputs "perl"))
-                             (out  (assoc-ref outputs "out")))
-                         (substitute* (string-append out "/bin/mig")
-                           (("perl ") (string-append perl "/bin/perl ")))
-                         #t))))))
-    (home-page "https://www.gnu.org/software/hurd/microkernel/mach/mig/gnu_mig.html")
-    (synopsis "Mach 3.0 interface generator for the Hurd")
-    (description
-     "GNU MIG is the GNU distribution of the Mach 3.0 interface generator
+  (let ((commit "5cf9885fde9c9697e4adade00cd71beb8bf4624b")
+         (revision "2"))
+    (package
+      (name "mig")
+      (version (git-version "1.8" revision commit))
+      (source
+        (origin
+          (method git-fetch)
+          (uri (git-reference
+                 (url "https://git.savannah.gnu.org/git/hurd/mig.git")
+                 (commit commit)))
+          (file-name (git-file-name name version))
+          (sha256
+           (base32
+            "1jl298zgqf0vhns86kv610s40rkak8j13cakjyl3qdmhrgx2l14p"))))
+      (build-system gnu-build-system)
+      ;; Flex is needed both at build and run time.
+      (inputs (list gnumach-headers flex perl))
+      (native-inputs
+        (list autoconf automake bison flex))
+      (arguments `(#:tests? #f
+                   #:phases
+                   (modify-phases %standard-phases
+                     (add-after 'install 'patch-non-shebang-references
+                       (lambda* (#:key build inputs outputs #:allow-other-keys)
+                         (let ((perl (assoc-ref inputs "perl"))
+                               (out  (assoc-ref outputs "out")))
+                           (substitute* (string-append out "/bin/mig")
+                             (("perl ") (string-append perl "/bin/perl ")))
+                           #t))))))
+      (home-page "https://www.gnu.org/software/hurd/microkernel/mach/mig/gnu_mig.html")
+      (synopsis "Mach 3.0 interface generator for the Hurd")
+      (description
+       "GNU MIG is the GNU distribution of the Mach 3.0 interface generator
 MIG, as maintained by the GNU Hurd developers for the GNU project.
 You need this tool to compile the GNU Mach and GNU Hurd distributions,
 and to compile the GNU C library for the Hurd.  Also, you will need it
 for other software in the GNU system that uses Mach-based inter-process
 communication.")
-    (license gpl2+)))
+      (license gpl2+))))
 
 (define-public mig/32-bit
   ;; When cross-compiling from x86_64-linux to i586-gnu, we need this 32-bit
@@ -160,8 +161,8 @@ (define-public mig/32-bit
 (define-public hurd-headers
   ;; Resort to a post-0.9 snapshot that provides the 'file_utimens' and
   ;; 'file_exec_paths' RPCs that glibc 2.28 expects.
-  (let ((revision "1")
-        (commit "91a51672ff4cfe1f1a0712b4c542ded3081c825b"))
+  (let ((revision "2")
+        (commit "67efb746c492c25fac4d77aa16b808a8aa26089d"))
    (package
      (name "hurd-headers")
      (version (git-version "0.9" revision commit))
@@ -172,7 +173,7 @@ (define-public hurd-headers
                      (commit commit)))
                (sha256
                 (base32
-                 "16k9wkahz9wasviijz53n6i13nmiwa9fs64ikf1jqh8rl60hw7cz"))
+                 "1ly8rzqh35k2231dsnci1lwcbsrk6dpl7j462kv1ly7jsf4lbfnj"))
                (file-name (git-file-name name version))))
      (build-system gnu-build-system)
      (native-inputs
@@ -194,7 +195,6 @@ (define-public hurd-headers
                             ;; Reduce set of dependencies.
                             "--without-parted"
                             "--disable-ncursesw"
-                            "--disable-test"
                             "--without-libbz2"
                             "--without-libcrypt"
                             "--without-libz"
@@ -208,7 +208,10 @@ (define-public hurd-headers
                             "ac_cv_func_file_exec_paths=no"
                             "ac_cv_func_exec_exec_paths=no"
                             "ac_cv_func__hurd_exec_paths=no"
-                            "ac_cv_func_file_futimens=no")
+                            "ac_cv_func__hurd_libc_proc_init=no"
+                            "ac_cv_func_file_futimens=no"
+                            "--without-rump"
+                            "--without-acpica")
 
         #:tests? #f))
      (home-page "https://www.gnu.org/software/hurd/hurd.html")
@@ -291,8 +294,11 @@ (define-public gnumach
     (name "gnumach")
     (arguments
      (substitute-keyword-arguments (package-arguments gnumach-headers)
+       ; Mach doesn't expect to be built with `C_INCLUDE_PATH' set,
+       ; so we unset it here to prevent it from using headers from
+       ; glibc by accident.
        ((#:make-flags flags ''())
-        `(cons "CFLAGS=-fcommon" ,flags))
+        `(cons* "C_INCLUDE_PATH=" "CROSS_C_INCLUDE_PATH=" ,flags))
        ((#:configure-flags flags ''())
         `(cons "--enable-kdb" ,flags))            ;enable kernel debugger
        ((#:phases phases '%standard-phases)
@@ -316,14 +322,14 @@ (define unifont
   (origin
     (method url-fetch)
     (uri
-     "http://unifoundry.com/pub/unifont-7.0.06/font-builds/unifont-7.0.06.bdf.gz")
+     "https://unifoundry.com/pub/unifont/unifont-15.0.01/font-builds/unifont-15.0.01.bdf.gz")
     (sha256
      (base32
-      "0p2vhnc18cnbmb39vq4m7hzv4mhnm2l0a2s7gx3ar277fwng3hys"))))
+      "140mrr3ryl033i9wyi8mrbvs10i499fb0xr1pxks1f1n1a8bmp8z"))))
 
 (define dde-sources
   ;; This is the current tip of the dde branch
-  (let ((commit "ac1c7eb7a8b24b7469bed5365be38a968d59a136"))
+  (let ((commit "ce8810277fa3584eb36ecb23da58394153fabe6f"))
     (origin
       (method git-fetch)
       (uri (git-reference
@@ -331,31 +337,33 @@ (define dde-sources
             (commit commit)))
       (sha256
        (base32
-        "1vryinbg75xpydfrv9dbgfnds6knlh8l8bk2rxp32y9dc58z0692"))
+        "0ygk7jm4jmhpvh0zzi5bk638242z7sbcab2i57fkb4y2mmdkjjbw"))
       (file-name (git-file-name "dde" commit)))))
 
 (define-public hurd
   (package
     (name "hurd")
     (version (package-version hurd-headers))
-    (source (origin (inherit (package-source hurd-headers))
-                    (patches (search-patches "hurd-cross.patch"
-                                             "hurd-xattr.patch"))))
+    (source (package-source hurd-headers))
     (arguments
-     `(#:phases
+    ; The Hurd doesn't expect to be built with `C_INCLUDE_PATH' set,
+    ; so we unset it here to prevent it from using headers from
+    ; glibc by accident.
+     `(#:make-flags '("C_INCLUDE_PATH=" "CROSS_C_INCLUDE_PATH=")
+       #:phases
        (modify-phases %standard-phases
          (add-after 'unpack 'prepare-dde
            (lambda* (#:key native-inputs inputs #:allow-other-keys)
              (substitute* "Makefile"
-               (("libbpf ")
-                "libbpf libmachdev libmachdevdde libddekit"))
+               (("libmachdev ")
+                "libmachdev libmachdevdde libddekit "))
              (for-each make-file-writable (find-files "."))
              (let ((dde (or (assoc-ref inputs "dde-sources")
                             (assoc-ref native-inputs "dde-sources"))))
                (for-each (lambda (dir)
                            (copy-recursively
                             (string-append dde "/" dir ) dir))
-                         '("libmachdev" "libmachdevdde" "libddekit")))
+                         '("libmachdevdde" "libddekit")))
              #t))
          (add-after 'unpack 'find-tirpc
            (lambda* (#:key inputs #:allow-other-keys)
@@ -504,8 +512,7 @@ (define-public hurd
                 ;; This is needed to pass the configure check for
                 ;; clnt_create
                 "ac_func_search_save_LIBS=-ltirpc"
-                "ac_cv_search_clnt_create=false"
-                "CFLAGS=-fcommon")))
+                "ac_cv_search_clnt_create=false")))
     (build-system gnu-build-system)
     (inputs
      `(("glibc-hurd-headers" ,glibc/hurd-headers)
@@ -548,8 +555,8 @@ (define-public hurd
     (license gpl2+)))
 
 (define-public netdde
-  (let ((commit "4a1016f130b6f2065d3f088325e5fb0b2997ae12")
-        (revision "1"))
+  (let ((commit "be828e44b332ccfeef6f687d69b5d74b2a16323d")
+        (revision "2"))
     (package
       (name "netdde")
       ;; The version prefix corresponds to the version of Linux from which the
@@ -562,7 +569,7 @@ (define-public netdde
                       (commit commit)))
                 (sha256
                  (base32
-                  "1njv9dszq4lj05yq4v9j5v247hfghpzvvz4hzy0khjjr35mw7hr8"))
+                  "1vixmv9xdpcfp8ckv4h3fqhby0dhn6n8x0s89mm1a3yi6ybrxvxj"))
                 (file-name (git-file-name name commit))))
       (build-system gnu-build-system)
       (arguments
@@ -599,11 +606,6 @@ (define-public netdde
            (add-after 'build-libdde-linux26 'convert
              (lambda* (#:key make-flags #:allow-other-keys)
                (apply invoke "make" "convert" make-flags)))
-           (replace 'build
-             (lambda* (#:key make-flags #:allow-other-keys)
-               ;; no-common can be dropped with GCC 10+ where this is the
-               ;; default.
-               (apply invoke "make" "CFLAGS=-fno-common" make-flags)))
            (replace 'install
              (lambda* (#:key outputs #:allow-other-keys)
                (install-file "netdde"
diff --git a/gnu/packages/patches/libstdc++-hurd.diff b/gnu/packages/patches/libstdc++-hurd.diff
new file mode 100644
index 0000000..e6a7fd6
--- /dev/null
+++ b/gnu/packages/patches/libstdc++-hurd.diff
@@ -0,0 +1,48 @@
+This is notably needed because in glibc 2.34, the move of pthread functions
+into libc.so happened for Linux only, not GNU/Hurd.
+
+The pthread_self() function can also always be used fine as it is on
+GNU/Hurd.
+
+libstdc++-v3/ChangeLog:
+
+        * config/os/gnu-linux/os_defines.h [!__linux__]
+          (_GLIBCXX_NATIVE_THREAD_ID, _GLIBCXX_GTHREAD_USE_WEAK): Do not define.
+
+--- a/libstdc++-v3/config/os/gnu-linux/os_defines.h
++++ b/libstdc++-v3/config/os/gnu-linux/os_defines.h
+@@ -49,22 +49,24 @@
+ // version dynamically in case it has changed since libstdc++ was configured.
+ #define _GLIBCXX_NO_OBSOLETE_ISINF_ISNAN_DYNAMIC __GLIBC_PREREQ(2,23)
+ 
+-#if __GLIBC_PREREQ(2, 27)
+-// Since glibc 2.27 pthread_self() is usable without linking to libpthread.
+-# define _GLIBCXX_NATIVE_THREAD_ID pthread_self()
+-#else
++#ifdef __linux__
++# if __GLIBC_PREREQ(2, 27)
++// Since glibc 2.27 Linux' pthread_self() is usable without linking to libpthread.
++#  define _GLIBCXX_NATIVE_THREAD_ID pthread_self()
++# else
+ // Before then it was in libc.so.6 but not libc.a, and always returns 0,
+ // which breaks the invariant this_thread::get_id() != thread::id{}.
+ // So only use it if we know the libpthread version is available.
+ // Otherwise use (__gthread_t)1 as the ID of the main (and only) thread.
+-# define _GLIBCXX_NATIVE_THREAD_ID \
+-  (__gthread_active_p() ? __gthread_self() : (__gthread_t)1)
+-#endif
++#  define _GLIBCXX_NATIVE_THREAD_ID \
++   (__gthread_active_p() ? __gthread_self() : (__gthread_t)1)
++# endif
+ 
+-#if __GLIBC_PREREQ(2, 34)
+-// Since glibc 2.34 all pthreads functions are usable without linking to
++# if __GLIBC_PREREQ(2, 34)
++// Since glibc 2.34 all Linux pthreads functions are usable without linking to
+ // libpthread.
+-# define _GLIBCXX_GTHREAD_USE_WEAK 0
++#  define _GLIBCXX_GTHREAD_USE_WEAK 0
++# endif
+ #endif
+ 
+ #endif
diff --git a/gnu/system/hurd.scm b/gnu/system/hurd.scm
index 24fc6db..57b132c 100644
--- a/gnu/system/hurd.scm
+++ b/gnu/system/hurd.scm
@@ -68,7 +68,7 @@ (define %base-packages/hurd
   ;; Note: the Shepherd comes before the Hurd, not just because its duty is to
   ;; shepherd the herd, but also because we want its 'halt' and 'reboot'
   ;; commands to take precedence.
-  (list shepherd hurd bash coreutils file findutils grep sed
+  (list shepherd-0.8 hurd bash coreutils file findutils grep sed
         diffutils patch gawk tar gzip bzip2 xz lzip
         guile-3.0-latest guile-colorized guile-readline
         net-base inetutils less shadow sudo which

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

* [bug#51770] progress report on updating the Hurd packages
  2023-02-23 10:59 progress report on updating the Hurd packages zamfofex
@ 2023-02-24 12:57 ` Joshua Branson via Guix-patches via
  0 siblings, 0 replies; 2+ messages in thread
From: Joshua Branson via Guix-patches via @ 2023-02-24 12:57 UTC (permalink / raw)
  To: zamfofex; +Cc: guix-devel@gnu.org, 51770

zamfofex <zamfofex@twdb.moe> writes:

> Hello, everyone! I just wanted to be able to report my progress with updating the Hurd packages.
>
> I have been able to get past my previous issues with building GMP, I think, but
> it seems that the glibc in Guix is still too outdated for the whole endeavor to
> succeed.
>
> I could either update the glibc package again or simply apply a patch to it
> (since the change needed seems to be small enough), but that would take quite a
> while waiting for things to build, and I’m not sure I’m up for it at the moment.
>
> I plan to pick this effort back up again at some point, but at the moment I’m a
> bit tired of having to wait for packages to build for multiple days. But if
> anyone wants to pick up where I left off, I will upload a ‘git diff’ with my
> current changes. (Applicable to ‘core-updates’.)
>
> Here is some more insight based on my conversations on #hurd:
>
> - https://logs.guix.gnu.org/hurd/2023-02-20.log
> - https://logs.guix.gnu.org/hurd/2023-02-21.log
>
> If anyone wants to take this work meanwhile, please do let me know somehow so that we don’t end up duplicating effort!
>
> Thanks for everyone’s amazing work on the Hurd and on Guix!

Here is an email that was send in the bug-hurd archives recently that
talked about how to build the Hurd on GNU/Linux.  Hopefully this will
help others to update our Hurd packages:

https://lists.gnu.org/archive/html/bug-hurd/2023-01/msg00132.html

Here are some scripts that automate this process:

https://github.com/flavioc/cross-hurd

The hurd was a wiki page for this as well (probably outdated):

https://darnassus.sceen.net/~hurd-web/toolchain/cross-gnu/

Also for those of you who don't know, the Hurd is getting a ton of
developer attention right now.  Work in progress includes SMP work, 64
bit kernel (with 32 bit address space), some re-using netBSD's driver's
work, etc.  Now's a great time get subscribed to the Hurd's mail
developmental email list:  bug-hurd:

https://lists.gnu.org/mailman/listinfo/bug-hurd






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

end of thread, other threads:[~2023-02-24 12:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-23 10:59 progress report on updating the Hurd packages zamfofex
2023-02-24 12:57 ` [bug#51770] " Joshua Branson via Guix-patches via

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