aboutsummaryrefslogtreecommitdiff
path: root/gnu/packages/patches
diff options
context:
space:
mode:
authorJohn Kehayias <john.kehayias@protonmail.com>2023-11-21 18:11:10 -0500
committerJohn Kehayias <john.kehayias@protonmail.com>2023-11-21 18:11:30 -0500
commit8d2a5a36af4c36dfa08c7ee75d7a06ebb7a8225a (patch)
tree0e0f0cc9d5fa5a3c783451d12b10ebdb4c0aafe9 /gnu/packages/patches
parentd1b786fe629ae9a80f37f64fdf48b9d7c132cd11 (diff)
parent42be8fa560a7554ac35801b46c3a0a007fd742ce (diff)
downloadguix-8d2a5a36af4c36dfa08c7ee75d7a06ebb7a8225a.tar.gz
guix-8d2a5a36af4c36dfa08c7ee75d7a06ebb7a8225a.zip
Merge branch 'master' into mesa-updates
Change-Id: I94c6874e5fdf916e3eb911f1a7df610cd3275474
Diffstat (limited to 'gnu/packages/patches')
-rw-r--r--gnu/packages/patches/ucx-tcp-iface-ioctl.patch105
1 files changed, 62 insertions, 43 deletions
diff --git a/gnu/packages/patches/ucx-tcp-iface-ioctl.patch b/gnu/packages/patches/ucx-tcp-iface-ioctl.patch
index c441a0861a..2a0e4ce138 100644
--- a/gnu/packages/patches/ucx-tcp-iface-ioctl.patch
+++ b/gnu/packages/patches/ucx-tcp-iface-ioctl.patch
@@ -3,102 +3,121 @@ TCP network interfaces cannot be obtained via /sys/class/net. This patch
provides alternative code that uses the SIOCGIFCONF ioctl to get the
names of the available TCP network interfaces.
+Initially submitted at <https://github.com/openucx/ucx/pull/4462>.
+
diff --git a/src/uct/tcp/tcp_iface.c b/src/uct/tcp/tcp_iface.c
-index cad4a2709..7c1d2c9de 100644
+index 6a6cd34fa..af32bb2e9 100644
--- a/src/uct/tcp/tcp_iface.c
+++ b/src/uct/tcp/tcp_iface.c
-@@ -17,6 +17,8 @@
- #include <sys/poll.h>
+@@ -18,6 +18,8 @@
#include <netinet/tcp.h>
#include <dirent.h>
+ #include <float.h>
+#include <net/if.h>
+#include <sys/ioctl.h>
+ #define UCT_TCP_IFACE_NETDEV_DIR "/sys/class/net"
- extern ucs_class_t UCS_CLASS_DECL_NAME(uct_tcp_iface_t);
-@@ -586,6 +588,68 @@ static UCS_CLASS_DEFINE_NEW_FUNC(uct_tcp_iface_t, uct_iface_t, uct_md_h,
+@@ -875,6 +877,85 @@ static UCS_CLASS_DEFINE_NEW_FUNC(uct_tcp_iface_t, uct_iface_t, uct_md_h,
uct_worker_h, const uct_iface_params_t*,
const uct_iface_config_t*);
+/* Fetch information about available network devices through an ioctl. */
-+static ucs_status_t query_devices_ioctl(uct_md_h md,
-+ uct_tl_device_resource_t **tl_devices_p,
-+ unsigned *num_tl_devices_p)
++static ucs_status_t uct_tcp_query_devices_ioctl(uct_md_h md,
++ uct_tl_device_resource_t **devices_p,
++ unsigned *num_devices_p)
+{
+ int sock, err, i;
-+ uct_tl_device_resource_t *resources, *tmp;
-+ unsigned num_resources;
++ uct_tl_device_resource_t *devices, *tmp;
++ unsigned num_devices;
+ ucs_status_t status;
+ struct ifconf conf;
-+ struct ifreq reqs[10];
+
-+ conf.ifc_len = sizeof reqs;
-+ conf.ifc_req = reqs;
++ conf.ifc_len = 0;
++ conf.ifc_req = NULL;
++
++ status = ucs_socket_create(AF_INET, SOCK_STREAM, &sock);
++ if (status != UCS_OK) {
++ goto out;
++ }
++
++ err = ioctl(sock, SIOCGIFCONF, &conf);
++ if (err < 0) {
++ ucs_error("ioctl(SIOCGIFCONF) failed: %m");
++ status = UCS_ERR_IO_ERROR;
++ goto out;
++ }
+
-+ sock = socket(SOCK_STREAM, AF_INET, 0);
-+ if (sock < 0) {
-+ ucs_error("socket(2) failed: %m");
-+ status = UCS_ERR_IO_ERROR;
-+ goto out;
++ conf.ifc_req = ucs_calloc(1, conf.ifc_len, "ifreq");
++ if (conf.ifc_req == NULL) {
++ ucs_error("memory alocation failed");
++ status = UCS_ERR_NO_MEMORY;
++ goto out;
+ }
+
+ err = ioctl(sock, SIOCGIFCONF, &conf);
+ if (err < 0) {
-+ ucs_error("SIOCGIFCONF ioctl failed: %m");
-+ status = UCS_ERR_IO_ERROR;
-+ goto out;
++ ucs_error("ioctl(SIOCGIFCONF) failed: %m");
++ status = UCS_ERR_IO_ERROR;
++ goto out_free;
+ }
+
-+ resources = NULL;
-+ num_resources = 0;
-+ for (i = 0; i < conf.ifc_len / sizeof(struct ifreq); i++) {
-+ const char *name = reqs[i].ifr_name;
++ devices = NULL;
++ num_devices = 0;
++ for (i = 0; i < (conf.ifc_len / sizeof(struct ifreq)); i++) {
++ const char *name = conf.ifc_req[i].ifr_name;
++ sa_family_t family = conf.ifc_req[i].ifr_addr.sa_family;
+
-+ if (!ucs_netif_is_active(name, AF_INET)) {
++ if (!ucs_netif_is_active(name, family)) {
+ continue;
+ }
+
-+ tmp = ucs_realloc(resources, sizeof(*resources) * (num_resources + 1),
-+ "tcp resources");
++ tmp = ucs_realloc(devices, sizeof(*devices) * (num_devices + 1),
++ "tcp devices");
+ if (tmp == NULL) {
-+ ucs_free(resources);
++ ucs_free(devices);
+ status = UCS_ERR_NO_MEMORY;
-+ goto out;
++ goto out_free;
+ }
-+ resources = tmp;
++ devices = tmp;
+
-+ ucs_snprintf_zero(resources[i].name, sizeof(resources[i].name),
++ ucs_snprintf_zero(devices[num_devices].name,
++ sizeof(devices[num_devices].name),
+ "%s", name);
-+ resources[i].type = UCT_DEVICE_TYPE_NET;
-+ ++num_resources;
++ devices[num_devices].type = UCT_DEVICE_TYPE_NET;
++ ++num_devices;
+ }
+
-+ *num_tl_devices_p = num_resources;
-+ *tl_devices_p = resources;
-+ status = UCS_OK;
++ *num_devices_p = num_devices;
++ *devices_p = devices;
++ status = UCS_OK;
+
++out_free:
++ ucs_free(conf.ifc_req);
+out:
-+ if (sock >= 0) close(sock);
++ if (sock >= 0) {
++ close(sock);
++ }
+ return status;
+}
+
ucs_status_t uct_tcp_query_devices(uct_md_h md,
uct_tl_device_resource_t **devices_p,
unsigned *num_devices_p)
-@@ -599,9 +663,9 @@ ucs_status_t uct_tcp_query_devices(uct_md_h md,
+@@ -893,9 +974,9 @@ ucs_status_t uct_tcp_query_devices(uct_md_h md,
dir = opendir(UCT_TCP_IFACE_NETDEV_DIR);
if (dir == NULL) {
- ucs_error("opendir(%s) failed: %m", UCT_TCP_IFACE_NETDEV_DIR);
- status = UCS_ERR_IO_ERROR;
- goto out;
-+ /* When /sys is unavailable, as can be the case in a container,
-+ * resort to a good old 'ioctl'. */
-+ return query_devices_ioctl(md, devices_p, num_devices_p);
++ /* When /sys is unavailable, as can be the case in a container,
++ * resort to a good old 'ioctl'. */
++ return uct_tcp_query_devices_ioctl(md, devices_p, num_devices_p);
}
devices = NULL;
-@@ -655,7 +719,6 @@ ucs_status_t uct_tcp_query_devices(uct_md_h md,
+@@ -963,7 +1044,6 @@ ucs_status_t uct_tcp_query_devices(uct_md_h md,
out_closedir:
closedir(dir);
t)) ;; Tells NSS to build for the 64-bit ABI if we are 64-bit system. #$@(if (target-64bit?) #~((setenv "USE_64" "1")) #~()))) (replace 'check (lambda* (#:key tests? #:allow-other-keys) (if tests? (begin ;; Use 127.0.0.1 instead of $HOST.$DOMSUF as HOSTADDR for ;; testing. The latter requires a working DNS or /etc/hosts. (setenv "DOMSUF" "localdomain") (setenv "USE_IP" "TRUE") (setenv "IP_ADDRESS" "127.0.0.1") ;; The "PayPalEE.cert" certificate expires every six months, ;; leading to test failures: ;; <https://bugzilla.mozilla.org/show_bug.cgi?id=609734>. To ;; work around that, set the time to roughly the release date. (invoke "faketime" "2022-06-01" "./nss/tests/all.sh")) (format #t "test suite not run~%")))) (replace 'install (lambda* (#:key outputs #:allow-other-keys) (let* ((out (assoc-ref outputs "out")) (bin (string-append (assoc-ref outputs "bin") "/bin")) (inc (string-append out "/include/nss")) (lib (string-append out "/lib/nss")) (obj (match (scandir "dist" (cut string-suffix? "OBJ" <>)) ((obj) (string-append "dist/" obj))))) ;; Install nss-config to $out/bin. (install-file (string-append obj "/bin/nss-config") (string-append out "/bin")) (delete-file (string-append obj "/bin/nss-config")) ;; Install nss.pc to $out/lib/pkgconfig. (install-file (string-append obj "/lib/pkgconfig/nss.pc") (string-append out "/lib/pkgconfig")) (delete-file (string-append obj "/lib/pkgconfig/nss.pc")) (rmdir (string-append obj "/lib/pkgconfig")) ;; Install other files. (copy-recursively "dist/public/nss" inc) (copy-recursively (string-append obj "/bin") bin) (copy-recursively (string-append obj "/lib") lib))))))) (inputs (list sqlite zlib)) (propagated-inputs (list nspr)) ;required by nss.pc. (native-inputs (list perl libfaketime)) ;for tests ;; The NSS test suite takes around 48 hours on Loongson 3A (MIPS) when ;; another build is happening concurrently on the same machine. (properties '((timeout . 216000))) ;60 hours (home-page "https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS") (synopsis "Network Security Services") (description "Network Security Services (@dfn{NSS}) is a set of libraries designed to support cross-platform development of security-enabled client and server applications. Applications built with NSS can support SSL v2 and v3, TLS, PKCS #5, PKCS #7, PKCS #11, PKCS #12, S/MIME, X.509 v3 certificates, and other security standards.") (license license:mpl2.0))) ='logmsg'> * gnu/packages/cpp.scm (expected-lite): New variable. Change-Id: I5a21dd631e1f2a3c97b920efcdca69f2537b42da 2023-12-27gnu: google-highway: Update to 1.0.7.Efraim Flashner * gnu/packages/cpp.scm (google-highway): Update to 1.0.7. Change-Id: I8374135da8343910156709c255f144dab1554cc0 2023-12-27gnu: google-highway: Build shared libraries.Efraim Flashner * gnu/packages/cpp.scm (google-highway)[arguments]: Add configure-flag to build shared libraries. Change-Id: Ic222dd454290742c7c964a1a5a5b7d8d7533c3e1 2023-12-04gnu: abseil-cpp: Update to 20230802.1.Greg Hogan * gnu/packages/cpp.scm (abseil-cpp): Update to 20230802.1. [arguments]<#:phases>: Add phase to set timezone environment variable. * gnu/packages/cpp.scm (abseil-cpp-20220623.1): Keep old version. * gnu/packages/cpp.scm (abseil-cpp-for-c++-standard): Accept package to inherit from. * gnu/packages/cpp.scm (abseil-cpp-cxxstd11, abseil-cpp-cxxstd17): Inherit from latest supported version. Signed-off-by: Ludovic Courtès <ludo@gnu.org> Change-Id: I7c29e1cd980b04496000eeb038529cdc6f636cb7 2023-11-30gnu: Add mapbox-variant.Liliana Marie Prikler * gnu/packages/cpp.scm (mapbox-variant): New variable. Change-Id: Id84b35d97d73fcf1c116ddca844bc75ada627b55 2023-11-23gnu: folly: Update to 2023.11.06.00.Greg Hogan * gnu/packages/cpp.scm (folly): Update to 2023.11.06.00. Signed-off-by: Ludovic Courtès <ludo@gnu.org> 2023-11-07gnu: Add frozen.Maxim Cournoyer * gnu/packages/cpp.scm (frozen): New variable. Change-Id: I738dfcfa55ddb824c2186fb61484a8a3c9532b35