unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#54767] [PATCH] gnu: hwloc-1: Update to 1.11.13 and add upstream patch to fix a test
@ 2022-04-07 15:30 Philippe SWARTVAGHER
  2022-04-07 18:28 ` Maxime Devos
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Philippe SWARTVAGHER @ 2022-04-07 15:30 UTC (permalink / raw)
  To: 54767; +Cc: Philippe SWARTVAGHER

gnu/packages/mpi.scm (hwloc-1):
* Update to 1.11.13
* Add upstream patch not in the release to fix one test on BTRFS filesystems
* Use the target of the redirection in the source URL, as advised by `guix lint`
* Apply `guix style`
---
 gnu/packages/mpi.scm                          | 72 +++++++++----------
 gnu/packages/patches/hwloc-1-test-btrfs.patch | 55 ++++++++++++++
 2 files changed, 87 insertions(+), 40 deletions(-)
 create mode 100644 gnu/packages/patches/hwloc-1-test-btrfs.patch

diff --git a/gnu/packages/mpi.scm b/gnu/packages/mpi.scm
index 94c32684fb..b0ec1b17ca 100644
--- a/gnu/packages/mpi.scm
+++ b/gnu/packages/mpi.scm
@@ -57,41 +57,37 @@ (define-public hwloc-1
   ;; to migrate to 2.0.
   (package
     (name "hwloc")
-    (version "1.11.12")
+    (version "1.11.13")
     (source (origin
               (method url-fetch)
-              (uri (string-append "https://www.open-mpi.org/software/hwloc/v"
-                                  (version-major+minor version)
-                                  "/downloads/hwloc-" version ".tar.bz2"))
+              (uri (string-append
+                    "https://download.open-mpi.org/release/hwloc/v"
+                    (version-major+minor version) "/hwloc-" version ".tar.bz2"))
               (sha256
                (base32
-                "0za1b9lvrm3rhn0lrxja5f64r0aq1qs4m0pxn1ji2mbi8ndppyyx"))))
-
+                "1j69p8a1pjpbpwn4w7l4dfxmaxxqikchjzqw1ncw05zmcmvlnjd4"))
+              (patches (search-patches "hwloc-1-test-btrfs.patch"))))
     (properties
-     ;; Tell the 'generic-html' updater to monitor this URL for updates.
-     `((release-monitoring-url
-        . "https://www-lb.open-mpi.org/software/hwloc/current")))
-
+                ;; Tell the 'generic-html' updater to monitor this URL for updates.
+                `((release-monitoring-url #{.}#
+                   "https://www-lb.open-mpi.org/software/hwloc/current")))
     (build-system gnu-build-system)
-    (outputs '("out"           ;'lstopo' & co., depends on Cairo, libx11, etc.
-               "lib"           ;small closure
-               "doc"           ;400+ section 3 man pages
+    (outputs '("out" ;'lstopo' & co., depends on Cairo, libx11, etc.
+               "lib" ;small closure
+               "doc" ;400+ section 3 man pages
                "debug"))
-    (inputs
-     `(("libx11" ,libx11)
-       ("cairo" ,cairo)
-       ("ncurses" ,ncurses)
-       ("expat" ,expat)
-       ,@(if (not (string-prefix? "armhf"
-                                  (or (%current-target-system)
-                                      (%current-system))))
-             `(("numactl" ,numactl))
-             '())))
+    (inputs `(("libx11" ,libx11) ("cairo" ,cairo)
+              ("ncurses" ,ncurses)
+              ("expat" ,expat)
+              ,@(if (not (string-prefix? "armhf"
+                                         (or (%current-target-system)
+                                             (%current-system))))
+                    `(("numactl" ,numactl))
+                    '())))
     (propagated-inputs
-     ;; hwloc.pc lists it in 'Requires.private'.
-     (list libpciaccess))
-    (native-inputs
-     (list pkg-config))
+                       ;; hwloc.pc lists it in 'Requires.private'.
+                       (list libpciaccess))
+    (native-inputs (list pkg-config))
     (arguments
      `(#:configure-flags '("--localstatedir=/var")
        #:phases
@@ -101,32 +97,28 @@ (define-public hwloc-1
              ;; Arrange to skip 'tests/linux-libnuma', which fails on some
              ;; machines: <https://github.com/open-mpi/hwloc/issues/213>.
              (substitute* "tests/linux-libnuma.c"
-               (("numa_available\\(\\)")
-                "-1"))
-             #t))
+               (("numa_available\\(\\)") "-1")) #t))
          (add-after 'install 'refine-libnuma
            ;; Give -L arguments for libraries to avoid propagation
            (lambda* (#:key inputs outputs #:allow-other-keys)
-             (let ((out  (assoc-ref outputs "lib"))
-                   (numa (assoc-ref inputs "numactl")))
-               (substitute* (map (lambda (f) (string-append out "/" f))
+             (let ((out (assoc-ref outputs "lib")) (numa (assoc-ref inputs
+                                                                    "numactl")))
+               (substitute* (map (lambda (f)
+                                   (string-append out "/" f))
                                  '("lib/pkgconfig/hwloc.pc" "lib/libhwloc.la"))
-                 (("-lnuma" lib)
-                  (string-append "-L" numa "/lib " lib))))))
+                 (("-lnuma" lib) (string-append "-L" numa "/lib " lib))))))
          (add-after 'install 'avoid-circular-references
            (lambda* (#:key outputs #:allow-other-keys)
              (let ((lib (assoc-ref outputs "lib")))
                ;; Suppress the 'prefix=' and 'exec_prefix=' lines so that the
                ;; "lib" output doesn't refer to "out".
                (substitute* (string-append lib "/lib/pkgconfig/hwloc.pc")
-                 (("^.*prefix=.*$")
-                  ""))
-               #t)))
+                 (("^.*prefix=.*$") "")) #t)))
          (add-after 'install 'move-man3-pages
            (lambda* (#:key outputs #:allow-other-keys)
              ;; Move section 3 man pages to the "doc" output.
-             (let ((out (assoc-ref outputs "out"))
-                   (doc (assoc-ref outputs "doc")))
+             (let ((out (assoc-ref outputs "out")) (doc (assoc-ref outputs
+                                                                   "doc")))
                (copy-recursively (string-append out "/share/man/man3")
                                  (string-append doc "/share/man/man3"))
                (delete-file-recursively (string-append out "/share/man/man3"))
diff --git a/gnu/packages/patches/hwloc-1-test-btrfs.patch b/gnu/packages/patches/hwloc-1-test-btrfs.patch
new file mode 100644
index 0000000000..32f2919abc
--- /dev/null
+++ b/gnu/packages/patches/hwloc-1-test-btrfs.patch
@@ -0,0 +1,55 @@
+From 093316a897a2eb4972a7a3a5888f40975d03f6bf Mon Sep 17 00:00:00 2001
+From: Brice Goglin <Brice.Goglin@inria.fr>
+Date: Tue, 5 Apr 2022 17:39:50 +0200
+Subject: [PATCH] linux: (partial) fix the discovery of hugepages on btrfs
+ fsroot
+
+btrfs always returns 1 in directory stat.st_nlink.
+It breaks make check in tests/linux/ because the hugepages discovery
+uses st_nlink to allocate the memory page_types array.
+
+Always allocate at least 3 page_types slots
+(enough for all known cases, 1 for normal, 2 for huge pages)
+
+(partially cherry-picked from commit 7f351cec9bfe54a031f35ad16c9cfb99784d76dc)
+
+We don't reallocate later if needed as in 2.x commit 7f351cec9bfe54a031f35ad16c9cfb99784d76dc
+because v1.11 doesn't deserve a complete fix. Just commit the minimal change
+so that tests/linux/2i386-2t-hugepagesizecount with HWLOC_PAGESIZE_DEBUG=4096
+doesn't crash in btrfs anymore (test-topology.sh fails during make check if /tmp is in btrfs).
+
+Thanks to Philippe Swartvagher for the report.
+
+Signed-off-by: Brice Goglin <Brice.Goglin@inria.fr>
+---
+ src/topology-linux.c | 11 +++++++++--
+ 1 file changed, 9 insertions(+), 2 deletions(-)
+
+diff --git a/src/topology-linux.c b/src/topology-linux.c
+index 58c275fea..269eca7f5 100644
+--- a/src/topology-linux.c
++++ b/src/topology-linux.c
+@@ -1,6 +1,6 @@
+ /*
+  * Copyright © 2009 CNRS
+- * Copyright © 2009-2019 Inria.  All rights reserved.
++ * Copyright © 2009-2022 Inria.  All rights reserved.
+  * Copyright © 2009-2013, 2015 Université Bordeaux
+  * Copyright © 2009-2014 Cisco Systems, Inc.  All rights reserved.
+  * Copyright © 2015 Intel, Inc.  All rights reserved.
+@@ -2329,7 +2329,14 @@ hwloc_get_procfs_meminfo_info(struct hwloc_topology *topology,
+ 
+   err = hwloc_stat("/sys/kernel/mm/hugepages", &st, data->root_fd);
+   if (!err) {
+-    types = 1 + st.st_nlink-2;
++    types = 1 /* normal non-huge size */ + st.st_nlink - 2 /* ignore . and .. */;
++    if (types < 3)
++      /* some buggy filesystems (e.g. btrfs when reading from fsroot)
++       * return wrong st_nlink for directories (always 1 for btrfs).
++       * use 3 as a sane default (default page + 2 huge sizes).
++       * hwloc_parse_hugepages_info() will extend it if needed.
++       */
++      types = 3;
+     has_sysfs_hugepages = 1;
+   }
+ 

base-commit: 7409f246e2b0be9a2b3b6ae246385f3f197e5fbb
-- 
2.30.2





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

* [bug#54767] [PATCH] gnu: hwloc-1: Update to 1.11.13 and add upstream patch to fix a test
  2022-04-07 15:30 [bug#54767] [PATCH] gnu: hwloc-1: Update to 1.11.13 and add upstream patch to fix a test Philippe SWARTVAGHER
@ 2022-04-07 18:28 ` Maxime Devos
  2022-04-07 18:29 ` Maxime Devos
  2022-04-11 20:36 ` Ludovic Courtès
  2 siblings, 0 replies; 4+ messages in thread
From: Maxime Devos @ 2022-04-07 18:28 UTC (permalink / raw)
  To: Philippe SWARTVAGHER, 54767

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

Philippe SWARTVAGHER schreef op do 07-04-2022 om 17:30 [+0200]:
> +                `((release-monitoring-url #{.}#

Why the #{ }#?  The . is not a symbol, it tells the Scheme reader the
surrounding 'release-monitoring-url' and "https://" form a pair.

Greetings,
Maxime.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 260 bytes --]

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

* [bug#54767] [PATCH] gnu: hwloc-1: Update to 1.11.13 and add upstream patch to fix a test
  2022-04-07 15:30 [bug#54767] [PATCH] gnu: hwloc-1: Update to 1.11.13 and add upstream patch to fix a test Philippe SWARTVAGHER
  2022-04-07 18:28 ` Maxime Devos
@ 2022-04-07 18:29 ` Maxime Devos
  2022-04-11 20:36 ` Ludovic Courtès
  2 siblings, 0 replies; 4+ messages in thread
From: Maxime Devos @ 2022-04-07 18:29 UTC (permalink / raw)
  To: Philippe SWARTVAGHER, 54767

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

Philippe SWARTVAGHER schreef op do 07-04-2022 om 17:30 [+0200]:
> +              ("expat" ,expat)
> +              ,@(if (not (string-prefix? "armhf"
> +                                         (or (%current-target-system)
> +                                             (%current-system))))

Why?

Also, this is incorrect when cross-compiling, because (%current-target-
system) would be something like "arm-linux-gnueabihf".  Consider using
one of the target-...? procedures from (guix utils) instead.

Greetings,
Maxime.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 260 bytes --]

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

* [bug#54767] [PATCH] gnu: hwloc-1: Update to 1.11.13 and add upstream patch to fix a test
  2022-04-07 15:30 [bug#54767] [PATCH] gnu: hwloc-1: Update to 1.11.13 and add upstream patch to fix a test Philippe SWARTVAGHER
  2022-04-07 18:28 ` Maxime Devos
  2022-04-07 18:29 ` Maxime Devos
@ 2022-04-11 20:36 ` Ludovic Courtès
  2 siblings, 0 replies; 4+ messages in thread
From: Ludovic Courtès @ 2022-04-11 20:36 UTC (permalink / raw)
  To: Philippe SWARTVAGHER; +Cc: Maxime Devos, 54767

Hi,

Philippe SWARTVAGHER <philippe.swartvagher@inria.fr> skribis:

> gnu/packages/mpi.scm (hwloc-1):
> * Update to 1.11.13
> * Add upstream patch not in the release to fix one test on BTRFS filesystems
> * Use the target of the redirection in the source URL, as advised by `guix lint`
> * Apply `guix style`

I ended up pushing a variant of this, minus the ‘guix style’ reindent,
also taking Maxime’s suggestions into account:

  649556ea09 gnu: hwloc: Remove trailing #t.
  ac2d36559f gnu: hwloc@1: Use 'target-arm32?' in conditional.
  d81d8b1258 gnu: hwloc: Remove input labels.
  37fa61364e gnu: hwloc@1: Update to 1.11.13.

Thanks,
Ludo’.




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

end of thread, other threads:[~2022-04-11 20:37 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-07 15:30 [bug#54767] [PATCH] gnu: hwloc-1: Update to 1.11.13 and add upstream patch to fix a test Philippe SWARTVAGHER
2022-04-07 18:28 ` Maxime Devos
2022-04-07 18:29 ` Maxime Devos
2022-04-11 20:36 ` 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).