From eb46c6c5c81695af475f7e1e416d05e51157fe60 Mon Sep 17 00:00:00 2001 From: Pierre Langlois Date: Sat, 10 Jul 2021 14:12:02 +0100 Subject: gnu: u-boot: Update to 2021.07. * gnu/packages/patches/u-boot-sifive-prevent-reloc-initrd-fdt.patch: New patch. * gnu/local.mk (dist_patch_DATA): Add it. * gnu/packages/bootloaders.scm (%u-boot-sifive-prevent-relocating-initrd-fdt): New variable. (u-boot): Update to 2021.07. [native-inputs]: Add python-pycryptodomex. (u-boot-2021.07): Delete variable. (u-boot-tools)[arguments]: Adapt 'patch phase, disable failing test_spl test. (u-boot-sifive-unmatched): Use default u-boot package. (u-boot-pinebook-pro-rk3328): Use default u-boot package. --- .../patches/u-boot-sifive-prevent-reloc-initrd-fdt.patch | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 gnu/packages/patches/u-boot-sifive-prevent-reloc-initrd-fdt.patch (limited to 'gnu/packages/patches') diff --git a/gnu/packages/patches/u-boot-sifive-prevent-reloc-initrd-fdt.patch b/gnu/packages/patches/u-boot-sifive-prevent-reloc-initrd-fdt.patch new file mode 100644 index 0000000000..a5b92e3e8f --- /dev/null +++ b/gnu/packages/patches/u-boot-sifive-prevent-reloc-initrd-fdt.patch @@ -0,0 +1,16 @@ +Description: prevent relocating initrd & fdt, that results in failure to boot +Author: Heinrich Schuchardt (xypron) +Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/u-boot/+bug/1937246 +Index: u-boot-2021.07~rc4+dfsg/include/configs/sifive-unmatched.h +=================================================================== +--- u-boot-2021.07~rc4+dfsg.orig/include/configs/sifive-unmatched.h ++++ u-boot-2021.07~rc4+dfsg/include/configs/sifive-unmatched.h +@@ -62,6 +62,8 @@ + "name=system,size=-,bootable,type=${type_guid_gpt_system};" + + #define CONFIG_EXTRA_ENV_SETTINGS \ ++ "fdt_high=0xffffffffffffffff\0" \ ++ "initrd_high=0xffffffffffffffff\0" \ + "kernel_addr_r=0x84000000\0" \ + "fdt_addr_r=0x88000000\0" \ + "scriptaddr=0x88100000\0" \ -- cgit v1.2.3 From 6da2b35b60aee8086c7ad1ee1c1492ed5e730a92 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Mon, 2 Aug 2021 12:17:38 +0200 Subject: gnu: Add onnx-optimizer. * gnu/packages/machine-learning.scm (onnx-optimizer): New variable. * gnu/packages/patches/onnx-optimizer-system-library.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. --- gnu/local.mk | 1 + gnu/packages/machine-learning.scm | 44 ++++++++++++++++++ .../patches/onnx-optimizer-system-library.patch | 53 ++++++++++++++++++++++ 3 files changed, 98 insertions(+) create mode 100644 gnu/packages/patches/onnx-optimizer-system-library.patch (limited to 'gnu/packages/patches') diff --git a/gnu/local.mk b/gnu/local.mk index 4c6aa6945e..9e8f2d702d 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1512,6 +1512,7 @@ dist_patch_DATA = \ %D%/packages/patches/ocaml-dose3-Install-mli-cmx-etc.patch \ %D%/packages/patches/omake-fix-non-determinism.patch \ %D%/packages/patches/oneko-remove-nonfree-characters.patch \ + %D%/packages/patches/onnx-optimizer-system-library.patch \ %D%/packages/patches/onnx-use-system-googletest.patch \ %D%/packages/patches/onnx-shared-libraries.patch \ %D%/packages/patches/onnx-skip-model-downloads.patch \ diff --git a/gnu/packages/machine-learning.scm b/gnu/packages/machine-learning.scm index 177d1aaa4f..b32e5ef289 100644 --- a/gnu/packages/machine-learning.scm +++ b/gnu/packages/machine-learning.scm @@ -675,6 +675,50 @@ standard data types.") ;; headers, hence the name change. (deprecated-package "python-onnx" onnx)) +(define-public onnx-optimizer + (package + (name "onnx-optimizer") + ;; Note: 0.2.x is *more* recent than 1.5.0. + (version "0.2.6") + (home-page "https://github.com/onnx/optimizer") + (source (origin + (method git-fetch) + (uri (git-reference + (url home-page) + (commit (string-append "v" version)))) + (sha256 + (base32 + "1wkqqdxcxpfbf8zpbdfdd3zz5jkw775g31gyykj11z4y6pp659l6")) + (file-name (git-file-name name version)) + (patches (search-patches "onnx-optimizer-system-library.patch")) + (modules '((guix build utils))) + (snippet '(delete-file-recursively "third_party")))) + (build-system python-build-system) + (arguments (package-arguments onnx)) ;reuse build system tweaks + (native-inputs + `(("cmake" ,cmake) + ("python-pytest" ,python-pytest) + ("python-pytest-runner" ,python-pytest-runner) + ("python-nbval" ,python-nbval) + ("python-coverage" ,python-coverage))) + (inputs + `(("onnx" ,onnx) + ("protobuf" ,protobuf) + ("pybind11" ,pybind11))) + (propagated-inputs + `(("python-numpy" ,python-numpy))) + (synopsis "Library to optimize ONNX models") + (description + "This package provides a C++ and Python library for performing arbitrary +optimizations on ONNX models, as well as a growing list of prepackaged +optimization passes. + +Not all possible optimizations can be directly implemented on ONNX graphs--- +some will need additional backend-specific information---but many can, and the +aim is to provide all such passes along with ONNX so that they can be re-used +with a single function call.") + (license license:expat))) + (define-public rxcpp (package (name "rxcpp") diff --git a/gnu/packages/patches/onnx-optimizer-system-library.patch b/gnu/packages/patches/onnx-optimizer-system-library.patch new file mode 100644 index 0000000000..5c592597e0 --- /dev/null +++ b/gnu/packages/patches/onnx-optimizer-system-library.patch @@ -0,0 +1,53 @@ +Arrange so that onnx-optimizer (1) uses our own ONNX build, +(2) builds as a shared library, and (3) links against the shared +libraries of ONNX. + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index c2e48b35..8af51076 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -9,8 +9,6 @@ endif(NOT MSVC) + + set(CMAKE_POSITION_INDEPENDENT_CODE ON) + +-set(ONNX_ROOT ${PROJECT_SOURCE_DIR}/third_party/onnx) +-add_subdirectory(${ONNX_ROOT}) + + file(READ "${PROJECT_SOURCE_DIR}/VERSION_NUMBER" ONNX_OPTIMIZER_VERSION) + string(STRIP "${ONNX_OPTIMIZER_VERSION}" ONNX_OPTIMIZER_VERSION) +@@ -21,14 +19,18 @@ file(GLOB_RECURSE onnx_opt_srcs "onnxoptimizer/*.cc" + list(REMOVE_ITEM onnx_opt_srcs "${PROJECT_SOURCE_DIR}/onnxoptimizer/cpp2py_export.cc") + + add_library(onnx_optimizer ${onnx_opt_srcs}) +-target_link_libraries(onnx_optimizer PUBLIC onnx) ++target_link_libraries(onnx_optimizer PUBLIC onnx onnx_proto) + target_include_directories(onnx_optimizer PUBLIC + $ + $ + ) + ++# These cpp macros must be defined so the ONNX headers behave ++# correctly. ++set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DONNX_ML=1 -DONNX_NAMESPACE=onnx") ++ + add_executable(onnx_optimizer_exec examples/onnx_optimizer_exec.cpp) +-target_link_libraries(onnx_optimizer_exec onnx_optimizer) ++target_link_libraries(onnx_optimizer_exec onnx_optimizer protobuf) + + if(BUILD_ONNX_PYTHON) + if("${PY_EXT_SUFFIX}" STREQUAL "") +@@ -79,11 +81,10 @@ if(BUILD_ONNX_PYTHON) + PRIVATE $) + else() + # Assume everything else is like gcc +- target_link_libraries(onnx_opt_cpp2py_export +- PRIVATE "-Wl,--whole-archive" $ +- "-Wl,--no-whole-archive") ++ target_link_libraries(onnx_opt_cpp2py_export PRIVATE onnx_optimizer) + set_target_properties(onnx_opt_cpp2py_export +- PROPERTIES LINK_FLAGS "-Wl,--exclude-libs,ALL") ++ PROPERTIES LINK_FLAGS ++ "-Wl,-rpath=${CMAKE_INSTALL_PREFIX}/lib") + endif() + + target_link_libraries(onnx_opt_cpp2py_export PRIVATE onnx_optimizer) -- cgit v1.2.3 From f71b381d1f467fe7a1b999663ee15ce93fadfa1c Mon Sep 17 00:00:00 2001 From: Efraim Flashner Date: Wed, 4 Aug 2021 16:23:37 +0300 Subject: gnu: samba: Update to 4.13.10. * gnu/packages/samba.scm (samba): Update to 4.13.10. [source]: Remove patch. * gnu/packages/patches/samba-fix-fcntl-hint-detection.patch: Remove file. * gnu/local.mk (dist_patch_DATA): Remove it. --- gnu/local.mk | 1 - .../patches/samba-fix-fcntl-hint-detection.patch | 55 ---------------------- gnu/packages/samba.scm | 5 +- 3 files changed, 2 insertions(+), 59 deletions(-) delete mode 100644 gnu/packages/patches/samba-fix-fcntl-hint-detection.patch (limited to 'gnu/packages/patches') diff --git a/gnu/local.mk b/gnu/local.mk index e8494806fd..e6a2f735f9 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1548,7 +1548,6 @@ dist_patch_DATA = \ %D%/packages/patches/plasma-framework-fix-KF5PlasmaMacros.cmake.patch \ %D%/packages/patches/ppsspp-disable-upgrade-and-gold.patch \ %D%/packages/patches/pthreadpool-system-libraries.patch \ - %D%/packages/patches/samba-fix-fcntl-hint-detection.patch \ %D%/packages/patches/sdcc-disable-non-free-code.patch \ %D%/packages/patches/sdl-pango-api_additions.patch \ %D%/packages/patches/sdl-pango-blit_overflow.patch \ diff --git a/gnu/packages/patches/samba-fix-fcntl-hint-detection.patch b/gnu/packages/patches/samba-fix-fcntl-hint-detection.patch deleted file mode 100644 index b56c628537..0000000000 --- a/gnu/packages/patches/samba-fix-fcntl-hint-detection.patch +++ /dev/null @@ -1,55 +0,0 @@ -From 454ccd986b61799908a6898a55d0480911f15306 Mon Sep 17 00:00:00 2001 -From: Ralph Boehme -Date: Mon, 21 Sep 2020 07:48:43 +0200 -Subject: [PATCH] s3: fix fcntl waf configure check - -RN: Fix fcntl waf configure check -BUG: https://bugzilla.samba.org/show_bug.cgi?id=14503 - -Signed-off-by: Ralph Boehme -Reviewed-by: Volker Lendecke - -Autobuild-User(master): Volker Lendecke -Autobuild-Date(master): Mon Sep 21 07:26:54 UTC 2020 on sn-devel-184 ---- - source3/wscript | 10 +++++----- - 1 file changed, 5 insertions(+), 5 deletions(-) - -diff --git a/source3/wscript b/source3/wscript -index 840ed430c0f..d3ef346eecd 100644 ---- a/source3/wscript -+++ b/source3/wscript -@@ -1244,7 +1244,7 @@ err: - - int main(void) - { -- uint64_t *hint, get_hint; -+ uint64_t hint, get_hint; - int fd; - - fd = open(DATA, O_RDONLY | O_CREAT | O_EXCL); -@@ -1252,8 +1252,8 @@ int main(void) - goto err; - } - -- *hint = RWH_WRITE_LIFE_SHORT; -- int ret = fcntl(fd, F_SET_RW_HINT, hint); -+ hint = RWH_WRITE_LIFE_SHORT; -+ int ret = fcntl(fd, F_SET_RW_HINT, &hint); - if (ret == -1) { - goto err; - } -@@ -1267,8 +1267,8 @@ int main(void) - goto err; - } - -- *hint = RWH_WRITE_LIFE_EXTREME; -- ret = fcntl(fd, F_SET_FILE_RW_HINT, hint); -+ hint = RWH_WRITE_LIFE_EXTREME; -+ ret = fcntl(fd, F_SET_FILE_RW_HINT, &hint); - if (ret == -1) { - goto err; - } --- -2.28.0 - diff --git a/gnu/packages/samba.scm b/gnu/packages/samba.scm index f9b20ccd47..6a1322b4b3 100644 --- a/gnu/packages/samba.scm +++ b/gnu/packages/samba.scm @@ -172,15 +172,14 @@ external dependencies.") (define-public samba (package (name "samba") - (version "4.13.4") + (version "4.13.10") (source (origin (method url-fetch) (uri (string-append "https://download.samba.org/pub/samba/stable/" "samba-" version ".tar.gz")) (sha256 - (base32 "0y2wc7njhyhg055krp878xfv9c3wbhrhzn02d5ich30hyxilrcx1")) - (patches (search-patches "samba-fix-fcntl-hint-detection.patch")) + (base32 "00q5hf2r71dyma785dckcyksv3082mqfgyy9q6k6rc6kqjwkirzh")) (modules '((guix build utils))) (snippet '(begin -- cgit v1.2.3 From 2e0ddc74f6641ec1e286f7f81eaf5bf6644eed52 Mon Sep 17 00:00:00 2001 From: Dmitry Polyakov Date: Wed, 4 Aug 2021 17:29:12 +0500 Subject: gnu: Add instead. * gnu/packages/game-development.scm (instead): New variable. * gnu/packages/patches/instead-use-games-path.patch: New file. * gnu/local.mk (dist_patch_DATA): Register it here. --- gnu/local.mk | 2 + gnu/packages/game-development.scm | 51 +++++++++++++++++++++++ gnu/packages/patches/instead-use-games-path.patch | 32 ++++++++++++++ 3 files changed, 85 insertions(+) create mode 100644 gnu/packages/patches/instead-use-games-path.patch (limited to 'gnu/packages/patches') diff --git a/gnu/local.mk b/gnu/local.mk index e6a2f735f9..82e5fbc88f 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -43,6 +43,7 @@ # Copyright © 2021 Philip McGrath # Copyright © 2021 Arun Isaac # Copyright © 2021 Sharlatan Hellseher +# Copyright © 2021 Dmitry Polyakov # # This file is part of GNU Guix. # @@ -1261,6 +1262,7 @@ dist_patch_DATA = \ %D%/packages/patches/imagemagick-WriteTHUMBNAILImage-fix.patch \ %D%/packages/patches/inetutils-hurd.patch \ %D%/packages/patches/inkscape-poppler-0.76.patch \ + %D%/packages/patches/instead-use-games-path.patch \ %D%/packages/patches/inkscape-1.1-fix-build-witch-gcc7.5.patch \ %D%/packages/patches/intel-xed-fix-nondeterminism.patch \ %D%/packages/patches/intltool-perl-compatibility.patch \ diff --git a/gnu/packages/game-development.scm b/gnu/packages/game-development.scm index e1593c0f82..dbe5ac6739 100644 --- a/gnu/packages/game-development.scm +++ b/gnu/packages/game-development.scm @@ -21,6 +21,7 @@ ;;; Copyright © 2020 Timotej Lazar ;;; Copyright © 2020 Giacomo Leidi ;;; Copyright © 2021 Alexandru-Sergiu Marton +;;; Copyright © 2021 Dmitry Polyakov ;;; ;;; This file is part of GNU Guix. ;;; @@ -2115,6 +2116,56 @@ upon which people base their games, ports to new platforms, and other projects.") (license license:gpl2)))) +(define-public instead + (package + (name "instead") + (version "3.3.5") + (build-system cmake-build-system) + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/instead-hub/instead") + (commit version))) + (file-name (git-file-name name version)) + (sha256 + (base32 "02j8cw623j51qmr4991i5hsbrzmnp0qfzds8m6nwwr15sjv3hv1g")) + (patches + (search-patches + "instead-use-games-path.patch")) + (modules '((guix build utils))) + (snippet + '(begin + (delete-file-recursively "src/zlib"))))) + (arguments + '(#:configure-flags + (list (string-append + "-DLUA_INCLUDE_DIR=" + (assoc-ref %build-inputs "luajit") "/include/luajit-2.1/") + "-DWITH_LUAJIT=1" + "-DWITH_GTK3=1") + #:tests? #f)) + (inputs + `(("gtk+",gtk+) + ("lua" ,lua) + ("luajit" ,luajit) + ("pkg-config" ,pkg-config) + ("sdl2-images" ,sdl2-image) + ("sdl2-ttf" ,sdl2-ttf) + ("sdl2-mixer" ,sdl2-mixer) + ("zlib" ,zlib))) + (home-page "https://instead3.syscall.ru/") + (synopsis "Text adventure interpreter") + (description "The STEAD (Simple TExt ADventures) interpreter provides +functionality to play games that mix elements of visual novels, interactive +fiction and classic point-and-click adventures.") + (native-search-paths + (list (search-path-specification + (variable "INSTEAD_GAMES_PATH") + (separator #f) ;single entry + (files '("share/instead/games"))))) + (license license:expat))) + (define-public openvr (package (name "openvr") diff --git a/gnu/packages/patches/instead-use-games-path.patch b/gnu/packages/patches/instead-use-games-path.patch new file mode 100644 index 0000000000..783fd21add --- /dev/null +++ b/gnu/packages/patches/instead-use-games-path.patch @@ -0,0 +1,32 @@ +From 8b350daa847dd8e131d9e6b5b4434ce68a7903d0 Mon Sep 17 00:00:00 2001 +From: Dmitry Polyakov +Date: Wed, 4 Aug 2021 15:46:33 +0500 +Subject: [PATCH] Add support for INSTEAD_GAMES_PATH + +In some setups, users might prefer to determine on their own the path in +which games are located. This patch enables them to do so by setting +the “INSTEAD_GAMES_PATH” environmnent variable. +--- + src/main.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/src/main.c b/src/main.c +index ba0ada1d..b05497b8 100644 +--- a/src/main.c ++++ b/src/main.c +@@ -394,6 +394,12 @@ int instead_main(int argc, char *argv[]) + setdir(game_cwd); + profile_load(NULL); + ++ char *gamespath_env = NULL; ++ ++ if (gamespath_env = getenv("INSTEAD_GAMES_PATH"), gamespath_env != NULL) { ++ games_sw = strdup(gamespath_env); ++ } ++ + for (i = 1; i < argc; i++) { + if (lua_sw) /* during load profile */ + break; +-- +2.32.0 + -- cgit v1.2.3 From dd55ad7ff896a0a099c669ef0b420ae2bcdb4498 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Wed, 4 Aug 2021 16:15:17 +0200 Subject: gnu: Add python-pytorch. * gnu/packages/machine-learning.scm (python-pytorch): New variable. * gnu/packages/patches/python-pytorch-runpath.patch, gnu/packages/patches/python-pytorch-system-libraries.patch: New files. * gnu/local.mk (dist_patch_DATA): Add them. --- gnu/local.mk | 2 + gnu/packages/machine-learning.scm | 143 ++++++++++++++++++++- gnu/packages/patches/python-pytorch-runpath.patch | 25 ++++ .../patches/python-pytorch-system-libraries.patch | 131 +++++++++++++++++++ 4 files changed, 300 insertions(+), 1 deletion(-) create mode 100644 gnu/packages/patches/python-pytorch-runpath.patch create mode 100644 gnu/packages/patches/python-pytorch-system-libraries.patch (limited to 'gnu/packages/patches') diff --git a/gnu/local.mk b/gnu/local.mk index 82e5fbc88f..51a76e3638 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1649,6 +1649,8 @@ dist_patch_DATA = \ %D%/packages/patches/python-pydot-regression-test.patch \ %D%/packages/patches/python2-pygobject-2-deprecation.patch \ %D%/packages/patches/python-pygpgme-fix-pinentry-tests.patch \ + %D%/packages/patches/python-pytorch-runpath.patch \ + %D%/packages/patches/python-pytorch-system-libraries.patch \ %D%/packages/patches/python-robotframework-source-date-epoch.patch \ %D%/packages/patches/python-seaborn-kde-test.patch \ %D%/packages/patches/python2-subprocess32-disable-input-test.patch \ diff --git a/gnu/packages/machine-learning.scm b/gnu/packages/machine-learning.scm index c3480d6523..4149defc47 100644 --- a/gnu/packages/machine-learning.scm +++ b/gnu/packages/machine-learning.scm @@ -65,10 +65,12 @@ #:use-module (gnu packages graphviz) #:use-module (gnu packages gstreamer) #:use-module (gnu packages image) + #:use-module (gnu packages libffi) #:use-module (gnu packages linux) #:use-module (gnu packages llvm) #:use-module (gnu packages maths) #:use-module (gnu packages mpi) + #:use-module (gnu packages ninja) #:use-module (gnu packages ocaml) #:use-module (gnu packages onc-rpc) #:use-module (gnu packages parallel) @@ -2546,7 +2548,7 @@ general non-linear dimension reduction.") (package (name "xnnpack") (version (git-version version revision commit)) - (home-page "https://github.com/google/XNNPACK") + (home-page "https://github.com/google/XNNPACK") ;fork of QNNPACK (source (origin (method git-fetch) (uri (git-reference (url home-page) (commit commit))) @@ -2586,3 +2588,142 @@ high-level machine learning frameworks, such as TensorFlow Lite, TensorFlow.js, PyTorch, and MediaPipe.") (license license:bsd-3)))) +(define-public python-pytorch + (package + (name "python-pytorch") + (version "1.9.0") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/pytorch/pytorch") + (commit (string-append "v" version)) + (recursive? #t))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "0cznsh68hwk5761gv7iijb4g6jgjpvs3bbixwpzzmkbkbn2q96c1")) + (patches (search-patches "python-pytorch-system-libraries.patch" + "python-pytorch-runpath.patch")) + (modules '((guix build utils))) + (snippet + '(begin + ;; XXX: Let's be clear: this package is a bundling fest. We + ;; delete as much as we can, but there's still a lot left. + (for-each (lambda (directory) + (delete-file-recursively + (string-append "third_party/" directory))) + '("benchmark" "cpuinfo" "eigen" + + ;; FIXME: QNNPACK (of which XNNPACK is a fork) + ;; needs these. + ;; "FP16" "FXdiv" "gemmlowp" "psimd" + + "gloo" "googletest" "ios-cmake" + "onnx" "protobuf" "pthreadpool" + "pybind11" "python-enum" "python-peachpy" + "python-six" "tbb" "XNNPACK" "zstd")) + + ;; Adjust references to the onnx-optimizer headers. + (substitute* "caffe2/onnx/backend.cc" + (("onnx/optimizer/") + "onnxoptimizer/")))))) + (build-system python-build-system) + (arguments + '(#:phases (modify-phases %standard-phases + (add-before 'build 'use-system-libraries + (lambda* (#:key outputs #:allow-other-keys) + ;; Tell 'setup.py' to let 'CMakeLists.txt' know that we + ;; want to use "system libraries" instead of the bundled + ;; ones. + (setenv "USE_SYSTEM_LIBS" "1") + + ;; XXX: Disable that for simplicity for now. + (setenv "USE_FBGEMM" "0") + + ;; Set 'OUT/lib' rather than '$ORIGIN' as the RUNPATH on + ;; binaries that go to 'lib/python3.8/torch/bin' & co. + #;(substitute* "cmake/Dependencies.cmake" + (("^set\\(CMAKE_INSTALL_RPATH .*") + (string-append "set(CMAKE_INSTALL_RPATH \"" + (assoc-ref outputs "out") + "/lib\")\n"))))) + (add-before 'build 'make-things-writable + (lambda _ + ;; The 'build_caffe2' function in + ;; 'tools/build_pytorch_libs.py', called from the + ;; top-level 'setup.py', needs write access to this + ;; directory. + (for-each make-file-writable + (find-files "caffe2/proto" "." + #:directories? #t)))) + (replace 'check + (lambda* (#:key inputs outputs tests? #:allow-other-keys) + ;; Run the test suite following the instructions in + ;; 'CONTRIBUTING.md'. XXX: Unfortunately this doesn't + ;; work, unless you set PYTHONPATH presumably. + (when tests? + (let ((python-site (site-packages inputs outputs))) + (setenv "PYTHONPATH" + (string-append python-site ":" + (getenv "PYTHONPATH"))) + (invoke "python" "test/run_test.py"))))) + (add-after 'install 'remove-test-executables + (lambda* (#:key inputs outputs #:allow-other-keys) + ;; Remove test executables, but keep other executables + ;; such as 'torch_shm_manager' and and .so files such as + ;; 'libtorch_global_deps.so'. + (let ((python-site (site-packages inputs outputs))) + (for-each delete-file + (find-files python-site + "(^test_cpp_rpc|_test)$")))))) + + ;; XXX: Tests attempt to download data such as + ;; . + #:tests? #f)) + (native-inputs + `(("cmake" ,cmake) + ("ninja" ,ninja))) + (inputs + `(("eigen" ,eigen) + ;; ("fmt" ,fmt) + ("fp16" ,fp16) + ("gemmlowp" ,gemmlowp) + ("googletest" ,googletest) + ("googlebenchmark" ,googlebenchmark) + ("gloo" ,gloo) + ("openblas" ,openblas) + ("openmpi" ,openmpi) + ("pthreadpool" ,pthreadpool) + ("protobuf" ,protobuf) + ("pybind11" ,pybind11) + ("sleef" ,sleef) + ("xnnpack" ,xnnpack) + ("zstd" ,zstd))) + (propagated-inputs + `(("python-astunparse" ,python-astunparse) + ("python-numpy" ,python-numpy) + ("python-pyyaml" ,python-pyyaml) + ("python-cffi" ,python-cffi) + ("python-peachpy" ,python-peachpy) + ("python-typing-extensions" ,python-typing-extensions) + ("python-future" ,python-future) + ("python-six" ,python-six) + ("python-requests" ,python-requests) + ("onnx" ,onnx) ;propagated for its Python modules + ("onnx-optimizer" ,onnx-optimizer) + ("cpuinfo" ,cpuinfo))) + (home-page "https://pytorch.org/") + (synopsis "Python library for tensor computation and deep neural networks") + (description + "PyTorch is a Python package that provides two high-level features: + +@itemize +@item tensor computation (like NumPy) with strong GPU acceleration; +@item deep neural networks (DNNs) built on a tape-based autograd system. +@end itemize + +You can reuse Python packages such as NumPy, SciPy, and Cython to extend +PyTorch when needed. + +Note: currently this package does not provide GPU support.") + (license license:bsd-3))) diff --git a/gnu/packages/patches/python-pytorch-runpath.patch b/gnu/packages/patches/python-pytorch-runpath.patch new file mode 100644 index 0000000000..6f270ef9b1 --- /dev/null +++ b/gnu/packages/patches/python-pytorch-runpath.patch @@ -0,0 +1,25 @@ +Libraries (such as 'libtorch_cpu.so') and executables (such as 'torch_shm_manager') +get installed, quite surprisingly, to 'lib/python3.8/site-packages/{bin,lib}'. +Make sure RUNPATH matches that. + +--- a/cmake/Dependencies.cmake ++++ b/cmake/Dependencies.cmake +@@ -4,7 +4,7 @@ if(APPLE) + set(CMAKE_MACOSX_RPATH ON) + set(_rpath_portable_origin "@loader_path") + else() +- set(_rpath_portable_origin $ORIGIN) ++ set(_rpath_portable_origin $ORIGIN/../lib) + endif(APPLE) + # Use separate rpaths during build and install phases + set(CMAKE_SKIP_BUILD_RPATH FALSE) + +--- a/caffe2/CMakeLists.txt ++++ b/caffe2/CMakeLists.txt +@@ -1797,5 +1797,5 @@ if(BUILD_PYTHON) + if(${BUILDING_WITH_TORCH_LIBS}) + # site-packages/caffe2/python/caffe2_pybind11_state + # site-packages/torch/lib +- set(caffe2_pybind11_rpath "${_rpath_portable_origin}/../../torch/lib") ++ set(caffe2_pybind11_rpath $ORIGIN/../../torch/lib) + endif(${BUILDING_WITH_TORCH_LIBS}) diff --git a/gnu/packages/patches/python-pytorch-system-libraries.patch b/gnu/packages/patches/python-pytorch-system-libraries.patch new file mode 100644 index 0000000000..c8d14b3f56 --- /dev/null +++ b/gnu/packages/patches/python-pytorch-system-libraries.patch @@ -0,0 +1,131 @@ +Use our own googletest rather than the bundled one. +Get NNPACK to use our own PeachPy rather than the bundled one. + +diff --git a/cmake/Dependencies.cmake b/cmake/Dependencies.cmake +index 5d57b9ca78..620cca4e60 100644 +--- a/cmake/Dependencies.cmake ++++ b/cmake/Dependencies.cmake +@@ -644,11 +644,6 @@ if(BUILD_TEST OR BUILD_MOBILE_BENCHMARK OR BUILD_MOBILE_TEST) + # this shouldn't be necessary anymore. + get_property(INC_DIR_temp DIRECTORY PROPERTY INCLUDE_DIRECTORIES) + set_property(DIRECTORY PROPERTY INCLUDE_DIRECTORIES "") +- add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/../third_party/googletest) +- set_property(DIRECTORY PROPERTY INCLUDE_DIRECTORIES ${INC_DIR_temp}) +- +- include_directories(BEFORE SYSTEM ${CMAKE_CURRENT_LIST_DIR}/../third_party/googletest/googletest/include) +- include_directories(BEFORE SYSTEM ${CMAKE_CURRENT_LIST_DIR}/../third_party/googletest/googlemock/include) + + # We will not need to test benchmark lib itself. + set(BENCHMARK_ENABLE_TESTING OFF CACHE BOOL "Disable benchmark testing as we don't need it.") +@@ -1485,7 +1480,7 @@ if(CAFFE2_CMAKE_BUILDING_WITH_MAIN_REPO AND NOT INTERN_DISABLE_ONNX) + endif() + set_property(TARGET onnx_proto PROPERTY IMPORTED_LOCATION ${ONNX_PROTO_LIBRARY}) + message("-- Found onnx: ${ONNX_LIBRARY} ${ONNX_PROTO_LIBRARY}") +- list(APPEND Caffe2_DEPENDENCY_LIBS onnx_proto onnx) ++ list(APPEND Caffe2_DEPENDENCY_LIBS onnx_proto onnx onnx_optimizer) + endif() + include_directories(${FOXI_INCLUDE_DIRS}) + list(APPEND Caffe2_DEPENDENCY_LIBS foxi_loader) + +diff --git a/caffe2/CMakeLists.txt b/caffe2/CMakeLists.txt +index 50ebb224ce..5953d9ddf7 100644 +--- a/caffe2/CMakeLists.txt ++++ b/caffe2/CMakeLists.txt +@@ -1632,7 +1632,7 @@ if(BUILD_TEST) + if(NOT MSVC) + add_executable(${test_name}_${CPU_CAPABILITY} "${test_src}" ../aten/src/ATen/native/quantized/affine_quantizer_base.cpp) + # TODO: Get rid of c10 dependency (which is only needed for the implementation of AT_ERROR) +- target_link_libraries(${test_name}_${CPU_CAPABILITY} c10 sleef gtest_main) ++ target_link_libraries(${test_name}_${CPU_CAPABILITY} c10 sleef gtest_main gtest) + if(USE_FBGEMM) + target_link_libraries(${test_name}_${CPU_CAPABILITY} fbgemm) + endif() +@@ -1655,7 +1655,7 @@ if(BUILD_TEST) + foreach(test_src ${Caffe2_CPU_TEST_SRCS}) + get_filename_component(test_name ${test_src} NAME_WE) + add_executable(${test_name} "${test_src}") +- target_link_libraries(${test_name} torch_library gtest_main) ++ target_link_libraries(${test_name} torch_library gtest_main gtest) + target_include_directories(${test_name} PRIVATE $) + target_include_directories(${test_name} PRIVATE $) + target_include_directories(${test_name} PRIVATE ${Caffe2_CPU_INCLUDE}) +@@ -1673,7 +1673,7 @@ if(BUILD_TEST) + foreach(test_src ${Caffe2_GPU_TEST_SRCS}) + get_filename_component(test_name ${test_src} NAME_WE) + cuda_add_executable(${test_name} "${test_src}") +- target_link_libraries(${test_name} torch_library gtest_main) ++ target_link_libraries(${test_name} torch_library gtest_main gtest) + target_include_directories(${test_name} PRIVATE $) + target_include_directories(${test_name} PRIVATE ${Caffe2_CPU_INCLUDE}) + add_test(NAME ${test_name} COMMAND $) +@@ -1691,7 +1691,7 @@ if(BUILD_TEST) + foreach(test_src ${Caffe2_VULKAN_TEST_SRCS}) + get_filename_component(test_name ${test_src} NAME_WE) + add_executable(${test_name} "${test_src}") +- target_link_libraries(${test_name} torch_library gtest_main) ++ target_link_libraries(${test_name} torch_library gtest_main gtest) + target_include_directories(${test_name} PRIVATE $) + target_include_directories(${test_name} PRIVATE ${Caffe2_CPU_INCLUDE}) + add_test(NAME ${test_name} COMMAND $) +@@ -1709,7 +1709,7 @@ if(BUILD_TEST) + foreach(test_src ${Caffe2_HIP_TEST_SRCS}) + get_filename_component(test_name ${test_src} NAME_WE) + add_executable(${test_name} "${test_src}") +- target_link_libraries(${test_name} torch_library gtest_main) ++ target_link_libraries(${test_name} torch_library gtest_main gtest) + target_include_directories(${test_name} PRIVATE $) + target_include_directories(${test_name} PRIVATE ${Caffe2_CPU_INCLUDE} ${Caffe2_HIP_INCLUDE}) + target_compile_options(${test_name} PRIVATE ${HIP_CXX_FLAGS}) + +diff --git a/torch/lib/c10d/test/CMakeLists.txt b/torch/lib/c10d/test/CMakeLists.txt +index b74d4b65f7..fc7c207505 100644 +--- a/torch/lib/c10d/test/CMakeLists.txt ++++ b/torch/lib/c10d/test/CMakeLists.txt +@@ -16,25 +16,25 @@ function(c10d_add_test test_src) + add_test(NAME ${test_name} COMMAND $) + endfunction() + +-c10d_add_test(FileStoreTest.cpp c10d gtest_main) +-c10d_add_test(TCPStoreTest.cpp c10d gtest_main) ++c10d_add_test(FileStoreTest.cpp c10d gtest_main gtest) ++c10d_add_test(TCPStoreTest.cpp c10d gtest_main gtest) + if(NOT WIN32) +- c10d_add_test(HashStoreTest.cpp c10d gtest_main) ++ c10d_add_test(HashStoreTest.cpp c10d gtest_main gtest) + endif() + + if(USE_CUDA) + if(USE_C10D_GLOO) +- c10d_add_test(ProcessGroupGlooTest.cpp c10d c10d_cuda_test gtest_main) +- c10d_add_test(ProcessGroupGlooAsyncTest.cpp c10d c10d_cuda_test gtest_main) ++ c10d_add_test(ProcessGroupGlooTest.cpp c10d c10d_cuda_test gtest_main gtest) ++ c10d_add_test(ProcessGroupGlooAsyncTest.cpp c10d c10d_cuda_test gtest_main gtest) + endif() + if(USE_C10D_NCCL) +- c10d_add_test(ProcessGroupNCCLTest.cpp c10d c10d_cuda_test gtest_main) ++ c10d_add_test(ProcessGroupNCCLTest.cpp c10d c10d_cuda_test gtest_main gtest) + c10d_add_test(ProcessGroupNCCLErrorsTest.cpp c10d c10d_cuda_test +- gtest_main) ++ gtest_main gtest) + endif() + else() + if(USE_C10D_GLOO) +- c10d_add_test(ProcessGroupGlooTest.cpp c10d gtest_main) ++ c10d_add_test(ProcessGroupGlooTest.cpp c10d gtest_main gtest) + endif() + endif() + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 5ecd2df..24feae3 100644 +--- a/third_party/NNPACK/CMakeLists.txt ++++ b/third_party/NNPACK/CMakeLists.txt +@@ -427,8 +427,7 @@ IF(NNPACK_BACKEND STREQUAL "x86-64") + FILE(MAKE_DIRECTORY ${obj_dir}) + ADD_CUSTOM_COMMAND( + OUTPUT ${obj} +- COMMAND "PYTHONPATH=${PEACHPY_PYTHONPATH}" +- ${PYTHON_EXECUTABLE} -m peachpy.x86_64 ++ COMMAND ${PYTHON_EXECUTABLE} -m peachpy.x86_64 + -mabi=sysv -g4 -mimage-format=${PEACHPY_IMAGE_FORMAT} + "-I${PROJECT_SOURCE_DIR}/src" "-I${PROJECT_SOURCE_DIR}/src/x86_64-fma" "-I${FP16_SOURCE_DIR}/include" + -o ${obj} "${PROJECT_SOURCE_DIR}/${src}" -- cgit v1.2.3 From e914fc5913085aa7bf768490b093a6313d750bfc Mon Sep 17 00:00:00 2001 From: Pierre Langlois Date: Mon, 2 Aug 2021 15:13:11 +0100 Subject: gnu: Rename u-boot-sifive-fu540 to sifive-unleashed. * gnu/packages/bootloaders.scm (u-boot-sifive-fu540): Rename to ... (u-boot-sifive-unleashed): ... this. Change board name from sifive_fu540 to sifive_unleashed. * gnu/packages/patches/u-boot-riscv64-fix-extlinux.patch: Rename sifive_fu540 to sifive_unleashed. --- gnu/packages/bootloaders.scm | 4 ++-- gnu/packages/patches/u-boot-riscv64-fix-extlinux.patch | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'gnu/packages/patches') diff --git a/gnu/packages/bootloaders.scm b/gnu/packages/bootloaders.scm index 7d783d621e..2889a90d54 100644 --- a/gnu/packages/bootloaders.scm +++ b/gnu/packages/bootloaders.scm @@ -869,8 +869,8 @@ to Novena upstream, does not load u-boot.img from the first partition.") (patches (search-patches "u-boot-riscv64-fix-extlinux.patch"))))))) -(define-public u-boot-sifive-fu540 - (make-u-boot-package "sifive_fu540" "riscv64-linux-gnu")) +(define-public u-boot-sifive-unleashed + (make-u-boot-package "sifive_unleashed" "riscv64-linux-gnu")) (define-public u-boot-sifive-unmatched (make-u-boot-package "sifive_unmatched" "riscv64-linux-gnu")) diff --git a/gnu/packages/patches/u-boot-riscv64-fix-extlinux.patch b/gnu/packages/patches/u-boot-riscv64-fix-extlinux.patch index d6c1987718..468024ab00 100644 --- a/gnu/packages/patches/u-boot-riscv64-fix-extlinux.patch +++ b/gnu/packages/patches/u-boot-riscv64-fix-extlinux.patch @@ -30,8 +30,8 @@ Index: u-boot/configs/qemu-riscv64_smode_defconfig +CONFIG_PREBOOT="setenv fdt_addr ${fdtcontroladdr}; fdt addr ${fdtcontroladdr};" Index: u-boot/configs/sifive_fu540_defconfig =================================================================== ---- u-boot.orig/configs/sifive_fu540_defconfig -+++ u-boot/configs/sifive_fu540_defconfig +--- u-boot.orig/configs/sifive_unleashed_defconfig ++++ u-boot/configs/sifive_unleashed_defconfig @@ -27,3 +27,5 @@ CONFIG_SPL_DM_SEQ_ALIAS=y CONFIG_SPL_CLK=y CONFIG_DM_MTD=y -- cgit v1.2.3 From 49432f6534c900e90017726f08cb37397662a9b8 Mon Sep 17 00:00:00 2001 From: Maxim Cournoyer Date: Wed, 4 Aug 2021 14:54:09 -0400 Subject: gnu: pypy3: Update to 7.3.5. The patch disabling tests is removed because it only fixes 2 out of 43 test failures. * gnu/packages/patches/pypy3-7.3.1-fix-tests.patch: Delete file. * gnu/local.mk (dist_patch_DATA): De-register it. * gnu/packages/python.scm (pypy3): Update to 7.3.5. [patches]: Remove patch. --- gnu/local.mk | 1 - gnu/packages/patches/pypy3-7.3.1-fix-tests.patch | 278 ----------------------- gnu/packages/python.scm | 11 +- 3 files changed, 5 insertions(+), 285 deletions(-) delete mode 100644 gnu/packages/patches/pypy3-7.3.1-fix-tests.patch (limited to 'gnu/packages/patches') diff --git a/gnu/local.mk b/gnu/local.mk index 51a76e3638..61ac39618a 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1657,7 +1657,6 @@ dist_patch_DATA = \ %D%/packages/patches/python-unittest2-python3-compat.patch \ %D%/packages/patches/python-unittest2-remove-argparse.patch \ %D%/packages/patches/python-waitress-fix-tests.patch \ - %D%/packages/patches/pypy3-7.3.1-fix-tests.patch \ %D%/packages/patches/qemu-build-info-manual.patch \ %D%/packages/patches/qemu-CVE-2021-20203.patch \ %D%/packages/patches/qemu-meson-compat.patch \ diff --git a/gnu/packages/patches/pypy3-7.3.1-fix-tests.patch b/gnu/packages/patches/pypy3-7.3.1-fix-tests.patch deleted file mode 100644 index 464aad967f..0000000000 --- a/gnu/packages/patches/pypy3-7.3.1-fix-tests.patch +++ /dev/null @@ -1,278 +0,0 @@ -Fix a few testcases. Adapted from python-3-fix-tests.patch. - -diff -Naur pypy3.6-v7.3.1-src.orig/lib-python/3/ctypes/test/test_callbacks.py pypy3.6-v7.3.1-src/lib-python/3/ctypes/test/test_callbacks.py ---- pypy3.6-v7.3.1-src.orig/lib-python/3/ctypes/test/test_callbacks.py 1970-01-01 01:00:01.000000000 +0100 -+++ pypy3.6-v7.3.1-src/lib-python/3/ctypes/test/test_callbacks.py 2020-05-21 14:19:14.827288853 +0200 -@@ -4,6 +4,7 @@ - from ctypes import * - from ctypes.test import need_symbol - import _ctypes_test -+import platform - - class Callbacks(unittest.TestCase): - functype = CFUNCTYPE -@@ -178,6 +179,8 @@ - - self.assertLess(diff, 0.01, "%s not less than 0.01" % diff) - -+ @unittest.skipIf(platform.machine() in ['mips64'], -+ "This test fails on this platform") - def test_issue_8959_a(self): - from ctypes.util import find_library - libc_path = find_library("c") -diff -Naur pypy3.6-v7.3.1-src.orig/lib-python/3/ctypes/test/test_libc.py pypy3.6-v7.3.1-src/lib-python/3/ctypes/test/test_libc.py ---- pypy3.6-v7.3.1-src.orig/lib-python/3/ctypes/test/test_libc.py 1970-01-01 01:00:01.000000000 +0100 -+++ pypy3.6-v7.3.1-src/lib-python/3/ctypes/test/test_libc.py 2020-05-21 14:19:14.827288853 +0200 -@@ -2,6 +2,7 @@ - - from ctypes import * - import _ctypes_test -+import platform - - lib = CDLL(_ctypes_test.__file__) - -@@ -17,6 +18,8 @@ - import math - self.assertEqual(lib.my_sqrt(2.0), math.sqrt(2.0)) - -+ @unittest.skipIf(platform.machine() in ['mips64'], -+ "This test fails on this platform") - def test_qsort(self): - comparefunc = CFUNCTYPE(c_int, POINTER(c_char), POINTER(c_char)) - lib.my_qsort.argtypes = c_void_p, c_size_t, c_size_t, comparefunc -diff -Naur pypy3.6-v7.3.1-src.orig/lib-python/3/distutils/tests/test_archive_util.py pypy3.6-v7.3.1-src/lib-python/3/distutils/tests/test_archive_util.py ---- pypy3.6-v7.3.1-src.orig/lib-python/3/distutils/tests/test_archive_util.py 1970-01-01 01:00:01.000000000 +0100 -+++ pypy3.6-v7.3.1-src/lib-python/3/distutils/tests/test_archive_util.py 2020-05-21 14:19:14.827288853 +0200 -@@ -333,6 +333,7 @@ - self.assertEqual(os.path.basename(res), 'archive.tar.xz') - self.assertEqual(self._tarinfo(res), self._created_files) - -+ @unittest.skipIf(True, "getgrgid(0)[0] raises a KeyError on Guix") - def test_make_archive_owner_group(self): - # testing make_archive with owner and group, with various combinations - # this works even if there's not gid/uid support -@@ -362,6 +363,7 @@ - - @unittest.skipUnless(ZLIB_SUPPORT, "Requires zlib") - @unittest.skipUnless(UID_GID_SUPPORT, "Requires grp and pwd support") -+ @unittest.skipIf(True, "getgrgid(0)[0] raises a KeyError on Guix") - def test_tarfile_root_owner(self): - tmpdir = self._create_files() - base_name = os.path.join(self.mkdtemp(), 'archive') -diff -Naur pypy3.6-v7.3.1-src.orig/lib-python/3/distutils/tests/test_sdist.py pypy3.6-v7.3.1-src/lib-python/3/distutils/tests/test_sdist.py ---- pypy3.6-v7.3.1-src.orig/lib-python/3/distutils/tests/test_sdist.py 1970-01-01 01:00:01.000000000 +0100 -+++ pypy3.6-v7.3.1-src/lib-python/3/distutils/tests/test_sdist.py 2020-05-21 14:19:14.827288853 +0200 -@@ -443,6 +443,7 @@ - "The tar command is not found") - @unittest.skipIf(find_executable('gzip') is None, - "The gzip command is not found") -+ @unittest.skipIf(True, "getgrgid(0)[0] raises a KeyError on Guix") - def test_make_distribution_owner_group(self): - # now building a sdist - dist, cmd = self.get_cmd() -diff -Naur pypy3.6-v7.3.1-src.orig/lib-python/3/test/test_asyncio/test_base_events.py pypy3.6-v7.3.1-src/lib-python/3/test/test_asyncio/test_base_events.py ---- pypy3.6-v7.3.1-src.orig/lib-python/3/test/test_asyncio/test_base_events.py 1970-01-01 01:00:01.000000000 +0100 -+++ pypy3.6-v7.3.1-src/lib-python/3/test/test_asyncio/test_base_events.py 2020-05-21 14:19:14.827288853 +0200 -@@ -1296,6 +1296,8 @@ - self._test_create_connection_ip_addr(m_socket, False) - - @patch_socket -+ @unittest.skipUnless(support.is_resource_enabled('network'), -+ 'network is not enabled') - def test_create_connection_service_name(self, m_socket): - m_socket.getaddrinfo = socket.getaddrinfo - sock = m_socket.socket.return_value -diff -Naur pypy3.6-v7.3.1-src.orig/lib-python/3/test/test_generators.py pypy3.6-v7.3.1-src/lib-python/3/test/test_generators.py ---- pypy3.6-v7.3.1-src.orig/lib-python/3/test/test_generators.py 1970-01-01 01:00:01.000000000 +0100 -+++ pypy3.6-v7.3.1-src/lib-python/3/test/test_generators.py 2020-05-21 14:19:14.827288853 +0200 -@@ -35,6 +35,7 @@ - else: - return "FAILED" - -+ @unittest.skipIf(True, 'Keyboard interrupts do not work in the Guix build environment') - def test_raise_and_yield_from(self): - gen = self.generator1() - gen.send(None) -diff -Naur pypy3.6-v7.3.1-src.orig/lib-python/3/test/_test_multiprocessing.py pypy3.6-v7.3.1-src/lib-python/3/test/_test_multiprocessing.py ---- pypy3.6-v7.3.1-src.orig/lib-python/3/test/_test_multiprocessing.py 1970-01-01 01:00:01.000000000 +0100 -+++ pypy3.6-v7.3.1-src/lib-python/3/test/_test_multiprocessing.py 2020-05-21 14:19:14.827288853 +0200 -@@ -1212,6 +1212,7 @@ - if pid is not None: - os.kill(pid, signal.SIGINT) - -+ @unittest.skipIf(True, "This fails for unknown reasons on Guix") - def test_wait_result(self): - if isinstance(self, ProcessesMixin) and sys.platform != 'win32': - pid = os.getpid() -diff -Naur pypy3.6-v7.3.1-src.orig/lib-python/3/test/test_normalization.py pypy3.6-v7.3.1-src/lib-python/3/test/test_normalization.py ---- pypy3.6-v7.3.1-src.orig/lib-python/3/test/test_normalization.py 1970-01-01 01:00:01.000000000 +0100 -+++ pypy3.6-v7.3.1-src/lib-python/3/test/test_normalization.py 2020-05-21 14:19:14.827288853 +0200 -@@ -2,6 +2,7 @@ - import unittest - - from http.client import HTTPException -+from urllib.error import URLError - import sys - from unicodedata import normalize, unidata_version - -@@ -43,6 +44,8 @@ - except PermissionError: - self.skipTest(f"Permission error when downloading {TESTDATAURL} " - f"into the test data directory") -+ except URLError: -+ self.skipTest("DNS lookups are not enabled.") - except (OSError, HTTPException): - self.fail(f"Could not retrieve {TESTDATAURL}") - -diff -Naur pypy3.6-v7.3.1-src.orig/lib-python/3/test/test_pathlib.py pypy3.6-v7.3.1-src/lib-python/3/test/test_pathlib.py ---- pypy3.6-v7.3.1-src.orig/lib-python/3/test/test_pathlib.py 1970-01-01 01:00:01.000000000 +0100 -+++ pypy3.6-v7.3.1-src/lib-python/3/test/test_pathlib.py 2020-05-21 14:19:14.827288853 +0200 -@@ -2130,8 +2130,7 @@ - self.assertEqual(given, expect) - self.assertEqual(set(p.rglob("FILEd*")), set()) - -- @unittest.skipUnless(hasattr(pwd, 'getpwall'), -- 'pwd module does not expose getpwall()') -+ @unittest.skipIf(True, "Guix builder home is '/' which causes trouble for these tests") - def test_expanduser(self): - P = self.cls - support.import_module('pwd') -diff -Naur pypy3.6-v7.3.1-src.orig/lib-python/3/test/test_pdb.py pypy3.6-v7.3.1-src/lib-python/3/test/test_pdb.py ---- pypy3.6-v7.3.1-src.orig/lib-python/3/test/test_pdb.py 1970-01-01 01:00:01.000000000 +0100 -+++ pypy3.6-v7.3.1-src/lib-python/3/test/test_pdb.py 2020-05-21 14:20:24.377203281 +0200 -@@ -1136,11 +1136,11 @@ - > (6)test_function() - -> print('pdb %d: %s' % (i, sess._previous_sigint_handler)) - (Pdb) continue -- pdb 1: -+ pdb 1: Handlers.SIG_IGN - > (6)test_function() - -> print('pdb %d: %s' % (i, sess._previous_sigint_handler)) - (Pdb) continue -- pdb 2: -+ pdb 2: Handlers.SIG_IGN - """ - - class PdbTestCase(unittest.TestCase): -diff -Naur pypy3.6-v7.3.1-src.orig/lib-python/3/test/test_regrtest.py pypy3.6-v7.3.1-src/lib-python/3/test/test_regrtest.py ---- pypy3.6-v7.3.1-src.orig/lib-python/3/test/test_regrtest.py 1970-01-01 01:00:01.000000000 +0100 -+++ pypy3.6-v7.3.1-src/lib-python/3/test/test_regrtest.py 2020-05-21 14:19:14.827288853 +0200 -@@ -766,6 +766,7 @@ - output = self.run_tests('--fromfile', filename) - self.check_executed_tests(output, tests) - -+ @unittest.skipIf(True, 'Keyboard interrupts do not work in the Guix build environment.') - def test_interrupted(self): - code = TEST_INTERRUPTED - test = self.create_test('sigint', code=code) -diff -Naur pypy3.6-v7.3.1-src.orig/lib-python/3/test/test_resource.py pypy3.6-v7.3.1-src/lib-python/3/test/test_resource.py ---- pypy3.6-v7.3.1-src.orig/lib-python/3/test/test_resource.py 1970-01-01 01:00:01.000000000 +0100 -+++ pypy3.6-v7.3.1-src/lib-python/3/test/test_resource.py 2020-05-21 14:19:14.827288853 +0200 -@@ -146,6 +146,7 @@ - - @unittest.skipUnless(hasattr(resource, 'prlimit'), 'no prlimit') - @support.requires_linux_version(2, 6, 36) -+ @unittest.skipIf(True, "Bug: the PermissionError is not raised") - def test_prlimit(self): - self.assertRaises(TypeError, resource.prlimit) - self.assertRaises(ProcessLookupError, resource.prlimit, -diff -Naur pypy3.6-v7.3.1-src.orig/lib-python/3/test/test_shutil.py pypy3.6-v7.3.1-src/lib-python/3/test/test_shutil.py ---- pypy3.6-v7.3.1-src.orig/lib-python/3/test/test_shutil.py 1970-01-01 01:00:01.000000000 +0100 -+++ pypy3.6-v7.3.1-src/lib-python/3/test/test_shutil.py 2020-05-21 14:19:14.827288853 +0200 -@@ -1138,6 +1138,7 @@ - self.assertRaises(ValueError, make_archive, base_name, 'xxx') - - @support.requires_zlib -+ @unittest.skipIf(True, "getgrgid(0)[0] raises a KeyError on Guix") - def test_make_archive_owner_group(self): - # testing make_archive with owner and group, with various combinations - # this works even if there's not gid/uid support -@@ -1166,6 +1167,7 @@ - - - @support.requires_zlib -+ @unittest.skipIf(True, "getgrgid(0)[0] raises a KeyError on Guix") - @unittest.skipUnless(UID_GID_SUPPORT, "Requires grp and pwd support") - def test_tarfile_root_owner(self): - root_dir, base_dir = self._create_files() -diff -Naur pypy3.6-v7.3.1-src.orig/lib-python/3/test/test_socket.py pypy3.6-v7.3.1-src/lib-python/3/test/test_socket.py ---- pypy3.6-v7.3.1-src.orig/lib-python/3/test/test_socket.py 1970-01-01 01:00:01.000000000 +0100 -+++ pypy3.6-v7.3.1-src/lib-python/3/test/test_socket.py 2020-05-21 14:19:14.827288853 +0200 -@@ -815,6 +815,8 @@ - if not fqhn in all_host_names: - self.fail("Error testing host resolution mechanisms. (fqdn: %s, all: %s)" % (fqhn, repr(all_host_names))) - -+ @unittest.skipUnless(support.is_resource_enabled('network'), -+ 'network is not enabled') - def test_host_resolution(self): - for addr in [support.HOST, '10.0.0.1', '255.255.255.255']: - self.assertEqual(socket.gethostbyname(addr), addr) -@@ -934,6 +936,8 @@ - self.assertRaises(OverflowError, socket.htonl, k) - self.assertRaises(OverflowError, socket.htons, k) - -+ @unittest.skipUnless(os.path.exists("/etc/services"), -+ "getservbyname uses /etc/services, which is not in the chroot") - def testGetServBy(self): - eq = self.assertEqual - # Find one service that exists, then check all the related interfaces. -@@ -1278,6 +1282,8 @@ - raise - self.assertRaises(TypeError, s.ioctl, socket.SIO_LOOPBACK_FAST_PATH, None) - -+ @unittest.skipUnless(os.path.exists("/etc/gai.conf"), -+ "getaddrinfo() will fail") - def testGetaddrinfo(self): - try: - socket.getaddrinfo('localhost', 80) -@@ -1357,6 +1363,8 @@ - # only IP addresses are allowed - self.assertRaises(OSError, socket.getnameinfo, ('mail.python.org',0), 0) - -+ @unittest.skipUnless(os.path.exists("/etc/gai.conf"), -+ "getaddrinfo() will fail") - @unittest.skipUnless(support.is_resource_enabled('network'), - 'network is not enabled') - def test_idna(self): -diff -Naur pypy3.6-v7.3.1-src.orig/lib-python/3/test/test_spwd.py pypy3.6-v7.3.1-src/lib-python/3/test/test_spwd.py ---- pypy3.6-v7.3.1-src.orig/lib-python/3/test/test_spwd.py 1970-01-01 01:00:01.000000000 +0100 -+++ pypy3.6-v7.3.1-src/lib-python/3/test/test_spwd.py 2020-05-21 14:19:14.827288853 +0200 -@@ -5,8 +5,7 @@ - spwd = support.import_module('spwd') - - --@unittest.skipUnless(hasattr(os, 'geteuid') and os.geteuid() == 0, -- 'root privileges required') -+@unittest.skipUnless(os.path.exists("/etc/shadow"), 'spwd tests require /etc/shadow') - class TestSpwdRoot(unittest.TestCase): - - def test_getspall(self): -@@ -56,8 +55,7 @@ - self.assertRaises(TypeError, spwd.getspnam, bytes_name) - - --@unittest.skipUnless(hasattr(os, 'geteuid') and os.geteuid() != 0, -- 'non-root user required') -+@unittest.skipUnless(os.path.exists("/etc/shadow"), 'spwd tests require /etc/shadow') - class TestSpwdNonRoot(unittest.TestCase): - - def test_getspnam_exception(self): -diff -Naur pypy3.6-v7.3.1-src.orig/lib-python/3/test/test_tarfile.py pypy3.6-v7.3.1-src/lib-python/3/test/test_tarfile.py ---- pypy3.6-v7.3.1-src.orig/lib-python/3/test/test_tarfile.py 1970-01-01 01:00:01.000000000 +0100 -+++ pypy3.6-v7.3.1-src/lib-python/3/test/test_tarfile.py 2020-05-21 14:19:14.827288853 +0200 -@@ -2491,9 +2491,12 @@ - import pwd, grp - except ImportError: - return False -- if pwd.getpwuid(0)[0] != 'root': -- return False -- if grp.getgrgid(0)[0] != 'root': -+ try: -+ if pwd.getpwuid(0)[0] != 'root': -+ return False -+ if grp.getgrgid(0)[0] != 'root': -+ return False -+ except KeyError: - return False - return True - diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm index e694321e17..5cc02d5ba3 100644 --- a/gnu/packages/python.scm +++ b/gnu/packages/python.scm @@ -716,15 +716,14 @@ ease from the desktop to a microcontroller or embedded system.") (define-public pypy3 (package (name "pypy3") - (version "7.3.1") + (version "7.3.5") (source (origin (method url-fetch) - (uri (string-append "https://bitbucket.org/pypy/pypy/downloads/" ; - "pypy3.6-v" version "-src.tar.bz2")) + (uri (string-append "https://downloads.python.org/pypy/" + "pypy3.7-v" version "-src.tar.bz2")) (sha256 (base32 - "10zsk8jby8j6visk5mzikpb1cidvz27qq4pfpa26jv53klic6b0c")) - (patches (search-patches "pypy3-7.3.1-fix-tests.patch")))) + "18lrdmpcczlbk3cfarkgwqdmilrybz56i1dafk8dkjlyk90gw86r")))) (build-system gnu-build-system) (native-inputs `(("python-2" ,python-2) @@ -749,7 +748,7 @@ ease from the desktop to a microcontroller or embedded system.") ("bash-minimal" ,bash-minimal) ; Used as /bin/sh ("xz" ,xz))) ; liblzma (arguments - `(#:tests? #f ;FIXME: Disabled for now, there are many tests failing. + `(#:tests? #f ;FIXME: 43 out of 364 tests are failing #:modules ((ice-9 ftw) (ice-9 match) (guix build utils) (guix build gnu-build-system)) #:phases (modify-phases %standard-phases -- cgit v1.2.3 From 1273548f4facefa379ae3607b47891959c42c13d Mon Sep 17 00:00:00 2001 From: Sarah Morgensen Date: Thu, 5 Aug 2021 13:20:07 -0700 Subject: gnu: restic: Patch tests for go-1.16. * gnu/packages/patches/restic-0.9.6-fix-tests-for-go1.15.patch: New file. * gnu/local.mk (dist_patch_DATA): Register it. * gnu/packages/backup.scm (restic): Use it. Signed-off-by: Maxim Cournoyer --- gnu/local.mk | 1 + gnu/packages/backup.scm | 5 ++- .../restic-0.9.6-fix-tests-for-go1.15.patch | 51 ++++++++++++++++++++++ 3 files changed, 56 insertions(+), 1 deletion(-) create mode 100644 gnu/packages/patches/restic-0.9.6-fix-tests-for-go1.15.patch (limited to 'gnu/packages/patches') diff --git a/gnu/local.mk b/gnu/local.mk index 61ac39618a..caa9090bbd 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1693,6 +1693,7 @@ dist_patch_DATA = \ %D%/packages/patches/rtags-separate-rct.patch \ %D%/packages/patches/racket-minimal-sh-via-rktio.patch \ %D%/packages/patches/remake-impure-dirs.patch \ + %D%/packages/patches/restic-0.9.6-fix-tests-for-go1.15.patch \ %D%/packages/patches/retroarch-LIBRETRO_DIRECTORY.patch \ %D%/packages/patches/rnp-add-version.cmake.patch \ %D%/packages/patches/rnp-disable-ruby-rnp-tests.patch \ diff --git a/gnu/packages/backup.scm b/gnu/packages/backup.scm index 9ec4e281d8..d8d8728a14 100644 --- a/gnu/packages/backup.scm +++ b/gnu/packages/backup.scm @@ -20,6 +20,7 @@ ;;; Copyright © 2020 Michael Rohleder ;;; Copyright © 2021 Timothy Sample ;;; Copyright © 2021 Brice Waegeneire +;;; Copyright © 2021 Sarah Morgensen ;;; ;;; This file is part of GNU Guix. ;;; @@ -928,7 +929,9 @@ is like a time machine for your data. ") (file-name (string-append name "-" version ".tar.gz")) (sha256 (base32 - "1zmh42aah32ah8w5n6ilz9bci0y2xrf8p7qshy3yf1lzm5gnbj0w")))) + "1zmh42aah32ah8w5n6ilz9bci0y2xrf8p7qshy3yf1lzm5gnbj0w")) + (patches + (search-patches "restic-0.9.6-fix-tests-for-go1.15.patch")))) (build-system go-build-system) (arguments `(#:import-path "github.com/restic/restic" diff --git a/gnu/packages/patches/restic-0.9.6-fix-tests-for-go1.15.patch b/gnu/packages/patches/restic-0.9.6-fix-tests-for-go1.15.patch new file mode 100644 index 0000000000..cc510c1cfe --- /dev/null +++ b/gnu/packages/patches/restic-0.9.6-fix-tests-for-go1.15.patch @@ -0,0 +1,51 @@ +This cherry-picked patch fixes tests for Go >= 1.15. Restic v0.10 (which +includes this patch) requires go module support from the Go build system. +Original patch follows. + +--- +From 97950ab81a18de06b95384da6d8646fef87c9d97 Mon Sep 17 00:00:00 2001 +From: Alexander Neumann +Date: Sat, 12 Sep 2020 17:36:44 +0200 +Subject: [PATCH] options: Fix test for Go >= 1.15 + +--- + internal/options/options_test.go | 12 +++++++++--- + 1 file changed, 9 insertions(+), 3 deletions(-) + +diff --git a/internal/options/options_test.go b/internal/options/options_test.go +index de94fc90a1..8d268992a3 100644 +--- a/internal/options/options_test.go ++++ b/internal/options/options_test.go +@@ -3,6 +3,7 @@ package options + import ( + "fmt" + "reflect" ++ "regexp" + "testing" + "time" + ) +@@ -199,7 +200,7 @@ var invalidSetTests = []struct { + "timeout": "2134", + }, + "ns", +- `time: missing unit in duration 2134`, ++ `time: missing unit in duration "?2134"?`, + }, + } + +@@ -212,8 +213,13 @@ func TestOptionsApplyInvalid(t *testing.T) { + t.Fatalf("expected error %v not found", test.err) + } + +- if err.Error() != test.err { +- t.Fatalf("expected error %q, got %q", test.err, err.Error()) ++ matched, err := regexp.MatchString(test.err, err.Error()) ++ if err != nil { ++ t.Fatal(err) ++ } ++ ++ if !matched { ++ t.Fatalf("expected error to match %q, got %q", test.err, err.Error()) + } + }) + } -- cgit v1.2.3 From c5ee2cf72a72624eff4dfbdf4670851c6075191e Mon Sep 17 00:00:00 2001 From: Lars-Dominik Braun Date: Fri, 6 Aug 2021 08:18:26 +0200 Subject: gnu: Add llvm-for-rocm. * gnu/packages/rocm.scm (llvm-for-rocm): New variable. * gnu/packages/patches/llvm-roc-3.0.0-add_libraries.patch, gnu/packages/patches/llvm-roc-4.0.0-remove-isystem-usr-include.patch, gnu/packages/patches/llvm-roc-4.2.0-add_Object.patch: New files. * gnu/local.mk (dist_patch_DATA): Add them. --- gnu/local.mk | 3 ++ .../patches/llvm-roc-3.0.0-add_libraries.patch | 22 ++++++++++++++ ...llvm-roc-4.0.0-remove-isystem-usr-include.patch | 29 ++++++++++++++++++ .../patches/llvm-roc-4.2.0-add_Object.patch | 13 ++++++++ gnu/packages/rocm.scm | 35 ++++++++++++++++++++++ 5 files changed, 102 insertions(+) create mode 100644 gnu/packages/patches/llvm-roc-3.0.0-add_libraries.patch create mode 100644 gnu/packages/patches/llvm-roc-4.0.0-remove-isystem-usr-include.patch create mode 100644 gnu/packages/patches/llvm-roc-4.2.0-add_Object.patch (limited to 'gnu/packages/patches') diff --git a/gnu/local.mk b/gnu/local.mk index caa9090bbd..59dc7b01b5 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1416,6 +1416,9 @@ dist_patch_DATA = \ %D%/packages/patches/llvm-9-fix-bitcast-miscompilation.patch \ %D%/packages/patches/llvm-9-fix-lpad-miscompilation.patch \ %D%/packages/patches/llvm-9-fix-scev-miscompilation.patch \ + %D%/packages/patches/llvm-roc-3.0.0-add_libraries.patch \ + %D%/packages/patches/llvm-roc-4.0.0-remove-isystem-usr-include.patch \ + %D%/packages/patches/llvm-roc-4.2.0-add_Object.patch \ %D%/packages/patches/lm-sensors-hwmon-attrs.patch \ %D%/packages/patches/lrcalc-includes.patch \ %D%/packages/patches/lsh-fix-x11-forwarding.patch \ diff --git a/gnu/packages/patches/llvm-roc-3.0.0-add_libraries.patch b/gnu/packages/patches/llvm-roc-3.0.0-add_libraries.patch new file mode 100644 index 0000000000..f6bc639f33 --- /dev/null +++ b/gnu/packages/patches/llvm-roc-3.0.0-add_libraries.patch @@ -0,0 +1,22 @@ +Taken from https://gitweb.gentoo.org/repo/gentoo.git/tree/sys-devel/llvm-roc/files + +diff -Naur a/clang/lib/Basic/CMakeLists.txt b/clang/lib/Basic/CMakeLists.txt +--- a/clang/lib/Basic/CMakeLists.txt 2019-12-28 07:42:49.119055933 +0100 ++++ b/clang/lib/Basic/CMakeLists.txt 2019-12-28 07:42:13.265056070 +0100 +@@ -2,6 +2,7 @@ + Core + MC + Support ++ Option + ) + + find_first_existing_vc_file("${LLVM_MAIN_SRC_DIR}" llvm_vc) +diff -Naur a/clang/lib/Driver/CMakeLists.txt b/clang/lib/Driver/CMakeLists.txt +--- a/clang/lib/Driver/CMakeLists.txt 2019-12-28 07:41:39.521056199 +0100 ++++ b/clang/lib/Driver/CMakeLists.txt 2019-12-28 07:40:23.998056487 +0100 +@@ -79,4 +79,5 @@ + LINK_LIBS + clangBasic + ${system_libs} ++ pthread + ) diff --git a/gnu/packages/patches/llvm-roc-4.0.0-remove-isystem-usr-include.patch b/gnu/packages/patches/llvm-roc-4.0.0-remove-isystem-usr-include.patch new file mode 100644 index 0000000000..f14ec4ac0d --- /dev/null +++ b/gnu/packages/patches/llvm-roc-4.0.0-remove-isystem-usr-include.patch @@ -0,0 +1,29 @@ +Author: Wilfried (justxi) Holzke + +Adopted from https://github.com/justxi/rocm/blob/master/sys-devel/llvm-roc/files/llvm-roc-4.0.0-remove-isystem-usr-include.patch + +Index: llvm-project-rocm-4.0.0/clang/lib/Driver/ToolChains/AMDGPU.cpp +=================================================================== +--- llvm-project-rocm-4.0.0.orig/clang/lib/Driver/ToolChains/AMDGPU.cpp ++++ llvm-project-rocm-4.0.0/clang/lib/Driver/ToolChains/AMDGPU.cpp +@@ -326,11 +326,6 @@ void RocmInstallationDetector::AddHIPInc + // + // ROCm 3.5 does not fully support the wrapper headers. Therefore it needs + // a workaround. +- SmallString<128> P(D.ResourceDir); +- if (UsesRuntimeWrapper) +- llvm::sys::path::append(P, "include", "cuda_wrappers"); +- CC1Args.push_back("-internal-isystem"); +- CC1Args.push_back(DriverArgs.MakeArgString(P)); + } + + if (DriverArgs.hasArg(options::OPT_nogpuinc)) +@@ -341,8 +336,6 @@ void RocmInstallationDetector::AddHIPInc + return; + } + +- CC1Args.push_back("-internal-isystem"); +- CC1Args.push_back(DriverArgs.MakeArgString(getIncludePath())); + if (UsesRuntimeWrapper) + CC1Args.append({"-include", "__clang_hip_runtime_wrapper.h"}); + } diff --git a/gnu/packages/patches/llvm-roc-4.2.0-add_Object.patch b/gnu/packages/patches/llvm-roc-4.2.0-add_Object.patch new file mode 100644 index 0000000000..f1762a558b --- /dev/null +++ b/gnu/packages/patches/llvm-roc-4.2.0-add_Object.patch @@ -0,0 +1,13 @@ +Taken from https://gitweb.gentoo.org/repo/gentoo.git/tree/sys-devel/llvm-roc/files + +diff --color -uprN orig/lib/Target/AMDGPU/Disassembler/CMakeLists.txt llvm/lib/Target/AMDGPU/Disassembler/CMakeLists.txt +--- a/llvm/lib/Target/AMDGPU/Disassembler/CMakeLists.txt 2021-06-14 11:57:54.222796911 +0800 ++++ b/llvm/lib/Target/AMDGPU/Disassembler/CMakeLists.txt 2021-06-14 11:58:35.206796875 +0800 +@@ -11,6 +11,7 @@ add_llvm_component_library(LLVMAMDGPUDis + MC + MCDisassembler + Support ++ Object + + ADD_TO_COMPONENT + AMDGPU diff --git a/gnu/packages/rocm.scm b/gnu/packages/rocm.scm index b04eb8050e..17685c7bcb 100644 --- a/gnu/packages/rocm.scm +++ b/gnu/packages/rocm.scm @@ -55,3 +55,38 @@ (description "ROCm cmake modules provides cmake modules for common build tasks needed for the ROCM software stack.") (license license:ncsa))) + +(define-public llvm-for-rocm + (hidden-package + (package + ;; Actually based on LLVM 13 as of v4.3, but llvm-12 works just fine. + (inherit llvm-12) + (name "llvm-for-rocm") + (version %rocm-version) + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/RadeonOpenCompute/llvm-project.git") + (commit (string-append "rocm-" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "0p75nr1qpmy6crymdax5hm40wkimman4lnglz4x5cnbiqindya7s")) + (patches + (search-patches "llvm-roc-4.2.0-add_Object.patch" + "llvm-roc-3.0.0-add_libraries.patch" + "llvm-roc-4.0.0-remove-isystem-usr-include.patch")))) + (arguments + (substitute-keyword-arguments (package-arguments llvm-12) + ((#:phases phases '%standard-phases) + `(modify-phases ,phases + (add-after 'unpack 'chdir + (lambda _ + (chdir "llvm"))))) + ((#:configure-flags flags) + ''("-DLLVM_ENABLE_PROJECTS=llvm;clang;lld" + "-DLLVM_TARGETS_TO_BUILD=AMDGPU;X86" + "-DCMAKE_SKIP_BUILD_RPATH=FALSE" + "-DCMAKE_BUILD_WITH_INSTALL_RPATH=FALSE" + "-DBUILD_SHARED_LIBS:BOOL=TRUE" + "-DLLVM_VERSION_SUFFIX="))))))) -- cgit v1.2.3 From 9c083e706329909d41ab13d0721e726031ab78c7 Mon Sep 17 00:00:00 2001 From: Lars-Dominik Braun Date: Fri, 6 Aug 2021 08:21:20 +0200 Subject: gnu: Add rocm-comgr. * gnu/packages/rocm.scm (rocm-comgr): New variable. * gnu/packages/patches/rocm-comgr-3.1.0-dependencies.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. --- gnu/local.mk | 1 + .../patches/rocm-comgr-3.1.0-dependencies.patch | 52 ++++++++++++++++++++++ gnu/packages/rocm.scm | 32 +++++++++++++ 3 files changed, 85 insertions(+) create mode 100644 gnu/packages/patches/rocm-comgr-3.1.0-dependencies.patch (limited to 'gnu/packages/patches') diff --git a/gnu/local.mk b/gnu/local.mk index 59dc7b01b5..d545db39dd 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1701,6 +1701,7 @@ dist_patch_DATA = \ %D%/packages/patches/rnp-add-version.cmake.patch \ %D%/packages/patches/rnp-disable-ruby-rnp-tests.patch \ %D%/packages/patches/rnp-unbundle-googletest.patch \ + %D%/packages/patches/rocm-comgr-3.1.0-dependencies.patch \ %D%/packages/patches/ruby-sanitize-system-libxml.patch \ %D%/packages/patches/rust-1.19-mrustc.patch \ %D%/packages/patches/rust-1.25-accept-more-detailed-gdb-lines.patch \ diff --git a/gnu/packages/patches/rocm-comgr-3.1.0-dependencies.patch b/gnu/packages/patches/rocm-comgr-3.1.0-dependencies.patch new file mode 100644 index 0000000000..c91d273f92 --- /dev/null +++ b/gnu/packages/patches/rocm-comgr-3.1.0-dependencies.patch @@ -0,0 +1,52 @@ +https://github.com/RadeonOpenCompute/ROCm-CompilerSupport/pull/25 + +From c65cba2e73f9118e128b9ab7e655ee0f8a7798e7 Mon Sep 17 00:00:00 2001 +From: Craig Andrews +Date: Sun, 1 Mar 2020 19:24:22 -0500 +Subject: [PATCH] Link additional required LLVM libraries + +Without these additional required dependencies, linking fails with errors such as: +`undefined reference to llvm::errs()'` +--- + CMakeLists.txt | 20 ++++++++++++++++++-- + 1 file changed, 18 insertions(+), 2 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 1794a07..c7b852a 100644 +--- a/lib/comgr/CMakeLists.txt ++++ b/lib/comgr/CMakeLists.txt +@@ -207,7 +207,11 @@ install(FILES + DESTINATION "${AMD_COMGR_PACKAGE_PREFIX}") + + set(CLANG_LIBS +- clangFrontendTool) ++ clangFrontendTool ++ clangFrontend ++ clangBasic ++ clangDriver ++ clangSerialization) + + set(LLD_LIBS + lldELF +@@ -218,8 +222,20 @@ if (LLVM_LINK_LLVM_DYLIB) + else() + llvm_map_components_to_libnames(LLVM_LIBS + ${LLVM_TARGETS_TO_BUILD} ++ Option + DebugInfoDWARF +- Symbolize) ++ Symbolize ++ Support ++ Object ++ BitWriter ++ MC ++ MCParser ++ MCDisassembler ++ Core ++ IRReader ++ CodeGen ++ Linker ++ BinaryFormat) + endif() + + target_link_libraries(amd_comgr diff --git a/gnu/packages/rocm.scm b/gnu/packages/rocm.scm index 48d709969e..5ecc741d11 100644 --- a/gnu/packages/rocm.scm +++ b/gnu/packages/rocm.scm @@ -115,3 +115,35 @@ tasks needed for the ROCM software stack.") (description "AMD-specific device-side language runtime libraries, namely oclc, ocml, ockl, opencl, hip and hc.") (license license:ncsa))) + +(define-public rocm-comgr + (package + (name "rocm-comgr") + (version %rocm-version) + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/RadeonOpenCompute/ROCm-CompilerSupport.git") + (commit (string-append "rocm-" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "0bakbm7shr0l67lph44b5cnc9psd6rivg1mp79qizaawkn380x60")) + (patches + (search-patches "rocm-comgr-3.1.0-dependencies.patch")))) + (build-system cmake-build-system) + (arguments + `(#:phases + (modify-phases %standard-phases + (add-after 'unpack 'chdir + (lambda _ + (chdir "lib/comgr")))))) + (inputs + `(("rocm-device-libs" ,rocm-device-libs) + ("llvm" ,llvm-for-rocm) + ("lld" ,lld))) + (home-page "https://github.com/RadeonOpenCompute/ROCm-CompilerSupport") + (synopsis "ROCm Code Object Manager") + (description "The Comgr library provides APIs for compiling and inspecting +AMDGPU code objects.") + (license license:ncsa))) -- cgit v1.2.3 From c0f10a5dd4be70a990223b707be1067f6982c4ae Mon Sep 17 00:00:00 2001 From: Lars-Dominik Braun Date: Fri, 6 Aug 2021 08:27:32 +0200 Subject: gnu: Add rocm-opencl-runtime. * gnu/packages/rocm.scm (rocm-opencl-runtime): New variable. * gnu/packages/patches/rocm-opencl-runtime-3.10.0-add-rocclr-include-directories.patch, gnu/packages/patches/rocm-opencl-runtime-4.3-noclinfo.patch, gnu/packages/patches/rocm-opencl-runtime-4.3-nocltrace.patch, gnu/packages/patches/rocm-opencl-runtime-4.3-noopencl.patch: New files. * gnu/local.mk (dist_patch_DATA): Add them. --- gnu/local.mk | 4 ++ ...ime-3.10.0-add-rocclr-include-directories.patch | 14 +++++ .../patches/rocm-opencl-runtime-4.3-noclinfo.patch | 28 ++++++++++ .../rocm-opencl-runtime-4.3-nocltrace.patch | 25 +++++++++ .../patches/rocm-opencl-runtime-4.3-noopencl.patch | 63 ++++++++++++++++++++++ gnu/packages/rocm.scm | 51 ++++++++++++++++++ 6 files changed, 185 insertions(+) create mode 100644 gnu/packages/patches/rocm-opencl-runtime-3.10.0-add-rocclr-include-directories.patch create mode 100644 gnu/packages/patches/rocm-opencl-runtime-4.3-noclinfo.patch create mode 100644 gnu/packages/patches/rocm-opencl-runtime-4.3-nocltrace.patch create mode 100644 gnu/packages/patches/rocm-opencl-runtime-4.3-noopencl.patch (limited to 'gnu/packages/patches') diff --git a/gnu/local.mk b/gnu/local.mk index d545db39dd..3f09b167b1 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1702,6 +1702,10 @@ dist_patch_DATA = \ %D%/packages/patches/rnp-disable-ruby-rnp-tests.patch \ %D%/packages/patches/rnp-unbundle-googletest.patch \ %D%/packages/patches/rocm-comgr-3.1.0-dependencies.patch \ + %D%/packages/patches/rocm-opencl-runtime-3.10.0-add-rocclr-include-directories.patch \ + %D%/packages/patches/rocm-opencl-runtime-4.3-noclinfo.patch \ + %D%/packages/patches/rocm-opencl-runtime-4.3-nocltrace.patch \ + %D%/packages/patches/rocm-opencl-runtime-4.3-noopencl.patch \ %D%/packages/patches/ruby-sanitize-system-libxml.patch \ %D%/packages/patches/rust-1.19-mrustc.patch \ %D%/packages/patches/rust-1.25-accept-more-detailed-gdb-lines.patch \ diff --git a/gnu/packages/patches/rocm-opencl-runtime-3.10.0-add-rocclr-include-directories.patch b/gnu/packages/patches/rocm-opencl-runtime-3.10.0-add-rocclr-include-directories.patch new file mode 100644 index 0000000000..d81bb0747f --- /dev/null +++ b/gnu/packages/patches/rocm-opencl-runtime-3.10.0-add-rocclr-include-directories.patch @@ -0,0 +1,14 @@ +Add missing include dirs for ROCclr. + +--- a/amdocl/CMakeLists.txt 2020-12-05 22:05:55.838529158 +0100 ++++ b/amdocl/CMakeLists.txt 2020-12-05 22:07:35.677524507 +0100 +@@ -23,6 +23,9 @@ + include_directories(${CMAKE_CURRENT_LIST_DIR}/../khronos) + include_directories(${CMAKE_CURRENT_LIST_DIR}/../khronos/headers) + include_directories(${CMAKE_CURRENT_LIST_DIR}/../khronos/headers/opencl2.2) ++include_directories(${ROCclr_DIR}/../../../include) ++include_directories(${ROCclr_DIR}/../../../include/compiler/lib/include/) ++include_directories(${ROCclr_DIR}/../../../include/elf/) + + if((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") OR + (CMAKE_${COMPILER}_COMPILER_ID MATCHES "Clang")) diff --git a/gnu/packages/patches/rocm-opencl-runtime-4.3-noclinfo.patch b/gnu/packages/patches/rocm-opencl-runtime-4.3-noclinfo.patch new file mode 100644 index 0000000000..5709e0d19a --- /dev/null +++ b/gnu/packages/patches/rocm-opencl-runtime-4.3-noclinfo.patch @@ -0,0 +1,28 @@ +Do not build and install clinfo. + +diff --git a/CMakeLists.txt.orig b/CMakeLists.txt +index 76847d3..3f62bfe 100644 +--- a/CMakeLists.txt.orig ++++ b/CMakeLists.txt +@@ -72,7 +72,7 @@ find_package(ROCclr REQUIRED CONFIG + + add_subdirectory(khronos/icd) + add_subdirectory(amdocl) +-add_subdirectory(tools/clinfo) ++#add_subdirectory(tools/clinfo) + add_subdirectory(tools/cltrace) + if(BUILD_TESTS) + add_subdirectory(tests/ocltst) +@@ -108,9 +108,9 @@ endif() + ###--- Packaging ------------------------------------------------------------### + + # MAIN package +-install(PROGRAMS $ +- DESTINATION bin +- COMPONENT MAIN) ++#install(PROGRAMS $ ++# DESTINATION bin ++# COMPONENT MAIN) + install(PROGRAMS $ + DESTINATION lib + COMPONENT MAIN) diff --git a/gnu/packages/patches/rocm-opencl-runtime-4.3-nocltrace.patch b/gnu/packages/patches/rocm-opencl-runtime-4.3-nocltrace.patch new file mode 100644 index 0000000000..e0328d7734 --- /dev/null +++ b/gnu/packages/patches/rocm-opencl-runtime-4.3-nocltrace.patch @@ -0,0 +1,25 @@ +Do not build and install cltrace. + +diff --git a/CMakeLists.txt.orig b/CMakeLists.txt +index c449db4..9cff673 100644 +--- a/CMakeLists.txt.orig ++++ b/CMakeLists.txt +@@ -73,7 +73,7 @@ find_package(ROCclr REQUIRED CONFIG + #add_subdirectory(khronos/icd) + add_subdirectory(amdocl) + #add_subdirectory(tools/clinfo) +-add_subdirectory(tools/cltrace) ++#add_subdirectory(tools/cltrace) + if(BUILD_TESTS) + add_subdirectory(tests/ocltst) + endif() +@@ -108,9 +108,6 @@ endif() + #install(PROGRAMS $ + # DESTINATION bin + # COMPONENT MAIN) +-install(PROGRAMS $ +- DESTINATION lib +- COMPONENT MAIN) + install(PROGRAMS $ + DESTINATION lib + COMPONENT MAIN) diff --git a/gnu/packages/patches/rocm-opencl-runtime-4.3-noopencl.patch b/gnu/packages/patches/rocm-opencl-runtime-4.3-noopencl.patch new file mode 100644 index 0000000000..ed20f02503 --- /dev/null +++ b/gnu/packages/patches/rocm-opencl-runtime-4.3-noopencl.patch @@ -0,0 +1,63 @@ +Do not build and install libOpenCL. + +--- b/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -70,7 +70,7 @@ + ${ROCclr_DIR} + ${LIBROCclr_STATIC_DIR}) + +-add_subdirectory(khronos/icd) ++#add_subdirectory(khronos/icd) + add_subdirectory(amdocl) + #add_subdirectory(tools/clinfo) + add_subdirectory(tools/cltrace) +@@ -93,9 +93,6 @@ + OUTPUT_VARIABLE OPENCL_VERSION_GITDATE + OUTPUT_STRIP_TRAILING_WHITESPACE) + +-get_target_property(OPENCL_LIB_VERSION_MAJOR OpenCL SOVERSION) +-get_target_property(OPENCL_LIB_VERSION_STRING OpenCL VERSION) +- + find_package(ROCM QUIET CONFIG PATHS /opt/rocm) + + if(ROCM_FOUND) +@@ -117,25 +114,6 @@ + install(PROGRAMS $ + DESTINATION lib + COMPONENT MAIN) +-install(PROGRAMS $ +- DESTINATION lib +- COMPONENT MAIN) +-install(PROGRAMS $ +- DESTINATION lib +- COMPONENT MAIN) +- +-# DEV package +-install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/khronos/headers/opencl2.2/CL" +- DESTINATION include +- COMPONENT DEV +- USE_SOURCE_PERMISSIONS +- PATTERN cl_d3d10.h EXCLUDE +- PATTERN cl_d3d11.h EXCLUDE +- PATTERN cl_dx9_media_sharing.h EXCLUDE +- PATTERN cl_egl.h EXCLUDE) +-install(PROGRAMS $ +- DESTINATION lib +- COMPONENT DEV) + + ############################# + # Packaging steps +--- a/khronos/icd/CMakeLists.txt 2020-06-07 16:05:32.425022904 +0200 ++++ b/khronos/icd/CMakeLists.txt 2020-06-07 16:06:03.273022786 +0200 +@@ -132,7 +132,7 @@ + add_subdirectory (test) + endif() + +-install (TARGETS OpenCL +- RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} +- ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} +- LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) ++#install (TARGETS OpenCL ++# RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ++# ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ++# LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) diff --git a/gnu/packages/rocm.scm b/gnu/packages/rocm.scm index 631d8336c0..07e395c9f0 100644 --- a/gnu/packages/rocm.scm +++ b/gnu/packages/rocm.scm @@ -253,3 +253,54 @@ applications to launch compute kernels to available HSA ROCm kernel agents.") interact with to different backends such as ROCr or PAL. This abstraction allows runtimes to work on Windows as well as on Linux without much effort.") (license license:ncsa))) + +(define-public rocm-opencl-runtime + (package + (name "rocm-opencl-runtime") + (version %rocm-version) + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/RadeonOpenCompute/ROCm-OpenCL-Runtime.git") + (commit (string-append "rocm-" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "1cglpiaj3ny1z74ssmy6j63vj92sfy4q38ix6qsga0mg3b2wvqz3")) + (patches + (search-patches + "rocm-opencl-runtime-3.10.0-add-rocclr-include-directories.patch" + ;; Do not install libOpenCL, which ocl-icd provides. + "rocm-opencl-runtime-4.3-noopencl.patch" + ;; Guix includes a program clinfo already. + "rocm-opencl-runtime-4.3-noclinfo.patch" + ;; cltrace linking fails, remove it. + "rocm-opencl-runtime-4.3-nocltrace.patch")))) + (build-system cmake-build-system) + (arguments + `(#:tests? #f ; Not sure how to run them. + #:phases + (modify-phases %standard-phases + (add-after 'install 'create-icd + ;; Manually install ICD, which simply consists of dumping + ;; the path of the .so into the correct file. + (lambda* (#:key outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (vendors (string-append out "/etc/OpenCL/vendors")) + (sopath (string-append out "/lib/libamdocl64.so"))) + (mkdir-p vendors) + (with-output-to-file (string-append vendors "/amdocl64.icd") + (lambda _ (display sopath))))))))) + (inputs + `(("mesa" ,mesa) + ("rocm-comgr" ,rocm-comgr) + ("rocr-runtime" ,rocr-runtime) + ("rocclr" ,rocclr) + ("ocl-icd" ,ocl-icd) + ("glew" ,glew))) + (native-inputs `()) + (home-page "https://github.com/RadeonOpenCompute/ROCm-OpenCL-Runtime") + (synopsis "ROCm OpenCL Runtime") + (description "OpenCL 2.0 compatible language runtime, supporting offline +and in-process/in-memory compilation.") + (license license:ncsa))) -- cgit v1.2.3 From 168d107abf5608e6a1bfb37ee3448c4087856602 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Tue, 10 Aug 2021 23:51:06 +0200 Subject: gnu: rocm-opencl-runtime: Shorten patch file name. This appeases 'guix lint -c patch-file-names'. * gnu/packages/patches/rocm-opencl-runtime-3.10.0-add-rocclr-include-directories.patch: Rename to... * gnu/packages/patches/rocm-opencl-runtime-3.10.0-includes.patch: ... this. * gnu/packages/rocm.scm (rocm-opencl-runtime)[source]: Adjust accordingly. * gnu/local.mk (dist_patch_DATA): Likewise. --- gnu/local.mk | 2 +- ...ncl-runtime-3.10.0-add-rocclr-include-directories.patch | 14 -------------- .../patches/rocm-opencl-runtime-3.10.0-includes.patch | 14 ++++++++++++++ gnu/packages/rocm.scm | 2 +- 4 files changed, 16 insertions(+), 16 deletions(-) delete mode 100644 gnu/packages/patches/rocm-opencl-runtime-3.10.0-add-rocclr-include-directories.patch create mode 100644 gnu/packages/patches/rocm-opencl-runtime-3.10.0-includes.patch (limited to 'gnu/packages/patches') diff --git a/gnu/local.mk b/gnu/local.mk index 3f09b167b1..32ac19d20e 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1702,7 +1702,7 @@ dist_patch_DATA = \ %D%/packages/patches/rnp-disable-ruby-rnp-tests.patch \ %D%/packages/patches/rnp-unbundle-googletest.patch \ %D%/packages/patches/rocm-comgr-3.1.0-dependencies.patch \ - %D%/packages/patches/rocm-opencl-runtime-3.10.0-add-rocclr-include-directories.patch \ + %D%/packages/patches/rocm-opencl-runtime-3.10.0-includes.patch \ %D%/packages/patches/rocm-opencl-runtime-4.3-noclinfo.patch \ %D%/packages/patches/rocm-opencl-runtime-4.3-nocltrace.patch \ %D%/packages/patches/rocm-opencl-runtime-4.3-noopencl.patch \ diff --git a/gnu/packages/patches/rocm-opencl-runtime-3.10.0-add-rocclr-include-directories.patch b/gnu/packages/patches/rocm-opencl-runtime-3.10.0-add-rocclr-include-directories.patch deleted file mode 100644 index d81bb0747f..0000000000 --- a/gnu/packages/patches/rocm-opencl-runtime-3.10.0-add-rocclr-include-directories.patch +++ /dev/null @@ -1,14 +0,0 @@ -Add missing include dirs for ROCclr. - ---- a/amdocl/CMakeLists.txt 2020-12-05 22:05:55.838529158 +0100 -+++ b/amdocl/CMakeLists.txt 2020-12-05 22:07:35.677524507 +0100 -@@ -23,6 +23,9 @@ - include_directories(${CMAKE_CURRENT_LIST_DIR}/../khronos) - include_directories(${CMAKE_CURRENT_LIST_DIR}/../khronos/headers) - include_directories(${CMAKE_CURRENT_LIST_DIR}/../khronos/headers/opencl2.2) -+include_directories(${ROCclr_DIR}/../../../include) -+include_directories(${ROCclr_DIR}/../../../include/compiler/lib/include/) -+include_directories(${ROCclr_DIR}/../../../include/elf/) - - if((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") OR - (CMAKE_${COMPILER}_COMPILER_ID MATCHES "Clang")) diff --git a/gnu/packages/patches/rocm-opencl-runtime-3.10.0-includes.patch b/gnu/packages/patches/rocm-opencl-runtime-3.10.0-includes.patch new file mode 100644 index 0000000000..d81bb0747f --- /dev/null +++ b/gnu/packages/patches/rocm-opencl-runtime-3.10.0-includes.patch @@ -0,0 +1,14 @@ +Add missing include dirs for ROCclr. + +--- a/amdocl/CMakeLists.txt 2020-12-05 22:05:55.838529158 +0100 ++++ b/amdocl/CMakeLists.txt 2020-12-05 22:07:35.677524507 +0100 +@@ -23,6 +23,9 @@ + include_directories(${CMAKE_CURRENT_LIST_DIR}/../khronos) + include_directories(${CMAKE_CURRENT_LIST_DIR}/../khronos/headers) + include_directories(${CMAKE_CURRENT_LIST_DIR}/../khronos/headers/opencl2.2) ++include_directories(${ROCclr_DIR}/../../../include) ++include_directories(${ROCclr_DIR}/../../../include/compiler/lib/include/) ++include_directories(${ROCclr_DIR}/../../../include/elf/) + + if((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") OR + (CMAKE_${COMPILER}_COMPILER_ID MATCHES "Clang")) diff --git a/gnu/packages/rocm.scm b/gnu/packages/rocm.scm index 8d6e3e69e2..66a28fc169 100644 --- a/gnu/packages/rocm.scm +++ b/gnu/packages/rocm.scm @@ -270,7 +270,7 @@ allows runtimes to work on Windows as well as on Linux without much effort.") "1cglpiaj3ny1z74ssmy6j63vj92sfy4q38ix6qsga0mg3b2wvqz3")) (patches (search-patches - "rocm-opencl-runtime-3.10.0-add-rocclr-include-directories.patch" + "rocm-opencl-runtime-3.10.0-includes.patch" ;; Do not install libOpenCL, which ocl-icd provides. "rocm-opencl-runtime-4.3-noopencl.patch" ;; Guix includes a program clinfo already. -- cgit v1.2.3 From 443e7f6338049d39427439fc5d997f8c59916fe1 Mon Sep 17 00:00:00 2001 From: Marius Bakke Date: Wed, 11 Aug 2021 09:59:42 +0200 Subject: gnu: rapidjson: Adjust for GCC 10. * gnu/packages/patches/rapidjson-gcc-compat.patch: Add additional patch. --- gnu/packages/patches/rapidjson-gcc-compat.patch | 48 +++++++++++++++++++++++++ 1 file changed, 48 insertions(+) (limited to 'gnu/packages/patches') diff --git a/gnu/packages/patches/rapidjson-gcc-compat.patch b/gnu/packages/patches/rapidjson-gcc-compat.patch index b5ffc0a908..8bfdb075d9 100644 --- a/gnu/packages/patches/rapidjson-gcc-compat.patch +++ b/gnu/packages/patches/rapidjson-gcc-compat.patch @@ -16,3 +16,51 @@ index 422a5240..d4039716 100644 #endif #ifdef _MSC_VER + +Cast destination pointers to avoid a GCC error about memmove writing to +a different type. + +Adapted from this upstream commit: +https://github.com/Tencent/rapidjson/commit/fa5963a2f5b231ee2babff771f169ccca22870ed + +diff --git a/include/rapidjson/document.h b/include/rapidjson/document.h +--- a/include/rapidjson/document.h ++++ b/include/rapidjson/document.h +@@ -1425,7 +1425,7 @@ public: + MemberIterator pos = MemberBegin() + (first - MemberBegin()); + for (MemberIterator itr = pos; itr != last; ++itr) + itr->~Member(); +- std::memmove(&*pos, &*last, static_cast(MemberEnd() - last) * sizeof(Member)); ++ std::memmove(static_cast(&*pos), &*last, static_cast(MemberEnd() - last) * sizeof(Member)); + data_.o.size -= static_cast(last - first); + return pos; + } +@@ -1628,8 +1628,8 @@ public: + RAPIDJSON_ASSERT(last <= End()); + ValueIterator pos = Begin() + (first - Begin()); + for (ValueIterator itr = pos; itr != last; ++itr) +- itr->~GenericValue(); +- std::memmove(pos, last, static_cast(End() - last) * sizeof(GenericValue)); ++ itr->~GenericValue(); ++ std::memmove(static_cast(pos), last, static_cast(End() - last) * sizeof(GenericValue)); + data_.a.size -= static_cast(last - first); + return pos; + } +@@ -1936,7 +1936,7 @@ private: + if (count) { + GenericValue* e = static_cast(allocator.Malloc(count * sizeof(GenericValue))); + SetElementsPointer(e); +- std::memcpy(e, values, count * sizeof(GenericValue)); ++ std::memcpy(static_cast(e), values, count * sizeof(GenericValue)); + } + else + SetElementsPointer(0); +@@ -1949,7 +1949,7 @@ private: + if (count) { + Member* m = static_cast(allocator.Malloc(count * sizeof(Member))); + SetMembersPointer(m); +- std::memcpy(m, members, count * sizeof(Member)); ++ std::memcpy(static_cast(m), members, count * sizeof(Member)); + } + else + SetMembersPointer(0); -- cgit v1.2.3