From 87144b17f8f77cfe2bff8dee07666617692ac527 Mon Sep 17 00:00:00 2001 From: Maxim Cournoyer Date: Sun, 31 Jan 2021 16:49:25 -0500 Subject: rust: Cleanup commit to prepare for new bootstrap. This commit is not atomic and is not functional by itself; this is done so to make the next set of changes more comprehensible. * gnu/packages/patches/rust-1.19-mrustc.patch: Delete file. * gnu/packages/patches/rust-1.30-gdb-llvm.patch: Likewise. * gnu/packages/patches/rust-bootstrap-stage0-test.patch: Likewise. * gnu/local.mk (dist_patch_DATA): Un-register files. * gnu/packages/rust.scm (mrustc): Delete variable. (rust-1.19, rust-1.20, rust-1.21 rust-1.22, rust-1.23, rust-1.24) (rust-1.25, rust-1.26, rust-1.27, rust-1.28, rust-1.29) (rust-1.30): Delete variables. (rust-1.31 through rust-1.49): Fix indentation and do other cosmetic changes. (rust): Define as rust-1.49. --- gnu/packages/rust.scm | 1301 +++++++++---------------------------------------- 1 file changed, 224 insertions(+), 1077 deletions(-) (limited to 'gnu/packages/rust.scm') diff --git a/gnu/packages/rust.scm b/gnu/packages/rust.scm index e646cd0091..66c1522735 100644 --- a/gnu/packages/rust.scm +++ b/gnu/packages/rust.scm @@ -107,876 +107,39 @@ (inherit base-rust) (version version) (source - (origin - (inherit (package-source base-rust)) - (uri (rust-uri version)) - (sha256 (base32 checksum)))) + (origin + (inherit (package-source base-rust)) + (uri (rust-uri version)) + (sha256 (base32 checksum)))) (native-inputs (alist-replace "cargo-bootstrap" (list base-rust "cargo") (alist-replace "rustc-bootstrap" (list base-rust) (package-native-inputs base-rust)))))) -(define-public mrustc - (let ((rustc-version "1.19.0")) - (package - (name "mrustc") - (version "0.9") - (source (origin - (method git-fetch) - (uri (git-reference - (url "https://github.com/thepowersgang/mrustc") - (commit (string-append "v" version)))) - (file-name (git-file-name name version)) - (sha256 - (base32 - "194ny7vsks5ygiw7d8yxjmp1qwigd71ilchis6xjl6bb2sj97rd2")))) - (outputs '("out" "cargo")) - (build-system gnu-build-system) - (inputs - `(("zlib" ,zlib))) - (native-inputs - `(("bison" ,bison) - ("flex" ,flex) - ;; Required for the libstd sources. - ("rustc" ,(package-source rust-1.19)))) - (arguments - `(#:test-target "test" - #:make-flags - (list ,(string-append "RUSTC_TARGET=" - (or (%current-target-system) - (nix-system->gnu-triplet-for-rust)))) - #:phases - (modify-phases %standard-phases - (add-after 'unpack 'patch-date - (lambda _ - (substitute* "Makefile" - (("shell date") "shell date -d @1")) - (substitute* "run_rustc/Makefile" - (("[$]Vtime ") "$V ")) - #t)) - (add-after 'patch-date 'unpack-target-compiler - (lambda* (#:key inputs outputs #:allow-other-keys) - (invoke "tar" "xf" (assoc-ref inputs "rustc")) - (chdir ,(string-append "rustc-" rustc-version "-src")) - (invoke "patch" "-p0" ,(string-append "../rustc-" rustc-version - "-src.patch")) - (chdir "..") - (setenv "RUSTC_VERSION" ,rustc-version) - (setenv "MRUSTC_TARGET_VER" - ,(version-major+minor rustc-version)) - (setenv "OUTDIR_SUF" "") - #t)) - (replace 'configure - (lambda* (#:key inputs #:allow-other-keys) - (setenv "CC" (string-append (assoc-ref inputs "gcc") - "/bin/gcc")) - (setenv "CXX" (string-append (assoc-ref inputs "gcc") - "/bin/g++")) - #t)) - (add-after 'build 'build-minicargo - (lambda* (#:key make-flags #:allow-other-keys) - ;; TODO: minicargo.mk: RUSTC_VERSION=$(RUSTC_VERSION) RUSTC_CHANNEL=$(RUSTC_SRC_TY) OUTDIR_SUF=$(OUTDIR_SUF) - (apply invoke "make" "-f" "minicargo.mk" "LIBS" make-flags) - (apply invoke "make" "-C" "tools/minicargo" make-flags))) - ;(add-after 'check 'check-locally - ; (lambda* (#:key make-flags #:allow-other-keys) - ; ;; The enum test wouldn't work otherwise. - ; ;; See . - ; (setenv "MRUSTC_TARGET_VER" ,(version-major+minor rustc-version)) - ; (apply invoke "make" "local_tests" make-flags))) - (replace 'install - (lambda* (#:key inputs outputs #:allow-other-keys) - (let* ((out (assoc-ref outputs "out")) - (bin (string-append out "/bin")) - (tools-bin (string-append out "/tools/bin")) - (cargo-out (assoc-ref outputs "cargo")) - (cargo-bin (string-append cargo-out "/bin")) - (lib (string-append out "/lib")) - (lib/rust (string-append lib "/mrust")) - (gcc (assoc-ref inputs "gcc")) - (run_rustc (string-append out - "/share/mrustc/run_rustc"))) - ;; These files are not reproducible. - (for-each delete-file (find-files "output" "\\.txt$")) - ;(delete-file-recursively "output/local_tests") - (mkdir-p (dirname lib/rust)) - (copy-recursively "output" lib/rust) - (mkdir-p bin) - (mkdir-p tools-bin) - (install-file "bin/mrustc" bin) - ;; minicargo uses relative paths to resolve mrustc. - (install-file "tools/bin/minicargo" tools-bin) - (install-file "tools/bin/minicargo" cargo-bin) - (mkdir-p run_rustc) - (copy-file "run_rustc/Makefile" - (string-append run_rustc "/Makefile")) - #t)))))) - (synopsis "Compiler for the Rust programming language") - (description "Rust is a systems programming language that provides memory -safety and thread safety guarantees.") - (home-page "https://github.com/thepowersgang/mrustc") - ;; Dual licensed. - (license (list license:asl2.0 license:expat))))) - -(define rust-1.19 - (package - (name "rust") - (version "1.19.0") - (source - (origin - (method url-fetch) - (uri (rust-uri "1.19.0")) - (sha256 (base32 "0l8c14qsf42rmkqy92ahij4vf356dbyspxcips1aswpvad81y8qm")) - (modules '((guix build utils))) - (snippet '(begin (delete-file-recursively "src/llvm") #t)) - (patches (search-patches "rust-1.19-mrustc.patch")))) - (outputs '("out" "cargo")) - (properties '((timeout . 72000) ;20 hours - (max-silent-time . 18000))) ;5 hours (for armel) - (arguments - `(#:imported-modules ,%cargo-utils-modules ;for `generate-all-checksums' - #:modules ((guix build utils) (ice-9 match) (guix build gnu-build-system)) - #:phases - (modify-phases %standard-phases - (add-after 'unpack 'set-env - (lambda* (#:key inputs #:allow-other-keys) - ;; Disable test for cross compilation support. - (setenv "CFG_DISABLE_CROSS_TESTS" "1") - (setenv "SHELL" (which "sh")) - (setenv "CONFIG_SHELL" (which "sh")) - (setenv "CC" (string-append (assoc-ref inputs "gcc") "/bin/gcc")) - ;; guix llvm-3.9.1 package installs only shared libraries - (setenv "LLVM_LINK_SHARED" "1") - #t)) - (add-after 'unpack 'patch-cargo-tomls - (lambda* (#:key inputs outputs #:allow-other-keys) - (substitute* "src/librustc_errors/Cargo.toml" - (("[[]dependencies[]]") " -[dependencies] -term = \"0.4.4\" -")) - (substitute* "src/librustc/Cargo.toml" - (("[[]dependencies[]]") " -[dependencies] -getopts = { path = \"../libgetopts\" } -")) - (substitute* "src/librustdoc/Cargo.toml" - (("[[]dependencies[]]") " -[dependencies] -test = { path = \"../libtest\" } -")) - #t)) - (add-after 'unpack 'patch-tests - (lambda* (#:key inputs #:allow-other-keys) - (let ((bash (assoc-ref inputs "bash"))) - (substitute* "src/libstd/process.rs" - ;; The newline is intentional. - ;; There's a line length "tidy" check in Rust which would - ;; fail otherwise. - (("\"/bin/sh\"") (string-append "\n\"" bash "/bin/sh\""))) - (substitute* "src/libstd/net/tcp.rs" - ;; There is no network in build environment - (("fn connect_timeout_unroutable") - "#[ignore]\nfn connect_timeout_unroutable")) - ;; - (substitute* "src/libstd/sys/unix/process/process_common.rs" - (("fn test_process_mask") "#[allow(unused_attributes)] - #[ignore] - fn test_process_mask")) - #t))) - (add-after 'patch-tests 'patch-aarch64-test - (lambda* _ - (substitute* "src/librustc_back/dynamic_lib.rs" - ;; This test is known to fail on aarch64 and powerpc64le: - ;; https://github.com/rust-lang/rust/issues/45410 - (("fn test_loading_cosine") "#[ignore]\nfn test_loading_cosine")) - #t)) - (add-after 'patch-tests 'use-readelf-for-tests - (lambda* _ - ;; nm doesn't recognize the file format because of the - ;; nonstandard sections used by the Rust compiler, but readelf - ;; ignores them. - (substitute* "src/test/run-make/atomic-lock-free/Makefile" - (("\tnm ") - "\treadelf -c ")) - #t)) - (add-after 'patch-tests 'remove-unsupported-tests - (lambda* _ - ;; Our ld-wrapper cannot process non-UTF8 bytes in LIBRARY_PATH. - ;; - (delete-file-recursively "src/test/run-make/linker-output-non-utf8") - #t)) - (add-after 'patch-source-shebangs 'patch-cargo-checksums - (lambda* _ - (use-modules (guix build cargo-utils)) - (substitute* "src/Cargo.lock" - (("(\"checksum .* = )\".*\"" all name) - (string-append name "\"" ,%cargo-reference-hash "\""))) - (generate-all-checksums "src/vendor") - #t)) - ;; This phase is overridden by newer versions. - (replace 'configure - (const #t)) - ;; This phase is overridden by newer versions. - (replace 'build - (lambda* (#:key inputs outputs #:allow-other-keys) - (let ((rustc-bootstrap (assoc-ref inputs "rustc-bootstrap"))) - (setenv "CFG_COMPILER_HOST_TRIPLE" - ,(nix-system->gnu-triplet (%current-system))) - (setenv "CFG_RELEASE" "") - (setenv "CFG_RELEASE_CHANNEL" "stable") - (setenv "CFG_LIBDIR_RELATIVE" "lib") - (setenv "CFG_VERSION" "1.19.0-stable-mrustc") - (setenv "MRUSTC_TARGET_VER" ,(version-major+minor version)) - ; bad: (setenv "CFG_PREFIX" "mrustc") ; FIXME output path. - (mkdir-p "output") - ;; mrustc 0.9 doesn't check the search paths for crates anymore. - (copy-recursively (string-append rustc-bootstrap "/lib/mrust") - "output") - (invoke (string-append rustc-bootstrap "/tools/bin/minicargo") - "src/rustc" "--vendor-dir" "src/vendor" - "--output-dir" "output/rustc-build" - "-L" (string-append rustc-bootstrap "/lib/mrust") - "-j" "1") - (setenv "CFG_COMPILER_HOST_TRIPLE" #f) - (setenv "CFG_RELEASE" #f) - (setenv "CFG_RELEASE_CHANNEL" #f) - (setenv "CFG_VERSION" #f) - (setenv "CFG_PREFIX" #f) - (setenv "CFG_LIBDIR_RELATIVE" #f) - (invoke (string-append rustc-bootstrap "/tools/bin/minicargo") - "src/tools/cargo" "--vendor-dir" "src/vendor" - "--output-dir" "output/cargo-build" - "-L" "output/" - "-L" (string-append rustc-bootstrap "/lib/mrust") - "-j" "1") - ;; Now use the newly-built rustc to build the libraries. - ;; One day that could be replaced by: - ;; (invoke "output/cargo-build/cargo" "build" - ;; "--manifest-path" "src/bootstrap/Cargo.toml" - ;; "--verbose") ; "--locked" "--frozen" - ;; but right now, Cargo has problems with libstd's circular - ;; dependencies. - (mkdir-p "output/target-libs") - (for-each (match-lambda - ((name . flags) - (write name) - (newline) - (apply invoke - "output/rustc-build/rustc" - "-C" (string-append "linker=" - (getenv "CC")) - ;; Required for libterm. - "-Z" "force-unstable-if-unmarked" - "-L" "output/target-libs" - (string-append "src/" name "/lib.rs") - "-o" - (string-append "output/target-libs/" - (car (string-split name #\/)) - ".rlib") - flags))) - '(("libcore") - ("libstd_unicode") - ("liballoc") - ("libcollections") - ("librand") - ("liblibc/src" "--cfg" "stdbuild") - ("libunwind" "-l" "gcc_s") - ("libcompiler_builtins") - ("liballoc_system") - ("libpanic_unwind") - ;; Uses "cc" to link. - ("libstd" "-l" "dl" "-l" "rt" "-l" "pthread") - ("libarena") - - ;; Test dependencies: - - ("libgetopts") - ("libterm") - ("libtest"))) - #t))) - ;; This phase is overridden by newer versions. - (replace 'check - (const #t)) - ;; This phase is overridden by newer versions. - (replace 'install - (lambda* (#:key inputs outputs #:allow-other-keys) - (let* ((out (assoc-ref outputs "out")) - (target-system ,(or (%current-target-system) - (nix-system->gnu-triplet - (%current-system)))) - (out-libs (string-append out "/lib/rustlib/" - target-system "/lib"))) - ;(setenv "CFG_PREFIX" out) - (mkdir-p out-libs) - (copy-recursively "output/target-libs" out-libs) - (install-file "output/rustc-build/rustc" - (string-append out "/bin")) - (install-file "output/rustc-build/rustdoc" - (string-append out "/bin")) - (install-file "output/cargo-build/cargo" - (string-append (assoc-ref outputs "cargo") - "/bin"))) - #t))))) - (build-system gnu-build-system) - (native-inputs - `(("bison" ,bison) ; For the tests - ("cmake" ,cmake-minimal) - ("flex" ,flex) ; For the tests - ;; FIXME: Rust 1.27 and some later versions require GDB 8.2 specifically. - ;; See . Use it on all Rusts for simplicity. - ("gdb" ,gdb-8.2) ; For the tests - ("procps" ,procps) ; For the tests - ("python-2" ,python-2) - ("rustc-bootstrap" ,mrustc) - ("cargo-bootstrap" ,mrustc "cargo") - ("pkg-config" ,pkg-config) ; For "cargo" - ("which" ,which))) - (inputs - `(("jemalloc" ,jemalloc-4.5.0) - ("llvm" ,llvm-3.9.1) - ("openssl" ,openssl-1.0) - ("libssh2" ,libssh2) ; For "cargo" - ("libcurl" ,curl))) ; For "cargo" - - ;; rustc invokes gcc, so we need to set its search paths accordingly. - ;; Note: duplicate its value here to cope with circular dependencies among - ;; modules (see ). - (native-search-paths - (list (search-path-specification - (variable "C_INCLUDE_PATH") - (files '("include"))) - (search-path-specification - (variable "CPLUS_INCLUDE_PATH") - (files '("include/c++" "include"))) - (search-path-specification - (variable "LIBRARY_PATH") - (files '("lib" "lib64"))))) - - (supported-systems '("x86_64-linux")) - (synopsis "Compiler for the Rust programming language") - (description "Rust is a systems programming language that provides memory -safety and thread safety guarantees.") - (home-page "https://www.rust-lang.org") - ;; Dual licensed. - (license (list license:asl2.0 license:expat)))) - -(define-public rust-1.20 - (let ((base-rust - (rust-bootstrapped-package rust-1.19 "1.20.0" - "0542y4rnzlsrricai130mqyxl8r6rd991frb4qsnwb27yigqg91a"))) - (package - (inherit base-rust) - (source - (origin - (inherit (package-source base-rust)) - (snippet '(begin - (delete-file-recursively "src/jemalloc") - (delete-file-recursively "src/llvm") - #t)) - (patches '()))) - (native-inputs - `(;; The tests fail with newer versions of GNU Make. - ("make" ,gnu-make-4.2) - ,@(package-native-inputs base-rust))) - (outputs '("out" "doc" "cargo")) - ;; Since rust-1.19 is local, it's quite probable that Hydra - ;; will build rust-1.19 only as a dependency of rust-1.20. - ;; But then Hydra will use the wrong properties, the ones here, - ;; for rust-1.19. Therefore, we copied the properties of - ;; rust-1.19 here. - (properties '((timeout . 72000) ;20 hours - (max-silent-time . 18000))) ;5 hours (for armel) - (arguments - (substitute-keyword-arguments (package-arguments rust-1.19) - ((#:phases phases) - `(modify-phases ,phases - (add-after 'patch-tests 'patch-cargo-tests - (lambda _ - (substitute* "src/tools/cargo/tests/build.rs" - (("/usr/bin/env") (which "env")) - ;; Guix llvm is compiled without asmjs-unknown-emscripten. - (("fn wasm32_final_outputs") "#[ignore]\nfn wasm32_final_outputs")) - (substitute* "src/tools/cargo/tests/death.rs" - ;; This is stuck when built in container. - (("fn ctrl_c_kills_everyone") "#[ignore]\nfn ctrl_c_kills_everyone")) - ;; Prints test output in the wrong order when built on - ;; i686-linux. - (substitute* "src/tools/cargo/tests/test.rs" - (("fn cargo_test_env") "#[ignore]\nfn cargo_test_env")) - - ;; These tests pull in a dependency on "git", which changes - ;; too frequently take part in the Rust toolchain. - (substitute* "src/tools/cargo/tests/new.rs" - (("fn author_prefers_cargo") "#[ignore]\nfn author_prefers_cargo") - (("fn finds_author_git") "#[ignore]\nfn finds_author_git") - (("fn finds_local_author_git") "#[ignore]\nfn finds_local_author_git")) - #t)) - (add-after 'patch-cargo-tests 'ignore-glibc-2.27-incompatible-test - ;; https://github.com/rust-lang/rust/issues/47863 - (lambda _ - (substitute* "src/test/run-pass/out-of-stack.rs" - (("// ignore-android") "// ignore-test\n// ignore-android")) - #t)) - (replace 'configure - (lambda* (#:key inputs outputs #:allow-other-keys) - (let* ((out (assoc-ref outputs "out")) - (doc (assoc-ref outputs "doc")) - (gcc (assoc-ref inputs "gcc")) - (gdb (assoc-ref inputs "gdb")) - (binutils (assoc-ref inputs "binutils")) - (python (assoc-ref inputs "python-2")) - (rustc (assoc-ref inputs "rustc-bootstrap")) - (cargo (assoc-ref inputs "cargo-bootstrap")) - (llvm (assoc-ref inputs "llvm")) - (jemalloc (assoc-ref inputs "jemalloc"))) - (call-with-output-file "config.toml" - (lambda (port) - (display (string-append " -[llvm] -[build] -cargo = \"" cargo "/bin/cargo" "\" -rustc = \"" rustc "/bin/rustc" "\" -docs = true -python = \"" python "/bin/python2" "\" -gdb = \"" gdb "/bin/gdb" "\" -vendor = true -submodules = false -[install] -prefix = \"" out "\" -docdir = \"" doc "/share/doc/rust" "\" -sysconfdir = \"etc\" -[rust] -default-linker = \"" gcc "/bin/gcc" "\" -channel = \"stable\" -rpath = true -" ;; There are 2 failed codegen tests: -;; codegen/mainsubprogram.rs and codegen/mainsubprogramstart.rs -;; These tests require a patched LLVM -"codegen-tests = false -[target." ,(nix-system->gnu-triplet-for-rust) "] -llvm-config = \"" llvm "/bin/llvm-config" "\" -cc = \"" gcc "/bin/gcc" "\" -cxx = \"" gcc "/bin/g++" "\" -ar = \"" binutils "/bin/ar" "\" -jemalloc = \"" jemalloc "/lib/libjemalloc_pic.a" "\" -[dist] -") port))) - #t))) - (add-after 'configure 'provide-cc - (lambda* (#:key inputs #:allow-other-keys) - (symlink (string-append (assoc-ref inputs "gcc") "/bin/gcc") - "/tmp/cc") - (setenv "PATH" (string-append "/tmp:" (getenv "PATH"))) - #t)) - (add-after 'provide-cc 'configure-archiver - (lambda* (#:key inputs #:allow-other-keys) - (substitute* "src/build_helper/lib.rs" - ;; Make sure "ar" is always used as the archiver. - (("\"musl\"") "\"\"") - ;; Then substitute "ar" by our name. - (("\"ar\"") (string-append "\"" - (assoc-ref inputs "binutils") - "/bin/ar\""))) - #t)) - (delete 'patch-cargo-tomls) - (add-before 'build 'reset-timestamps-after-changes - (lambda* _ - (for-each - (lambda (filename) - ;; Rust 1.20.0 treats timestamp 0 as "file doesn't exist". - ;; Therefore, use timestamp 1. - (utime filename 1 1 1 1)) - (find-files "." #:directories? #t)) - #t)) - (replace 'build - (lambda* _ - (invoke "./x.py" "build") - (invoke "./x.py" "build" "src/tools/cargo"))) - (replace 'check - (lambda* _ - ;; Disable parallel execution to prevent EAGAIN errors when - ;; running tests. - (invoke "./x.py" "-j1" "test" "-vv") - (invoke "./x.py" "-j1" "test" "src/tools/cargo") - #t)) - (replace 'install - (lambda* (#:key outputs #:allow-other-keys) - (invoke "./x.py" "install") - (substitute* "config.toml" - ;; replace prefix to specific output - (("prefix = \"[^\"]*\"") - (string-append "prefix = \"" (assoc-ref outputs "cargo") "\""))) - (invoke "./x.py" "install" "cargo"))) - (add-after 'install 'delete-install-logs - (lambda* (#:key outputs #:allow-other-keys) - (define (delete-manifest-file out-path file) - (delete-file (string-append out-path "/lib/rustlib/" file))) - - (let ((out (assoc-ref outputs "out")) - (cargo-out (assoc-ref outputs "cargo"))) - (for-each - (lambda (file) (delete-manifest-file out file)) - '("install.log" - "manifest-rust-docs" - ,(string-append "manifest-rust-std-" - (nix-system->gnu-triplet-for-rust)) - "manifest-rustc")) - (for-each - (lambda (file) (delete-manifest-file cargo-out file)) - '("install.log" - "manifest-cargo")) - #t))) - (add-after 'install 'wrap-rustc - (lambda* (#:key inputs outputs #:allow-other-keys) - (let ((out (assoc-ref outputs "out")) - (libc (assoc-ref inputs "libc")) - (ld-wrapper (assoc-ref inputs "ld-wrapper"))) - ;; Let gcc find ld and libc startup files. - (wrap-program (string-append out "/bin/rustc") - `("PATH" ":" prefix (,(string-append ld-wrapper "/bin"))) - `("LIBRARY_PATH" ":" suffix (,(string-append libc "/lib")))) - #t)))))))))) - -(define-public rust-1.21 - (let ((base-rust (rust-bootstrapped-package rust-1.20 "1.21.0" - "1yj8lnxybjrybp00fqhxw8fpr641dh8wcn9mk44xjnsb4i1c21qp"))) - (package - (inherit base-rust) - (arguments - (substitute-keyword-arguments (package-arguments base-rust) - ((#:phases phases) - `(modify-phases ,phases - (add-after 'configure 'remove-ar - (lambda* (#:key inputs #:allow-other-keys) - ;; Remove because toml complains about "unknown field". - (substitute* "config.toml" - (("^ar =.*") "\n")) - #t))))))))) - -(define-public rust-1.22 - (let ((base-rust (rust-bootstrapped-package rust-1.21 "1.22.1" - "1lrzzp0nh7s61wgfs2h6ilaqi6iq89f1pd1yaf65l87bssyl4ylb"))) - (package - (inherit base-rust) - (arguments - (substitute-keyword-arguments (package-arguments base-rust) - ((#:phases phases) - `(modify-phases ,phases - (add-after 'unpack 'remove-flaky-test - (lambda _ - ;; See . - (when (file-exists? "src/test/run-make/issue-26092") - (delete-file-recursively "src/test/run-make/issue-26092")) - #t))))))))) - -(define-public rust-1.23 - (let ((base-rust (rust-bootstrapped-package rust-1.22 "1.23.0" - "14fb8vhjzsxlbi6yrn1r6fl5dlbdd1m92dn5zj5gmzfwf4w9ar3l"))) - (package - (inherit base-rust) - (arguments - (substitute-keyword-arguments (package-arguments base-rust) - ((#:phases phases) - `(modify-phases ,phases - (delete 'configure-archiver) - (delete 'remove-ar) - (add-after 'unpack 'dont-build-native - (lambda _ - ;; XXX: Revisit this when we use gcc 6. - (substitute* "src/binaryen/CMakeLists.txt" - (("ADD_COMPILE_FLAG\\(\\\"-march=native\\\"\\)") "")) - #t))))))))) - -(define-public rust-1.24 - (let ((base-rust - (rust-bootstrapped-package rust-1.23 "1.24.1" - "1vv10x2h9kq7fxh2v01damdq8pvlp5acyh1kzcda9sfjx12kv99y"))) - (package - (inherit base-rust) - (arguments - (substitute-keyword-arguments (package-arguments base-rust) - ((#:phases phases) - `(modify-phases ,phases - (delete 'use-readelf-for-tests) - (replace 'patch-aarch64-test - (lambda* _ - (substitute* "src/librustc_metadata/dynamic_lib.rs" - ;; This test is known to fail on aarch64 and powerpc64le: - ;; https://github.com/rust-lang/rust/issues/45410 - (("fn test_loading_cosine") "#[ignore]\nfn test_loading_cosine")) - #t))))))))) - -;;; Rust 1.25 release support work with llvm 6--but build with llvm 6 is -;;; not determenistic due to . -;;; Keep using llvm 3.9.1 until builds become determenistic -(define-public rust-1.25 - (let ((base-rust - (rust-bootstrapped-package rust-1.24 "1.25.0" - "0baxjr99311lvwdq0s38bipbnj72pn6fgbk6lcq7j555xq53mxpf"))) - (package - (inherit base-rust) - (source - (origin - (inherit (package-source base-rust)) - (snippet '(begin - (delete-file-recursively "src/jemalloc") - (delete-file-recursively "src/llvm") - (delete-file-recursively "src/llvm-emscripten") - #t)) - (patches (search-patches - "rust-1.25-accept-more-detailed-gdb-lines.patch")))) - (arguments - (substitute-keyword-arguments (package-arguments base-rust) - ((#:phases phases) - `(modify-phases ,phases - (add-after 'patch-cargo-tests 'patch-cargo-index-update - (lambda _ - (substitute* "src/tools/cargo/tests/generate-lockfile.rs" - ;; This test wants to update the crate index. - (("fn no_index_update") "#[ignore]\nfn no_index_update")) - #t)) - (replace 'patch-aarch64-test - (lambda _ - (substitute* "src/librustc_metadata/dynamic_lib.rs" - ;; This test is known to fail on aarch64 and powerpc64le: - ;; https://github.com/rust-lang/rust/issues/45410 - (("fn test_loading_cosine") "#[ignore]\nfn test_loading_cosine")) - ;; This test fails on aarch64 with llvm@6.0: - ;; https://github.com/rust-lang/rust/issues/49807 - ;; other possible solution: - ;; https://github.com/rust-lang/rust/pull/47688 - (delete-file "src/test/debuginfo/by-value-self-argument-in-trait-impl.rs") - #t)) - (delete 'ignore-glibc-2.27-incompatible-test)))))))) - -(define-public rust-1.26 - (let ((base-rust - (rust-bootstrapped-package rust-1.25 "1.26.2" - "0047ais0fvmqvngqkdsxgrzhb0kljg8wy85b01kbbjc88hqcz7pv"))) - (package - (inherit base-rust) - (source - (origin - (inherit (package-source base-rust)) - (patches (search-patches - "rust-coresimd-doctest.patch" - "rust-1.25-accept-more-detailed-gdb-lines.patch")))) - (inputs - (alist-replace "openssl" (list openssl) - (package-inputs base-rust))) - (arguments - (substitute-keyword-arguments (package-arguments base-rust) - ((#:phases phases) - `(modify-phases ,phases - ;; binaryen was replaced with LLD project from LLVM - (delete 'dont-build-native) - (replace 'check - (lambda* _ - ;; Enable parallel execution. - (let ((parallel-job-spec - (string-append "-j" (number->string - (min 4 - (parallel-job-count)))))) - (invoke "./x.py" parallel-job-spec "test" "-vv") - (invoke "./x.py" parallel-job-spec "test" - "src/tools/cargo")))) - (replace 'remove-unsupported-tests - (lambda* _ - ;; Our ld-wrapper cannot process non-UTF8 bytes in LIBRARY_PATH. - ;; - (delete-file-recursively "src/test/run-make-fulldeps/linker-output-non-utf8") - #t)) - (replace 'patch-cargo-tests - (lambda* _ - (substitute* "src/tools/cargo/tests/testsuite/build.rs" - (("/usr/bin/env") (which "env")) - ;; Guix llvm is compiled without asmjs-unknown-emscripten. - (("fn wasm32_final_outputs") "#[ignore]\nfn wasm32_final_outputs")) - (substitute* "src/tools/cargo/tests/testsuite/death.rs" - ;; This is stuck when built in container. - (("fn ctrl_c_kills_everyone") "#[ignore]\nfn ctrl_c_kills_everyone")) - ;; Prints test output in the wrong order when built on - ;; i686-linux. - (substitute* "src/tools/cargo/tests/testsuite/test.rs" - (("fn cargo_test_env") "#[ignore]\nfn cargo_test_env")) - - ;; Avoid dependency on "git". - (substitute* "src/tools/cargo/tests/testsuite/new.rs" - (("fn author_prefers_cargo") "#[ignore]\nfn author_prefers_cargo") - (("fn finds_author_git") "#[ignore]\nfn finds_author_git") - (("fn finds_local_author_git") "#[ignore]\nfn finds_local_author_git")) - #t)) - (add-after 'patch-cargo-tests 'disable-cargo-test-for-nightly-channel - (lambda* _ - ;; This test failed to work on "nightly" channel builds - ;; https://github.com/rust-lang/cargo/issues/5648 - (substitute* "src/tools/cargo/tests/testsuite/resolve.rs" - (("fn test_resolving_minimum_version_with_transitive_deps") - "#[ignore]\nfn test_resolving_minimum_version_with_transitive_deps")) - #t)) - (replace 'patch-cargo-index-update - (lambda* _ - (substitute* "src/tools/cargo/tests/testsuite/generate_lockfile.rs" - ;; This test wants to update the crate index. - (("fn no_index_update") "#[ignore]\nfn no_index_update")) - #t))))))))) - -(define-public rust-1.27 - (let ((base-rust - (rust-bootstrapped-package rust-1.26 "1.27.2" - "0pg1s37bhx9zqbynxyydq5j6q7kij9vxkcv8maz0m25prm88r0cs"))) - (package - (inherit base-rust) - (source - (origin - (inherit (package-source base-rust)) - (patches (search-patches "rust-coresimd-doctest.patch" - "rust-bootstrap-stage0-test.patch" - "rust-1.25-accept-more-detailed-gdb-lines.patch" - "rust-reproducible-builds.patch")))) - (arguments - (substitute-keyword-arguments (package-arguments base-rust) - ((#:phases phases) - `(modify-phases ,phases - (add-before 'install 'mkdir-prefix-paths - (lambda* (#:key outputs #:allow-other-keys) - ;; As result of https://github.com/rust-lang/rust/issues/36989 - ;; `prefix' directory should exist before `install' call - (mkdir-p (assoc-ref outputs "out")) - (mkdir-p (assoc-ref outputs "cargo")) - #t)) - (add-after 'patch-cargo-tests 'disable-thinlto-test - (lambda* _ - ;; thinlto required llvm 6.0 for work - (substitute* "src/tools/cargo/tests/testsuite/path.rs" - (("fn thin_lto_works") "#[ignore]\nfn thin_lto_works")) - #t))))))))) - -(define-public rust-1.28 - (let ((base-rust - (rust-bootstrapped-package rust-1.27 "1.28.0" - "11k4rn77bca2rikykkk9fmprrgjswd4x4kaq7fia08vgkir82nhx"))) - (package - (inherit base-rust) - (source - (origin - (inherit (package-source base-rust)) - (patches (search-patches "rust-coresimd-doctest.patch" - "rust-bootstrap-stage0-test.patch" - "rust-1.25-accept-more-detailed-gdb-lines.patch" - "rust-reproducible-builds.patch")))) - (inputs - ;; Use LLVM 6.0 - (alist-replace "llvm" (list llvm-6) - (package-inputs base-rust))) - (arguments - (substitute-keyword-arguments (package-arguments base-rust) - ((#:phases phases) - `(modify-phases ,phases - (add-after 'configure 'enable-codegen-tests - ;; Codegen tests should pass with llvm 6, so enable them. - (lambda* _ - (substitute* "config.toml" - (("codegen-tests = false") "")) - #t)) - (add-after 'patch-tests 'disable-amd64-avx-test - ;; That test would fail on x86_64 machines without avx. - (lambda* _ - (substitute* "src/test/run-pass/issue-44056.rs" - (("only-x86_64") "ignore-test")) - #t)) - ;; This is no longer needed as of 1.28 - (delete 'disable-cargo-test-for-nightly-channel) - ;; The thinlto test should pass with llvm 6. - (delete 'disable-thinlto-test)))))))) - -(define-public rust-1.29 - (let ((base-rust - (rust-bootstrapped-package rust-1.28 "1.29.2" - "1jb787080z754caa2w3w1amsygs4qlzj9rs1vy64firfmabfg22h"))) - (package - (inherit base-rust) - (source - (origin - (inherit (package-source base-rust)) - (patches (search-patches "rust-1.25-accept-more-detailed-gdb-lines.patch" - "rust-reproducible-builds.patch"))))))) - -(define-public rust-1.30 - (let ((base-rust - (rust-bootstrapped-package rust-1.29 "1.30.1" - "0aavdc1lqv0cjzbqwl5n59yd0bqdlhn0zas61ljf38yrvc18k8rn"))) - (package - (inherit base-rust) - (source - (origin - (inherit (package-source base-rust)) - (snippet '(begin - (delete-file-recursively "src/jemalloc") - (delete-file-recursively "src/llvm") - (delete-file-recursively "src/llvm-emscripten") - (delete-file-recursively "src/tools/clang") - (delete-file-recursively "src/tools/lldb") - #t)))) - (arguments - (substitute-keyword-arguments (package-arguments base-rust) - ((#:phases phases) - `(modify-phases ,phases - (add-after 'patch-cargo-tests 'patch-cargo-env-shebang - (lambda* (#:key inputs #:allow-other-keys) - (let ((coreutils (assoc-ref inputs "coreutils"))) - (substitute* "src/tools/cargo/tests/testsuite/fix.rs" - ;; Cargo has a test which explicitly sets a - ;; RUSTC_WRAPPER environment variable which points - ;; to /usr/bin/env. Since it's not a shebang, it - ;; needs to be manually patched - (("\"/usr/bin/env\"") - (string-append "\"" coreutils "/bin/env\""))) - #t))) - (add-after 'patch-cargo-env-shebang 'ignore-cargo-package-tests - (lambda* _ - (substitute* "src/tools/cargo/tests/testsuite/package.rs" - ;; These tests largely check that cargo outputs warning/error - ;; messages as expected. It seems that cargo outputs an - ;; absolute path to something in the store instead of the - ;; expected relative path (e.g. `[..]`) so we'll ignore - ;; these for now - (("fn include") "#[ignore]\nfn include") - (("fn exclude") "#[ignore]\nfn exclude")) - #t)) - ;; The test has been moved elsewhere. - (replace 'disable-amd64-avx-test - (lambda _ - (substitute* "src/test/ui/run-pass/issues/issue-44056.rs" - (("only-x86_64") "ignore-test")) - #t))))))))) - (define (patch-command-exec-tests-phase test-path) - "The command-exec.rs test moves around between releases. We need to apply +"The command-exec.rs test moves around between releases. We need to apply a Guix-specific patch to it for each release. This function generates the phase that applies said patch, parametrized by the test-path. This is done this way because the phase is more complex than the equivalents for other tests that move around." - `(lambda* (#:key inputs #:allow-other-keys) - (let ((coreutils (assoc-ref inputs "coreutils"))) - (substitute* ,test-path - ;; This test suite includes some tests that the stdlib's - ;; `Command` execution properly handles situations where - ;; the environment or PATH variable are empty, but this - ;; fails since we don't have `echo` available in the usual - ;; Linux directories. - ;; NB: the leading space is so we don't fail a tidy check - ;; for trailing whitespace, and the newlines are to ensure - ;; we don't exceed the 100 chars tidy check as well - ((" Command::new\\(\"echo\"\\)") - (string-append "\nCommand::new(\"" coreutils "/bin/echo\")\n"))) - #t))) +`(lambda* (#:key inputs #:allow-other-keys) + (let ((coreutils (assoc-ref inputs "coreutils"))) + (substitute* ,test-path + ;; This test suite includes some tests that the stdlib's + ;; `Command` execution properly handles situations where + ;; the environment or PATH variable are empty, but this + ;; fails since we don't have `echo` available in the usual + ;; Linux directories. + ;; NB: the leading space is so we don't fail a tidy check + ;; for trailing whitespace, and the newlines are to ensure + ;; we don't exceed the 100 chars tidy check as well + ((" Command::new\\(\"echo\"\\)") + (string-append "\nCommand::new(\"" coreutils "/bin/echo\")\n")))))) (define-public rust-1.31 - (let ((base-rust - (rust-bootstrapped-package rust-1.30 "1.31.1" - "0sk84ff0cklybcp0jbbxcw7lk7mrm6kb6km5nzd6m64dy0igrlli"))) + (let ((base-rust (rust-bootstrapped-package + rust-1.30 "1.31.1" + "0sk84ff0cklybcp0jbbxcw7lk7mrm6kb6km5nzd6m64dy0igrlli"))) (package (inherit base-rust) (arguments @@ -985,44 +148,43 @@ move around." `(modify-phases ,phases (add-after 'patch-tests 'patch-command-exec-tests ,(patch-command-exec-tests-phase - "src/test/run-pass/command-exec.rs")) + "src/test/run-pass/command-exec.rs")) ;; The test has been moved elsewhere. (replace 'disable-amd64-avx-test (lambda _ (substitute* "src/test/ui/issues/issue-44056.rs" - (("only-x86_64") "ignore-test")) - #t)) + (("only-x86_64") + "ignore-test")))) (add-after 'patch-tests 'patch-process-docs-rev-cmd (lambda* _ ;; Disable some doc tests which depend on the "rev" command ;; https://github.com/rust-lang/rust/pull/58746 (substitute* "src/libstd/process.rs" - (("```rust") "```rust,no_run")) - #t))))))))) + (("```rust") + "```rust,no_run"))))))))))) (define-public rust-1.32 - (let ((base-rust - (rust-bootstrapped-package rust-1.31 "1.32.0" - "0ji2l9xv53y27xy72qagggvq47gayr5lcv2jwvmfirx029vlqnac"))) + (let ((base-rust (rust-bootstrapped-package + rust-1.31 "1.32.0" + "0ji2l9xv53y27xy72qagggvq47gayr5lcv2jwvmfirx029vlqnac"))) (package (inherit base-rust) (source - (origin - (inherit (package-source base-rust)) - (snippet '(begin (delete-file-recursively "src/llvm") - (delete-file-recursively "src/llvm-emscripten") - (delete-file-recursively "src/tools/clang") - (delete-file-recursively "src/tools/lldb") - (delete-file-recursively "vendor/jemalloc-sys/jemalloc") - #t)) - (patches (search-patches "rust-reproducible-builds.patch")) - ;; the vendor directory has moved to the root of - ;; the tarball, so we have to strip an extra prefix - (patch-flags '("-p2")))) + (origin + (inherit (package-source base-rust)) + (snippet '(for-each delete-file-recursively + '("src/llvm" + "src/llvm-emscripten" + "src/tools/clang" + "src/tools/lldb" + "vendor/jemalloc-sys/jemalloc"))) + (patches (search-patches "rust-reproducible-builds.patch")) + ;; the vendor directory has moved to the root of + ;; the tarball, so we have to strip an extra prefix + (patch-flags '("-p2")))) (inputs ;; Downgrade to LLVM 6, all LTO tests appear to fail with LLVM 7.0.1 - (alist-replace "llvm" (list llvm-6) - (package-inputs base-rust))) + (alist-replace "llvm" (list llvm-6) (package-inputs base-rust))) (arguments (substitute-keyword-arguments (package-arguments base-rust) ((#:phases phases) @@ -1035,8 +197,7 @@ move around." (substitute* "Cargo.lock" (("(\"checksum .* = )\".*\"" all name) (string-append name "\"" ,%cargo-reference-hash "\""))) - (generate-all-checksums "vendor") - #t)) + (generate-all-checksums "vendor"))) (add-after 'enable-codegen-tests 'override-jemalloc (lambda* (#:key inputs #:allow-other-keys) ;; The compiler is no longer directly built against jemalloc, @@ -1047,28 +208,27 @@ move around." (substitute* "config.toml" (("^jemalloc =.*$") "") (("[[]rust[]]") "\n[rust]\njemalloc=true\n")) - (setenv "JEMALLOC_OVERRIDE" (string-append (assoc-ref inputs "jemalloc") - "/lib/libjemalloc_pic.a")) - #t)) + (setenv "JEMALLOC_OVERRIDE" (string-append + (assoc-ref inputs "jemalloc") + "/lib/libjemalloc_pic.a")))) ;; Remove no longer relevant steps (delete 'remove-flaky-test) (delete 'patch-aarch64-test)))))))) (define-public rust-1.33 - (let ((base-rust - (rust-bootstrapped-package rust-1.32 "1.33.0" - "152x91mg7bz4ygligwjb05fgm1blwy2i70s2j03zc9jiwvbsh0as"))) + (let ((base-rust (rust-bootstrapped-package + rust-1.32 "1.33.0" + "152x91mg7bz4ygligwjb05fgm1blwy2i70s2j03zc9jiwvbsh0as"))) (package (inherit base-rust) (source - (origin - (inherit (package-source base-rust)) - (patches '()) - (patch-flags '("-p1")))) + (origin + (inherit (package-source base-rust)) + (patches '()) + (patch-flags '("-p1")))) (inputs ;; Upgrade to jemalloc@5.1.0 - (alist-replace "jemalloc" (list jemalloc) - (package-inputs base-rust))) + (alist-replace "jemalloc" (list jemalloc) (package-inputs base-rust))) (arguments (substitute-keyword-arguments (package-arguments base-rust) ((#:phases phases) @@ -1080,33 +240,30 @@ move around." ;; https://github.com/rust-lang/cargo/issues/6746 ;; https://github.com/rust-lang/rust/issues/58907 (lambda* (#:key inputs #:allow-other-keys) - (setenv "RUST_TEST_THREADS" "2") - #t))))))))) + (setenv "RUST_TEST_THREADS" "2")))))))))) (define-public rust-1.34 - (let ((base-rust - (rust-bootstrapped-package rust-1.33 "1.34.1" - "19s09k7y5j6g3y4d2rk6kg9pvq6ml94c49w6b72dmq8p9lk8bixh"))) + (let ((base-rust (rust-bootstrapped-package + rust-1.33 "1.34.1" + "19s09k7y5j6g3y4d2rk6kg9pvq6ml94c49w6b72dmq8p9lk8bixh"))) (package (inherit base-rust) (source - (origin - (inherit (package-source base-rust)) - (snippet '(begin - (delete-file-recursively "src/llvm-emscripten") - (delete-file-recursively "src/llvm-project") - (delete-file-recursively "vendor/jemalloc-sys/jemalloc") - #t))))))) + (origin + (inherit (package-source base-rust)) + (snippet '(for-each delete-file-recursively + '("src/llvm-emscripten" + "src/llvm-project" + "vendor/jemalloc-sys/jemalloc")))))))) (define-public rust-1.35 - (let ((base-rust - (rust-bootstrapped-package rust-1.34 "1.35.0" - "0bbizy6b7002v1rdhrxrf5gijclbyizdhkglhp81ib3bf5x66kas"))) + (let ((base-rust (rust-bootstrapped-package + rust-1.34 "1.35.0" + "0bbizy6b7002v1rdhrxrf5gijclbyizdhkglhp81ib3bf5x66kas"))) (package (inherit base-rust) (inputs - (alist-replace "llvm" (list llvm-8) - (package-inputs base-rust))) + (alist-replace "llvm" (list llvm-8) (package-inputs base-rust))) (arguments (substitute-keyword-arguments (package-arguments base-rust) ((#:phases phases) @@ -1118,13 +275,13 @@ move around." (add-after 'configure 'disable-tidy-bins-check (lambda* _ (substitute* "src/tools/tidy/src/main.rs" - (("bins::check") "//bins::check")) - #t))))))))) + (("bins::check") + "//bins::check"))))))))))) (define-public rust-1.36 - (let ((base-rust - (rust-bootstrapped-package rust-1.35 "1.36.0" - "06xv2p6zq03lidr0yaf029ii8wnjjqa894nkmrm6s0rx47by9i04"))) + (let ((base-rust (rust-bootstrapped-package + rust-1.35 "1.36.0" + "06xv2p6zq03lidr0yaf029ii8wnjjqa894nkmrm6s0rx47by9i04"))) (package (inherit base-rust) (arguments @@ -1134,9 +291,9 @@ move around." (delete 'patch-process-docs-rev-cmd)))))))) (define-public rust-1.37 - (let ((base-rust - (rust-bootstrapped-package rust-1.36 "1.37.0" - "1hrqprybhkhs6d9b5pjskfnc5z9v2l2gync7nb39qjb5s0h703hj"))) + (let ((base-rust (rust-bootstrapped-package + rust-1.36 "1.37.0" + "1hrqprybhkhs6d9b5pjskfnc5z9v2l2gync7nb39qjb5s0h703hj"))) (package (inherit base-rust) (arguments @@ -1147,36 +304,35 @@ move around." (lambda _ (let ((cargo-home (string-append (getcwd) "/.cargo"))) (mkdir-p cargo-home) - (setenv "CARGO_HOME" cargo-home) - #t)))))))))) + (setenv "CARGO_HOME" cargo-home))))))))))) (define-public rust-1.38 - (let ((base-rust - (rust-bootstrapped-package rust-1.37 "1.38.0" - "101dlpsfkq67p0hbwx4acqq6n90dj4bbprndizpgh1kigk566hk4"))) + (let ((base-rust (rust-bootstrapped-package + rust-1.37 "1.38.0" + "101dlpsfkq67p0hbwx4acqq6n90dj4bbprndizpgh1kigk566hk4"))) (package (inherit base-rust) (inputs - (alist-replace "llvm" (list llvm-9) - (package-inputs base-rust))) + (alist-replace "llvm" (list llvm-9) (package-inputs base-rust))) (arguments (substitute-keyword-arguments (package-arguments base-rust) ((#:phases phases) `(modify-phases ,phases (replace 'patch-command-exec-tests ,(patch-command-exec-tests-phase - "src/test/ui/command-exec.rs")) + "src/test/ui/command-exec.rs")) (add-after 'patch-tests 'patch-command-uid-gid-test (lambda _ (substitute* "src/test/ui/command-uid-gid.rs" - (("/bin/sh") (which "sh")) - (("ignore-sgx") "ignore-sgx\n// ignore-tidy-linelength")) - #t))))))))) + (("/bin/sh") + (which "sh")) + (("ignore-sgx") + "ignore-sgx\n// ignore-tidy-linelength"))))))))))) (define-public rust-1.39 - (let ((base-rust - (rust-bootstrapped-package rust-1.38 "1.39.0" - "0mwkc1bnil2cfyf6nglpvbn2y0zfbv44zfhsd5qg4c9rm6vgd8dl"))) + (let ((base-rust (rust-bootstrapped-package + rust-1.38 "1.39.0" + "0mwkc1bnil2cfyf6nglpvbn2y0zfbv44zfhsd5qg4c9rm6vgd8dl"))) (package (inherit base-rust) (arguments @@ -1190,24 +346,22 @@ move around." (substitute* "Cargo.lock" (("(checksum = )\".*\"" all name) (string-append name "\"" ,%cargo-reference-hash "\""))) - (generate-all-checksums "vendor") - #t))))))))) + (generate-all-checksums "vendor")))))))))) (define-public rust-1.40 - (let ((base-rust - (rust-bootstrapped-package rust-1.39 "1.40.0" - "1ba9llwhqm49w7sz3z0gqscj039m53ky9wxzhaj11z6yg1ah15yx"))) + (let ((base-rust (rust-bootstrapped-package + rust-1.39 "1.40.0" + "1ba9llwhqm49w7sz3z0gqscj039m53ky9wxzhaj11z6yg1ah15yx"))) (package (inherit base-rust) (source - (origin - (inherit (package-source base-rust)) - ;; llvm-emscripten is no longer bundled, as that codegen backend - ;; got removed. - (snippet '(begin - (delete-file-recursively "src/llvm-project") - (delete-file-recursively "vendor/jemalloc-sys/jemalloc") - #t)))) + (origin + (inherit (package-source base-rust)) + ;; llvm-emscripten is no longer bundled, as that codegen backend + ;; got removed. + (snippet '(for-each delete-file-recursively + '("src/llvm-project" + "vendor/jemalloc-sys/jemalloc"))))) (arguments ;; Rust 1.40 does not ship rustc-internal libraries by default ;; (see rustc-dev-split). This means that librustc_driver.so is no @@ -1220,106 +374,103 @@ move around." ;; Rust 1.41 stopped putting the codegen backend in a separate library, ;; which makes this workaround only necessary for this release. (cons* #:validate-runpath? #f - (substitute-keyword-arguments (package-arguments base-rust) - ((#:phases phases) - `(modify-phases ,phases - ;; We often need to patch tests with various Guix-specific paths. - ;; This often increases the line length and makes tidy, rustc's - ;; style checker, complain. We could insert additional newlines - ;; or add an "// ignore-tidy-linelength" comment, but as an - ;; ignore comment must be used, both approaches are fragile due - ;; to upstream formatting changes. As such, disable running the - ;; linter during tests, since it's intended for rustc developers - ;; anyway. - ;; - ;; TODO(rebuild-rust): This phase could be added earlier to - ;; simplify a significant amount of code, but it would require - ;; rebuilding the entire rusty universe. - (add-after 'patch-tests 'neuter-tidy - (lambda _ - (substitute* "src/bootstrap/builder.rs" - (("^.*::Tidy,") "")) - #t)) - ;; TODO(rebuild-rust): Adapt the find-files approach for - ;; earlier testsuite patches. - (replace 'patch-command-uid-gid-test - (lambda _ - (match (find-files "src/test" "command-uid-gid\\.rs") - ((file) - (substitute* file - (("/bin/sh") (which "sh"))))) - #t)) - (replace 'patch-command-exec-tests - ,(patch-command-exec-tests-phase - '(match (find-files "src/test" "command-exec\\.rs") - ((file) file)))) - ;; The test got removed in commit 000fe63b6fc57b09828930cacbab20c2ee6e6d15 - ;; "Remove painful test that is not pulling its weight" - (delete 'remove-unsupported-tests))))))))) + (substitute-keyword-arguments (package-arguments base-rust) + ((#:phases phases) + `(modify-phases ,phases + ;; We often need to patch tests with various Guix-specific paths. + ;; This often increases the line length and makes tidy, rustc's + ;; style checker, complain. We could insert additional newlines + ;; or add an "// ignore-tidy-linelength" comment, but as an + ;; ignore comment must be used, both approaches are fragile due + ;; to upstream formatting changes. As such, disable running the + ;; linter during tests, since it's intended for rustc developers + ;; anyway. + ;; + ;; TODO(rebuild-rust): This phase could be added earlier to + ;; simplify a significant amount of code, but it would require + ;; rebuilding the entire rusty universe. + (add-after 'patch-tests 'neuter-tidy + (lambda _ + (substitute* "src/bootstrap/builder.rs" + (("^.*::Tidy,") + "")))) + ;; TODO(rebuild-rust): Adapt the find-files approach for + ;; earlier testsuite patches. + (replace 'patch-command-uid-gid-test + (lambda _ + (match (find-files "src/test" "command-uid-gid\\.rs") + ((file) + (substitute* file + (("/bin/sh") + (which "sh"))))))) + (replace 'patch-command-exec-tests + ,(patch-command-exec-tests-phase + '(match (find-files "src/test" "command-exec\\.rs") + ((file) file)))) + ;; The test got removed in commit 000fe63b6fc57b09828930cacbab20c2ee6e6d15 + ;; "Remove painful test that is not pulling its weight" + (delete 'remove-unsupported-tests))))))))) (define-public rust-1.41 - (let ((base-rust - (rust-bootstrapped-package rust-1.40 "1.41.1" - "0ws5x0fxv57fyllsa6025h3q6j9v3m8nb3syl4x0hgkddq0kvj9q"))) + (let ((base-rust (rust-bootstrapped-package + rust-1.40 "1.41.1" + "0ws5x0fxv57fyllsa6025h3q6j9v3m8nb3syl4x0hgkddq0kvj9q"))) (package (inherit base-rust) (arguments (substitute-keyword-arguments (package-arguments base-rust) - ((#:validate-runpath? _) #t)))))) + ((#:validate-runpath? _ #f) #t)))))) (define-public rust-1.42 - (rust-bootstrapped-package rust-1.41 "1.42.0" - "0x9lxs82may6c0iln0b908cxyn1cv7h03n5cmbx3j1bas4qzks6j")) + (rust-bootstrapped-package + rust-1.41 "1.42.0" "0x9lxs82may6c0iln0b908cxyn1cv7h03n5cmbx3j1bas4qzks6j")) (define-public rust-1.43 - (rust-bootstrapped-package rust-1.42 "1.43.0" - "18akhk0wz1my6y9vhardriy2ysc482z0fnjdcgs9gy59kmnarxkm")) + (rust-bootstrapped-package + rust-1.42 "1.43.0" "18akhk0wz1my6y9vhardriy2ysc482z0fnjdcgs9gy59kmnarxkm")) (define-public rust-1.44 - (rust-bootstrapped-package rust-1.43 "1.44.1" - "0ww4z2v3gxgn3zddqzwqya1gln04p91ykbrflnpdbmcd575n8bky")) + (rust-bootstrapped-package + rust-1.43 "1.44.1" "0ww4z2v3gxgn3zddqzwqya1gln04p91ykbrflnpdbmcd575n8bky")) (define-public rust-1.45 - (let ((base-rust - (rust-bootstrapped-package rust-1.44 "1.45.2" - "0273a1g3f59plyi1n0azf21qjzwml1yqdnj5z472crz37qggr8xp"))) + (let ((base-rust (rust-bootstrapped-package + rust-1.44 "1.45.2" + "0273a1g3f59plyi1n0azf21qjzwml1yqdnj5z472crz37qggr8xp"))) (package (inherit base-rust) (source - (origin - (inherit (package-source base-rust)) - (patches (search-patches "rust-1.45-linker-locale.patch")))) + (origin + (inherit (package-source base-rust)) + (patches (search-patches "rust-1.45-linker-locale.patch")))) (inputs - (alist-replace "llvm" (list llvm-10) - (package-inputs base-rust))) + (alist-replace "llvm" (list llvm-10) (package-inputs base-rust))) (arguments - (substitute-keyword-arguments (package-arguments base-rust) - ((#:phases phases) - `(modify-phases ,phases - ;; These tests make sure that the parser behaves properly when - ;; a source file starts with a shebang. Unfortunately, - ;; the patch-shebangs phase changes the meaning of these edge-cases. - ;; We skip the test since it's drastically unlikely Guix's packaging - ;; will introduce a bug here. - (add-after 'patch-tests 'skip-shebang-tests - (lambda _ - (with-directory-excursion "src/test/ui/parser/shebang" - (delete-file "shebang-doc-comment.rs") - (delete-file "sneaky-attrib.rs") - #t))) - ;; This test case synchronizes itself by starting a localhost TCP - ;; server. This doesn't work as networking is not available. - (add-after 'patch-tests 'skip-networking-test - (lambda _ - (substitute* "src/tools/cargo/tests/testsuite/freshness.rs" - (("fn linking_interrupted" all) - (string-append "#[ignore] " all))) - #t))))))))) + (substitute-keyword-arguments (package-arguments base-rust) + ((#:phases phases) + `(modify-phases ,phases + ;; These tests make sure that the parser behaves properly when + ;; a source file starts with a shebang. Unfortunately, + ;; the patch-shebangs phase changes the meaning of these edge-cases. + ;; We skip the test since it's drastically unlikely Guix's packaging + ;; will introduce a bug here. + (add-after 'patch-tests 'skip-shebang-tests + (lambda _ + (with-directory-excursion "src/test/ui/parser/shebang" + (delete-file "shebang-doc-comment.rs") + (delete-file "sneaky-attrib.rs")))) + ;; This test case synchronizes itself by starting a localhost TCP + ;; server. This doesn't work as networking is not available. + (add-after 'patch-tests 'skip-networking-test + (lambda _ + (substitute* "src/tools/cargo/tests/testsuite/freshness.rs" + (("fn linking_interrupted" all) + (string-append "#[ignore] " all)))))))))))) (define-public rust-1.46 - (let ((base-rust - (rust-bootstrapped-package rust-1.45 "1.46.0" - "0a17jby2pd050s24cy4dfc0gzvgcl585v3vvyfilniyvjrqknsid"))) + (let ((base-rust (rust-bootstrapped-package + rust-1.45 "1.46.0" + "0a17jby2pd050s24cy4dfc0gzvgcl585v3vvyfilniyvjrqknsid"))) (package (inherit base-rust) (outputs (cons "rustfmt" (package-outputs base-rust))) @@ -1328,34 +479,34 @@ move around." ((#:phases phases) `(modify-phases ,phases (replace 'build + ;; Phase overridden to also build rustfmt. (lambda* _ (invoke "./x.py" "build") (invoke "./x.py" "build" "src/tools/cargo") (invoke "./x.py" "build" "src/tools/rustfmt"))) (replace 'check + ;; Phase overridden to also test rustfmt. (lambda* _ - ;; Test rustfmt. - (let ((parallel-job-spec - (string-append "-j" (number->string - (min 4 - (parallel-job-count)))))) - (invoke "./x.py" parallel-job-spec "test" "-vv") - (invoke "./x.py" parallel-job-spec "test" - "src/tools/cargo") - (invoke "./x.py" parallel-job-spec "test" - "src/tools/rustfmt")))) + (let ((job-spec (string-append + "-j" (if parallel-build? + (number->string (parallel-job-count)) + "1")))) + (invoke "./x.py" job-spec "test" "-vv") + (invoke "./x.py" job-spec "test" "src/tools/cargo") + (invoke "./x.py" job-spec "test" "src/tools/rustfmt")))) (replace 'install + ;; Phase overridden to also install rustfmt. (lambda* (#:key outputs #:allow-other-keys) (invoke "./x.py" "install") (substitute* "config.toml" - ;; replace prefix to specific output + ;; Adjust the prefix to the 'cargo' output. (("prefix = \"[^\"]*\"") - (string-append "prefix = \"" (assoc-ref outputs "cargo") "\""))) + (format #f "prefix = ~s" (assoc-ref outputs "cargo")))) (invoke "./x.py" "install" "cargo") (substitute* "config.toml" - ;; replace prefix to specific output + ;; Adjust the prefix to the 'rustfmt' output. (("prefix = \"[^\"]*\"") - (string-append "prefix = \"" (assoc-ref outputs "rustfmt") "\""))) + (format #f "prefix = ~s" (assoc-ref outputs "rustfmt")))) (invoke "./x.py" "install" "rustfmt"))) (replace 'delete-install-logs (lambda* (#:key outputs #:allow-other-keys) @@ -1366,31 +517,29 @@ move around." (cargo-out (assoc-ref outputs "cargo")) (rustfmt-out (assoc-ref outputs "rustfmt"))) (for-each - (lambda (file) (delete-manifest-file out file)) - '("install.log" - "manifest-rust-docs" - ,(string-append "manifest-rust-std-" - (nix-system->gnu-triplet-for-rust)) - "manifest-rustc")) + (lambda (file) (delete-manifest-file out file)) + '("install.log" + "manifest-rust-docs" + ,(string-append "manifest-rust-std-" + (nix-system->gnu-triplet-for-rust)) + "manifest-rustc")) (for-each - (lambda (file) (delete-manifest-file cargo-out file)) - '("install.log" - "manifest-cargo")) + (lambda (file) (delete-manifest-file cargo-out file)) + '("install.log" + "manifest-cargo")) (for-each - (lambda (file) (delete-manifest-file rustfmt-out file)) - '("install.log" - "manifest-rustfmt-preview")) - #t)))))))))) + (lambda (file) (delete-manifest-file rustfmt-out file)) + '("install.log" + "manifest-rustfmt-preview")))))))))))) (define-public rust-1.47 - (let ((base-rust - (rust-bootstrapped-package rust-1.46 "1.47.0" - "07fqd2vp7cf1ka3hr207dnnz93ymxml4935vp74g4is79h3dz19i"))) + (let ((base-rust (rust-bootstrapped-package + rust-1.46 "1.47.0" + "07fqd2vp7cf1ka3hr207dnnz93ymxml4935vp74g4is79h3dz19i"))) (package (inherit base-rust) (inputs - (alist-replace "llvm" (list llvm-11) - (package-inputs base-rust))) + (alist-replace "llvm" (list llvm-11) (package-inputs base-rust))) (arguments (substitute-keyword-arguments (package-arguments base-rust) ((#:phases phases) @@ -1405,8 +554,7 @@ move around." (substitute* "library/std/src/sys/unix/process/process_common.rs" (("fn test_process_mask") "#[allow(unused_attributes)] #[ignore] - fn test_process_mask")) - #t))) + fn test_process_mask"))))) (delete 'patch-cargo-checksums) (add-after 'patch-generated-file-shebangs 'patch-cargo-checksums ;; Generate checksums after patching generated files (in @@ -1416,21 +564,20 @@ move around." (substitute* "Cargo.lock" (("(checksum = )\".*\"" all name) (string-append name "\"" ,%cargo-reference-hash "\""))) - (generate-all-checksums "vendor") - #t))))))))) + (generate-all-checksums "vendor")))))))))) (define-public rust-1.48 - (let ((base-rust - (rust-bootstrapped-package rust-1.47 "1.48.0" - "0fz4gbb5hp5qalrl9lcl8yw4kk7ai7wx511jb28nypbxninkwxhf"))) + (let ((base-rust (rust-bootstrapped-package + rust-1.47 "1.48.0" + "0fz4gbb5hp5qalrl9lcl8yw4kk7ai7wx511jb28nypbxninkwxhf"))) (package (inherit base-rust) (source - (origin - (inherit (package-source base-rust)) - ;; New patch required due to the second part of the source code rearrangement: - ;; the relevant source code is now in the compiler directory. - (patches (search-patches "rust-1.48-linker-locale.patch")))) + (origin + (inherit (package-source base-rust)) + ;; New patch required due to the second part of the source code rearrangement: + ;; the relevant source code is now in the compiler directory. + (patches (search-patches "rust-1.48-linker-locale.patch")))) (arguments (substitute-keyword-arguments (package-arguments base-rust) ((#:phases phases) @@ -1440,16 +587,16 @@ move around." (lambda* (#:key inputs #:allow-other-keys) (let ((bash (assoc-ref inputs "bash"))) (substitute* "library/std/src/process/tests.rs" - (("\"/bin/sh\"") (string-append "\"" bash "/bin/sh\""))) + (("\"/bin/sh\"") + (string-append "\"" bash "/bin/sh\""))) (substitute* "library/std/src/sys/unix/process/process_common/tests.rs" - (("fn test_process_mask") "#[allow(unused_attributes)] + (("fn test_process_mask") + "#[allow(unused_attributes)] #[ignore] - fn test_process_mask")) - #t)))))))))) + fn test_process_mask")))))))))))) (define-public rust-1.49 - (rust-bootstrapped-package rust-1.48 "1.49.0" - "0yf7kll517398dgqsr7m3gldzj0iwsp3ggzxrayckpqzvylfy2mm")) + (rust-bootstrapped-package + rust-1.48 "1.49.0" "0yf7kll517398dgqsr7m3gldzj0iwsp3ggzxrayckpqzvylfy2mm")) -;; TODO(staging): Bump this variable to the latest packaged rust. -(define-public rust rust-1.45) +(define-public rust rust-1.49) -- cgit v1.2.3 From df93fc21a48047988b032ead90b0869491c834c8 Mon Sep 17 00:00:00 2001 From: Danny Milosavljevic Date: Tue, 18 Aug 2020 14:59:03 -0400 Subject: gnu: rust: Bootstrap rust@1.29.2 by mrustc@0.9. This reduced bootstrap reduces the complete Rust bootstrap chain build time by approximately 30% compared to the original (about 11 hours instead of 16 hours, on a fast machine). * gnu/packages/patches/rust-1.45-linker-locale.patch: Delete file. * gnu/packages/patches/rust-1.48-linker-locale.patch: Likewise. * gnu/local.mk (dist_patch_DATA): De-register deleted files. * gnu/packages/rust.scm (%mrustc-source): New variable. (rust-1.29): New variable. It is bootstrapped from mrust 0.9, which is used in source form. (rust-1.30): New variable. (rust-1.31)[phases]{patch-command-exec-tests-phase}: Rewrite so that it doesn't need to be redefined later when the file is moved. {enable-docs}: New phase. (rust-1.32): Disable tests. [inputs]: Remove field. [phases]{override-jemalloc}: Reorder after the configure phase. (rust-1.33): Enable tests. [phases]{disable-codegen-tests}: New phase. (rust-1.34)[phases]{disable-codegen-tests}: Delete phase. (rust-1.35)[arguments]: Remove field. The disable-tidy-bins-check phase is now defined in rust-1.30. (rust-1.38)[phases]{patch-command-exec-tests-phase}: Remove. {patch-command-uid-gid-test}: Do not worry about the Tidy lint test, which is disabled. (rust-1.40)[phases]: Move #:validate-runpath? inside the use of 'substitute-keyword-arguments'. {neuter-tidy}: Delete. {patch-command-uid-gid-test}: Make the regexp more precise. Remove the TODO comment, which has been addressed. (rust-1.44)[inputs]: Replace python2 by python-wrapper. [phases]{use-python3}: New phase. (rust-1.45)[source]: Remove field. The linker locale fix is now made via ... [phases]{set-linker-locale-to-utf8}: ... this phase. (rust-1.46)[phases]{build, check}: Allow parallel execution. Add comments. {delete-install-logs}: Delete phase; it's now done in rust-1.30. (rust-1.47)[phases]{patch-cargo-checksums}: Do not reorder phase. The initial ordering of the phase has been fixed with in the rust-1.30 package. (rust-1.48)[source]: Remove field. --- gnu/local.mk | 2 - gnu/packages/patches/rust-1.45-linker-locale.patch | 14 - gnu/packages/patches/rust-1.48-linker-locale.patch | 14 - gnu/packages/rust.scm | 747 ++++++++++++++++----- 4 files changed, 594 insertions(+), 183 deletions(-) delete mode 100644 gnu/packages/patches/rust-1.45-linker-locale.patch delete mode 100644 gnu/packages/patches/rust-1.48-linker-locale.patch (limited to 'gnu/packages/rust.scm') diff --git a/gnu/local.mk b/gnu/local.mk index 1fc4f4245b..f908f51074 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1600,8 +1600,6 @@ dist_patch_DATA = \ %D%/packages/patches/ruby-tzinfo-data-ignore-broken-test.patch\ %D%/packages/patches/runc-CVE-2019-5736.patch \ %D%/packages/patches/rust-1.25-accept-more-detailed-gdb-lines.patch \ - %D%/packages/patches/rust-1.45-linker-locale.patch \ - %D%/packages/patches/rust-1.48-linker-locale.patch \ %D%/packages/patches/rust-coresimd-doctest.patch \ %D%/packages/patches/rust-ndarray-remove-blas-src-dep.patch \ %D%/packages/patches/rust-nettle-disable-vendor.patch \ diff --git a/gnu/packages/patches/rust-1.45-linker-locale.patch b/gnu/packages/patches/rust-1.45-linker-locale.patch deleted file mode 100644 index 40220e8e77..0000000000 --- a/gnu/packages/patches/rust-1.45-linker-locale.patch +++ /dev/null @@ -1,14 +0,0 @@ -Patch will be included upstream in 1.47: https://github.com/rust-lang/rust/pull/74416 -diff --git a/src/librustc_codegen_ssa/back/linker.rs b/src/librustc_codegen_ssa/back/linker.rs -index e64aafa599f..12575ac4358 100644 ---- a/src/librustc_codegen_ssa/back/linker.rs -+++ b/src/librustc_codegen_ssa/back/linker.rs -@@ -28,7 +28,7 @@ use rustc_target::spec::{LinkOutputKind, LinkerFlavor, LldFlavor}; - pub fn disable_localization(linker: &mut Command) { - // No harm in setting both env vars simultaneously. - // Unix-style linkers. -- linker.env("LC_ALL", "C"); -+ linker.env("LC_ALL", "en_US.UTF-8"); - // MSVC's `link.exe`. - linker.env("VSLANG", "1033"); - } diff --git a/gnu/packages/patches/rust-1.48-linker-locale.patch b/gnu/packages/patches/rust-1.48-linker-locale.patch deleted file mode 100644 index d06dcbe682..0000000000 --- a/gnu/packages/patches/rust-1.48-linker-locale.patch +++ /dev/null @@ -1,14 +0,0 @@ -https://github.com/rust-lang/rust/pull/74416 -diff --git a/compiler/rustc_codegen_ssa/src/back/linker.rs b/compiler/rustc_codegen_ssa/src/back/linker.rs -index 3df956c465e..f45fee45be4 100644 ---- a/compiler/rustc_codegen_ssa/src/back/linker.rs -+++ b/compiler/rustc_codegen_ssa/src/back/linker.rs -@@ -28,7 +28,7 @@ - pub fn disable_localization(linker: &mut Command) { - // No harm in setting both env vars simultaneously. - // Unix-style linkers. -- linker.env("LC_ALL", "C"); -+ linker.env("LC_ALL", "en_US.UTF-8"); - // MSVC's `link.exe`. - linker.env("VSLANG", "1033"); - } diff --git a/gnu/packages/rust.scm b/gnu/packages/rust.scm index 66c1522735..d98bd876ce 100644 --- a/gnu/packages/rust.scm +++ b/gnu/packages/rust.scm @@ -11,6 +11,7 @@ ;;; Copyright © 2020, 2021 Jakub Kądziołka ;;; Copyright © 2020 Pierre Langlois ;;; Copyright © 2020 Matthew Kraai +;;; Copyright © 2021 Maxim Cournoyer ;;; ;;; This file is part of GNU Guix. ;;; @@ -116,25 +117,495 @@ (alist-replace "rustc-bootstrap" (list base-rust) (package-native-inputs base-rust)))))) -(define (patch-command-exec-tests-phase test-path) -"The command-exec.rs test moves around between releases. We need to apply -a Guix-specific patch to it for each release. This function generates the phase -that applies said patch, parametrized by the test-path. This is done this way -because the phase is more complex than the equivalents for other tests that -move around." -`(lambda* (#:key inputs #:allow-other-keys) - (let ((coreutils (assoc-ref inputs "coreutils"))) - (substitute* ,test-path - ;; This test suite includes some tests that the stdlib's - ;; `Command` execution properly handles situations where - ;; the environment or PATH variable are empty, but this - ;; fails since we don't have `echo` available in the usual - ;; Linux directories. - ;; NB: the leading space is so we don't fail a tidy check - ;; for trailing whitespace, and the newlines are to ensure - ;; we don't exceed the 100 chars tidy check as well - ((" Command::new\\(\"echo\"\\)") - (string-append "\nCommand::new(\"" coreutils "/bin/echo\")\n")))))) +;;; Note: mrustc's only purpose is to be able to bootstap Rust; it's designed +;;; to be used in source form. +(define %mrustc-source + (let ((name "mrustc") + (version "0.9")) + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/thepowersgang/mrustc") + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "194ny7vsks5ygiw7d8yxjmp1qwigd71ilchis6xjl6bb2sj97rd2"))))) + +;;; Rust 1.29 is special in that it is built with mrustc, which shortens the +;;; bootstrap path. Note: the build is non-deterministic. +(define-public rust-1.29 + (package + (name "rust") + (version "1.29.2") + (source + (origin + (method url-fetch) + (uri (rust-uri version)) + (sha256 (base32 "1jb787080z754caa2w3w1amsygs4qlzj9rs1vy64firfmabfg22h")) + (modules '((guix build utils))) + (snippet '(for-each delete-file-recursively + '("src/jemalloc" + "src/llvm" + "src/llvm-emscripten"))) + (patches (search-patches + "rust-1.25-accept-more-detailed-gdb-lines.patch" + "rust-reproducible-builds.patch")))) + (outputs '("out" "cargo")) + (properties '((timeout . 72000) ;20 hours + (max-silent-time . 18000))) ;5 hours (for armel) + (build-system gnu-build-system) + (inputs + `(("libcurl" ,curl) + ("libssh2" ,libssh2) + ;; Use llvm-7, which enables rust to be built reproducibly. + ("llvm" ,llvm-7) + ("openssl" ,openssl) + ("zlib" ,zlib))) + (native-inputs + `(("bison" ,bison) + ("flex" ,flex) + ("pkg-config" ,pkg-config) + ;; Required for the libstd sources. + ("mrustc-source" ,%mrustc-source))) + (arguments + `(#:imported-modules ,%cargo-utils-modules ;for `generate-all-checksums' + #:modules ((guix build cargo-utils) + (guix build utils) + (guix build gnu-build-system)) + #:test-target "test" + ;; Rust's own .so library files are not found in any RUNPATH, but + ;; that doesn't seem to cause issues. + #:validate-runpath? #f + #:make-flags + (list ,(string-append "RUSTC_TARGET=" + (or (%current-target-system) + (nix-system->gnu-triplet-for-rust))) + ,(string-append "RUSTCSRC=../")) + #:phases + (modify-phases %standard-phases + (add-after 'unpack 'patch-reference-to-cc + ;; This prevents errors like 'error: linker `cc` not found' when + ;; "cc" is not found on PATH. + (lambda* (#:key inputs #:allow-other-keys) + (let ((gcc (assoc-ref inputs "gcc"))) + (substitute* (find-files "." "^link.rs$") + (("\"cc\".as_ref") + (format #f "~s.as_ref" (string-append gcc "/bin/gcc"))))))) + (add-after 'unpack 'copy-mrustc-and-patch + (lambda* (#:key inputs #:allow-other-keys) + (copy-recursively (assoc-ref inputs "mrustc-source") "mrustc") + (invoke "patch" "-p0" "-i" "mrustc/rustc-1.29.0-src.patch"))) + (add-after 'copy-mrustc-and-patch 'patch-makefiles + ;; This disables building the (unbundled) LLVM. + (lambda* (#:key inputs parallel-build? #:allow-other-keys) + (let ((llvm (assoc-ref inputs "llvm")) + (job-spec (format #f "-j~a" + (if parallel-build? + (number->string (parallel-job-count)) + "1")))) + (with-directory-excursion "mrustc" + (substitute* '("minicargo.mk" + "run_rustc/Makefile") + ;; Use the system-provided LLVM. + (("LLVM_CONFIG := .*") + (string-append "LLVM_CONFIG := " llvm "/bin/llvm-config\n")) + (("\\$\\(LLVM_CONFIG\\): .*") + "$(LLVM_CONFIG):\n") + (("\\$Vcd \\$\\(RUSTCSRC\\)build && \\$\\(MAKE\\).*") + "true\n")) + ;; Patch date. + (substitute* "Makefile" + (("shell date") + "shell date -d @1")) + (substitute* "run_rustc/Makefile" + (("[$]Vtime ") + "$V ") + ;; Unlock the number of parallel jobs for cargo. + (("-j [[:digit:]]+ ") + "") + ;; Patch the shebang of a generated wrapper for rustc, and + ;; make sure that \n newline escapes get interpreted + ;; correctly, specifying the '-e' option of echo. + (("echo '#!/bin/sh") + (string-append "echo -e '#!" (which "sh")))))))) + (add-after 'patch-source-shebangs 'patch-cargo-checksums + (lambda* _ + (substitute* "src/Cargo.lock" + (("(\"checksum .* = )\".*\"" all name) + (string-append name "\"" ,%cargo-reference-hash "\""))) + (generate-all-checksums "src/vendor"))) + (replace 'configure + (lambda _ + (setenv "CC" "gcc") + (setenv "CXX" "g++") + ;; The Guix LLVM package installs only shared libraries. + (setenv "LLVM_LINK_SHARED" "1") + ;; This is a workaround for + ;; https://github.com/thepowersgang/mrustc/issues/138. + (setenv "LIBSSH2_SYS_USE_PKG_CONFIG" "yes"))) + (delete 'patch-generated-file-shebangs) + (replace 'build + (lambda* (#:key make-flags parallel-build? #:allow-other-keys) + (let* ((job-count (if parallel-build? + (parallel-job-count) + 1)) + (job-spec (string-append "-j" (number->string job-count))) + (make-flags* (cons job-spec make-flags))) + ;; Adapted from: + ;; https://github.com/dtolnay/bootstrap/blob/master/build.sh. + (chdir "mrustc") + (setenv "MINICARGO_FLAGS" job-spec) + (setenv "CARGO_BUILD_JOBS" (number->string job-count)) + (display "Building rustc...\n") + (apply invoke "make" "-f" "minicargo.mk" "output/rustc" + make-flags*) + (display "Building cargo...\n") + (apply invoke "make" "-f" "minicargo.mk" "output/cargo" + make-flags*) + (display "Rebuilding stdlib with rustc...\n") + (with-directory-excursion "run_rustc" + (apply invoke "make" "RUST_SRC=../../src/" make-flags*))))) + (replace 'install + (lambda* (#:key inputs outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (cargo (assoc-ref outputs "cargo")) + (bin (string-append out "/bin")) + (rustc (string-append bin "/rustc")) + (cargo-bin (string-append cargo "/bin")) + (lib (string-append out "/lib")) + (gnu-triplet ,(or (%current-target-system) + (nix-system->gnu-triplet-for-rust))) + (system-lib-prefix (string-append lib "/rustlib/" + gnu-triplet "/lib"))) + (mkdir-p (dirname rustc)) + (copy-file "run_rustc/output/prefix/bin/rustc_binary" rustc) + (wrap-program rustc + `("LD_LIBRARY_PATH" = (,system-lib-prefix))) + (mkdir-p lib) + (copy-recursively "run_rustc/output/prefix/lib" lib) + (install-file "run_rustc/output/prefix/bin/cargo" cargo-bin))))))) + (synopsis "Compiler for the Rust programming language") + (description "Rust is a systems programming language that provides memory +safety and thread safety guarantees.") + (home-page "https://github.com/thepowersgang/mrustc") + ;; Dual licensed. + (license (list license:asl2.0 license:expat)))) + +(define-public rust-1.30 + (package + (name "rust") + (version "1.30.1") + (source (origin + (inherit (package-source rust-1.29)) + (uri (rust-uri version)) + (sha256 + (base32 "0aavdc1lqv0cjzbqwl5n59yd0bqdlhn0zas61ljf38yrvc18k8rn")) + (snippet '(for-each delete-file-recursively + '("src/jemalloc" + "src/llvm" + "src/llvm-emscripten" + "src/tools/clang" + "src/tools/lldb"))))) + (outputs '("out" "cargo" "doc")) + (properties '((timeout . 72000) ;20 hours + (max-silent-time . 18000))) ;5 hours (for armel) + (build-system gnu-build-system) + (arguments + `(#:tests? #t + #:imported-modules ,%cargo-utils-modules ;for `generate-all-checksums' + #:modules ((guix build utils) + (guix build gnu-build-system) + (ice-9 match) + (srfi srfi-1)) + #:phases + (modify-phases %standard-phases + (add-after 'unpack 'set-env + (lambda* (#:key inputs #:allow-other-keys) + ;; Disable test for cross compilation support. + (setenv "CFG_DISABLE_CROSS_TESTS" "1") + (setenv "SHELL" (which "sh")) + (setenv "CONFIG_SHELL" (which "sh")) + (setenv "CC" (string-append (assoc-ref inputs "gcc") "/bin/gcc")) + ;; The Guix LLVM package installs only shared libraries. + (setenv "LLVM_LINK_SHARED" "1"))) + (add-after 'unpack 'relax-gdb-auto-load-safe-path + ;; Allow GDB to load binaries from any location, otherwise the + ;; GDB tests fail. + (lambda _ + (setenv "HOME" (getcwd)) + (with-output-to-file (string-append (getenv "HOME") "/.gdbinit") + (lambda _ + (format #t "set auto-load safe-path /~%"))) + ;; Do not launch gdb with '-nx' which causes it to not execute + ;; any init file. + (substitute* "src/tools/compiletest/src/runtest.rs" + (("\"-nx\".(to_owned|as_ref)\\(\\),") + "")) + ;; Patch the wrapper scripts to refer to the (not yet) built + ;; rustc sysroot rather than the earlier one used as a bootstrap. + (substitute* '("src/etc/rust-gdb" + "src/etc/rust-gdbgui" + "src/etc/rust-lldb") + (("^RUSTC_SYSROOT.*") + (string-append "RUSTC_SYSROOT=" (getcwd) "/build/" + ,(nix-system->gnu-triplet-for-rust) + "/stage2"))))) + (add-after 'unpack 'patch-tests + (lambda* (#:key inputs #:allow-other-keys) + (let ((bash (assoc-ref inputs "bash"))) + (substitute* "src/libstd/process.rs" + (("\"/bin/sh\"") + (format #f "~s" (which "sh")))) + (substitute* "src/libstd/net/tcp.rs" + ;; There is no network in build environment + (("fn connect_timeout_unroutable") + "#[ignore]\nfn connect_timeout_unroutable")) + ;; + (substitute* "src/libstd/sys/unix/process/process_common.rs" + (("fn test_process_mask") "#[allow(unused_attributes)] + #[ignore] + fn test_process_mask")) + ;; This test is known to be flaky (see: + ;; https://github.com/rust-lang/rust/issues/55503). + (substitute* "src/libstd/process.rs" + (("fn test_inherit_env") + "#[ignore]\nfn test_inherit_env")) + ;; This one also (see: + ;; https://github.com/rust-lang/rust/commit/ + ;; a1580e72daee5fa9b7a61a74a20326b8c5741177) + (substitute* "src/libstd/net/tcp.rs" + (("fn fast_rebind") + "#[ignore]\nfn fast_rebind"))))) + (add-after 'unpack 'remove-flaky-test + (lambda _ + ;; See . + (when (file-exists? "src/test/run-make/issue-26092") + (delete-file-recursively "src/test/run-make/issue-26092")))) + (add-after 'patch-tests 'neuter-tidy + ;; We often need to patch tests with various Guix-specific paths. + ;; This often increases the line length and makes tidy, rustc's + ;; style checker, complain. We could insert additional newlines or + ;; add an "// ignore-tidy-linelength" comment, but as an ignore + ;; comment must be used, both approaches are fragile due to + ;; upstream formatting changes. As such, disable running the + ;; linter during tests, since it's intended for rustc developers + ;; anyway. + (lambda _ + (substitute* "src/bootstrap/builder.rs" + ((".*::Tidy,.*") + "")))) + (add-after 'patch-tests 'disable-debuginfo-test + (lambda _ + ;; The GDB tests fail. + (substitute* "src/bootstrap/builder.rs" + ((".*test::Debuginfo,.*") + "")))) + (add-after 'patch-tests 'patch-cargo-index-update + (lambda* _ + (substitute* "src/tools/cargo/tests/testsuite/generate_lockfile.rs" + ;; This test wants to update the crate index. + (("fn no_index_update") "#[ignore]\nfn no_index_update")))) + (add-after 'patch-tests 'patch-aarch64-test + (lambda* _ + (substitute* "src/librustc_metadata/dynamic_lib.rs" + ;; This test is known to fail on aarch64 and powerpc64le: + ;; https://github.com/rust-lang/rust/issues/45410 + (("fn test_loading_cosine") "#[ignore]\nfn test_loading_cosine")) + ;; This test fails on aarch64 with llvm@6.0: + ;; https://github.com/rust-lang/rust/issues/49807 + ;; other possible solution: + ;; https://github.com/rust-lang/rust/pull/47688 + (delete-file + "src/test/debuginfo/by-value-self-argument-in-trait-impl.rs"))) + (add-after 'patch-tests 'remove-unsupported-tests + (lambda* _ + ;; Our ld-wrapper cannot process non-UTF8 bytes in LIBRARY_PATH. + ;; + (delete-file-recursively + "src/test/run-make-fulldeps/linker-output-non-utf8"))) + (add-after 'patch-tests 'disable-amd64-avx-test + (lambda _ + (substitute* (match (find-files "." "^issue-44056.rs$") + ((file) file)) + (("only-x86_64") "ignore-test")))) + (add-after 'patch-tests 'patch-cargo-tests + (lambda _ + (substitute* '("src/tools/cargo/tests/testsuite/build.rs" + "src/tools/cargo/tests/testsuite/fix.rs") + (("/usr/bin/env") + (which "env"))) + (substitute* "src/tools/cargo/tests/testsuite/death.rs" + ;; This is stuck when built in container. + (("fn ctrl_c_kills_everyone") + "#[ignore]\nfn ctrl_c_kills_everyone")) + ;; Prints test output in the wrong order when built on + ;; i686-linux. + (substitute* "src/tools/cargo/tests/testsuite/test.rs" + (("fn cargo_test_env") + "#[ignore]\nfn cargo_test_env")) + + ;; These tests pull in a dependency on "git", which changes + ;; too frequently take part in the Rust toolchain. + (substitute* "src/tools/cargo/tests/testsuite/new.rs" + (("fn author_prefers_cargo") + "#[ignore]\nfn author_prefers_cargo") + (("fn finds_author_git") + "#[ignore]\nfn finds_author_git") + (("fn finds_local_author_git") + "#[ignore]\nfn finds_local_author_git")))) + (add-after 'patch-cargo-tests 'patch-cargo-env-shebang + (lambda* (#:key inputs #:allow-other-keys) + (let ((coreutils (assoc-ref inputs "coreutils"))) + (substitute* "src/tools/cargo/tests/testsuite/fix.rs" + ;; Cargo has a test which explicitly sets a + ;; RUSTC_WRAPPER environment variable which points + ;; to /usr/bin/env. Since it's not a shebang, it + ;; needs to be manually patched + (("\"/usr/bin/env\"") + (string-append "\"" coreutils "/bin/env\"")))))) + (add-after 'patch-cargo-env-shebang 'ignore-cargo-package-tests + (lambda* _ + (substitute* "src/tools/cargo/tests/testsuite/package.rs" + ;; These tests largely check that cargo outputs warning/error + ;; messages as expected. It seems that cargo outputs an + ;; absolute path to something in the store instead of the + ;; expected relative path (e.g. `[..]`) so we'll ignore + ;; these for now + (("fn include") "#[ignore]\nfn include") + (("fn exclude") "#[ignore]\nfn exclude")))) + (add-after 'patch-generated-file-shebangs 'patch-cargo-checksums + (lambda* _ + (use-modules (guix build cargo-utils)) + (substitute* "src/Cargo.lock" + (("(\"checksum .* = )\".*\"" all name) + (string-append name "\"" ,%cargo-reference-hash "\""))) + (generate-all-checksums "src/vendor"))) + (replace 'configure + (lambda* (#:key inputs outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (doc (assoc-ref outputs "doc")) + (gcc (assoc-ref inputs "gcc")) + (gdb (assoc-ref inputs "gdb")) + (binutils (assoc-ref inputs "binutils")) + (python (assoc-ref inputs "python")) + (rustc (assoc-ref inputs "rustc-bootstrap")) + (cargo (assoc-ref inputs "cargo-bootstrap")) + (llvm (assoc-ref inputs "llvm")) + (jemalloc (assoc-ref inputs "jemalloc"))) + (call-with-output-file "config.toml" + (lambda (port) + (display (string-append " +[llvm] +[build] +cargo = \"" cargo "/bin/cargo" "\" +rustc = \"" rustc "/bin/rustc" "\" +docs = false +python = \"" python "/bin/python2" "\" +gdb = \"" gdb "/bin/gdb" "\" +vendor = true +submodules = false +[install] +prefix = \"" out "\" +docdir = \"" doc "/share/doc/rust" "\" +sysconfdir = \"etc\" +[rust] +default-linker = \"" gcc "/bin/gcc" "\" +channel = \"stable\" +rpath = true +[target." ,(nix-system->gnu-triplet-for-rust) "] +llvm-config = \"" llvm "/bin/llvm-config" "\" +cc = \"" gcc "/bin/gcc" "\" +cxx = \"" gcc "/bin/g++" "\" +ar = \"" binutils "/bin/ar" "\" +jemalloc = \"" jemalloc "/lib/libjemalloc_pic.a" "\" +[dist] +") port)))))) + (replace 'build + (lambda* (#:key parallel-build? #:allow-other-keys) + (let ((job-spec (string-append + "-j" (if parallel-build? + (number->string (parallel-job-count)) + "1")))) + (invoke "./x.py" job-spec "build") + (invoke "./x.py" job-spec "build" "src/tools/cargo")))) + (replace 'check + (lambda* (#:key tests? parallel-build? #:allow-other-keys) + (when tests? + (let ((job-spec (string-append + "-j" (if parallel-build? + (number->string (parallel-job-count)) + "1")))) + (invoke "./x.py" job-spec "test" "-vv") + (invoke "./x.py" job-spec "test" "src/tools/cargo"))))) + (replace 'install + (lambda* (#:key outputs #:allow-other-keys) + (let ((out (assoc-ref outputs "out")) + (cargo-out (assoc-ref outputs "cargo"))) + (mkdir-p out) + (invoke "./x.py" "install") + (substitute* "config.toml" + ;; Adjust the prefix to the 'cargo' output. + (("prefix = \"[^\"]*\"") + (format #f "prefix = ~s" cargo-out))) + (mkdir-p cargo-out) + (invoke "./x.py" "install" "cargo")))) + (add-after 'install 'delete-install-logs + (lambda* (#:key outputs #:allow-other-keys) + (for-each (lambda (f) + (false-if-exception (delete-file f))) + (append-map (lambda (output) + (find-files (string-append + output "/lib/rustlib") + "(^install.log$|^manifest-)")) + (map cdr outputs))))) + (add-after 'install 'wrap-rustc + (lambda* (#:key inputs outputs #:allow-other-keys) + (let ((out (assoc-ref outputs "out")) + (libc (assoc-ref inputs "libc")) + (ld-wrapper (assoc-ref inputs "ld-wrapper"))) + ;; Let gcc find ld and libc startup files. + (wrap-program (string-append out "/bin/rustc") + `("PATH" ":" prefix (,(string-append ld-wrapper "/bin"))) + `("LIBRARY_PATH" ":" + suffix (,(string-append libc "/lib")))))))))) + (native-inputs + `(("bison" ,bison) ; For the tests + ("cmake" ,cmake-minimal) + ("flex" ,flex) ; For the tests + ("gdb" ,gdb-9.2) ; For the tests + ("pkg-config" ,pkg-config) ; For "cargo" + ("procps" ,procps) ; For the tests + ("python" ,python-2) ; For the tests + ("rustc-bootstrap" ,rust-1.29) + ("cargo-bootstrap" ,rust-1.29 "cargo") + ("which" ,which))) + (inputs + `(("jemalloc" ,jemalloc-4.5.0) + ("llvm" ,llvm-7) + ("openssl" ,openssl) + ("libssh2" ,libssh2) ; For "cargo" + ("libcurl" ,curl))) ; For "cargo" + ;; rustc invokes gcc, so we need to set its search paths accordingly. + ;; Note: duplicate its value here to cope with circular dependencies among + ;; modules (see ). + (native-search-paths + (list (search-path-specification + (variable "C_INCLUDE_PATH") + (files '("include"))) + (search-path-specification + (variable "CPLUS_INCLUDE_PATH") + (files '("include/c++" "include"))) + (search-path-specification + (variable "LIBRARY_PATH") + (files '("lib" "lib64"))))) + (supported-systems '("x86_64-linux")) + (synopsis "Compiler for the Rust progamming language") + (description "Rust is a systems programming language that provides memory +safety and thread safety guarantees.") + (home-page "https://www.rust-lang.org") + ;; Dual licensed. + (license (list license:asl2.0 license:expat)))) (define-public rust-1.31 (let ((base-rust (rust-bootstrapped-package @@ -146,15 +617,27 @@ move around." (substitute-keyword-arguments (package-arguments base-rust) ((#:phases phases) `(modify-phases ,phases + (delete 'disable-debuginfo-test) + (add-after 'configure 'enable-docs + ;; Docs are disabled in 1.30 as the doc tests fail. Re-enable + ;; them here. + (lambda* _ + (substitute* "config.toml" + (("docs = false") + "docs = true")))) (add-after 'patch-tests 'patch-command-exec-tests - ,(patch-command-exec-tests-phase - "src/test/run-pass/command-exec.rs")) - ;; The test has been moved elsewhere. - (replace 'disable-amd64-avx-test - (lambda _ - (substitute* "src/test/ui/issues/issue-44056.rs" - (("only-x86_64") - "ignore-test")))) + (lambda* (#:key inputs #:allow-other-keys) + (let ((coreutils (assoc-ref inputs "coreutils"))) + (substitute* (match (find-files "." "^command-exec.rs$") + ((file) file)) + ;; This test suite includes some tests that the stdlib's + ;; `Command` execution properly handles in situations + ;; where the environment or PATH variable are empty, but + ;; this fails since we don't have `echo` available at its + ;; usual FHS location. + (("Command::new\\(\"echo\"\\)") + (string-append "Command::new(\"" + coreutils "/bin/echo\")")))))) (add-after 'patch-tests 'patch-process-docs-rev-cmd (lambda* _ ;; Disable some doc tests which depend on the "rev" command @@ -179,14 +662,15 @@ move around." "src/tools/lldb" "vendor/jemalloc-sys/jemalloc"))) (patches (search-patches "rust-reproducible-builds.patch")) - ;; the vendor directory has moved to the root of - ;; the tarball, so we have to strip an extra prefix + ;; the vendor directory has moved to the root of + ;; the tarball, so we have to strip an extra prefix (patch-flags '("-p2")))) - (inputs - ;; Downgrade to LLVM 6, all LTO tests appear to fail with LLVM 7.0.1 - (alist-replace "llvm" (list llvm-6) (package-inputs base-rust))) (arguments (substitute-keyword-arguments (package-arguments base-rust) + ;; The test suite fails due to LLVM 7, required for the build to be + ;; reproducible. + ((#:tests? _ #t) + #f) ((#:phases phases) `(modify-phases ,phases ;; Cargo.lock and the vendor/ directory have been moved to the @@ -198,7 +682,7 @@ move around." (("(\"checksum .* = )\".*\"" all name) (string-append name "\"" ,%cargo-reference-hash "\""))) (generate-all-checksums "vendor"))) - (add-after 'enable-codegen-tests 'override-jemalloc + (add-after 'configure 'override-jemalloc (lambda* (#:key inputs #:allow-other-keys) ;; The compiler is no longer directly built against jemalloc, ;; but rather via the jemalloc-sys crate (which vendors the @@ -231,16 +715,25 @@ move around." (alist-replace "jemalloc" (list jemalloc) (package-inputs base-rust))) (arguments (substitute-keyword-arguments (package-arguments base-rust) + ((#:tests? _ #f) + #t) ((#:phases phases) - `(modify-phases ,phases - (delete 'ignore-cargo-package-tests) - (add-after 'configure 'configure-test-threads - ;; Several rustc and cargo tests will fail if run on one core - ;; https://github.com/rust-lang/rust/issues/59122 - ;; https://github.com/rust-lang/cargo/issues/6746 - ;; https://github.com/rust-lang/rust/issues/58907 - (lambda* (#:key inputs #:allow-other-keys) - (setenv "RUST_TEST_THREADS" "2")))))))))) + `(modify-phases ,phases + (delete 'ignore-cargo-package-tests) + (add-after 'configure 'configure-test-threads + ;; Several rustc and cargo tests will fail if run on one core + ;; https://github.com/rust-lang/rust/issues/59122 + ;; https://github.com/rust-lang/cargo/issues/6746 + ;; https://github.com/rust-lang/rust/issues/58907 + (lambda* (#:key inputs #:allow-other-keys) + (setenv "RUST_TEST_THREADS" "2"))) + (add-after 'configure 'disable-codegen-tests + ;; The codegen tests fail in this version due to using LLVM + ;; 7. + (lambda _ + (substitute* "config.toml" + (("rpath = .*" all) + (string-append all "codegen-tests = false\n")))))))))))) (define-public rust-1.34 (let ((base-rust (rust-bootstrapped-package @@ -268,15 +761,7 @@ move around." (substitute-keyword-arguments (package-arguments base-rust) ((#:phases phases) `(modify-phases ,phases - ;; The tidy test includes a pass which ensures large binaries - ;; don't accidentally get checked into the rust git repo. - ;; Unfortunately the test assumes that git is always available, - ;; so we'll comment out the invocation of this pass. - (add-after 'configure 'disable-tidy-bins-check - (lambda* _ - (substitute* "src/tools/tidy/src/main.rs" - (("bins::check") - "//bins::check"))))))))))) + (delete 'disable-codegen-tests)))))))) (define-public rust-1.36 (let ((base-rust (rust-bootstrapped-package @@ -318,16 +803,11 @@ move around." (substitute-keyword-arguments (package-arguments base-rust) ((#:phases phases) `(modify-phases ,phases - (replace 'patch-command-exec-tests - ,(patch-command-exec-tests-phase - "src/test/ui/command-exec.rs")) (add-after 'patch-tests 'patch-command-uid-gid-test (lambda _ (substitute* "src/test/ui/command-uid-gid.rs" (("/bin/sh") - (which "sh")) - (("ignore-sgx") - "ignore-sgx\n// ignore-tidy-linelength"))))))))))) + (which "sh")))))))))))) (define-public rust-1.39 (let ((base-rust (rust-bootstrapped-package @@ -373,43 +853,21 @@ move around." ;; As such, we skip validating the runpath for Rust 1.40. ;; Rust 1.41 stopped putting the codegen backend in a separate library, ;; which makes this workaround only necessary for this release. - (cons* #:validate-runpath? #f - (substitute-keyword-arguments (package-arguments base-rust) - ((#:phases phases) - `(modify-phases ,phases - ;; We often need to patch tests with various Guix-specific paths. - ;; This often increases the line length and makes tidy, rustc's - ;; style checker, complain. We could insert additional newlines - ;; or add an "// ignore-tidy-linelength" comment, but as an - ;; ignore comment must be used, both approaches are fragile due - ;; to upstream formatting changes. As such, disable running the - ;; linter during tests, since it's intended for rustc developers - ;; anyway. - ;; - ;; TODO(rebuild-rust): This phase could be added earlier to - ;; simplify a significant amount of code, but it would require - ;; rebuilding the entire rusty universe. - (add-after 'patch-tests 'neuter-tidy - (lambda _ - (substitute* "src/bootstrap/builder.rs" - (("^.*::Tidy,") - "")))) - ;; TODO(rebuild-rust): Adapt the find-files approach for - ;; earlier testsuite patches. - (replace 'patch-command-uid-gid-test - (lambda _ - (match (find-files "src/test" "command-uid-gid\\.rs") - ((file) - (substitute* file - (("/bin/sh") - (which "sh"))))))) - (replace 'patch-command-exec-tests - ,(patch-command-exec-tests-phase - '(match (find-files "src/test" "command-exec\\.rs") - ((file) file)))) - ;; The test got removed in commit 000fe63b6fc57b09828930cacbab20c2ee6e6d15 - ;; "Remove painful test that is not pulling its weight" - (delete 'remove-unsupported-tests))))))))) + (substitute-keyword-arguments (package-arguments base-rust) + ((#:validate-runpath? _ #f) + #f) + ((#:phases phases) + `(modify-phases ,phases + (replace 'patch-command-uid-gid-test + (lambda _ + (substitute* (match (find-files "src/test" + "^command-uid-gid\\.rs$") + ((file) file)) + (("/bin/sh") + (which "sh"))))) + ;; The test got removed in commit 000fe63b6fc57b09828930cacbab20c2ee6e6d15 + ;; "Remove painful test that is not pulling its weight" + (delete 'remove-unsupported-tests)))))))) (define-public rust-1.41 (let ((base-rust (rust-bootstrapped-package @@ -419,7 +877,8 @@ move around." (inherit base-rust) (arguments (substitute-keyword-arguments (package-arguments base-rust) - ((#:validate-runpath? _ #f) #t)))))) + ((#:validate-runpath? _ #t) + #t)))))) (define-public rust-1.42 (rust-bootstrapped-package @@ -430,8 +889,22 @@ move around." rust-1.42 "1.43.0" "18akhk0wz1my6y9vhardriy2ysc482z0fnjdcgs9gy59kmnarxkm")) (define-public rust-1.44 - (rust-bootstrapped-package - rust-1.43 "1.44.1" "0ww4z2v3gxgn3zddqzwqya1gln04p91ykbrflnpdbmcd575n8bky")) + (let ((base-rust (rust-bootstrapped-package + rust-1.43 "1.44.1" + "0ww4z2v3gxgn3zddqzwqya1gln04p91ykbrflnpdbmcd575n8bky"))) + (package + (inherit base-rust) + ;; Rust 1.44 gained support to use Python 3 for testing. + (native-inputs + (alist-replace "python" (list python-wrapper) (package-native-inputs base-rust))) + (arguments (substitute-keyword-arguments (package-arguments base-rust) + ((#:phases phases) + `(modify-phases ,phases + (add-after 'configure 'use-python3 + (lambda _ + (substitute* "config.toml" + (("/bin/python2") + "/bin/python"))))))))))) (define-public rust-1.45 (let ((base-rust (rust-bootstrapped-package @@ -439,16 +912,17 @@ move around." "0273a1g3f59plyi1n0azf21qjzwml1yqdnj5z472crz37qggr8xp"))) (package (inherit base-rust) - (source - (origin - (inherit (package-source base-rust)) - (patches (search-patches "rust-1.45-linker-locale.patch")))) (inputs (alist-replace "llvm" (list llvm-10) (package-inputs base-rust))) (arguments (substitute-keyword-arguments (package-arguments base-rust) ((#:phases phases) `(modify-phases ,phases + (add-after 'unpack 'set-linker-locale-to-utf8 + (lambda _ + (substitute* (find-files "." "^linker.rs$") + (("linker.env\\(\"LC_ALL\", \"C\"\\);") + "linker.env(\"LC_ALL\", \"en_US.UTF-8\");")))) ;; These tests make sure that the parser behaves properly when ;; a source file starts with a shebang. Unfortunately, ;; the patch-shebangs phase changes the meaning of these edge-cases. @@ -480,20 +954,25 @@ move around." `(modify-phases ,phases (replace 'build ;; Phase overridden to also build rustfmt. - (lambda* _ - (invoke "./x.py" "build") - (invoke "./x.py" "build" "src/tools/cargo") - (invoke "./x.py" "build" "src/tools/rustfmt"))) - (replace 'check - ;; Phase overridden to also test rustfmt. - (lambda* _ + (lambda* (#:key parallel-build? #:allow-other-keys) (let ((job-spec (string-append "-j" (if parallel-build? (number->string (parallel-job-count)) "1")))) - (invoke "./x.py" job-spec "test" "-vv") - (invoke "./x.py" job-spec "test" "src/tools/cargo") - (invoke "./x.py" job-spec "test" "src/tools/rustfmt")))) + (invoke "./x.py" job-spec "build") + (invoke "./x.py" job-spec "build" "src/tools/cargo") + (invoke "./x.py" job-spec "build" "src/tools/rustfmt")))) + (replace 'check + ;; Phase overridden to also test rustfmt. + (lambda* (#:key tests? parallel-build? #:allow-other-keys) + (when tests? + (let ((job-spec (string-append + "-j" (if parallel-build? + (number->string (parallel-job-count)) + "1")))) + (invoke "./x.py" job-spec "test" "-vv") + (invoke "./x.py" job-spec "test" "src/tools/cargo") + (invoke "./x.py" job-spec "test" "src/tools/rustfmt"))))) (replace 'install ;; Phase overridden to also install rustfmt. (lambda* (#:key outputs #:allow-other-keys) @@ -507,30 +986,7 @@ move around." ;; Adjust the prefix to the 'rustfmt' output. (("prefix = \"[^\"]*\"") (format #f "prefix = ~s" (assoc-ref outputs "rustfmt")))) - (invoke "./x.py" "install" "rustfmt"))) - (replace 'delete-install-logs - (lambda* (#:key outputs #:allow-other-keys) - (define (delete-manifest-file out-path file) - (delete-file (string-append out-path "/lib/rustlib/" file))) - - (let ((out (assoc-ref outputs "out")) - (cargo-out (assoc-ref outputs "cargo")) - (rustfmt-out (assoc-ref outputs "rustfmt"))) - (for-each - (lambda (file) (delete-manifest-file out file)) - '("install.log" - "manifest-rust-docs" - ,(string-append "manifest-rust-std-" - (nix-system->gnu-triplet-for-rust)) - "manifest-rustc")) - (for-each - (lambda (file) (delete-manifest-file cargo-out file)) - '("install.log" - "manifest-cargo")) - (for-each - (lambda (file) (delete-manifest-file rustfmt-out file)) - '("install.log" - "manifest-rustfmt-preview")))))))))))) + (invoke "./x.py" "install" "rustfmt")))))))))) (define-public rust-1.47 (let ((base-rust (rust-bootstrapped-package @@ -552,19 +1008,10 @@ move around." (("\"/bin/sh\"") (string-append "\"" bash "/bin/sh\""))) ;; (substitute* "library/std/src/sys/unix/process/process_common.rs" - (("fn test_process_mask") "#[allow(unused_attributes)] + (("fn test_process_mask") + "#[allow(unused_attributes)] #[ignore] - fn test_process_mask"))))) - (delete 'patch-cargo-checksums) - (add-after 'patch-generated-file-shebangs 'patch-cargo-checksums - ;; Generate checksums after patching generated files (in - ;; particular, vendor/jemalloc/rep/Makefile). - (lambda* _ - (use-modules (guix build cargo-utils)) - (substitute* "Cargo.lock" - (("(checksum = )\".*\"" all name) - (string-append name "\"" ,%cargo-reference-hash "\""))) - (generate-all-checksums "vendor")))))))))) + fn test_process_mask")))))))))))) (define-public rust-1.48 (let ((base-rust (rust-bootstrapped-package @@ -572,12 +1019,6 @@ move around." "0fz4gbb5hp5qalrl9lcl8yw4kk7ai7wx511jb28nypbxninkwxhf"))) (package (inherit base-rust) - (source - (origin - (inherit (package-source base-rust)) - ;; New patch required due to the second part of the source code rearrangement: - ;; the relevant source code is now in the compiler directory. - (patches (search-patches "rust-1.48-linker-locale.patch")))) (arguments (substitute-keyword-arguments (package-arguments base-rust) ((#:phases phases) -- cgit v1.2.3 From 7878f344c16bc3a4f5575e375e79fdebe454ee88 Mon Sep 17 00:00:00 2001 From: Maxim Cournoyer Date: Mon, 1 Feb 2021 10:34:26 -0500 Subject: gnu: rust: Only test the current release. By only testing the final Rust in the bootstrap chain, the total build time is reduced by approximately 30%, from about 11 hours to 8 hours on a fast machine. Combined with commit df93fc21a4, the total Rust bootstrap chain build time should have been halved. * gnu/packages/patches/rust-1.25-accept-more-detailed-gdb-lines.patch: Delete file. * gnu/local.mk (dist_patch_DATA): De-register it. * gnu/packages/rust.scm (rust-1.29): Do not apply the above patch. (rust-1.30): Remove the "doc" output. Disable tests. [phases]{set-env}: Do not set CFG_DISABLE_CROSS_TESTS. {relax-gdb-auto-load-safe-path, patch-tests, patch-cargo-index-update} {patch-aarch64-test, remove-unsupported-tests, disable-amd64-avx-test} {patch-cargo-tests, patch-cargo-env-shebang} {ignore-cargo-package-tests}: Remove phases. {configure}: Remove the doc and gdb bindings and their respective configuration entries in the generated config.toml file. {check}: Remove phase. [native-inputs]{bison, flex, gdb, procps}: Remove inputs. {python-2}: Replace by python-wrapper. {rust-1.29}: Do not export variable. {rust-1.30}: Likewise. (rust-1.31): Likewise. [arguments]: Remove field. (rust-1.32): Do not export variable. [source]: Remove patch. [phases]{override-jemalloc}: Order following 'configure. {remove-flaky-test, patch-aarch64-test}: Remove deletions. (rust-1.33): Do not export variable. [arguments]: Remove field. (rust-1.34): Do not export variable. (rust-1.35): Likewise. (rust-1.36): Likewise. [arguments]: Remove field. (rust-1.37): Do not export variable. (rust-1.38): Do not export variable. [arguments]: Likewise. (rust-1.39): Do not export variable. (rust-1.40): Do not export variable. [phases]: Do not alter the #:phases argument. (rust-1.41, rust-1.42, rust-1.43): Do not export variables. (rust-1.44): Likewise. [arguments]: Remove field. (rust-1.45): Do not export variable. [phases]{skip-shebang-tests, skip-networking-test}: Remove phases. (rust-1.46): Do not export variable. (rust-1.47): Do not export variable. [arguments]: Remove field. (rust-1.48): Do not export variable. [arguments]: Remove field. (rust-1.49): Rename to... (rust): ... this. [outputs]: Add a "doc" output. [phases]{enable-docs, add-gdb-to-config} {relax-gdb-auto-load-safe-path, patch-cargo-env-shebang} {disable-tests-requiring-git, disable-interrupt-tests} {patch-command-exec-tests, patch-command-uid-gid-test} {skip-shebang-tests, patch-process-tests}: New phases. [native-inputs]{gdb-9.2, procps}: New inputs. --- gnu/local.mk | 1 - .../rust-1.25-accept-more-detailed-gdb-lines.patch | 111 ----- gnu/packages/rust.scm | 515 +++++++-------------- 3 files changed, 160 insertions(+), 467 deletions(-) delete mode 100644 gnu/packages/patches/rust-1.25-accept-more-detailed-gdb-lines.patch (limited to 'gnu/packages/rust.scm') diff --git a/gnu/local.mk b/gnu/local.mk index f908f51074..0584bd65e8 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1599,7 +1599,6 @@ dist_patch_DATA = \ %D%/packages/patches/ruby-sanitize-system-libxml.patch \ %D%/packages/patches/ruby-tzinfo-data-ignore-broken-test.patch\ %D%/packages/patches/runc-CVE-2019-5736.patch \ - %D%/packages/patches/rust-1.25-accept-more-detailed-gdb-lines.patch \ %D%/packages/patches/rust-coresimd-doctest.patch \ %D%/packages/patches/rust-ndarray-remove-blas-src-dep.patch \ %D%/packages/patches/rust-nettle-disable-vendor.patch \ diff --git a/gnu/packages/patches/rust-1.25-accept-more-detailed-gdb-lines.patch b/gnu/packages/patches/rust-1.25-accept-more-detailed-gdb-lines.patch deleted file mode 100644 index a2bad55117..0000000000 --- a/gnu/packages/patches/rust-1.25-accept-more-detailed-gdb-lines.patch +++ /dev/null @@ -1,111 +0,0 @@ -GDB responds with some overly detailed lines - which makes the tests fail. -Patch rust to accept those instead. -See . -diff -ur orig/rustc-1.25.0-src/src/test/debuginfo/generic-enum-with-different-disr-sizes.rs rustc-1.25.0-src/src/test/debuginfo/generic-enum-with-different-disr-sizes.rs ---- orig/rustc-1.25.0-src/src/test/debuginfo/generic-enum-with-different-disr-sizes.rs 2018-09-13 10:24:33.775565159 +0200 -+++ rustc-1.25.0-src/src/test/debuginfo/generic-enum-with-different-disr-sizes.rs 2018-09-13 10:25:56.322513658 +0200 -@@ -19,36 +19,36 @@ - - // gdb-command:print eight_bytes1 - // gdbg-check:$1 = {{RUST$ENUM$DISR = Variant1, __0 = 100}, {RUST$ENUM$DISR = Variant1, __0 = 100}} --// gdbr-check:$1 = generic_enum_with_different_disr_sizes::Enum::Variant1(100) -+// gdbr-check:$1 = generic_enum_with_different_disr_sizes::Enum::Variant1(100) - - // gdb-command:print four_bytes1 - // gdbg-check:$2 = {{RUST$ENUM$DISR = Variant1, __0 = 101}, {RUST$ENUM$DISR = Variant1, __0 = 101}} --// gdbr-check:$2 = generic_enum_with_different_disr_sizes::Enum::Variant1(101) -+// gdbr-check:$2 = generic_enum_with_different_disr_sizes::Enum::Variant1(101) - - // gdb-command:print two_bytes1 - // gdbg-check:$3 = {{RUST$ENUM$DISR = Variant1, __0 = 102}, {RUST$ENUM$DISR = Variant1, __0 = 102}} --// gdbr-check:$3 = generic_enum_with_different_disr_sizes::Enum::Variant1(102) -+// gdbr-check:$3 = generic_enum_with_different_disr_sizes::Enum::Variant1(102) - - // gdb-command:print one_byte1 - // gdbg-check:$4 = {{RUST$ENUM$DISR = Variant1, __0 = 65 'A'}, {RUST$ENUM$DISR = Variant1, __0 = 65 'A'}} --// gdbr-check:$4 = generic_enum_with_different_disr_sizes::Enum::Variant1(65) -+// gdbr-check:$4 = generic_enum_with_different_disr_sizes::Enum::Variant1(65) - - - // gdb-command:print eight_bytes2 - // gdbg-check:$5 = {{RUST$ENUM$DISR = Variant2, __0 = 100}, {RUST$ENUM$DISR = Variant2, __0 = 100}} --// gdbr-check:$5 = generic_enum_with_different_disr_sizes::Enum::Variant2(100) -+// gdbr-check:$5 = generic_enum_with_different_disr_sizes::Enum::Variant2(100) - - // gdb-command:print four_bytes2 - // gdbg-check:$6 = {{RUST$ENUM$DISR = Variant2, __0 = 101}, {RUST$ENUM$DISR = Variant2, __0 = 101}} --// gdbr-check:$6 = generic_enum_with_different_disr_sizes::Enum::Variant2(101) -+// gdbr-check:$6 = generic_enum_with_different_disr_sizes::Enum::Variant2(101) - - // gdb-command:print two_bytes2 - // gdbg-check:$7 = {{RUST$ENUM$DISR = Variant2, __0 = 102}, {RUST$ENUM$DISR = Variant2, __0 = 102}} --// gdbr-check:$7 = generic_enum_with_different_disr_sizes::Enum::Variant2(102) -+// gdbr-check:$7 = generic_enum_with_different_disr_sizes::Enum::Variant2(102) - - // gdb-command:print one_byte2 - // gdbg-check:$8 = {{RUST$ENUM$DISR = Variant2, __0 = 65 'A'}, {RUST$ENUM$DISR = Variant2, __0 = 65 'A'}} --// gdbr-check:$8 = generic_enum_with_different_disr_sizes::Enum::Variant2(65) -+// gdbr-check:$8 = generic_enum_with_different_disr_sizes::Enum::Variant2(65) - - // gdb-command:continue - -diff -ur orig/rustc-1.25.0-src/src/test/debuginfo/generic-struct-style-enum.rs rustc-1.25.0-src/src/test/debuginfo/generic-struct-style-enum.rs ---- orig/rustc-1.25.0-src/src/test/debuginfo/generic-struct-style-enum.rs 2018-09-13 10:24:33.775565159 +0200 -+++ rustc-1.25.0-src/src/test/debuginfo/generic-struct-style-enum.rs 2018-09-13 10:27:43.353108111 +0200 -@@ -19,15 +19,15 @@ - - // gdb-command:print case1 - // gdbg-check:$1 = {{RUST$ENUM$DISR = Case1, a = 0, b = 31868, c = 31868, d = 31868, e = 31868}, {RUST$ENUM$DISR = Case1, [...]}, {RUST$ENUM$DISR = Case1, [...]}} --// gdbr-check:$1 = generic_struct_style_enum::Regular::Case1{a: 0, b: 31868, c: 31868, d: 31868, e: 31868} -+// gdbr-check:$1 = generic_struct_style_enum::Regular::Case1{a: 0, b: 31868, c: 31868, d: 31868, e: 31868} - - // gdb-command:print case2 - // gdbg-check:$2 = {{RUST$ENUM$DISR = Case2, [...]}, {RUST$ENUM$DISR = Case2, a = 0, b = 286331153, c = 286331153}, {RUST$ENUM$DISR = Case2, [...]}} --// gdbr-check:$2 = generic_struct_style_enum::Regular::Case2{a: 0, b: 286331153, c: 286331153} -+// gdbr-check:$2 = generic_struct_style_enum::Regular::Case2{a: 0, b: 286331153, c: 286331153} - - // gdb-command:print case3 - // gdbg-check:$3 = {{RUST$ENUM$DISR = Case3, [...]}, {RUST$ENUM$DISR = Case3, [...]}, {RUST$ENUM$DISR = Case3, a = 0, b = 6438275382588823897}} --// gdbr-check:$3 = generic_struct_style_enum::Regular::Case3{a: 0, b: 6438275382588823897} -+// gdbr-check:$3 = generic_struct_style_enum::Regular::Case3{a: 0, b: 6438275382588823897} - - // gdb-command:print univariant - // gdbg-check:$4 = {{a = -1}} -diff -ur orig/rustc-1.25.0-src/src/test/debuginfo/generic-tuple-style-enum.rs rustc-1.25.0-src/src/test/debuginfo/generic-tuple-style-enum.rs ---- orig/rustc-1.25.0-src/src/test/debuginfo/generic-tuple-style-enum.rs 2018-09-13 10:24:33.775565159 +0200 -+++ rustc-1.25.0-src/src/test/debuginfo/generic-tuple-style-enum.rs 2018-09-13 10:28:26.328546298 +0200 -@@ -21,15 +21,15 @@ - - // gdb-command:print case1 - // gdbg-check:$1 = {{RUST$ENUM$DISR = Case1, __0 = 0, __1 = 31868, __2 = 31868, __3 = 31868, __4 = 31868}, {RUST$ENUM$DISR = Case1, [...]}, {RUST$ENUM$DISR = Case1, [...]}} --// gdbr-check:$1 = generic_tuple_style_enum::Regular::Case1(0, 31868, 31868, 31868, 31868) -+// gdbr-check:$1 = generic_tuple_style_enum::Regular::Case1(0, 31868, 31868, 31868, 31868) - - // gdb-command:print case2 - // gdbg-check:$2 = {{RUST$ENUM$DISR = Case2, [...]}, {RUST$ENUM$DISR = Case2, __0 = 0, __1 = 286331153, __2 = 286331153}, {RUST$ENUM$DISR = Case2, [...]}} --// gdbr-check:$2 = generic_tuple_style_enum::Regular::Case2(0, 286331153, 286331153) -+// gdbr-check:$2 = generic_tuple_style_enum::Regular::Case2(0, 286331153, 286331153) - - // gdb-command:print case3 - // gdbg-check:$3 = {{RUST$ENUM$DISR = Case3, [...]}, {RUST$ENUM$DISR = Case3, [...]}, {RUST$ENUM$DISR = Case3, __0 = 0, __1 = 6438275382588823897}} --// gdbr-check:$3 = generic_tuple_style_enum::Regular::Case3(0, 6438275382588823897) -+// gdbr-check:$3 = generic_tuple_style_enum::Regular::Case3(0, 6438275382588823897) - - // gdb-command:print univariant - // gdbg-check:$4 = {{__0 = -1}} ---- orig/rustc-1.25.0-src/src/test/debuginfo/nil-enum.rs 2018-09-13 10:24:33.783565071 +0200 -+++ rustc-1.25.0-src/src/test/debuginfo/nil-enum.rs 2018-10-26 18:19:20.404564587 +0200 -@@ -17,11 +17,11 @@ - - // gdb-command:print first - // gdbg-check:$1 = {} --// gdbr-check:$1 = -+// gdbr-check:$1 = nil_enum::ANilEnum - - // gdb-command:print second - // gdbg-check:$2 = {} --// gdbr-check:$2 = -+// gdbr-check:$2 = nil_enum::AnotherNilEnum - - #![allow(unused_variables)] - #![feature(omit_gdb_pretty_printer_section)] diff --git a/gnu/packages/rust.scm b/gnu/packages/rust.scm index d98bd876ce..70d19e089a 100644 --- a/gnu/packages/rust.scm +++ b/gnu/packages/rust.scm @@ -134,7 +134,7 @@ ;;; Rust 1.29 is special in that it is built with mrustc, which shortens the ;;; bootstrap path. Note: the build is non-deterministic. -(define-public rust-1.29 +(define rust-1.29 (package (name "rust") (version "1.29.2") @@ -148,9 +148,7 @@ '("src/jemalloc" "src/llvm" "src/llvm-emscripten"))) - (patches (search-patches - "rust-1.25-accept-more-detailed-gdb-lines.patch" - "rust-reproducible-builds.patch")))) + (patches (search-patches "rust-reproducible-builds.patch")))) (outputs '("out" "cargo")) (properties '((timeout . 72000) ;20 hours (max-silent-time . 18000))) ;5 hours (for armel) @@ -292,7 +290,7 @@ safety and thread safety guarantees.") ;; Dual licensed. (license (list license:asl2.0 license:expat)))) -(define-public rust-1.30 +(define rust-1.30 (package (name "rust") (version "1.30.1") @@ -307,12 +305,14 @@ safety and thread safety guarantees.") "src/llvm-emscripten" "src/tools/clang" "src/tools/lldb"))))) - (outputs '("out" "cargo" "doc")) + (outputs '("out" "cargo")) (properties '((timeout . 72000) ;20 hours (max-silent-time . 18000))) ;5 hours (for armel) (build-system gnu-build-system) (arguments - `(#:tests? #t + ;; Only the final Rust is tested, not the intermediate bootstrap ones, + ;; for performance and simplicity. + `(#:tests? #f #:imported-modules ,%cargo-utils-modules ;for `generate-all-checksums' #:modules ((guix build utils) (guix build gnu-build-system) @@ -322,67 +322,12 @@ safety and thread safety guarantees.") (modify-phases %standard-phases (add-after 'unpack 'set-env (lambda* (#:key inputs #:allow-other-keys) - ;; Disable test for cross compilation support. - (setenv "CFG_DISABLE_CROSS_TESTS" "1") (setenv "SHELL" (which "sh")) (setenv "CONFIG_SHELL" (which "sh")) (setenv "CC" (string-append (assoc-ref inputs "gcc") "/bin/gcc")) ;; The Guix LLVM package installs only shared libraries. (setenv "LLVM_LINK_SHARED" "1"))) - (add-after 'unpack 'relax-gdb-auto-load-safe-path - ;; Allow GDB to load binaries from any location, otherwise the - ;; GDB tests fail. - (lambda _ - (setenv "HOME" (getcwd)) - (with-output-to-file (string-append (getenv "HOME") "/.gdbinit") - (lambda _ - (format #t "set auto-load safe-path /~%"))) - ;; Do not launch gdb with '-nx' which causes it to not execute - ;; any init file. - (substitute* "src/tools/compiletest/src/runtest.rs" - (("\"-nx\".(to_owned|as_ref)\\(\\),") - "")) - ;; Patch the wrapper scripts to refer to the (not yet) built - ;; rustc sysroot rather than the earlier one used as a bootstrap. - (substitute* '("src/etc/rust-gdb" - "src/etc/rust-gdbgui" - "src/etc/rust-lldb") - (("^RUSTC_SYSROOT.*") - (string-append "RUSTC_SYSROOT=" (getcwd) "/build/" - ,(nix-system->gnu-triplet-for-rust) - "/stage2"))))) - (add-after 'unpack 'patch-tests - (lambda* (#:key inputs #:allow-other-keys) - (let ((bash (assoc-ref inputs "bash"))) - (substitute* "src/libstd/process.rs" - (("\"/bin/sh\"") - (format #f "~s" (which "sh")))) - (substitute* "src/libstd/net/tcp.rs" - ;; There is no network in build environment - (("fn connect_timeout_unroutable") - "#[ignore]\nfn connect_timeout_unroutable")) - ;; - (substitute* "src/libstd/sys/unix/process/process_common.rs" - (("fn test_process_mask") "#[allow(unused_attributes)] - #[ignore] - fn test_process_mask")) - ;; This test is known to be flaky (see: - ;; https://github.com/rust-lang/rust/issues/55503). - (substitute* "src/libstd/process.rs" - (("fn test_inherit_env") - "#[ignore]\nfn test_inherit_env")) - ;; This one also (see: - ;; https://github.com/rust-lang/rust/commit/ - ;; a1580e72daee5fa9b7a61a74a20326b8c5741177) - (substitute* "src/libstd/net/tcp.rs" - (("fn fast_rebind") - "#[ignore]\nfn fast_rebind"))))) - (add-after 'unpack 'remove-flaky-test - (lambda _ - ;; See . - (when (file-exists? "src/test/run-make/issue-26092") - (delete-file-recursively "src/test/run-make/issue-26092")))) - (add-after 'patch-tests 'neuter-tidy + (add-after 'unpack 'neuter-tidy ;; We often need to patch tests with various Guix-specific paths. ;; This often increases the line length and makes tidy, rustc's ;; style checker, complain. We could insert additional newlines or @@ -395,85 +340,6 @@ safety and thread safety guarantees.") (substitute* "src/bootstrap/builder.rs" ((".*::Tidy,.*") "")))) - (add-after 'patch-tests 'disable-debuginfo-test - (lambda _ - ;; The GDB tests fail. - (substitute* "src/bootstrap/builder.rs" - ((".*test::Debuginfo,.*") - "")))) - (add-after 'patch-tests 'patch-cargo-index-update - (lambda* _ - (substitute* "src/tools/cargo/tests/testsuite/generate_lockfile.rs" - ;; This test wants to update the crate index. - (("fn no_index_update") "#[ignore]\nfn no_index_update")))) - (add-after 'patch-tests 'patch-aarch64-test - (lambda* _ - (substitute* "src/librustc_metadata/dynamic_lib.rs" - ;; This test is known to fail on aarch64 and powerpc64le: - ;; https://github.com/rust-lang/rust/issues/45410 - (("fn test_loading_cosine") "#[ignore]\nfn test_loading_cosine")) - ;; This test fails on aarch64 with llvm@6.0: - ;; https://github.com/rust-lang/rust/issues/49807 - ;; other possible solution: - ;; https://github.com/rust-lang/rust/pull/47688 - (delete-file - "src/test/debuginfo/by-value-self-argument-in-trait-impl.rs"))) - (add-after 'patch-tests 'remove-unsupported-tests - (lambda* _ - ;; Our ld-wrapper cannot process non-UTF8 bytes in LIBRARY_PATH. - ;; - (delete-file-recursively - "src/test/run-make-fulldeps/linker-output-non-utf8"))) - (add-after 'patch-tests 'disable-amd64-avx-test - (lambda _ - (substitute* (match (find-files "." "^issue-44056.rs$") - ((file) file)) - (("only-x86_64") "ignore-test")))) - (add-after 'patch-tests 'patch-cargo-tests - (lambda _ - (substitute* '("src/tools/cargo/tests/testsuite/build.rs" - "src/tools/cargo/tests/testsuite/fix.rs") - (("/usr/bin/env") - (which "env"))) - (substitute* "src/tools/cargo/tests/testsuite/death.rs" - ;; This is stuck when built in container. - (("fn ctrl_c_kills_everyone") - "#[ignore]\nfn ctrl_c_kills_everyone")) - ;; Prints test output in the wrong order when built on - ;; i686-linux. - (substitute* "src/tools/cargo/tests/testsuite/test.rs" - (("fn cargo_test_env") - "#[ignore]\nfn cargo_test_env")) - - ;; These tests pull in a dependency on "git", which changes - ;; too frequently take part in the Rust toolchain. - (substitute* "src/tools/cargo/tests/testsuite/new.rs" - (("fn author_prefers_cargo") - "#[ignore]\nfn author_prefers_cargo") - (("fn finds_author_git") - "#[ignore]\nfn finds_author_git") - (("fn finds_local_author_git") - "#[ignore]\nfn finds_local_author_git")))) - (add-after 'patch-cargo-tests 'patch-cargo-env-shebang - (lambda* (#:key inputs #:allow-other-keys) - (let ((coreutils (assoc-ref inputs "coreutils"))) - (substitute* "src/tools/cargo/tests/testsuite/fix.rs" - ;; Cargo has a test which explicitly sets a - ;; RUSTC_WRAPPER environment variable which points - ;; to /usr/bin/env. Since it's not a shebang, it - ;; needs to be manually patched - (("\"/usr/bin/env\"") - (string-append "\"" coreutils "/bin/env\"")))))) - (add-after 'patch-cargo-env-shebang 'ignore-cargo-package-tests - (lambda* _ - (substitute* "src/tools/cargo/tests/testsuite/package.rs" - ;; These tests largely check that cargo outputs warning/error - ;; messages as expected. It seems that cargo outputs an - ;; absolute path to something in the store instead of the - ;; expected relative path (e.g. `[..]`) so we'll ignore - ;; these for now - (("fn include") "#[ignore]\nfn include") - (("fn exclude") "#[ignore]\nfn exclude")))) (add-after 'patch-generated-file-shebangs 'patch-cargo-checksums (lambda* _ (use-modules (guix build cargo-utils)) @@ -484,11 +350,9 @@ safety and thread safety guarantees.") (replace 'configure (lambda* (#:key inputs outputs #:allow-other-keys) (let* ((out (assoc-ref outputs "out")) - (doc (assoc-ref outputs "doc")) (gcc (assoc-ref inputs "gcc")) - (gdb (assoc-ref inputs "gdb")) - (binutils (assoc-ref inputs "binutils")) (python (assoc-ref inputs "python")) + (binutils (assoc-ref inputs "binutils")) (rustc (assoc-ref inputs "rustc-bootstrap")) (cargo (assoc-ref inputs "cargo-bootstrap")) (llvm (assoc-ref inputs "llvm")) @@ -501,13 +365,11 @@ safety and thread safety guarantees.") cargo = \"" cargo "/bin/cargo" "\" rustc = \"" rustc "/bin/rustc" "\" docs = false -python = \"" python "/bin/python2" "\" -gdb = \"" gdb "/bin/gdb" "\" +python = \"" python "/bin/python" "\" vendor = true submodules = false [install] prefix = \"" out "\" -docdir = \"" doc "/share/doc/rust" "\" sysconfdir = \"etc\" [rust] default-linker = \"" gcc "/bin/gcc" "\" @@ -529,15 +391,6 @@ jemalloc = \"" jemalloc "/lib/libjemalloc_pic.a" "\" "1")))) (invoke "./x.py" job-spec "build") (invoke "./x.py" job-spec "build" "src/tools/cargo")))) - (replace 'check - (lambda* (#:key tests? parallel-build? #:allow-other-keys) - (when tests? - (let ((job-spec (string-append - "-j" (if parallel-build? - (number->string (parallel-job-count)) - "1")))) - (invoke "./x.py" job-spec "test" "-vv") - (invoke "./x.py" job-spec "test" "src/tools/cargo"))))) (replace 'install (lambda* (#:key outputs #:allow-other-keys) (let ((out (assoc-ref outputs "out")) @@ -570,13 +423,9 @@ jemalloc = \"" jemalloc "/lib/libjemalloc_pic.a" "\" `("LIBRARY_PATH" ":" suffix (,(string-append libc "/lib")))))))))) (native-inputs - `(("bison" ,bison) ; For the tests - ("cmake" ,cmake-minimal) - ("flex" ,flex) ; For the tests - ("gdb" ,gdb-9.2) ; For the tests + `(("cmake" ,cmake-minimal) ("pkg-config" ,pkg-config) ; For "cargo" - ("procps" ,procps) ; For the tests - ("python" ,python-2) ; For the tests + ("python" ,python-wrapper) ("rustc-bootstrap" ,rust-1.29) ("cargo-bootstrap" ,rust-1.29 "cargo") ("which" ,which))) @@ -607,46 +456,11 @@ safety and thread safety guarantees.") ;; Dual licensed. (license (list license:asl2.0 license:expat)))) -(define-public rust-1.31 - (let ((base-rust (rust-bootstrapped-package - rust-1.30 "1.31.1" - "0sk84ff0cklybcp0jbbxcw7lk7mrm6kb6km5nzd6m64dy0igrlli"))) - (package - (inherit base-rust) - (arguments - (substitute-keyword-arguments (package-arguments base-rust) - ((#:phases phases) - `(modify-phases ,phases - (delete 'disable-debuginfo-test) - (add-after 'configure 'enable-docs - ;; Docs are disabled in 1.30 as the doc tests fail. Re-enable - ;; them here. - (lambda* _ - (substitute* "config.toml" - (("docs = false") - "docs = true")))) - (add-after 'patch-tests 'patch-command-exec-tests - (lambda* (#:key inputs #:allow-other-keys) - (let ((coreutils (assoc-ref inputs "coreutils"))) - (substitute* (match (find-files "." "^command-exec.rs$") - ((file) file)) - ;; This test suite includes some tests that the stdlib's - ;; `Command` execution properly handles in situations - ;; where the environment or PATH variable are empty, but - ;; this fails since we don't have `echo` available at its - ;; usual FHS location. - (("Command::new\\(\"echo\"\\)") - (string-append "Command::new(\"" - coreutils "/bin/echo\")")))))) - (add-after 'patch-tests 'patch-process-docs-rev-cmd - (lambda* _ - ;; Disable some doc tests which depend on the "rev" command - ;; https://github.com/rust-lang/rust/pull/58746 - (substitute* "src/libstd/process.rs" - (("```rust") - "```rust,no_run"))))))))))) +(define rust-1.31 + (rust-bootstrapped-package + rust-1.30 "1.31.1" "0sk84ff0cklybcp0jbbxcw7lk7mrm6kb6km5nzd6m64dy0igrlli")) -(define-public rust-1.32 +(define rust-1.32 (let ((base-rust (rust-bootstrapped-package rust-1.31 "1.32.0" "0ji2l9xv53y27xy72qagggvq47gayr5lcv2jwvmfirx029vlqnac"))) @@ -661,7 +475,6 @@ safety and thread safety guarantees.") "src/tools/clang" "src/tools/lldb" "vendor/jemalloc-sys/jemalloc"))) - (patches (search-patches "rust-reproducible-builds.patch")) ;; the vendor directory has moved to the root of ;; the tarball, so we have to strip an extra prefix (patch-flags '("-p2")))) @@ -692,14 +505,11 @@ safety and thread safety guarantees.") (substitute* "config.toml" (("^jemalloc =.*$") "") (("[[]rust[]]") "\n[rust]\njemalloc=true\n")) - (setenv "JEMALLOC_OVERRIDE" (string-append - (assoc-ref inputs "jemalloc") - "/lib/libjemalloc_pic.a")))) - ;; Remove no longer relevant steps - (delete 'remove-flaky-test) - (delete 'patch-aarch64-test)))))))) + (setenv "JEMALLOC_OVERRIDE" + (string-append (assoc-ref inputs "jemalloc") + "/lib/libjemalloc_pic.a"))))))))))) -(define-public rust-1.33 +(define rust-1.33 (let ((base-rust (rust-bootstrapped-package rust-1.32 "1.33.0" "152x91mg7bz4ygligwjb05fgm1blwy2i70s2j03zc9jiwvbsh0as"))) @@ -711,31 +521,10 @@ safety and thread safety guarantees.") (patches '()) (patch-flags '("-p1")))) (inputs - ;; Upgrade to jemalloc@5.1.0 - (alist-replace "jemalloc" (list jemalloc) (package-inputs base-rust))) - (arguments - (substitute-keyword-arguments (package-arguments base-rust) - ((#:tests? _ #f) - #t) - ((#:phases phases) - `(modify-phases ,phases - (delete 'ignore-cargo-package-tests) - (add-after 'configure 'configure-test-threads - ;; Several rustc and cargo tests will fail if run on one core - ;; https://github.com/rust-lang/rust/issues/59122 - ;; https://github.com/rust-lang/cargo/issues/6746 - ;; https://github.com/rust-lang/rust/issues/58907 - (lambda* (#:key inputs #:allow-other-keys) - (setenv "RUST_TEST_THREADS" "2"))) - (add-after 'configure 'disable-codegen-tests - ;; The codegen tests fail in this version due to using LLVM - ;; 7. - (lambda _ - (substitute* "config.toml" - (("rpath = .*" all) - (string-append all "codegen-tests = false\n")))))))))))) + ;; Upgrade jemalloc. + (alist-replace "jemalloc" (list jemalloc) (package-inputs base-rust)))))) -(define-public rust-1.34 +(define rust-1.34 (let ((base-rust (rust-bootstrapped-package rust-1.33 "1.34.1" "19s09k7y5j6g3y4d2rk6kg9pvq6ml94c49w6b72dmq8p9lk8bixh"))) @@ -749,7 +538,7 @@ safety and thread safety guarantees.") "src/llvm-project" "vendor/jemalloc-sys/jemalloc")))))))) -(define-public rust-1.35 +(define rust-1.35 (let ((base-rust (rust-bootstrapped-package rust-1.34 "1.35.0" "0bbizy6b7002v1rdhrxrf5gijclbyizdhkglhp81ib3bf5x66kas"))) @@ -763,19 +552,11 @@ safety and thread safety guarantees.") `(modify-phases ,phases (delete 'disable-codegen-tests)))))))) -(define-public rust-1.36 - (let ((base-rust (rust-bootstrapped-package - rust-1.35 "1.36.0" - "06xv2p6zq03lidr0yaf029ii8wnjjqa894nkmrm6s0rx47by9i04"))) - (package - (inherit base-rust) - (arguments - (substitute-keyword-arguments (package-arguments base-rust) - ((#:phases phases) - `(modify-phases ,phases - (delete 'patch-process-docs-rev-cmd)))))))) +(define rust-1.36 + (rust-bootstrapped-package + rust-1.35 "1.36.0" "06xv2p6zq03lidr0yaf029ii8wnjjqa894nkmrm6s0rx47by9i04")) -(define-public rust-1.37 +(define rust-1.37 (let ((base-rust (rust-bootstrapped-package rust-1.36 "1.37.0" "1hrqprybhkhs6d9b5pjskfnc5z9v2l2gync7nb39qjb5s0h703hj"))) @@ -791,25 +572,16 @@ safety and thread safety guarantees.") (mkdir-p cargo-home) (setenv "CARGO_HOME" cargo-home))))))))))) -(define-public rust-1.38 +(define rust-1.38 (let ((base-rust (rust-bootstrapped-package rust-1.37 "1.38.0" "101dlpsfkq67p0hbwx4acqq6n90dj4bbprndizpgh1kigk566hk4"))) (package (inherit base-rust) (inputs - (alist-replace "llvm" (list llvm-9) (package-inputs base-rust))) - (arguments - (substitute-keyword-arguments (package-arguments base-rust) - ((#:phases phases) - `(modify-phases ,phases - (add-after 'patch-tests 'patch-command-uid-gid-test - (lambda _ - (substitute* "src/test/ui/command-uid-gid.rs" - (("/bin/sh") - (which "sh")))))))))))) + (alist-replace "llvm" (list llvm-9) (package-inputs base-rust)))))) -(define-public rust-1.39 +(define rust-1.39 (let ((base-rust (rust-bootstrapped-package rust-1.38 "1.39.0" "0mwkc1bnil2cfyf6nglpvbn2y0zfbv44zfhsd5qg4c9rm6vgd8dl"))) @@ -828,7 +600,7 @@ safety and thread safety guarantees.") (string-append name "\"" ,%cargo-reference-hash "\""))) (generate-all-checksums "vendor")))))))))) -(define-public rust-1.40 +(define rust-1.40 (let ((base-rust (rust-bootstrapped-package rust-1.39 "1.40.0" "1ba9llwhqm49w7sz3z0gqscj039m53ky9wxzhaj11z6yg1ah15yx"))) @@ -842,34 +614,21 @@ safety and thread safety guarantees.") (snippet '(for-each delete-file-recursively '("src/llvm-project" "vendor/jemalloc-sys/jemalloc"))))) - (arguments - ;; Rust 1.40 does not ship rustc-internal libraries by default - ;; (see rustc-dev-split). This means that librustc_driver.so is no - ;; longer available in lib/rustlib/$target/lib, which is the directory - ;; included in the runpath of librustc_codegen_llvm-llvm.so. - ;; This is detected by our validate-runpath phase as an error, but it - ;; is harmless as the codegen backend is loaded by librustc_driver.so - ;; itself, which must at that point have been already loaded. - ;; As such, we skip validating the runpath for Rust 1.40. - ;; Rust 1.41 stopped putting the codegen backend in a separate library, - ;; which makes this workaround only necessary for this release. - (substitute-keyword-arguments (package-arguments base-rust) + ;; Rust 1.40 does not ship rustc-internal libraries by default (see + ;; rustc-dev-split). This means that librustc_driver.so is no longer + ;; available in lib/rustlib/$target/lib, which is the directory + ;; included in the runpath of librustc_codegen_llvm-llvm.so. This is + ;; detected by our validate-runpath phase as an error, but it is + ;; harmless as the codegen backend is loaded by librustc_driver.so + ;; itself, which must at that point have been already loaded. As such, + ;; we skip validating the runpath for Rust 1.40. Rust 1.41 stopped + ;; putting the codegen backend in a separate library, which makes this + ;; workaround only necessary for this release. + (arguments (substitute-keyword-arguments (package-arguments base-rust) ((#:validate-runpath? _ #f) - #f) - ((#:phases phases) - `(modify-phases ,phases - (replace 'patch-command-uid-gid-test - (lambda _ - (substitute* (match (find-files "src/test" - "^command-uid-gid\\.rs$") - ((file) file)) - (("/bin/sh") - (which "sh"))))) - ;; The test got removed in commit 000fe63b6fc57b09828930cacbab20c2ee6e6d15 - ;; "Remove painful test that is not pulling its weight" - (delete 'remove-unsupported-tests)))))))) + #f)))))) -(define-public rust-1.41 +(define rust-1.41 (let ((base-rust (rust-bootstrapped-package rust-1.40 "1.41.1" "0ws5x0fxv57fyllsa6025h3q6j9v3m8nb3syl4x0hgkddq0kvj9q"))) @@ -880,33 +639,19 @@ safety and thread safety guarantees.") ((#:validate-runpath? _ #t) #t)))))) -(define-public rust-1.42 +(define rust-1.42 (rust-bootstrapped-package rust-1.41 "1.42.0" "0x9lxs82may6c0iln0b908cxyn1cv7h03n5cmbx3j1bas4qzks6j")) -(define-public rust-1.43 +(define rust-1.43 (rust-bootstrapped-package rust-1.42 "1.43.0" "18akhk0wz1my6y9vhardriy2ysc482z0fnjdcgs9gy59kmnarxkm")) -(define-public rust-1.44 - (let ((base-rust (rust-bootstrapped-package - rust-1.43 "1.44.1" - "0ww4z2v3gxgn3zddqzwqya1gln04p91ykbrflnpdbmcd575n8bky"))) - (package - (inherit base-rust) - ;; Rust 1.44 gained support to use Python 3 for testing. - (native-inputs - (alist-replace "python" (list python-wrapper) (package-native-inputs base-rust))) - (arguments (substitute-keyword-arguments (package-arguments base-rust) - ((#:phases phases) - `(modify-phases ,phases - (add-after 'configure 'use-python3 - (lambda _ - (substitute* "config.toml" - (("/bin/python2") - "/bin/python"))))))))))) +(define rust-1.44 + (rust-bootstrapped-package + rust-1.43 "1.44.1" "0ww4z2v3gxgn3zddqzwqya1gln04p91ykbrflnpdbmcd575n8bky")) -(define-public rust-1.45 +(define rust-1.45 (let ((base-rust (rust-bootstrapped-package rust-1.44 "1.45.2" "0273a1g3f59plyi1n0azf21qjzwml1yqdnj5z472crz37qggr8xp"))) @@ -922,26 +667,9 @@ safety and thread safety guarantees.") (lambda _ (substitute* (find-files "." "^linker.rs$") (("linker.env\\(\"LC_ALL\", \"C\"\\);") - "linker.env(\"LC_ALL\", \"en_US.UTF-8\");")))) - ;; These tests make sure that the parser behaves properly when - ;; a source file starts with a shebang. Unfortunately, - ;; the patch-shebangs phase changes the meaning of these edge-cases. - ;; We skip the test since it's drastically unlikely Guix's packaging - ;; will introduce a bug here. - (add-after 'patch-tests 'skip-shebang-tests - (lambda _ - (with-directory-excursion "src/test/ui/parser/shebang" - (delete-file "shebang-doc-comment.rs") - (delete-file "sneaky-attrib.rs")))) - ;; This test case synchronizes itself by starting a localhost TCP - ;; server. This doesn't work as networking is not available. - (add-after 'patch-tests 'skip-networking-test - (lambda _ - (substitute* "src/tools/cargo/tests/testsuite/freshness.rs" - (("fn linking_interrupted" all) - (string-append "#[ignore] " all)))))))))))) + "linker.env(\"LC_ALL\", \"en_US.UTF-8\");"))))))))))) -(define-public rust-1.46 +(define rust-1.46 (let ((base-rust (rust-bootstrapped-package rust-1.45 "1.46.0" "0a17jby2pd050s24cy4dfc0gzvgcl585v3vvyfilniyvjrqknsid"))) @@ -988,43 +716,95 @@ safety and thread safety guarantees.") (format #f "prefix = ~s" (assoc-ref outputs "rustfmt")))) (invoke "./x.py" "install" "rustfmt")))))))))) -(define-public rust-1.47 +(define rust-1.47 (let ((base-rust (rust-bootstrapped-package rust-1.46 "1.47.0" "07fqd2vp7cf1ka3hr207dnnz93ymxml4935vp74g4is79h3dz19i"))) (package (inherit base-rust) (inputs - (alist-replace "llvm" (list llvm-11) (package-inputs base-rust))) - (arguments - (substitute-keyword-arguments (package-arguments base-rust) - ((#:phases phases) - `(modify-phases ,phases - ;; The source code got rearranged: libstd is now in the newly created library folder. - (replace 'patch-tests - (lambda* (#:key inputs #:allow-other-keys) - (let ((bash (assoc-ref inputs "bash"))) - (substitute* "library/std/src/process.rs" - (("\"/bin/sh\"") (string-append "\"" bash "/bin/sh\""))) - ;; - (substitute* "library/std/src/sys/unix/process/process_common.rs" - (("fn test_process_mask") - "#[allow(unused_attributes)] - #[ignore] - fn test_process_mask")))))))))))) + (alist-replace "llvm" (list llvm-11) (package-inputs base-rust)))))) -(define-public rust-1.48 +(define rust-1.48 + (rust-bootstrapped-package + rust-1.47 "1.48.0" "0fz4gbb5hp5qalrl9lcl8yw4kk7ai7wx511jb28nypbxninkwxhf")) + +;;; Note: Only the current version of rust is supported and tested. The +;;; other, intermediate rusts built for bootstrapping purposes should be +;;; private and stripped from any test fixing patches or phases. This is to +;;; ease maintenance and reduce the time required to build the full Rust +;;; bootstrap chain. +(define-public rust (let ((base-rust (rust-bootstrapped-package - rust-1.47 "1.48.0" - "0fz4gbb5hp5qalrl9lcl8yw4kk7ai7wx511jb28nypbxninkwxhf"))) + rust-1.48 "1.49.0" + "0yf7kll517398dgqsr7m3gldzj0iwsp3ggzxrayckpqzvylfy2mm"))) (package (inherit base-rust) + (outputs (cons "doc" (package-outputs base-rust))) (arguments (substitute-keyword-arguments (package-arguments base-rust) + ((#:tests? _ #f) + #t) ((#:phases phases) `(modify-phases ,phases - ;; Some tests got split out into separate files. - (replace 'patch-tests + (add-after 'unpack 'relax-gdb-auto-load-safe-path + ;; Allow GDB to load binaries from any location, otherwise the + ;; gdbinfo tests fail. This is only useful when testing with a + ;; GDB version newer than 8.2. + (lambda _ + (setenv "HOME" (getcwd)) + (with-output-to-file (string-append (getenv "HOME") "/.gdbinit") + (lambda _ + (format #t "set auto-load safe-path /~%"))) + ;; Do not launch gdb with '-nx' which causes it to not execute + ;; any init file. + (substitute* "src/tools/compiletest/src/runtest.rs" + (("\"-nx\".as_ref\\(\\), ") + "")))) + (add-after 'unpack 'patch-cargo-env-shebang + (lambda _ + (substitute* '("src/tools/cargo/tests/testsuite/build.rs" + "src/tools/cargo/tests/testsuite/fix.rs") + ;; The cargo *_wrapper tests set RUSTC.*WRAPPER environment + ;; variable which points to /usr/bin/env. Since it's not a + ;; shebang, it needs to be manually patched. + (("/usr/bin/env") + (which "env"))))) + (add-after 'unpack 'disable-tests-requiring-git + (lambda _ + (substitute* "src/tools/cargo/tests/testsuite/new.rs" + (("fn author_prefers_cargo") + "#[ignore]\nfn author_prefers_cargo") + (("fn finds_author_git") + "#[ignore]\nfn finds_author_git") + (("fn finds_local_author_git") + "#[ignore]\nfn finds_local_author_git")))) + (add-after 'unpack 'patch-command-exec-tests + ;; This test suite includes some tests that the stdlib's + ;; `Command` execution properly handles in situations where + ;; the environment or PATH variable are empty, but this fails + ;; since we don't have `echo` available at its usual FHS + ;; location. + (lambda _ + (substitute* (match (find-files "." "^command-exec.rs$") + ((file) file)) + (("Command::new\\(\"echo\"\\)") + (format #f "Command::new(~s)" (which "echo")))))) + (add-after 'unpack 'patch-command-uid-gid-test + (lambda _ + (substitute* (match (find-files "." "^command-uid-gid.rs$") + ((file) file)) + (("/bin/sh") + (which "sh"))))) + (add-after 'unpack 'skip-shebang-tests + ;; This test make sure that the parser behaves properly when a + ;; source file starts with a shebang. Unfortunately, the + ;; patch-shebangs phase changes the meaning of these edge-cases. + ;; We skip the test since it's drastically unlikely Guix's + ;; packaging will introduce a bug here. + (lambda _ + (delete-file "src/test/ui/parser/shebang/sneaky-attrib.rs"))) + (add-after 'unpack 'patch-process-tests (lambda* (#:key inputs #:allow-other-keys) (let ((bash (assoc-ref inputs "bash"))) (substitute* "library/std/src/process/tests.rs" @@ -1034,10 +814,35 @@ safety and thread safety guarantees.") (("fn test_process_mask") "#[allow(unused_attributes)] #[ignore] - fn test_process_mask")))))))))))) - -(define-public rust-1.49 - (rust-bootstrapped-package - rust-1.48 "1.49.0" "0yf7kll517398dgqsr7m3gldzj0iwsp3ggzxrayckpqzvylfy2mm")) - -(define-public rust rust-1.49) + fn test_process_mask"))))) + (add-after 'unpack 'disable-interrupt-tests + (lambda _ + ;; This test hangs in the build container; disable it. + (substitute* (match (find-files "." "^freshness.rs$") + ((file) file)) + (("fn linking_interrupted") + "#[ignore]\nfn linking_interrupted")) + ;; Likewise for the ctrl_c_kills_everyone test. + (substitute* (match (find-files "." "^death.rs$") + ((file) file)) + (("fn ctrl_c_kills_everyone") + "#[ignore]\nfn ctrl_c_kills_everyone")))) + (add-after 'configure 'enable-docs + (lambda _ + (substitute* "config.toml" + (("docs = false") + "docs = true")))) + (add-after 'configure 'add-gdb-to-config + (lambda* (#:key inputs #:allow-other-keys) + (let ((gdb (assoc-ref inputs "gdb"))) + (substitute* "config.toml" + (("^python =.*" all) + (string-append all + "gdb = \"" gdb "/bin/gdb\"\n")))))))))) + ;; Add test inputs. + (native-inputs (cons* + ;; The tests fail when using GDB 10 (see: + ;; https://github.com/rust-lang/rust/issues/79009). + `("gdb" ,gdb-9.2) + `("procps" ,procps) + (package-native-inputs base-rust)))))) -- cgit v1.2.3 From 001fc29b43fd0beb365d536774fae96624309413 Mon Sep 17 00:00:00 2001 From: Chris Marusich Date: Sun, 7 Mar 2021 15:58:19 -0800 Subject: gnu: rust: Make it "supported" on all systems but i686-linux. * gnu/packages/rust.scm (rust-1.30)[supported-systems]: Instead of hard-coding this to just "x86_64-linux", calculate the supported systems by deleting "i686-linux" from %supported-systems. --- gnu/packages/rust.scm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'gnu/packages/rust.scm') diff --git a/gnu/packages/rust.scm b/gnu/packages/rust.scm index 9efe19e1a2..d7bf149d89 100644 --- a/gnu/packages/rust.scm +++ b/gnu/packages/rust.scm @@ -448,7 +448,9 @@ jemalloc = \"" jemalloc "/lib/libjemalloc_pic.a" "\" (search-path-specification (variable "LIBRARY_PATH") (files '("lib" "lib64"))))) - (supported-systems '("x86_64-linux")) + (supported-systems + (delete "i686-linux" ; fails to build, see bug #35519 + %supported-systems)) (synopsis "Compiler for the Rust progamming language") (description "Rust is a systems programming language that provides memory safety and thread safety guarantees.") -- cgit v1.2.3 From 145eba0965e81cb95b8632237cb27217307957e3 Mon Sep 17 00:00:00 2001 From: Efraim Flashner Date: Mon, 19 Apr 2021 14:27:15 +0300 Subject: gnu: rust: Re-use llvm versions. * gnu/packages/rust.scm (rust-1.35)[inputs]: Don't replace llvm. (rust-1.38)[inputs]: Same. (rust-1.44)[inputs]: Switch to llvm-10. (rust-1.45)[inputs]: Don't replace llvm. (rust-1.47)[inputs]: Same. --- gnu/packages/rust.scm | 37 +++++++++++++++---------------------- 1 file changed, 15 insertions(+), 22 deletions(-) (limited to 'gnu/packages/rust.scm') diff --git a/gnu/packages/rust.scm b/gnu/packages/rust.scm index 162371026c..cc056456e9 100644 --- a/gnu/packages/rust.scm +++ b/gnu/packages/rust.scm @@ -4,7 +4,7 @@ ;;; Copyright © 2016 Nikita ;;; Copyright © 2017 Ben Woodcroft ;;; Copyright © 2017, 2018 Nikolai Merinov -;;; Copyright © 2017, 2019, 2020 Efraim Flashner +;;; Copyright © 2017, 2019, 2020, 2021 Efraim Flashner ;;; Copyright © 2018, 2019 Tobias Geerinckx-Rice ;;; Copyright © 2018 Danny Milosavljevic ;;; Copyright © 2019 Ivan Petkov @@ -157,6 +157,7 @@ `(("libcurl" ,curl) ("libssh2" ,libssh2) ;; Use llvm-7, which enables rust to be built reproducibly. + ;; Versions newer than 7 fail to compile. ("llvm" ,llvm-7) ("openssl" ,openssl) ("zlib" ,zlib))) @@ -546,8 +547,6 @@ safety and thread safety guarantees.") "0bbizy6b7002v1rdhrxrf5gijclbyizdhkglhp81ib3bf5x66kas"))) (package (inherit base-rust) - (inputs - (alist-replace "llvm" (list llvm-8) (package-inputs base-rust))) (arguments (substitute-keyword-arguments (package-arguments base-rust) ((#:phases phases) @@ -575,13 +574,8 @@ safety and thread safety guarantees.") (setenv "CARGO_HOME" cargo-home))))))))))) (define rust-1.38 - (let ((base-rust (rust-bootstrapped-package - rust-1.37 "1.38.0" - "101dlpsfkq67p0hbwx4acqq6n90dj4bbprndizpgh1kigk566hk4"))) - (package - (inherit base-rust) - (inputs - (alist-replace "llvm" (list llvm-9) (package-inputs base-rust)))))) + (rust-bootstrapped-package + rust-1.37 "1.38.0" "101dlpsfkq67p0hbwx4acqq6n90dj4bbprndizpgh1kigk566hk4")) (define rust-1.39 (let ((base-rust (rust-bootstrapped-package @@ -649,9 +643,15 @@ safety and thread safety guarantees.") (rust-bootstrapped-package rust-1.42 "1.43.0" "18akhk0wz1my6y9vhardriy2ysc482z0fnjdcgs9gy59kmnarxkm")) +;; This version needs llvm >= 8.0 and NOT 11 (define rust-1.44 - (rust-bootstrapped-package - rust-1.43 "1.44.1" "0ww4z2v3gxgn3zddqzwqya1gln04p91ykbrflnpdbmcd575n8bky")) + (let ((base-rust (rust-bootstrapped-package + rust-1.43 "1.44.1" + "0ww4z2v3gxgn3zddqzwqya1gln04p91ykbrflnpdbmcd575n8bky"))) + (package + (inherit base-rust) + (inputs + (alist-replace "llvm" (list llvm-10) (package-inputs base-rust)))))) (define rust-1.45 (let ((base-rust (rust-bootstrapped-package @@ -659,8 +659,6 @@ safety and thread safety guarantees.") "0273a1g3f59plyi1n0azf21qjzwml1yqdnj5z472crz37qggr8xp"))) (package (inherit base-rust) - (inputs - (alist-replace "llvm" (list llvm-10) (package-inputs base-rust))) (arguments (substitute-keyword-arguments (package-arguments base-rust) ((#:phases phases) @@ -718,14 +716,9 @@ safety and thread safety guarantees.") (format #f "prefix = ~s" (assoc-ref outputs "rustfmt")))) (invoke "./x.py" "install" "rustfmt")))))))))) -(define-public rust-1.47 - (let ((base-rust (rust-bootstrapped-package - rust-1.46 "1.47.0" - "07fqd2vp7cf1ka3hr207dnnz93ymxml4935vp74g4is79h3dz19i"))) - (package - (inherit base-rust) - (inputs - (alist-replace "llvm" (list llvm-11) (package-inputs base-rust)))))) +(define rust-1.47 + (rust-bootstrapped-package + rust-1.46 "1.47.0" "07fqd2vp7cf1ka3hr207dnnz93ymxml4935vp74g4is79h3dz19i")) (define rust-1.48 (rust-bootstrapped-package -- cgit v1.2.3 From 8f18a09857149d35db2bdc0d58f843e17af6e7d9 Mon Sep 17 00:00:00 2001 From: Marius Bakke Date: Sun, 9 May 2021 11:54:39 +0200 Subject: gnu: Rust: Export all versions. * gnu/packages/rust.scm (rust-1.29, rust-1.30, rust-1.31, rust-1.32, rust-1.33, rust-1.34, rust-1.35, rust-1.36, rust-1.37, rust-1.38, rust-1.39, rust-1.40, rust-1.41, rust-1.42, rust-1.43, rust-1.44, rust-1.45, rust-1.46, rust-1.47, rust-1.48): Export. (rust): Rename to .... rust-1.49): ... this. (rust-1.50): Refer to RUST-1.49 instead of RUST. (rust): Turn into alias for RUST-1.49. --- gnu/packages/rust.scm | 55 ++++++++++++++++++++++++++------------------------- 1 file changed, 28 insertions(+), 27 deletions(-) (limited to 'gnu/packages/rust.scm') diff --git a/gnu/packages/rust.scm b/gnu/packages/rust.scm index cc056456e9..636420e25d 100644 --- a/gnu/packages/rust.scm +++ b/gnu/packages/rust.scm @@ -134,7 +134,7 @@ ;;; Rust 1.29 is special in that it is built with mrustc, which shortens the ;;; bootstrap path. Note: the build is non-deterministic. -(define rust-1.29 +(define-public rust-1.29 (package (name "rust") (version "1.29.2") @@ -291,7 +291,7 @@ safety and thread safety guarantees.") ;; Dual licensed. (license (list license:asl2.0 license:expat)))) -(define rust-1.30 +(define-public rust-1.30 (package (name "rust") (version "1.30.1") @@ -459,11 +459,11 @@ safety and thread safety guarantees.") ;; Dual licensed. (license (list license:asl2.0 license:expat)))) -(define rust-1.31 +(define-public rust-1.31 (rust-bootstrapped-package rust-1.30 "1.31.1" "0sk84ff0cklybcp0jbbxcw7lk7mrm6kb6km5nzd6m64dy0igrlli")) -(define rust-1.32 +(define-public rust-1.32 (let ((base-rust (rust-bootstrapped-package rust-1.31 "1.32.0" "0ji2l9xv53y27xy72qagggvq47gayr5lcv2jwvmfirx029vlqnac"))) @@ -512,7 +512,7 @@ safety and thread safety guarantees.") (string-append (assoc-ref inputs "jemalloc") "/lib/libjemalloc_pic.a"))))))))))) -(define rust-1.33 +(define-public rust-1.33 (let ((base-rust (rust-bootstrapped-package rust-1.32 "1.33.0" "152x91mg7bz4ygligwjb05fgm1blwy2i70s2j03zc9jiwvbsh0as"))) @@ -527,7 +527,7 @@ safety and thread safety guarantees.") ;; Upgrade jemalloc. (alist-replace "jemalloc" (list jemalloc) (package-inputs base-rust)))))) -(define rust-1.34 +(define-public rust-1.34 (let ((base-rust (rust-bootstrapped-package rust-1.33 "1.34.1" "19s09k7y5j6g3y4d2rk6kg9pvq6ml94c49w6b72dmq8p9lk8bixh"))) @@ -541,7 +541,7 @@ safety and thread safety guarantees.") "src/llvm-project" "vendor/jemalloc-sys/jemalloc")))))))) -(define rust-1.35 +(define-public rust-1.35 (let ((base-rust (rust-bootstrapped-package rust-1.34 "1.35.0" "0bbizy6b7002v1rdhrxrf5gijclbyizdhkglhp81ib3bf5x66kas"))) @@ -553,11 +553,11 @@ safety and thread safety guarantees.") `(modify-phases ,phases (delete 'disable-codegen-tests)))))))) -(define rust-1.36 +(define-public rust-1.36 (rust-bootstrapped-package rust-1.35 "1.36.0" "06xv2p6zq03lidr0yaf029ii8wnjjqa894nkmrm6s0rx47by9i04")) -(define rust-1.37 +(define-public rust-1.37 (let ((base-rust (rust-bootstrapped-package rust-1.36 "1.37.0" "1hrqprybhkhs6d9b5pjskfnc5z9v2l2gync7nb39qjb5s0h703hj"))) @@ -573,11 +573,11 @@ safety and thread safety guarantees.") (mkdir-p cargo-home) (setenv "CARGO_HOME" cargo-home))))))))))) -(define rust-1.38 +(define-public rust-1.38 (rust-bootstrapped-package rust-1.37 "1.38.0" "101dlpsfkq67p0hbwx4acqq6n90dj4bbprndizpgh1kigk566hk4")) -(define rust-1.39 +(define-public rust-1.39 (let ((base-rust (rust-bootstrapped-package rust-1.38 "1.39.0" "0mwkc1bnil2cfyf6nglpvbn2y0zfbv44zfhsd5qg4c9rm6vgd8dl"))) @@ -596,7 +596,7 @@ safety and thread safety guarantees.") (string-append name "\"" ,%cargo-reference-hash "\""))) (generate-all-checksums "vendor")))))))))) -(define rust-1.40 +(define-public rust-1.40 (let ((base-rust (rust-bootstrapped-package rust-1.39 "1.40.0" "1ba9llwhqm49w7sz3z0gqscj039m53ky9wxzhaj11z6yg1ah15yx"))) @@ -624,7 +624,7 @@ safety and thread safety guarantees.") ((#:validate-runpath? _ #f) #f)))))) -(define rust-1.41 +(define-public rust-1.41 (let ((base-rust (rust-bootstrapped-package rust-1.40 "1.41.1" "0ws5x0fxv57fyllsa6025h3q6j9v3m8nb3syl4x0hgkddq0kvj9q"))) @@ -635,16 +635,16 @@ safety and thread safety guarantees.") ((#:validate-runpath? _ #t) #t)))))) -(define rust-1.42 +(define-public rust-1.42 (rust-bootstrapped-package rust-1.41 "1.42.0" "0x9lxs82may6c0iln0b908cxyn1cv7h03n5cmbx3j1bas4qzks6j")) -(define rust-1.43 +(define-public rust-1.43 (rust-bootstrapped-package rust-1.42 "1.43.0" "18akhk0wz1my6y9vhardriy2ysc482z0fnjdcgs9gy59kmnarxkm")) ;; This version needs llvm >= 8.0 and NOT 11 -(define rust-1.44 +(define-public rust-1.44 (let ((base-rust (rust-bootstrapped-package rust-1.43 "1.44.1" "0ww4z2v3gxgn3zddqzwqya1gln04p91ykbrflnpdbmcd575n8bky"))) @@ -653,7 +653,7 @@ safety and thread safety guarantees.") (inputs (alist-replace "llvm" (list llvm-10) (package-inputs base-rust)))))) -(define rust-1.45 +(define-public rust-1.45 (let ((base-rust (rust-bootstrapped-package rust-1.44 "1.45.2" "0273a1g3f59plyi1n0azf21qjzwml1yqdnj5z472crz37qggr8xp"))) @@ -669,7 +669,7 @@ safety and thread safety guarantees.") (("linker.env\\(\"LC_ALL\", \"C\"\\);") "linker.env(\"LC_ALL\", \"en_US.UTF-8\");"))))))))))) -(define rust-1.46 +(define-public rust-1.46 (let ((base-rust (rust-bootstrapped-package rust-1.45 "1.46.0" "0a17jby2pd050s24cy4dfc0gzvgcl585v3vvyfilniyvjrqknsid"))) @@ -716,20 +716,15 @@ safety and thread safety guarantees.") (format #f "prefix = ~s" (assoc-ref outputs "rustfmt")))) (invoke "./x.py" "install" "rustfmt")))))))))) -(define rust-1.47 +(define-public rust-1.47 (rust-bootstrapped-package rust-1.46 "1.47.0" "07fqd2vp7cf1ka3hr207dnnz93ymxml4935vp74g4is79h3dz19i")) -(define rust-1.48 +(define-public rust-1.48 (rust-bootstrapped-package rust-1.47 "1.48.0" "0fz4gbb5hp5qalrl9lcl8yw4kk7ai7wx511jb28nypbxninkwxhf")) -;;; Note: Only the current version of rust is supported and tested. The -;;; other, intermediate rusts built for bootstrapping purposes should be -;;; private and stripped from any test fixing patches or phases. This is to -;;; ease maintenance and reduce the time required to build the full Rust -;;; bootstrap chain. -(define-public rust +(define-public rust-1.49 (let ((base-rust (rust-bootstrapped-package rust-1.48 "1.49.0" "0yf7kll517398dgqsr7m3gldzj0iwsp3ggzxrayckpqzvylfy2mm"))) @@ -843,9 +838,15 @@ safety and thread safety guarantees.") (package-native-inputs base-rust)))))) (define-public rust-1.50 - (rust-bootstrapped-package rust "1.50.0" + (rust-bootstrapped-package rust-1.49 "1.50.0" "0pjs7j62maiyvkmhp9zrxl528g2n0fphp4rq6ap7aqdv0a6qz5wm")) (define-public rust-1.51 (rust-bootstrapped-package rust-1.50 "1.51.0" "0ixqkqglv3isxbvl4ldr4byrkx692wghsz3fasy1pn5kr2prnsvs")) + +;;; Note: Only the latest versions of Rust are supported and tested. The +;;; intermediate rusts are built for bootstrapping purposes and should not +;;; be relied upon. This is to ease maintenance and reduce the time +;;; required to build the full Rust bootstrap chain. +(define-public rust rust-1.49) -- cgit v1.2.3 From 377e9453caf16417fc4ec8a2b65db1ac4ba0d5ff Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Fri, 16 Jul 2021 16:19:35 +0200 Subject: gnu: Use 'search-input-file' when looking for *.so and *.a. * gnu/packages/bioinformatics.scm (sailfish)[arguments]: Use 'search-input-file' when looking for *.a and *.so. * gnu/packages/emulators.scm (dolphin-emu): Likewise. * gnu/packages/engineering.scm (lepton-eda): Likewise. (pcb): Likewise. * gnu/packages/golang.scm (go-1.4): Likewise. (go-1.14): Likewise. * gnu/packages/haskell.scm (ghc-7): Likewise. * gnu/packages/irods.scm (irods): Likewise. * gnu/packages/language.scm (python2-tegaki-pygtk): Likewise. * gnu/packages/lisp-xyz.scm (sbcl-lzlib): Likewise. (sbcl-cl-gobject-introspection): Likewise. (sbcl-cl-ana): Likewise. (sbcl-cl-libuv): Likewise. (sbcl-cl-async): Likewise. (sbcl-mcclim): Likewise. (sbcl-zstd): Likewise. (sbcl-cl-opengl): Likewise. (sbcl-lev): Likewise. (sbcl-cl-glfw3): Likewise. * gnu/packages/machine-learning.scm (tensorflow): Likewise. * gnu/packages/messaging.scm (utox): Likewise. * gnu/packages/mpi.scm (java-openmpi): Likewise. * gnu/packages/music.scm (jack-select): Likewise. * gnu/packages/pascal.scm (fpc): Likewise. * gnu/packages/python-crypto.scm (python-libnacl): Likewise. * gnu/packages/python-xyz.scm (python-cairocffi): Likewise. (python-pyev): Likewise. (python-pytidylib): Likewise. * gnu/packages/radio.scm (unixcw): Likewise. * gnu/packages/rust.scm (rust-1.32): Likewise. * gnu/packages/security-token.scm (opensc): Likewise. (python-pyscard): Likewise. * gnu/packages/selinux.scm (python-setools): Likewise. * gnu/packages/spice.scm (libcacard): Likewise. * gnu/packages/telephony.scm (libtgvoip): Likewise. --- gnu/packages/bioinformatics.scm | 12 +++++----- gnu/packages/emulators.scm | 3 +-- gnu/packages/engineering.scm | 12 ++++------ gnu/packages/golang.scm | 4 ++-- gnu/packages/haskell.scm | 7 +++--- gnu/packages/irods.scm | 2 +- gnu/packages/language.scm | 7 +++--- gnu/packages/lisp-xyz.scm | 50 ++++++++++++++------------------------- gnu/packages/machine-learning.scm | 15 ++++-------- gnu/packages/messaging.scm | 3 +-- gnu/packages/mpi.scm | 3 +-- gnu/packages/music.scm | 4 +--- gnu/packages/pascal.scm | 6 ++--- gnu/packages/python-crypto.scm | 4 +--- gnu/packages/python-xyz.scm | 22 ++++++----------- gnu/packages/radio.scm | 3 +-- gnu/packages/rust.scm | 4 ++-- gnu/packages/security-token.scm | 8 +++---- gnu/packages/selinux.scm | 3 +-- gnu/packages/spice.scm | 4 ++-- gnu/packages/telephony.scm | 7 ++---- 21 files changed, 70 insertions(+), 113 deletions(-) (limited to 'gnu/packages/rust.scm') diff --git a/gnu/packages/bioinformatics.scm b/gnu/packages/bioinformatics.scm index 1d359f5989..965dd91853 100644 --- a/gnu/packages/bioinformatics.scm +++ b/gnu/packages/bioinformatics.scm @@ -9481,14 +9481,14 @@ dependency like SeqAn.") inputs (string-append "/include/jellyfish-" ,(package-version jellyfish)))) (("\\$\\{GAT_SOURCE_DIR\\}/external/install/lib/libjellyfish-2.0.a") - (string-append (assoc-ref inputs "jellyfish") - "/lib/libjellyfish-2.0.a")) + (search-input-file inputs + "/lib/libjellyfish-2.0.a")) (("\\$\\{GAT_SOURCE_DIR\\}/external/install/lib/libdivsufsort.a") - (string-append (assoc-ref inputs "libdivsufsort") - "/lib/libdivsufsort.so")) + (search-input-file inputs + "/lib/libdivsufsort.so")) (("\\$\\{GAT_SOURCE_DIR\\}/external/install/lib/libdivsufsort64.a") - (string-append (assoc-ref inputs "libdivsufsort") - "/lib/libdivsufsort64.so"))) + (search-input-file inputs + "/lib/libdivsufsort64.so"))) (substitute* "CMakeLists.txt" ;; Don't prefer static libs (("SET\\(CMAKE_FIND_LIBRARY_SUFFIXES.*") "") diff --git a/gnu/packages/emulators.scm b/gnu/packages/emulators.scm index 63a91f0365..a5edc918e2 100644 --- a/gnu/packages/emulators.scm +++ b/gnu/packages/emulators.scm @@ -286,8 +286,7 @@ console.") (string-append (assoc-ref inputs "font-wqy-microhei") "/share/fonts/truetype/wqy-microhei.ttc")) (libvulkan - (string-append (assoc-ref inputs "vulkan-loader") - "/lib/libvulkan.so"))) + (search-input-file inputs "/lib/libvulkan.so"))) (chdir "docs") (invoke "bash" "-c" "g++ -O2 $(freetype-config \ --cflags --libs) gc-font-tool.cpp -o gc-font-tool") diff --git a/gnu/packages/engineering.scm b/gnu/packages/engineering.scm index aa74d691c7..4e01bf8b3e 100644 --- a/gnu/packages/engineering.scm +++ b/gnu/packages/engineering.scm @@ -335,12 +335,10 @@ utilities.") (substitute* '("libleptongui/scheme/schematic/ffi/gtk.scm.in" "utils/attrib/lepton-attrib.scm") (("@LIBGTK@") - (string-append (assoc-ref inputs "gtk") - "/lib/libgtk-3.so"))) + (search-input-file inputs "/lib/libgtk-3.so"))) (substitute* '("libleptongui/scheme/schematic/ffi/gobject.scm.in") (("@LIBGOBJECT@") - (string-append (assoc-ref inputs "glib") - "/lib/libgobject-2.0.so"))) + (search-input-file inputs "/lib/libgobject-2.0.so"))) (substitute* "liblepton/scheme/lepton/ffi.scm.in" (("@LIBLEPTON@") (string-append (assoc-ref outputs "out") @@ -351,8 +349,7 @@ utilities.") "/lib/libleptonattrib.so"))) (substitute* "liblepton/scheme/lepton/log.scm.in" (("@LIBGLIB@") - (string-append (assoc-ref inputs "glib") - "/lib/libglib-2.0.so"))) + (search-input-file inputs "/lib/libglib-2.0.so"))) ;; For finding libraries when running tests before installation. (setenv "LIBLEPTONGUI" @@ -437,7 +434,8 @@ features."))) ;; fix of the mesa package we wrap the pcb executable such that ;; Mesa can find libudev.so.0 through LD_LIBRARY_PATH. (let* ((out (assoc-ref outputs "out")) - (path (string-append (assoc-ref inputs "udev") "/lib"))) + (path (dirname + (search-input-file inputs "/lib/libudev.so")))) (wrap-program (string-append out "/bin/pcb") `("LD_LIBRARY_PATH" ":" prefix (,path)))) #t)) diff --git a/gnu/packages/golang.scm b/gnu/packages/golang.scm index 8e17e87897..703b5fc57c 100644 --- a/gnu/packages/golang.scm +++ b/gnu/packages/golang.scm @@ -1060,7 +1060,7 @@ your Go binary to be later served from an http.FileSystem.") (add-before 'build 'prebuild (lambda* (#:key inputs outputs #:allow-other-keys) (let* ((gcclib (string-append (assoc-ref inputs "gcc:lib") "/lib")) - (ld (string-append (assoc-ref inputs "libc") "/lib")) + (ld (dirname (search-input-file inputs "/lib/libc.so"))) (loader (car (find-files ld "^ld-linux.+"))) (net-base (assoc-ref inputs "net-base")) (tzdata-path @@ -1208,7 +1208,7 @@ in the style of communicating sequential processes (@dfn{CSP}).") (replace 'prebuild (lambda* (#:key inputs outputs #:allow-other-keys) (let* ((gcclib (string-append (assoc-ref inputs "gcc:lib") "/lib")) - (ld (string-append (assoc-ref inputs "libc") "/lib")) + (ld (dirname (search-input-file inputs "/lib/libc.so"))) (loader (car (find-files ld "^ld-linux.+"))) (net-base (assoc-ref inputs "net-base")) (tzdata-path diff --git a/gnu/packages/haskell.scm b/gnu/packages/haskell.scm index 09732fc594..0ddaad9d52 100644 --- a/gnu/packages/haskell.scm +++ b/gnu/packages/haskell.scm @@ -3,7 +3,7 @@ ;;; Copyright © 2015 Siniša Biđin ;;; Copyright © 2015 Paul van der Walt ;;; Copyright © 2015, 2019 Eric Bavier -;;; Copyright © 2016, 2018, 2019 Ludovic Courtès +;;; Copyright © 2016, 2018, 2019, 2021 Ludovic Courtès ;;; Copyright © 2016, 2017 Nikita ;;; Copyright © 2016 Efraim Flashner ;;; Copyright © 2015, 2016, 2017, 2018, 2019, 2020 Ricardo Wurmus @@ -246,9 +246,8 @@ top of CLISP.") (gmp-lib (string-append gmp "/lib")) (gmp-include (string-append gmp "/include")) (ncurses-lib - (string-append (assoc-ref inputs "ncurses") "/lib")) - (ld-so (string-append (assoc-ref inputs "libc") - ,(glibc-dynamic-linker))) + (dirname (search-input-file inputs "/lib/libncurses.so"))) + (ld-so (search-input-file inputs ,(glibc-dynamic-linker))) (libtinfo-dir (string-append ghc-bootstrap-prefix "/lib/ghc-7.8.4/terminfo-0.4.0.0"))) diff --git a/gnu/packages/irods.scm b/gnu/packages/irods.scm index e82888e7ae..e9ac0d5297 100644 --- a/gnu/packages/irods.scm +++ b/gnu/packages/irods.scm @@ -120,7 +120,7 @@ (("'usr', 'lib', 'irods'") "'lib', 'irods'")) (substitute* "scripts/irods/pypyodbc.py" (("\"/usr/lib/libodbc.so\"") - (string-append (assoc-ref inputs "unixodbc") "/lib/libodbc.so"))))) + (search-input-file inputs "/lib/libodbc.so"))))) (add-after 'set-paths 'adjust-CPLUS_INCLUDE_PATH (lambda* (#:key inputs #:allow-other-keys) (let ((gcc (assoc-ref inputs "gcc"))) diff --git a/gnu/packages/language.scm b/gnu/packages/language.scm index 861a92505f..1aa2d5971e 100644 --- a/gnu/packages/language.scm +++ b/gnu/packages/language.scm @@ -975,10 +975,11 @@ suitable for both the desktop and mobile devices.") (lambda* (#:key inputs #:allow-other-keys) (substitute* "tegakigtk/fakekey.py" (("libX11.so.6" so) - (string-append (assoc-ref inputs "libx11") "/lib/" so)) + (search-input-file inputs + (string-append "/lib/" so))) (("libXtst.so.6" so) - (string-append (assoc-ref inputs "libxtst") "/lib/" so))) - #t)))))) + (search-input-file inputs + (string-append "/lib/" so)))))))))) (inputs ; required for sending key strokes `(("libx11" ,libx11) ("libxtst" ,libxtst))) diff --git a/gnu/packages/lisp-xyz.scm b/gnu/packages/lisp-xyz.scm index a51691ac92..dcb520d58a 100644 --- a/gnu/packages/lisp-xyz.scm +++ b/gnu/packages/lisp-xyz.scm @@ -7248,7 +7248,7 @@ cl-plumbing libraries.") (lambda* (#:key inputs #:allow-other-keys) (substitute* "src/lzlib.lisp" (("liblz\\.so") - (string-append (assoc-ref inputs "lzlib") "/lib/liblz.so"))) + (search-input-file inputs "/lib/liblz.so"))) #t))))) (synopsis "Common Lisp library for lzip (de)compression") (description @@ -7403,11 +7403,10 @@ function.") (lambda* (#:key inputs #:allow-other-keys) (substitute* "src/init.lisp" (("libgobject-2\\.0\\.so") - (string-append (assoc-ref inputs "glib") "/lib/libgobject-2.0.so")) + (search-input-file inputs "/lib/libgobject-2.0.so")) (("libgirepository-1\\.0\\.so") - (string-append (assoc-ref inputs "gobject-introspection") - "/lib/libgirepository-1.0.so"))) - #t))))) + (search-input-file inputs + "/lib/libgirepository-1.0.so")))))))) (synopsis "Common Lisp bindings to GObject Introspection") (description "This library is a bridge between Common Lisp and GObject @@ -8565,8 +8564,7 @@ sacrificing much in the way of power.") (lambda* (#:key inputs #:allow-other-keys) (substitute* "hdf-cffi/hdf-cffi.lisp" (("/usr/lib/i386-linux-gnu/hdf5/serial/libhdf5.so") - (string-append (assoc-ref inputs "hdf5") - "/lib/libhdf5.so"))) + (search-input-file inputs "/lib/libhdf5.so"))) (substitute* "gsl-cffi/gsl-cffi.lisp" (("define-foreign-library gsl-cffi" all) (string-append all " (:unix " @@ -8896,9 +8894,7 @@ has a small codebase that's easy to understand and use.") (lambda* (#:key inputs #:allow-other-keys) (substitute* "lib.lisp" (("/usr/lib/libuv.so") - (string-append (assoc-ref inputs "libuv") - "/lib/libuv.so"))) - #t)) + (search-input-file inputs "/lib/libuv.so"))))) (add-after 'fix-paths 'fix-system-definition (lambda _ (substitute* "cl-libuv.asd" @@ -8956,12 +8952,9 @@ has a small codebase that's easy to understand and use.") (lambda* (#:key inputs #:allow-other-keys) (substitute* "src/ssl/package.lisp" (("libcrypto\\.so") - (string-append (assoc-ref inputs "openssl") - "/lib/libcrypto.so")) + (search-input-file inputs "/lib/libcrypto.so")) (("libssl\\.so") - (string-append (assoc-ref inputs "openssl") - "/lib/libssl.so"))) - #t))))) + (search-input-file inputs "/lib/libssl.so")))))))) (synopsis "Asynchronous operations for Common Lisp") (description "Cl-async is a library for general purpose, non-blocking programming in @@ -12261,13 +12254,10 @@ and saving 2-dimensional pixel-based images.") "/share/fonts/truetype/"))) (substitute* "Extensions/fontconfig/src/functions.lisp" (("libfontconfig\\.so") - (string-append (assoc-ref inputs "fontconfig") - "/lib/libfontconfig.so"))) + (search-input-file inputs "/lib/libfontconfig.so"))) (substitute* "Extensions/harfbuzz/src/functions.lisp" (("libharfbuzz\\.so") - (string-append (assoc-ref inputs "harfbuzz") - "/lib/libharfbuzz.so"))) - #t)) + (search-input-file inputs "/lib/libharfbuzz.so"))))) (add-after 'unpack 'fix-build (lambda _ ;; The cffi-grovel system does not get loaded automatically, @@ -14418,9 +14408,7 @@ library are feedforward neural networks trained using backpropagation.") (lambda* (#:key inputs #:allow-other-keys) (substitute* "src/libzstd.lisp" (("libzstd\\.so") - (string-append (assoc-ref inputs "zstd-lib") - "/lib/libzstd.so"))) - #t))))) + (search-input-file inputs "/lib/libzstd.so")))))))) (synopsis "Common Lisp library for Zstandard (de)compression") (description "This Common Lisp library provides functions for Zstandard @@ -15986,14 +15974,13 @@ compiled foreign library collection.") (lambda* (#:key inputs #:allow-other-keys) (substitute* "gl/library.lisp" (("libGL.so" all) - (string-append (assoc-ref inputs "mesa") "/lib/" all))) + (search-input-file inputs "/lib/libGL.so"))) (substitute* "glu/library.lisp" (("libGLU.so" all) - (string-append (assoc-ref inputs "glu") "/lib/" all))) + (search-input-file inputs "/lib/libGLU.so"))) (substitute* "glut/library.lisp" (("libglut.so" all) - (string-append (assoc-ref inputs "freeglut") "/lib/" all))) - #t))))) + (search-input-file inputs "/lib/libglut.so")))))))) (inputs `(("alexandria" ,sbcl-alexandria) ("cffi" ,sbcl-cffi) @@ -16926,9 +16913,8 @@ Common Lisp.") (add-after 'unpack 'patch-libev-lib-path (lambda* (#:key inputs #:allow-other-keys) (substitute* "src/lev.lisp" - (("libev.so" all) - (string-append (assoc-ref inputs "libev") - "/lib/" all)))))))) + (("libev.so" _) + (search-input-file inputs "/lib/libev.so")))))))) (inputs `(("cffi" ,sbcl-cffi) ("libev" ,libev))) @@ -17503,8 +17489,8 @@ and even allows the generic visualisation of graphs in this format.") (add-after 'unpack 'patch-glfw-lib-path (lambda* (#:key inputs #:allow-other-keys) (substitute* "glfw-bindings.lisp" - (("libglfw.so.3" all) - (string-append (assoc-ref inputs "glfw") "/lib/" all)))))))) + (("libglfw.so.3" _) + (search-input-file inputs "/lib/libglfw.so.3")))))))) (inputs `(("alexandria" ,sbcl-alexandria) ("cffi" ,sbcl-cffi) diff --git a/gnu/packages/machine-learning.scm b/gnu/packages/machine-learning.scm index 74742df442..93eee3de88 100644 --- a/gnu/packages/machine-learning.scm +++ b/gnu/packages/machine-learning.scm @@ -1588,36 +1588,31 @@ Python.") ;; Sqlite (("include\\(sqlite\\)") "") (("\\$\\{sqlite_STATIC_LIBRARIES\\}") - (string-append (assoc-ref inputs "sqlite") - "/lib/libsqlite3.so")) + (search-input-file inputs "/lib/libsqlite3.so")) (("sqlite_copy_headers_to_destination") "") ;; PNG (("include\\(png\\)") "") (("\\$\\{png_STATIC_LIBRARIES\\}") - (string-append (assoc-ref inputs "libpng") - "/lib/libpng16.so")) + (search-input-file inputs "/lib/libpng16.so")) (("png_copy_headers_to_destination") "") ;; JPEG (("include\\(jpeg\\)") "") (("\\$\\{jpeg_STATIC_LIBRARIES\\}") - (string-append (assoc-ref inputs "libjpeg") - "/lib/libjpeg.so")) + (search-input-file inputs "/lib/libjpeg.so")) (("jpeg_copy_headers_to_destination") "") ;; GIF (("include\\(gif\\)") "") (("\\$\\{gif_STATIC_LIBRARIES\\}") - (string-append (assoc-ref inputs "giflib") - "/lib/libgif.so")) + (search-input-file inputs "/lib/libgif.so")) (("gif_copy_headers_to_destination") "") ;; lmdb (("include\\(lmdb\\)") "") (("\\$\\{lmdb_STATIC_LIBRARIES\\}") - (string-append (assoc-ref inputs "lmdb") - "/lib/liblmdb.so")) + (search-input-file inputs "/lib/liblmdb.so")) (("lmdb_copy_headers_to_destination") "") ;; Protobuf diff --git a/gnu/packages/messaging.scm b/gnu/packages/messaging.scm index 173119a8b1..29f9a0d08c 100644 --- a/gnu/packages/messaging.scm +++ b/gnu/packages/messaging.scm @@ -1537,8 +1537,7 @@ messenger protocol.") (lambda* (#:key inputs outputs #:allow-other-keys) (substitute* "../source/src/xlib/gtk.c" (("libgtk-3.so") - (string-append (assoc-ref inputs "gtk+") - "/lib/libgtk-3.so"))))) + (search-input-file inputs "/lib/libgtk-3.so"))))) (add-after 'install 'wrap-program (lambda* (#:key inputs outputs #:allow-other-keys) (wrap-program (string-append (assoc-ref outputs "out") diff --git a/gnu/packages/mpi.scm b/gnu/packages/mpi.scm index af1de10377..b91afc2067 100644 --- a/gnu/packages/mpi.scm +++ b/gnu/packages/mpi.scm @@ -348,8 +348,7 @@ software vendors, application developers and computer science researchers.") (lambda* (#:key inputs #:allow-other-keys) (substitute* "ompi/mpi/java/c/Makefile.in" (("\\$\\(top_builddir\\)/ompi/lib@OMPI_LIBMPI_NAME@.la") - (string-append (assoc-ref inputs "openmpi") "/lib/libmpi.la"))) - #t)) + (search-input-file inputs "/lib/libmpi.la"))))) (add-after 'install 'strip-jar-timestamps (assoc-ref ant:%standard-phases 'strip-jar-timestamps))))))) (synopsis "Java bindings for MPI"))) diff --git a/gnu/packages/music.scm b/gnu/packages/music.scm index d1fb4ee291..7c57b45029 100644 --- a/gnu/packages/music.scm +++ b/gnu/packages/music.scm @@ -3045,9 +3045,7 @@ can connect to any JACK port and record the output into a stereo WAV file.") ;; Fix reference to dlopened libraries. (substitute* "jackselect/alsainfo.py" (("libasound.so.2") - (string-append (assoc-ref inputs "alsa-lib") - "/lib/libasound.so.2"))) - #t)) + (search-input-file inputs "/lib/libasound.so.2"))))) (replace 'build (assoc-ref python:%standard-phases 'build)) (add-after 'install 'wrap diff --git a/gnu/packages/pascal.scm b/gnu/packages/pascal.scm index 0fdbecf05c..dd9df1c199 100644 --- a/gnu/packages/pascal.scm +++ b/gnu/packages/pascal.scm @@ -150,11 +150,9 @@ (substitute* "fpcsrc/compiler/systems/t_linux.pas" ;; Point to the current glibc dynamic linker. (("/lib/ld-linux.so.2") - (string-append (assoc-ref inputs "libc") - ,(glibc-dynamic-linker))) + (search-input-file inputs ,(glibc-dynamic-linker))) (("/lib64/ld-linux-x86-64.so.2") - (string-append (assoc-ref inputs "libc") - ,(glibc-dynamic-linker))) + (search-input-file inputs ,(glibc-dynamic-linker))) ; TODO: /lib/ld-linux-armhf.so.3 ; TODO: /lib/ld-linux-aarch64.so.1 ; TODO: /lib64/ld64.so.2 diff --git a/gnu/packages/python-crypto.scm b/gnu/packages/python-crypto.scm index d3add550fe..c864835248 100644 --- a/gnu/packages/python-crypto.scm +++ b/gnu/packages/python-crypto.scm @@ -1177,9 +1177,7 @@ none of them have everything that I'd like, so here's one more. It uses (lambda* (#:key inputs #:allow-other-keys) (substitute* "libnacl/__init__.py" (("/usr/local/lib/libsodium.so") - (string-append (assoc-ref inputs "libsodium") - "/lib/libsodium.so"))) - #t))))) + (search-input-file inputs "/lib/libsodium.so")))))))) (native-inputs `(("python-pyhamcrest" ,python-pyhamcrest))) (inputs diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm index 763a8d18a3..60a0ea5f5d 100644 --- a/gnu/packages/python-xyz.scm +++ b/gnu/packages/python-xyz.scm @@ -6926,22 +6926,16 @@ support for Python 3 and PyPy. It is based on cffi.") (("filenames = \\(library_filename,\\) \\+ filenames") "pass") (("libcairo.so.2") - (string-append (assoc-ref inputs "cairo") - "/lib/libcairo.so.2"))) + (search-input-file inputs "/lib/libcairo.so.2"))) (substitute* "cairocffi/pixbuf.py" (("libgdk_pixbuf-2.0.so.0") - (string-append (assoc-ref inputs "gdk-pixbuf") - "/lib/libgdk_pixbuf-2.0.so.0")) + (search-input-file inputs "/lib/libgdk_pixbuf-2.0.so.0")) (("libgobject-2.0.so.0") - (string-append (assoc-ref inputs "glib") - "/lib/libgobject-2.0.so.0")) + (search-input-file inputs "/lib/libgobject-2.0.so.0")) (("libglib-2.0.so.0") - (string-append (assoc-ref inputs "glib") - "/lib/libglib-2.0.so.0")) + (search-input-file inputs "/lib/libglib-2.0.so.0")) (("libgdk-3.so.0") - (string-append (assoc-ref inputs "gtk+") - "/lib/libgdk-3.so.0"))) - #t)) + (search-input-file inputs "/lib/libgdk-3.so.0"))))) (add-after 'unpack 'disable-linters ;; Their check fails; none of our business. (lambda _ @@ -16131,8 +16125,7 @@ Record Format (DWARF).") (modify-phases %standard-phases (add-after 'unpack 'patch (lambda* (#:key inputs #:allow-other-keys) - (let ((libev (string-append (assoc-ref inputs "libev") - "/lib/libev.so.4"))) + (let ((libev (search-input-file inputs "/lib/libev.so.4"))) (substitute* "setup.py" (("libev_dll_name = find_library\\(\\\"ev\\\"\\)") (string-append "libev_dll_name = \"" libev "\""))))))))) @@ -24284,8 +24277,7 @@ be necessary when using @code{cmd}.") (modify-phases %standard-phases (add-before 'build 'qualify-libtidy (lambda* (#:key inputs #:allow-other-keys) - (let ((libtidy (string-append (assoc-ref inputs "tidy") - "/lib/libtidy.so"))) + (let ((libtidy (search-input-file inputs "/lib/libtidy.so"))) (substitute* "tidylib/tidy.py" (("ctypes\\.util\\.find_library\\('tidy'\\)") (format #f "'~a'" libtidy))) diff --git a/gnu/packages/radio.scm b/gnu/packages/radio.scm index 5aa27bf511..443b115d46 100644 --- a/gnu/packages/radio.scm +++ b/gnu/packages/radio.scm @@ -1651,8 +1651,7 @@ methods: "-lncurses")) (substitute* "src/libcw/libcw_pa.c" (("libpulse-simple.so" all) - (string-append (assoc-ref inputs "pulseaudio") - "/lib/" all)))))))) + (search-input-file inputs "/lib/libpulse-simple.so")))))))) (home-page "http://unixcw.sourceforge.net/") (synopsis "Morse code library and programs") (description diff --git a/gnu/packages/rust.scm b/gnu/packages/rust.scm index 64b3e5176e..0e0c33068f 100644 --- a/gnu/packages/rust.scm +++ b/gnu/packages/rust.scm @@ -509,8 +509,8 @@ safety and thread safety guarantees.") (("^jemalloc =.*$") "") (("[[]rust[]]") "\n[rust]\njemalloc=true\n")) (setenv "JEMALLOC_OVERRIDE" - (string-append (assoc-ref inputs "jemalloc") - "/lib/libjemalloc_pic.a"))))))))))) + (search-input-file inputs + "/lib/libjemalloc_pic.a"))))))))))) (define-public rust-1.33 (let ((base-rust (rust-bootstrapped-package diff --git a/gnu/packages/security-token.scm b/gnu/packages/security-token.scm index 4bd1fe585d..1d2493dbd5 100644 --- a/gnu/packages/security-token.scm +++ b/gnu/packages/security-token.scm @@ -303,8 +303,8 @@ website for more information about Yubico and the YubiKey.") ;; configuration file at runtime. (add-after 'unpack 'set-default-libpcsclite.so.1-path (lambda* (#:key inputs #:allow-other-keys) - (let ((libpcsclite (string-append (assoc-ref inputs "pcsc-lite") - "/lib/libpcsclite.so.1"))) + (let ((libpcsclite (search-input-file inputs + "/lib/libpcsclite.so.1"))) (substitute* "configure" (("DEFAULT_PCSC_PROVIDER=\"libpcsclite\\.so\\.1\"") (string-append @@ -442,8 +442,8 @@ retrieve a YubiKey's serial number, and so forth.") (("lib = \"libpcsclite\\.so\\.1\";") (simple-format #f "lib = \"~a\";" - (string-append (assoc-ref inputs "pcsc-lite") - "/lib/libpcsclite.so.1")))) + (search-input-file inputs + "/lib/libpcsclite.so.1")))) #t))))) (inputs `(("pcsc-lite" ,pcsc-lite))) diff --git a/gnu/packages/selinux.scm b/gnu/packages/selinux.scm index e7e6289d1c..8a75538d10 100644 --- a/gnu/packages/selinux.scm +++ b/gnu/packages/selinux.scm @@ -329,8 +329,7 @@ based on required access.") (add-after 'unpack 'set-SEPOL-variable (lambda* (#:key inputs #:allow-other-keys) (setenv "SEPOL" - (string-append (assoc-ref inputs "libsepol") - "/lib/libsepol.a")))) + (search-input-file inputs "/lib/libsepol.a")))) (add-after 'unpack 'remove-Werror (lambda _ (substitute* "setup.py" diff --git a/gnu/packages/spice.scm b/gnu/packages/spice.scm index 76670463d7..5c065151d1 100644 --- a/gnu/packages/spice.scm +++ b/gnu/packages/spice.scm @@ -356,8 +356,8 @@ resolution scaling on graphical console window resize.") (lambda* (#:key inputs #:allow-other-keys) (substitute* "tests/setup-softhsm2.sh" (("\\/usr\\/lib64\\/pkcs11\\/libsofthsm2\\.so") - (string-append (assoc-ref inputs "softhsm") - "/lib/softhsm/libsofthsm2.so")))))))) + (search-input-file inputs + "/lib/softhsm/libsofthsm2.so")))))))) (propagated-inputs `(("glib" ,glib) ; Requires: in the pkg-config file ("nss" ,nss))) ; Requires.private: in the pkg-config diff --git a/gnu/packages/telephony.scm b/gnu/packages/telephony.scm index f75a168948..37ff103c42 100644 --- a/gnu/packages/telephony.scm +++ b/gnu/packages/telephony.scm @@ -894,14 +894,11 @@ Initiation Protocol (SIP) and a multimedia framework.") (lambda* (#:key inputs #:allow-other-keys) (substitute* "os/linux/AudioPulse.cpp" (("libpulse\\.so") - (string-append (assoc-ref inputs "pulseaudio") - "/lib/libpulse.so"))) + (search-input-file inputs "/lib/libpulse.so"))) (substitute* '("os/linux/AudioInputALSA.cpp" "os/linux/AudioOutputALSA.cpp") (("libasound\\.so") - (string-append (assoc-ref inputs "alsa-lib") - "/lib/libasound.so"))) - #t))))) + (search-input-file inputs "/lib/libasound.so")))))))) (synopsis "VoIP library for Telegram clients") (description "A collection of libraries and header files for implementing telephony functionality into custom Telegram clients.") -- cgit v1.2.3 From bc64d9554b337d4baaeccbcce22ea08a184c9e4c Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Fri, 16 Jul 2021 16:50:56 +0200 Subject: gnu: Use 'search-input-file' when looking for executables. * gnu/packages/admin.scm (isc-dhcp): Use 'search-input-file' when looking for executables. * gnu/packages/audio.scm (ableton-link): Likewise. * gnu/packages/benchmark.scm (fio): Likewise. * gnu/packages/bioinformatics.scm (roary): Likewise. (ngless): Likewise. * gnu/packages/boost.scm (boost-for-irods): Likewise. * gnu/packages/bootloaders.scm (grub): Likewise. (grub-efi): Likewise. * gnu/packages/chemistry.scm (inchi): Likewise. * gnu/packages/dictionaries.scm (ding): Likewise. * gnu/packages/dlang.scm (ldc): Likewise. * gnu/packages/education.scm (childsplay): Likewise. * gnu/packages/emacs-xyz.scm (emacs-hyperbole): Likewise. (emacs-haskell-mode): Likewise. (emacs-auctex): Likewise. (emacs-ggtags): Likewise. (emacs-graphviz-dot-mode): Likewise. (emacs-flycheck-grammalecte): Likewise. (emacs-counsel-notmuch): Likewise. (emacspeak): Likewise. (emacs-exwm): Likewise. (emacs-exwm-x): Likewise. (emacs-treemacs): Likewise. (emacs-telega): Likewise. (emacs-exiftool): Likewise. * gnu/packages/emulators.scm (higan): Likewise. * gnu/packages/engineering.scm (freehdl): Likewise. (librepcb): Likewise. * gnu/packages/entr.scm (entr): Likewise. * gnu/packages/file-systems.scm (libeatmydata): Likewise. (xfstests): Likewise. (mergerfs): Likewise. (mergerfs-tools): Likewise. * gnu/packages/finance.scm (monero-gui): Likewise. * gnu/packages/flashing-tools.scm (flashrom): Likewise. * gnu/packages/fontutils.scm (fontforge): Likewise. * gnu/packages/game-development.scm (python2-renpy): Likewise. * gnu/packages/games.scm (opensurge): Likewise. (xboard): Likewise. (hyperrogue): Likewise. (flare-game): Likewise. (chessx): Likewise. * gnu/packages/geo.scm (grass): Likewise. * gnu/packages/glib.scm (glib): Likewise. * gnu/packages/gnome.scm (mm-common): Likewise. (network-manager-openvpn): Likewise. (network-manager-vpnc): Likewise. (network-manager-openconnect): Likewise. (apostrophe): Likewise. * gnu/packages/gnupg.scm (pius): Likewise. (jetring): Likewise. * gnu/packages/gnuzilla.scm (icedove): Likewise. * gnu/packages/golang.scm (go-1.4): Likewise. * gnu/packages/graphviz.scm (xdot): Likewise. * gnu/packages/guile-xyz.scm (jupyter-guile-kernel): Likewise. * gnu/packages/haskell-xyz.scm (ghc-hindent): Likewise. * gnu/packages/ibus.scm (ibus): Likewise. * gnu/packages/image.scm (phockup): Likewise. * gnu/packages/irc.scm (quassel): Likewise. * gnu/packages/java.scm (drip): Likewise. (ant-bootstrap): Likewise. (tla2tools): Likewise. * gnu/packages/julia.scm (julia): Likewise. * gnu/packages/less.scm (lesspipe): Likewise. * gnu/packages/libreoffice.scm (libreoffice): Likewise. * gnu/packages/linux.scm (fuse): Likewise. (lm-sensors): Likewise. (bluez): Likewise. (fakeroot): Likewise. (inputattach): Likewise. * gnu/packages/lisp-xyz.scm (sbcl-cl-diskspace): Likewise. * gnu/packages/lisp.scm (lisp-repl-core-dumper): Likewise. * gnu/packages/lua.scm (fennel): Likewise. * gnu/packages/lxde.scm (spacefm): Likewise. * gnu/packages/mail.scm (public-inbox): Likewise. * gnu/packages/maths.scm (hdf-java): Likewise. (maxima): Likewise. (frama-c): Likewise. * gnu/packages/messaging.scm (libgadu): Likewise. * gnu/packages/music.scm (denemo): Likewise. (curseradio): Likewise. * gnu/packages/netpbm.scm (netpbm): Likewise. * gnu/packages/networking.scm (blueman): Likewise. (squid): Likewise. (aircrack-ng): Likewise. * gnu/packages/node.scm (node): Likewise. (node-llparse-frontend-bootstrap): Likewise. (node-llparse-bootstrap): Likewise. (llhttp-bootstrap): Likewise. (node-lts): Likewise. * gnu/packages/ocaml.scm (ocaml-4.11): Likewise. (opam): Likewise. (ocaml-graph): Likewise. * gnu/packages/orpheus.scm (orpheus): Likewise. * gnu/packages/password-utils.scm (password-store): Likewise. * gnu/packages/python.scm (pypy3): Likewise. * gnu/packages/qt.scm (qt5ct): Likewise. * gnu/packages/radio.scm (libosmo-dsp): Likewise. * gnu/packages/ruby.scm (ruby-pandoc-ruby): Likewise. * gnu/packages/rust.scm (rust-1.30): Likewise. * gnu/packages/screen.scm (byobu): Likewise. * gnu/packages/statistics.scm (r-with-tests): Likewise. * gnu/packages/suckless.scm (surf): Likewise. * gnu/packages/syndication.scm (gfeeds): Likewise. * gnu/packages/telephony.scm (mumble): Likewise. * gnu/packages/terminals.scm (alacritty): Likewise. * gnu/packages/tex.scm (texlive-bin): Likewise. * gnu/packages/uml.scm (plantuml): Likewise. * gnu/packages/version-control.scm (python-git-multimail): Likewise. (gitolite): Likewise. (hg-commitsigs): Likewise. (git-when-merged): Likewise. (git-imerge): Likewise. (gita): Likewise. * gnu/packages/video.scm (you-get): Likewise. * gnu/packages/vim.scm (eovim): Likewise. * gnu/packages/virtualization.scm (qemu): Likewise. (virt-manager): Likewise. (criu): Likewise. * gnu/packages/vpn.scm (strongswan): Likewise. (xl2tpd): Likewise. * gnu/packages/wm.scm (i3lock-fancy): Likewise. * gnu/packages/wxwidgets.scm (python-wxpython): Likewise. (python2-wxpython): Likewise. * gnu/packages/xdisorg.scm (autorandr): Likewise. * gnu/packages/xorg.scm (hackneyed-x11-cursors): Likewise. (v86d): Likewise. (mkfontdir): Likewise. (xpra): Likewise. --- gnu/packages/admin.scm | 6 ++-- gnu/packages/audio.scm | 9 +++--- gnu/packages/benchmark.scm | 3 +- gnu/packages/bioinformatics.scm | 14 ++++----- gnu/packages/boost.scm | 4 +-- gnu/packages/bootloaders.scm | 13 ++++----- gnu/packages/chemistry.scm | 3 +- gnu/packages/dictionaries.scm | 5 ++-- gnu/packages/dlang.scm | 2 +- gnu/packages/education.scm | 3 +- gnu/packages/emacs-xyz.scm | 59 ++++++++++++++++---------------------- gnu/packages/emulators.scm | 3 +- gnu/packages/engineering.scm | 20 +++++-------- gnu/packages/entr.scm | 6 ++-- gnu/packages/file-systems.scm | 22 +++++++------- gnu/packages/finance.scm | 3 +- gnu/packages/flashing-tools.scm | 6 ++-- gnu/packages/fontutils.scm | 3 +- gnu/packages/game-development.scm | 7 ++--- gnu/packages/games.scm | 17 +++++------ gnu/packages/geo.scm | 3 +- gnu/packages/glib.scm | 10 +++---- gnu/packages/gnome.scm | 38 +++++++++---------------- gnu/packages/gnupg.scm | 12 ++++---- gnu/packages/gnuzilla.scm | 3 +- gnu/packages/golang.scm | 4 +-- gnu/packages/graphviz.scm | 5 ++-- gnu/packages/guile-xyz.scm | 4 +-- gnu/packages/haskell-xyz.scm | 5 ++-- gnu/packages/ibus.scm | 9 ++++-- gnu/packages/image.scm | 6 ++-- gnu/packages/irc.scm | 2 +- gnu/packages/java.scm | 11 +++---- gnu/packages/julia.scm | 2 +- gnu/packages/less.scm | 9 +++--- gnu/packages/libreoffice.scm | 7 ++--- gnu/packages/linux.scm | 60 ++++++++++++++++++--------------------- gnu/packages/lisp-xyz.scm | 2 +- gnu/packages/lisp.scm | 11 ++++--- gnu/packages/lua.scm | 4 +-- gnu/packages/lxde.scm | 4 +-- gnu/packages/mail.scm | 2 +- gnu/packages/maths.scm | 21 ++++++-------- gnu/packages/messaging.scm | 4 +-- gnu/packages/music.scm | 10 +++---- gnu/packages/netpbm.scm | 3 +- gnu/packages/networking.scm | 28 ++++++++---------- gnu/packages/node.scm | 22 ++++++-------- gnu/packages/ocaml.scm | 10 +++---- gnu/packages/orpheus.scm | 9 ++---- gnu/packages/password-utils.scm | 6 ++-- gnu/packages/python.scm | 2 +- gnu/packages/qt.scm | 4 +-- gnu/packages/radio.scm | 4 +-- gnu/packages/ruby.scm | 8 ++---- gnu/packages/rust.scm | 2 +- gnu/packages/screen.scm | 3 +- gnu/packages/statistics.scm | 3 +- gnu/packages/suckless.scm | 4 +-- gnu/packages/syndication.scm | 2 +- gnu/packages/telephony.scm | 4 +-- gnu/packages/terminals.scm | 2 +- gnu/packages/tex.scm | 4 +-- gnu/packages/uml.scm | 3 +- gnu/packages/version-control.scm | 30 +++++++------------- gnu/packages/video.scm | 3 +- gnu/packages/vim.scm | 3 +- gnu/packages/virtualization.scm | 12 ++++---- gnu/packages/vpn.scm | 7 ++--- gnu/packages/wm.scm | 14 ++++----- gnu/packages/wxwidgets.scm | 7 +++-- gnu/packages/xdisorg.scm | 5 ++-- gnu/packages/xorg.scm | 16 +++++------ 73 files changed, 279 insertions(+), 397 deletions(-) (limited to 'gnu/packages/rust.scm') diff --git a/gnu/packages/admin.scm b/gnu/packages/admin.scm index 9d1654ef91..cf37a96b15 100644 --- a/gnu/packages/admin.scm +++ b/gnu/packages/admin.scm @@ -1259,8 +1259,7 @@ connection alive.") (sed (assoc-ref inputs "sed*"))) (substitute* "client/scripts/linux" (("/sbin/ip") - (string-append (assoc-ref inputs "iproute") - "/sbin/ip"))) + (search-input-file inputs "/sbin/ip"))) (mkdir-p libexec) (copy-file "client/scripts/linux" @@ -1561,8 +1560,7 @@ at once based on a Perl regular expression.") (lambda* (#:key inputs #:allow-other-keys) (substitute* "rc/rc" (("/usr/sbin/sendmail") - (string-append (assoc-ref inputs "mailutils") - "/bin/mail"))) + (search-input-file inputs "/bin/mail"))) #t)) (add-after 'unpack 'fix-configure (lambda* (#:key inputs native-inputs #:allow-other-keys) diff --git a/gnu/packages/audio.scm b/gnu/packages/audio.scm index b740f0ffed..6535c87ea1 100644 --- a/gnu/packages/audio.scm +++ b/gnu/packages/audio.scm @@ -5223,11 +5223,10 @@ Rate} 3600x2250 bit/s vocoder used in various radio systems.") (modify-phases %standard-phases (replace 'check (lambda* (#:key inputs #:allow-other-keys) - (let* ((python (string-append (assoc-ref inputs "python") - "/bin/python3")) - (run-tests (string-append "../ableton-link-" - ,version - "-checkout/ci/run-tests.py"))) + (let* ((python (search-input-file inputs "/bin/python3")) + (run-tests (string-append "../ableton-link-" + ,version + "-checkout/ci/run-tests.py"))) (invoke python run-tests "--target" "LinkCoreTest") (invoke python run-tests "--target" "LinkDiscoveryTest")))) (add-before 'install 'patch-cmake diff --git a/gnu/packages/benchmark.scm b/gnu/packages/benchmark.scm index 78b491d50d..577196e3df 100644 --- a/gnu/packages/benchmark.scm +++ b/gnu/packages/benchmark.scm @@ -69,8 +69,7 @@ 'unpack 'patch-paths (lambda* (#:key inputs outputs #:allow-other-keys) (let ((out (assoc-ref outputs "out")) - (gnuplot (string-append (assoc-ref inputs "gnuplot") - "/bin/gnuplot"))) + (gnuplot (search-input-file inputs "/bin/gnuplot"))) (substitute* "tools/plot/fio2gnuplot" (("/usr/share/fio") (string-append out "/share/fio")) ;; FIXME (upstream): The 'gnuplot' executable is used inline diff --git a/gnu/packages/bioinformatics.scm b/gnu/packages/bioinformatics.scm index 965dd91853..75668418f0 100644 --- a/gnu/packages/bioinformatics.scm +++ b/gnu/packages/bioinformatics.scm @@ -5704,7 +5704,7 @@ partial genes, and identifies translation initiation sites.") (string-append out "/bin/roary-create_pan_genome_plots.R")) (r-site-lib (getenv "R_LIBS_SITE")) (coreutils-path - (string-append (assoc-ref inputs "coreutils") "/bin"))) + (dirname (search-input-file inputs "bin/chmod")))) (wrap-program file `("R_LIBS_SITE" ":" prefix (,(string-append r-site-lib ":" out "/site-library/")))) @@ -12285,17 +12285,13 @@ datasets.") (add-after 'install 'link-tools (lambda* (#:key inputs outputs #:allow-other-keys) (let ((bin (string-append (assoc-ref outputs "out") "/bin/"))) - (symlink (string-append (assoc-ref inputs "prodigal") - "/bin/prodigal") + (symlink (search-input-file inputs "/bin/prodigal") (string-append bin "ngless-" ,version "-prodigal")) - (symlink (string-append (assoc-ref inputs "minimap2") - "/bin/minimap2") + (symlink (search-input-file inputs "/bin/minimap2") (string-append bin "ngless-" ,version "-minimap2")) - (symlink (string-append (assoc-ref inputs "samtools") - "/bin/samtools") + (symlink (search-input-file inputs "/bin/samtools") (string-append bin "ngless-" ,version "-samtools")) - (symlink (string-append (assoc-ref inputs "bwa") - "/bin/bwa") + (symlink (search-input-file inputs "/bin/bwa") (string-append bin "ngless-" ,version "-bwa")) #t)))))) (inputs diff --git a/gnu/packages/boost.scm b/gnu/packages/boost.scm index 8b6bea30c4..538d921c0b 100644 --- a/gnu/packages/boost.scm +++ b/gnu/packages/boost.scm @@ -3,7 +3,7 @@ ;;; Copyright © 2014, 2015, 2018 Mark H Weaver ;;; Copyright © 2015 Andreas Enge ;;; Copyright © 2016 Eric Bavier -;;; Copyright © 2015, 2019, 2020 Ludovic Courtès +;;; Copyright © 2015, 2019, 2020, 2021 Ludovic Courtès ;;; Copyright © 2017 Thomas Danckaert ;;; Copyright © 2018 Tobias Geerinckx-Rice ;;; Copyright © 2018 Arun Isaac @@ -252,7 +252,7 @@ across a broad spectrum of applications.") (lambda* (#:key inputs outputs #:allow-other-keys) (let ((icu (assoc-ref inputs "icu4c")) (out (assoc-ref outputs "out")) - (sh (string-append (assoc-ref inputs "bash") "/bin/sh"))) + (sh (search-input-file inputs "/bin/sh"))) (substitute* '("libs/config/configure" "libs/spirit/classic/phoenix/test/runtest.sh" "tools/build/src/engine/execunix.c" diff --git a/gnu/packages/bootloaders.scm b/gnu/packages/bootloaders.scm index 742992a119..61f0c14d9c 100644 --- a/gnu/packages/bootloaders.scm +++ b/gnu/packages/bootloaders.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2013, 2014, 2015, 2016, 2017, 2018, 2019 Ludovic Courtès +;;; Copyright © 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2021 Ludovic Courtès ;;; Copyright © 2015, 2018 Mark H Weaver ;;; Copyright © 2015 Leo Famulari ;;; Copyright © 2016, 2020 Jan (janneke) Nieuwenhuizen @@ -139,9 +139,9 @@ ;; Give the absolute file name of 'ckbcomp'. (substitute* "util/grub-kbdcomp.in" (("^ckbcomp ") - (string-append (assoc-ref inputs "console-setup") - "/bin/ckbcomp "))) - #t)) + (string-append + (search-input-file inputs "/bin/ckbcomp") + " "))))) (add-after 'unpack 'set-freetype-variables ;; These variables need to be set to the native versions ;; of the dependencies because they are used to build @@ -315,9 +315,8 @@ menu to select one of the installed operating systems.") (lambda* (#:key inputs #:allow-other-keys) (substitute* "grub-core/osdep/unix/platform.c" (("efibootmgr") - (string-append (assoc-ref inputs "efibootmgr") - "/sbin/efibootmgr"))) - #t)) + (search-input-file inputs + "/sbin/efibootmgr"))))) (add-after 'patch-stuff 'use-absolute-mtools-path (lambda* (#:key inputs #:allow-other-keys) (let ((mtools (assoc-ref inputs "mtools"))) diff --git a/gnu/packages/chemistry.scm b/gnu/packages/chemistry.scm index a52ecf69f7..4b46052f99 100644 --- a/gnu/packages/chemistry.scm +++ b/gnu/packages/chemistry.scm @@ -192,8 +192,7 @@ only with Python 2 and NumPy < 1.9.") (include-dir (string-append out "/include/inchi")) (lib (string-append out "/lib/inchi")) (inchi-doc (assoc-ref inputs "inchi-doc")) - (unzip (string-append (assoc-ref inputs "unzip") - "/bin/unzip"))) + (unzip (search-input-file inputs "/bin/unzip"))) (chdir "../../..") ;; Install binary. (with-directory-excursion "INCHI_EXE/bin/Linux" diff --git a/gnu/packages/dictionaries.scm b/gnu/packages/dictionaries.scm index 5ca9e128ff..b8bde241f7 100644 --- a/gnu/packages/dictionaries.scm +++ b/gnu/packages/dictionaries.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2014, 2015, 2016 Ludovic Courtès +;;; Copyright © 2014, 2015, 2016, 2021 Ludovic Courtès ;;; Copyright © 2016, 2017, 2018, 2020, 2021 Efraim Flashner ;;; Copyright © 2016 Sou Bunnbu ;;; Copyright © 2017, 2018, 2019, 2021 Nicolas Goaziou @@ -178,8 +178,7 @@ work, such as sentence length and other readability measures.") (lambda* (#:key inputs #:allow-other-keys) (let ((bindir (string-append (assoc-ref %outputs "out") "/bin")) - (wish (string-append (assoc-ref inputs "tk") - "/bin/wish8.6")) + (wish (search-input-file inputs "/bin/wish8.6")) (sharedir (string-append (assoc-ref %outputs "out") "/share/applications")) diff --git a/gnu/packages/dlang.scm b/gnu/packages/dlang.scm index c782ef928a..dc22ea2e62 100644 --- a/gnu/packages/dlang.scm +++ b/gnu/packages/dlang.scm @@ -261,7 +261,7 @@ bootstrapping more recent compilers written in D.") (lambda* (#:key inputs outputs #:allow-other-keys) ;; some tests call into gdb binary which needs SHELL and CC set (setenv "SHELL" (which "sh")) - (setenv "CC" (string-append (assoc-ref inputs "gcc") "/bin/gcc")) + (setenv "CC" (search-input-file inputs "/bin/gcc")) (invoke "make" "test" "-j" (number->string (parallel-job-count)))))))) (native-inputs `(("llvm" ,llvm-6) diff --git a/gnu/packages/education.scm b/gnu/packages/education.scm index 02aacf353c..d21c8ea7da 100644 --- a/gnu/packages/education.scm +++ b/gnu/packages/education.scm @@ -513,8 +513,7 @@ specialized device.") #t))) (add-after 'install 'create-executable (lambda* (#:key outputs inputs #:allow-other-keys) - (let* ((python (string-append (assoc-ref inputs "python") - "/bin/python")) + (let* ((python (search-input-file inputs "/bin/python")) (out (assoc-ref outputs "out")) (bin (string-append out "/bin")) (executable (string-append bin "/childsplay"))) diff --git a/gnu/packages/emacs-xyz.scm b/gnu/packages/emacs-xyz.scm index e85b5f40ae..973d944a9c 100644 --- a/gnu/packages/emacs-xyz.scm +++ b/gnu/packages/emacs-xyz.scm @@ -1,6 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2014 Taylan Ulrich Bayirli/Kammer -;;; Copyright © 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020 Ludovic Courtès +;;; Copyright © 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021 Ludovic Courtès ;;; Copyright © 2014, 2015, 2016, 2017, 2018 Mark H Weaver ;;; Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Alex Kost ;;; Copyright © 2015 Federico Beffa @@ -484,8 +484,7 @@ system.") (lambda* (#:key inputs #:allow-other-keys) (substitute* "hypb.el" (("/bin/domainname") - (string-append (assoc-ref inputs "inetutils") - "/bin/dnsdomainname"))) + (search-input-file inputs "bin/dnsdomainname"))) (substitute* "hyperbole.el" (("\\(hyperb:check-dir-user\\)") "")))) (add-after 'install 'install-images @@ -1413,7 +1412,7 @@ replacement.") ((f1 f2 ...) (dirname f1)) (_ ""))) - (let ((sh (string-append (assoc-ref inputs "bash") "/bin/sh"))) + (let ((sh (search-input-file inputs "/bin/sh"))) (define emacs-prefix? (cut string-prefix? "emacs-" <>)) (setenv "SHELL" "sh") @@ -2568,7 +2567,7 @@ as a library for other Emacs packages.") (lambda* (#:key inputs #:allow-other-keys) (emacs-substitute-variables "preview.el" ("preview-gs-command" - (string-append (assoc-ref inputs "ghostscript") "/bin/gs"))) + (search-input-file inputs "/bin/gs"))) (substitute* "preview.el" (("\"dvipng ") (string-append "\"" (assoc-ref inputs "texlive") @@ -2932,8 +2931,7 @@ into mode hooks and is intended to be used that way.") (chmod "ggtags.el" #o644) (emacs-substitute-variables "ggtags.el" ("ggtags-executable-directory" - (string-append (assoc-ref inputs "global") "/bin"))) - #t))))) + (dirname (search-input-file inputs "bin/global"))))))))) (home-page "https://github.com/leoliu/ggtags") (synopsis "Frontend to the GNU Global source code tagging system") (description "@code{ggtags} provides a frontend to the GNU Global source @@ -3039,7 +3037,7 @@ directly inside Emacs. It requires a Google Map Static API key to function.") (with-directory-excursion "texinfo" (substitute* "Makefile" (("\\/usr\\/bin\\/gzip") - (string-append (assoc-ref inputs "gzip") "/bin/gzip"))) + (search-input-file inputs "/bin/gzip"))) (invoke "make" "clean" "info" @@ -5503,8 +5501,7 @@ for Flow files.") (add-after 'unpack 'specify-python-location ;; Hard-code python3 executable location in the library. (lambda* (#:key inputs #:allow-other-keys) - (let ((python3 (string-append (assoc-ref inputs "python") - "/bin/python3"))) + (let ((python3 (search-input-file inputs "/bin/python3"))) (substitute* "flycheck-grammalecte.el" (("\"python3") (string-append "\"" python3))) (substitute* '("conjugueur.py" "flycheck-grammalecte.py") @@ -9276,9 +9273,7 @@ queries using counsel.") (make-file-writable "counsel-notmuch.el") (emacs-substitute-variables "counsel-notmuch.el" ("counsel-notmuch-path" - (string-append (assoc-ref inputs "notmuch") - "/bin/notmuch"))) - #t))))) + (search-input-file inputs "/bin/notmuch")))))))) (inputs `(("emacs-counsel" ,emacs-counsel) ("notmuch" ,notmuch) @@ -12973,8 +12968,7 @@ highlights quasi-quoted expressions.") (bin (string-append out "/bin")) (lisp (string-append out "/share/emacs/site-lisp/emacspeak")) (info (string-append out "/share/info")) - (emacs (string-append (assoc-ref inputs "emacs") - "/bin/emacs"))) + (emacs (search-input-file inputs "/bin/emacs"))) ;; According to etc/install.org, the Emacspeak directory should ;; be copied to its installation destination. (for-each @@ -13700,10 +13694,10 @@ It should enable you to implement low-level X11 applications.") (format #t "#!~a ~@ ~a +SI:localuser:$USER ~@ exec ~a --exit-with-session ~a \"$@\" --eval '~s' ~%" - (string-append (assoc-ref inputs "bash") "/bin/sh") - (string-append (assoc-ref inputs "xhost") "/bin/xhost") - (string-append (assoc-ref inputs "dbus") "/bin/dbus-launch") - (string-append (assoc-ref inputs "emacs") "/bin/emacs") + (search-input-file inputs "/bin/sh") + (search-input-file inputs "/bin/xhost") + (search-input-file inputs "/bin/dbus-launch") + (search-input-file inputs "/bin/emacs") '(cond ((file-exists-p "~/.exwm") (load-file "~/.exwm")) @@ -13816,10 +13810,10 @@ other operations.") (format #t "#!~a ~@ ~a +SI:localuser:$USER ~@ exec ~a --exit-with-session ~a \"$@\" --eval '~s' ~%" - (string-append (assoc-ref inputs "bash") "/bin/sh") - (string-append (assoc-ref inputs "xhost") "/bin/xhost") - (string-append (assoc-ref inputs "dbus") "/bin/dbus-launch") - (string-append (assoc-ref inputs "emacs") "/bin/emacs") + (search-input-file inputs "/bin/sh") + (search-input-file inputs "/bin/xhost") + (search-input-file inputs "/bin/dbus-launch") + (search-input-file inputs "/bin/emacs") '(require 'exwmx-loader)))) (chmod exwm-executable #o555) #t)))))) @@ -23332,7 +23326,7 @@ processes for Emacs") (chmod "src/elisp/treemacs-customization.el" #o644) (emacs-substitute-variables "src/elisp/treemacs-customization.el" ("treemacs-python-executable" - (string-append (assoc-ref inputs "python") "/bin/python3"))) + (search-input-file inputs "/bin/python3"))) (chmod "src/elisp/treemacs-async.el" #o644) (substitute* "src/elisp/treemacs-async.el" (("src/scripts") (string-append "share/" ,name "/scripts")))) @@ -26285,14 +26279,14 @@ service, and connect it with Emacs via inter-process communication.") (add-after 'unpack 'patch-sources (lambda* (#:key inputs #:allow-other-keys) ;; Hard-code paths to `ffplay` and `ffmpeg`. - (let* ((ffmpeg (assoc-ref inputs "ffmpeg")) - (ffmpeg-bin (string-append ffmpeg "/bin/ffmpeg")) - (ffplay-bin (string-append ffmpeg "/bin/ffplay"))) + (let* ((ffplay-bin (search-input-file inputs "/bin/ffplay")) + (ffmpeg-bin (search-input-file inputs "/bin/ffmpeg"))) (substitute* '("telega-ffplay.el" "telega-vvnote.el") (("(shell-command-to-string\|concat) \"(ffmpeg\|ffprobe)" all func cmd) - (string-append func " \"" (assoc-ref inputs "ffmpeg") - "/bin/" cmd)) + (string-append func " \"" + (search-input-file + inputs (string-append "/bin/" cmd)))) (("\\(executable-find \"ffplay\"\\)") (string-append "(and (file-executable-p \"" ffplay-bin "\")" "\"" ffplay-bin "\")")) @@ -26303,8 +26297,7 @@ service, and connect it with Emacs via inter-process communication.") (lambda* (#:key inputs outputs #:allow-other-keys) (substitute* "telega-server.el" (("@TELEGA_SERVER_BIN@") - (string-append (assoc-ref inputs "emacs-telega-server") - "/bin/telega-server"))) + (search-input-file inputs "/bin/telega-server"))) (substitute* "telega-util.el" (("@TELEGA_SHARE@") (string-append (assoc-ref outputs "out") @@ -27596,9 +27589,7 @@ emoji.") (make-file-writable "exiftool.el") (emacs-substitute-variables "exiftool.el" ("exiftool-executable" - (string-append (assoc-ref inputs "perl-image-exiftool") - "/bin/exiftool"))) - #t))))) + (search-input-file inputs "/bin/exiftool")))))))) (inputs `(("perl-image-exiftool" ,perl-image-exiftool))) (home-page "https://git.systemreboot.net/exiftool.el/about/") diff --git a/gnu/packages/emulators.scm b/gnu/packages/emulators.scm index a5edc918e2..2394342d26 100644 --- a/gnu/packages/emulators.scm +++ b/gnu/packages/emulators.scm @@ -615,8 +615,7 @@ and a game metadata scraper.") (bin (string-append out "/bin")) (higan (string-append bin "/higan")) (higan-original (string-append higan "-original")) - (bash (string-append (assoc-ref inputs "bash") - "/bin/bash")) + (bash (search-input-file inputs "/bin/bash")) (coreutils (assoc-ref inputs "coreutils")) (mkdir (string-append coreutils "/bin/mkdir")) (cp (string-append coreutils "/bin/cp")) diff --git a/gnu/packages/engineering.scm b/gnu/packages/engineering.scm index 4e01bf8b3e..74e95cfc9e 100644 --- a/gnu/packages/engineering.scm +++ b/gnu/packages/engineering.scm @@ -1964,19 +1964,14 @@ parallel computing platforms. It also supports serial execution.") (lambda* (#:key inputs #:allow-other-keys) (substitute* "freehdl/freehdl-config" (("pkg-config") - (string-append (assoc-ref inputs "pkg-config") - "/bin/pkg-config")) + (search-input-file inputs "/bin/pkg-config")) (("cat") - (string-append (assoc-ref inputs "coreutils") - "/bin/cat"))) - #t)) + (search-input-file inputs "/bin/cat"))))) (add-after 'patch-pkg-config 'setenv (lambda* (#:key inputs #:allow-other-keys) - (setenv "CXX" (string-append (assoc-ref inputs "gcc") - "/bin/g++")) - (setenv "SYSTEM_LIBTOOL" (string-append (assoc-ref inputs "libtool") - "/bin/libtool")) - #t)) + (setenv "CXX" (search-input-file inputs "/bin/g++")) + (setenv "SYSTEM_LIBTOOL" + (search-input-file inputs "/bin/libtool")))) (add-after 'setenv 'patch-gvhdl (lambda _ (substitute* "v2cc/gvhdl.in" @@ -1987,7 +1982,7 @@ parallel computing platforms. It also supports serial execution.") (lambda* (#:key inputs #:allow-other-keys) (substitute* "freehdl/freehdl-gennodes.in" (("guile") - (string-append (assoc-ref inputs "guile") "/bin/guile")) + (search-input-file inputs "/bin/guile")) (("\\(debug") ";(debug") (("\\(@ ") "(apply-emit") (("\\(@@ ") "(apply-mini-format")) @@ -2066,8 +2061,7 @@ parallel computing platforms. It also supports serial execution.") (lambda* (#:key inputs outputs #:allow-other-keys) (mkdir-p "build") (chdir "build") - (let ((lrelease (string-append (assoc-ref inputs "qttools") - "/bin/lrelease")) + (let ((lrelease (search-input-file inputs "/bin/lrelease")) (out (assoc-ref outputs "out"))) (invoke "qmake" (string-append "QMAKE_LRELEASE=" lrelease) diff --git a/gnu/packages/entr.scm b/gnu/packages/entr.scm index 5ca40690dd..9a7a3daef6 100644 --- a/gnu/packages/entr.scm +++ b/gnu/packages/entr.scm @@ -59,11 +59,11 @@ (lambda* (#:key inputs #:allow-other-keys) (substitute* "entr.c" (("/bin/sh" command) - (string-append (assoc-ref inputs "bash") command)) + (search-input-file inputs command)) (("/bin/cat" command) - (string-append (assoc-ref inputs "coreutils") command)) + (search-input-file inputs command)) (("/usr(/bin/clear)" _ command) - (string-append (assoc-ref inputs "ncurses") command))) + (search-input-file inputs command))) #t))))) (inputs `(("bash" ,bash) diff --git a/gnu/packages/file-systems.scm b/gnu/packages/file-systems.scm index b6d0bcbc55..94f3c7e6d7 100644 --- a/gnu/packages/file-systems.scm +++ b/gnu/packages/file-systems.scm @@ -868,7 +868,8 @@ All of this is accomplished without a centralized metadata server.") (lambda* (#:key inputs #:allow-other-keys) (substitute* (list "eatmydata.in" "eatmydata.sh.in") (("basename|readlink|uname" command) - (string-append (assoc-ref inputs "coreutils") "/bin/" command))))) + (search-input-file inputs + (string-append "bin/" command)))))) (add-before 'patch-file-names 'tighten-symlink-mode ;; When the ‘eatmydata’ helper detects that it's a symlink, it will ;; transparently invoke the command of the same name. However, it's @@ -1046,11 +1047,9 @@ APFS.") (assoc-ref inputs "bash") match)) (("/bin/(rm|true)" match) - (string-append (assoc-ref inputs "coreutils") - match)) + (search-input-file inputs match)) (("/usr(/bin/time)" _ match) - (string-append (assoc-ref inputs "time") - match)))) + (search-input-file inputs match)))) (append (find-files "common" ".*") (find-files "tests" ".*") (find-files "tools" ".*") @@ -1097,8 +1096,7 @@ APFS.") (with-output-to-file helper (lambda _ (format #t "#!~a --no-auto-compile\n!#\n" - (string-append (assoc-ref inputs "guile") - "/bin/guile")) + (search-input-file inputs "/bin/guile")) (write `(begin (define (try proc dir) @@ -1407,8 +1405,9 @@ On Guix System, you will need to invoke the included shell scripts as (substitute* '("libfuse/lib/mount_util.c" "libfuse/util/mount_util.c") (("/bin/(u?)mount" _ maybe-u) - (string-append (assoc-ref inputs "util-linux") - "/bin/" maybe-u "mount"))) + (search-input-file inputs + (string-append "bin/" maybe-u + "mount")))) (substitute* '("libfuse/util/mount.mergerfs.c") (("/bin/sh" command) (string-append (assoc-ref inputs "bash-minimal") command)))))))) @@ -1461,10 +1460,9 @@ is similar to mhddfs, unionfs, and aufs.") (string-append "'" (assoc-ref inputs "coreutils") "/bin/rm'"))) (substitute* "src/mergerfs.mktrash" (("xattr") - (string-append (assoc-ref inputs "python-xattr") "/bin/xattr")) + (search-input-file inputs "/bin/xattr")) (("mkdir") - (string-append (assoc-ref inputs "coreutils") "/bin/mkdir"))) - #t))))) + (search-input-file inputs "/bin/mkdir")))))))) (synopsis "Tools to help manage data in a mergerfs pool") (description "mergerfs-tools is a suite of programs that can audit permissions and ownership of files and directories on a mergerfs volume, diff --git a/gnu/packages/finance.scm b/gnu/packages/finance.scm index f88b578085..e6c2a42e71 100644 --- a/gnu/packages/finance.scm +++ b/gnu/packages/finance.scm @@ -823,8 +823,7 @@ the Monero command line client and daemon.") ;; The monerod program must be available so that monero-wallet-gui ;; can start a Monero daemon if necessary. (lambda* (#:key inputs outputs #:allow-other-keys) - (symlink (string-append (assoc-ref inputs "monero") - "/bin/monerod") + (symlink (search-input-file inputs "/bin/monerod") (string-append (assoc-ref outputs "out") "/bin/monerod"))))))) (home-page "https://web.getmonero.org/") diff --git a/gnu/packages/flashing-tools.scm b/gnu/packages/flashing-tools.scm index e0a099e966..3961bdf409 100644 --- a/gnu/packages/flashing-tools.scm +++ b/gnu/packages/flashing-tools.scm @@ -2,7 +2,7 @@ ;;; Copyright © 2014 Mark H Weaver ;;; Copyright © 2014 Manolis Fragkiskos Ragkousis ;;; Copyright © 2016 Hartmut Goebel -;;; Copyright © 2016, 2018 Ludovic Courtès +;;; Copyright © 2016, 2018, 2021 Ludovic Courtès ;;; Copyright © 2016, 2019 Efraim Flashner ;;; Copyright © 2017 Jonathan Brielmaier ;;; Copyright © 2017 Julien Lepiller @@ -83,9 +83,7 @@ (substitute* "dmi.c" (("\"dmidecode\"") (format #f "~S" - (string-append (assoc-ref inputs "dmidecode") - "/sbin/dmidecode")))) - #t))))) + (search-input-file inputs "/sbin/dmidecode"))))))))) (home-page "https://flashrom.org/") (synopsis "Identify, read, write, erase, and verify ROM/flash chips") (description diff --git a/gnu/packages/fontutils.scm b/gnu/packages/fontutils.scm index b4ef9f5c24..6ef09455b5 100644 --- a/gnu/packages/fontutils.scm +++ b/gnu/packages/fontutils.scm @@ -696,7 +696,8 @@ definitions.") (add-after 'install 'set-library-path (lambda* (#:key inputs outputs #:allow-other-keys) (let ((out (assoc-ref outputs "out")) - (potrace (string-append (assoc-ref inputs "potrace") "/bin"))) + (potrace (dirname + (search-input-file inputs "bin/potrace")))) (wrap-program (string-append out "/bin/fontforge") ;; Fontforge dynamically opens libraries. `("LD_LIBRARY_PATH" ":" prefix diff --git a/gnu/packages/game-development.scm b/gnu/packages/game-development.scm index 17b52e2694..e7be20d580 100644 --- a/gnu/packages/game-development.scm +++ b/gnu/packages/game-development.scm @@ -1,7 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2014 Tomáš Čech ;;; Copyright © 2015 Mark H Weaver -;;; Copyright © 2015, 2018 Ludovic Courtès +;;; Copyright © 2015, 2018, 2021 Ludovic Courtès ;;; Copyright © 2015, 2018 Alex Kost ;;; Copyright © 2015, 2016, 2017 David Thompson ;;; Copyright © 2016, 2017, 2018, 2019, 2020, 2021 Efraim Flashner @@ -1203,9 +1203,8 @@ developed mainly for Ren'py.") (add-after 'set-paths 'set-build-vars (lambda* (#:key inputs native-inputs #:allow-other-keys) (setenv "RENPY_CYTHON" - (string-append (assoc-ref (or native-inputs inputs) - "python2-cython") - "/bin/cython")) + (search-input-file (or native-inputs inputs) + "/bin/cython")) (setenv "RENPY_DEPS_INSTALL" (string-join (map cdr inputs) ":")) #t)) (replace 'build diff --git a/gnu/packages/games.scm b/gnu/packages/games.scm index 8362300bef..38b5782547 100644 --- a/gnu/packages/games.scm +++ b/gnu/packages/games.scm @@ -1555,8 +1555,7 @@ shadow mimic them to reach blocks you couldn't reach alone.") ;; Look for xdg-open in the store. (substitute* "src/core/web.c" (("/usr(/bin/xdg-open)" _ bin) - (string-append (assoc-ref inputs "xdg-utils") bin))) - #t)) + (search-input-file inputs bin))))) (add-after 'unpack 'unbundle-fonts (lambda* (#:key inputs #:allow-other-keys) ;; Replace bundled Roboto fonts with links to the store. @@ -3353,7 +3352,8 @@ exec ~a/bin/freedink -refdir ~a/share/dink\n" (lambda* (#:key inputs #:allow-other-keys) (substitute* "xboard.conf" (("aplay -q") - (string-append (assoc-ref inputs "alsa-utils") "/bin/aplay -q"))))) + (string-append (search-input-file inputs "/bin/aplay") + " -q"))))) ;; Fixes https://issues.guix.gnu.org/45236. (add-after 'unpack 'patch-default-engine (lambda* (#:key inputs #:allow-other-keys) @@ -5848,7 +5848,7 @@ throwing people around in pseudo-randomly generated buildings.") (let* ((data (assoc-ref inputs "hyperrogue-data")) (out (assoc-ref outputs "out")) (sounds (string-append out "/share/hyperrogue/sounds")) - (unzip (string-append (assoc-ref inputs "unzip") "/bin/unzip"))) + (unzip (search-input-file inputs "/bin/unzip"))) ;; Extract media license information into sounds directory. (invoke unzip "-j" data (string-append @@ -9045,10 +9045,8 @@ action RPGs.") ;; parameters. (lambda* (#:key inputs outputs #:allow-other-keys) (let* ((out (assoc-ref outputs "out")) - (bash (string-append (assoc-ref inputs "bash") - "/bin/bash")) - (flare (string-append (assoc-ref inputs "flare-engine") - "/bin/flare")) + (bash (search-input-file inputs "/bin/bash")) + (flare (search-input-file inputs "/bin/flare")) (script (string-append out "/bin/flare-game"))) (mkdir-p (dirname script)) (call-with-output-file script @@ -11919,8 +11917,7 @@ and chess engines.") (lambda* (#:key inputs #:allow-other-keys) (substitute* "chessx.pro" (("\\$\\$\\[QT_INSTALL_BINS\\]/lrelease") - (string-append (assoc-ref inputs "qttools") "/bin/lrelease"))) - #t)) + (search-input-file inputs "/bin/lrelease"))))) (add-after 'fix-paths 'make-qt-deterministic (lambda _ (setenv "QT_RCC_SOURCE_DATE_OVERRIDE" "1") diff --git a/gnu/packages/geo.scm b/gnu/packages/geo.scm index 61c104fdfb..cb53afdc54 100644 --- a/gnu/packages/geo.scm +++ b/gnu/packages/geo.scm @@ -1964,8 +1964,7 @@ track your position right from your laptop.") (modify-phases %standard-phases (replace 'configure (lambda* (#:key inputs outputs #:allow-other-keys) - (let ((shell (string-append (assoc-ref inputs "bash") - "/bin/bash"))) + (let ((shell (search-input-file inputs "/bin/bash"))) (setenv "SHELL" shell) (setenv "CONFIG_SHELL" shell) (setenv "LDFLAGS" (string-append "-Wl,-rpath -Wl," diff --git a/gnu/packages/glib.scm b/gnu/packages/glib.scm index 6a7e9696b2..ae88dbe9e7 100644 --- a/gnu/packages/glib.scm +++ b/gnu/packages/glib.scm @@ -246,11 +246,11 @@ shared NFS home directories.") "gobject/glib-genmarshal.in" "gobject/glib-mkenums.in") (("@PYTHON@") - (string-append (assoc-ref (or native-inputs inputs) "python") - "/bin/python" - ,(version-major+minor - (package-version python))))) - #t)) + (search-input-file (or native-inputs inputs) + (string-append + "/bin/python" + ,(version-major+minor + (package-version python)))))))) (add-before 'check 'pre-check (lambda* (#:key native-inputs inputs outputs #:allow-other-keys) ;; For tests/gdatetime.c. diff --git a/gnu/packages/gnome.scm b/gnu/packages/gnome.scm index 1b35645694..24c5adc44a 100644 --- a/gnu/packages/gnome.scm +++ b/gnu/packages/gnome.scm @@ -1129,15 +1129,10 @@ freedesktop.org desktop notification specification.") (add-after 'unpack 'patch (lambda* (#:key inputs #:allow-other-keys) (substitute* "util/mm-common-prepare.in" - (("ln") (string-append (assoc-ref inputs "coreutils") - "/bin/ln")) - (("cp") (string-append (assoc-ref inputs "coreutils") - "/bin/cp")) - (("sed") (string-append (assoc-ref inputs "sed") - "/bin/sed")) - (("cat") (string-append (assoc-ref inputs "coreutils") - "/bin/cat"))) - #t))))) + (("ln") (search-input-file inputs "/bin/ln")) + (("cp") (search-input-file inputs "/bin/cp")) + (("sed") (search-input-file inputs "/bin/sed")) + (("cat") (search-input-file inputs "/bin/cat")))))))) (native-inputs `(("coreutils" ,coreutils) ("gettext" ,gettext-minimal) @@ -7833,10 +7828,8 @@ services.") (modify-phases %standard-phases (add-after 'configure 'patch-path (lambda* (#:key inputs outputs #:allow-other-keys #:rest args) - (let* ((ovpn (string-append (assoc-ref inputs "openvpn") - "/sbin/openvpn")) - (modprobe (string-append (assoc-ref inputs "kmod") - "/bin/modprobe")) + (let* ((ovpn (search-input-file inputs "/sbin/openvpn")) + (modprobe (search-input-file inputs "/bin/modprobe")) (pretty-ovpn (string-append "\"" ovpn "\""))) (for-each (lambda (file) @@ -7889,10 +7882,8 @@ to virtual private networks (VPNs) via OpenVPN.") (modify-phases %standard-phases (add-after 'configure 'patch-path (lambda* (#:key inputs outputs #:allow-other-keys #:rest args) - (let* ((vpnc (string-append (assoc-ref inputs "vpnc") - "/sbin/vpnc")) - (modprobe (string-append (assoc-ref inputs "kmod") - "/bin/modprobe")) + (let* ((vpnc (search-input-file inputs "/sbin/vpnc")) + (modprobe (search-input-file inputs "/bin/modprobe")) (pretty-ovpn (string-append "\"" vpnc "\""))) (substitute* "src/nm-vpnc-service.c" (("\"/usr/local/sbin/vpnc\"") pretty-ovpn) @@ -7938,10 +7929,9 @@ Compatible with Cisco VPN concentrators configured to use IPsec.") (modify-phases %standard-phases (add-after 'configure 'patch-path (lambda* (#:key inputs outputs #:allow-other-keys #:rest args) - (let* ((openconnect (string-append (assoc-ref inputs "openconnect") - "/sbin/openconnect")) - (modprobe (string-append (assoc-ref inputs "kmod") - "/bin/modprobe")) + (let* ((openconnect (search-input-file inputs + "/sbin/openconnect")) + (modprobe (search-input-file inputs "/bin/modprobe")) (pretty-ovpn (string-append "\"" openconnect "\""))) (substitute* "src/nm-openconnect-service.c" (("\"/usr(/local)?/s?bin/openconnect\"") pretty-ovpn) @@ -11611,9 +11601,9 @@ GTK+. It integrates well with the GNOME desktop environment.") (wrap-program prog `("PYTHONPATH" = (,(getenv "PYTHONPATH") ,pylib)) `("GI_TYPELIB_PATH" = (,(getenv "GI_TYPELIB_PATH"))) - `("PATH" prefix (,(string-append (assoc-ref inputs "pandoc") - "/bin")))) - #t)))))) + `("PATH" prefix (,(dirname + (search-input-file inputs + "/bin/pandoc"))))))))))) (inputs `(("glib" ,glib) ("gobject-introspection" ,gobject-introspection) diff --git a/gnu/packages/gnupg.scm b/gnu/packages/gnupg.scm index 10f21f6a6d..4584310e55 100644 --- a/gnu/packages/gnupg.scm +++ b/gnu/packages/gnupg.scm @@ -469,8 +469,10 @@ gpgpme starting with version 1.7.") ;; When cross-compiling, the bash script 'libgcrypt-config' ;; must be accessible during the configure phase. (setenv "PATH" - (string-append (assoc-ref inputs "libgcrypt") - "/bin:" (getenv "PATH"))))))))) + (string-append + (dirname + (search-input-file inputs "bin/libgcrypt-config")) + ":" (getenv "PATH"))))))))) (native-inputs `(("pkg-config" ,pkg-config) ("autoconf" ,autoconf) @@ -684,8 +686,7 @@ signing, decryption, verification, and key-listing parsing.") (add-before 'build 'set-gpg-file-name (lambda* (#:key inputs outputs #:allow-other-keys) - (let* ((gpg (string-append (assoc-ref inputs "gpg") - "/bin/gpg"))) + (let* ((gpg (search-input-file inputs "/bin/gpg"))) (substitute* "libpius/constants.py" (("/usr/bin/gpg2") gpg)) #t)))))) @@ -1213,8 +1214,7 @@ over.") (delete 'configure) ; no configure script (add-before 'install 'hardlink-gnupg (lambda* (#:key inputs #:allow-other-keys) - (let ((gpg (string-append (assoc-ref inputs "gnupg") - "/bin/gpg"))) + (let ((gpg (search-input-file inputs "/bin/gpg"))) (substitute* (find-files "." "jetring-[[:alpha:]]+$") (("gpg -") (string-append gpg " -")) (("\\\"gpg\\\"") (string-append "\"" gpg "\""))) diff --git a/gnu/packages/gnuzilla.scm b/gnu/packages/gnuzilla.scm index 74403751a9..1dc340c082 100644 --- a/gnu/packages/gnuzilla.scm +++ b/gnu/packages/gnuzilla.scm @@ -1460,8 +1460,7 @@ standards of the IceCat project.") (setenv "CC" "gcc") (setenv "MOZ_NOSPAM" "1") (setenv "PYTHON" - (string-append (assoc-ref inputs "python2") - "/bin/python")) + (search-input-file inputs "/bin/python")) (setenv "MOZ_BUILD_DATE" ,%icedove-build-id) ; avoid timestamp (setenv "LDFLAGS" (string-append "-Wl,-rpath=" (assoc-ref outputs "out") diff --git a/gnu/packages/golang.scm b/gnu/packages/golang.scm index 703b5fc57c..d3ef39a2e6 100644 --- a/gnu/packages/golang.scm +++ b/gnu/packages/golang.scm @@ -2,7 +2,7 @@ ;;; Copyright © 2016, 2017, 2018, 2019, 2020, 2021 Efraim Flashner ;;; Copyright © 2016 Matthew Jordan ;;; Copyright © 2016 Andy Wingo -;;; Copyright © 2016, 2019 Ludovic Courtès +;;; Copyright © 2016, 2019, 2021 Ludovic Courtès ;;; Copyright © 2016, 2017 Petter ;;; Copyright © 2016, 2017, 2018, 2019, 2020 Leo Famulari ;;; Copyright © 2017 Sergei Trofimovich @@ -1140,7 +1140,7 @@ your Go binary to be later served from an http.FileSystem.") (lambda* (#:key outputs inputs #:allow-other-keys) (let* ((output (assoc-ref outputs "out")) (doc_out (assoc-ref outputs "doc")) - (bash (string-append (assoc-ref inputs "bash") "bin/bash")) + (bash (search-input-file inputs "bin/bash")) (docs (string-append doc_out "/share/doc/" ,name "-" ,version)) (tests (string-append (assoc-ref outputs "tests") "/share/" ,name "-" ,version))) diff --git a/gnu/packages/graphviz.scm b/gnu/packages/graphviz.scm index 43eaecace4..3bfbcb2250 100644 --- a/gnu/packages/graphviz.scm +++ b/gnu/packages/graphviz.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2013, 2015 Ludovic Courtès +;;; Copyright © 2013, 2015, 2021 Ludovic Courtès ;;; Copyright © 2015, 2020 Efraim Flashner ;;; Copyright © 2016 Theodoros Foradis ;;; Copyright © 2017, 2018, 2019 Ricardo Wurmus @@ -359,8 +359,7 @@ Graphviz and LaTeX.") ":" (assoc-ref inputs "gdk-pixbuf") "/lib/girepository-1.0" ":" (assoc-ref inputs "atk") "/lib/girepository-1.0"))) `("PATH" ":" prefix - (,(string-append (assoc-ref inputs "graphviz") "/bin")))) - #t))))) + (,(dirname (search-input-file inputs "bin/dot")))))))))) (inputs `(("atk" ,atk) ("gdk-pixbuf" ,gdk-pixbuf+svg) diff --git a/gnu/packages/guile-xyz.scm b/gnu/packages/guile-xyz.scm index 6c834698b8..78f77d2547 100644 --- a/gnu/packages/guile-xyz.scm +++ b/gnu/packages/guile-xyz.scm @@ -1126,9 +1126,7 @@ messaging library.") ;; command. (substitute* "src/hmac.scm" (("openssl") - (string-append (assoc-ref inputs "openssl") - "/bin/openssl"))) - #t)) + (search-input-file inputs "/bin/openssl"))))) ;; XXX: The code uses 'include' to include its own source ;; files, and "-L src" isn't enough in this case. diff --git a/gnu/packages/haskell-xyz.scm b/gnu/packages/haskell-xyz.scm index 7ed0db6c66..2c48ce9586 100644 --- a/gnu/packages/haskell-xyz.scm +++ b/gnu/packages/haskell-xyz.scm @@ -3,7 +3,7 @@ ;;; Copyright © 2015 Siniša Biđin ;;; Copyright © 2015 Paul van der Walt ;;; Copyright © 2015, 2019 Eric Bavier -;;; Copyright © 2016, 2018, 2019 Ludovic Courtès +;;; Copyright © 2016, 2018, 2019, 2021 Ludovic Courtès ;;; Copyright © 2016, 2017 Nikita ;;; Copyright © 2016, 2019 Efraim Flashner ;;; Copyright © 2015, 2016, 2017, 2018, 2019 Ricardo Wurmus @@ -5895,8 +5895,7 @@ descriptions.") (let* ((out (assoc-ref outputs "out")) (elisp-file "elisp/hindent.el") (dest (string-append out "/share/emacs/site-lisp")) - (emacs (string-append (assoc-ref inputs "emacs") - "/bin/emacs"))) + (emacs (search-input-file inputs "/bin/emacs"))) (make-file-writable elisp-file) (emacs-substitute-variables elisp-file ("hindent-process-path" diff --git a/gnu/packages/ibus.scm b/gnu/packages/ibus.scm index cdd4708d22..12e9f3a79f 100644 --- a/gnu/packages/ibus.scm +++ b/gnu/packages/ibus.scm @@ -135,11 +135,14 @@ (lambda* (#:key inputs #:allow-other-keys) (substitute* "src/ibusenginesimple.c" (("/usr/share/X11/locale") - (string-append (assoc-ref inputs "libx11") - "/share/X11/locale"))) + (search-input-directory inputs + "share/X11/locale"))) (substitute* "ui/gtk3/xkblayout.vala" (("\"(setxkbmap|xmodmap)\"" _ prog) - (string-append "\"" (assoc-ref inputs prog) "/bin/" prog "\""))))) + (string-append "\"" + (search-input-file inputs + (string-append "bin/" prog)) + "\""))))) (add-before 'check 'pre-check (lambda _ ;; Tests write to $HOME. diff --git a/gnu/packages/image.scm b/gnu/packages/image.scm index c55a87ba9f..19bbb2d63d 100644 --- a/gnu/packages/image.scm +++ b/gnu/packages/image.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2013, 2017, 2019 Ludovic Courtès +;;; Copyright © 2013, 2017, 2019, 2021 Ludovic Courtès ;;; Copyright © 2013, 2015, 2016 Andreas Enge ;;; Copyright © 2014, 2015, 2016, 2020 Mark H Weaver ;;; Copyright © 2014, 2015 Alex Kost @@ -2343,9 +2343,7 @@ Wacom-style graphics tablets.") (lambda* (#:key inputs #:allow-other-keys) (substitute* (list "src/dependency.py" "src/exif.py") (("exiftool") - (string-append (assoc-ref inputs "perl-image-exiftool") - "/bin/exiftool"))) - #t)) + (search-input-file inputs "/bin/exiftool"))))) (add-before 'install 'check (lambda _ (invoke "pytest"))) diff --git a/gnu/packages/irc.scm b/gnu/packages/irc.scm index e386e54e77..470c7ec8f3 100644 --- a/gnu/packages/irc.scm +++ b/gnu/packages/irc.scm @@ -119,7 +119,7 @@ (modify-phases %standard-phases (add-after 'unpack 'patch-inxi-reference (lambda* (#:key inputs #:allow-other-keys) - (let ((inxi (string-append (assoc-ref inputs "inxi") "/bin/inxi"))) + (let ((inxi (search-input-file inputs "/bin/inxi"))) (symlink inxi "data/scripts/inxi") #t)))) #:tests? #f)) ; no test target diff --git a/gnu/packages/java.scm b/gnu/packages/java.scm index f7840f6ca4..fdfd044926 100644 --- a/gnu/packages/java.scm +++ b/gnu/packages/java.scm @@ -198,7 +198,7 @@ and binary format defined in The Java Virtual Machine Specification.") (delete 'configure) (add-before 'install 'fix-wrapper (lambda* (#:key inputs #:allow-other-keys) - (let ((jps (string-append (assoc-ref inputs "jdk") "/bin/jps"))) + (let ((jps (search-input-file inputs "/bin/jps"))) (substitute* "bin/drip" (("jps") jps) (("brew update && brew upgrade drip") "guix pull && guix install drip") @@ -378,11 +378,9 @@ JNI.") (lambda* (#:key inputs #:allow-other-keys) (setenv "JAVA_HOME" (assoc-ref inputs "jamvm")) (setenv "JAVACMD" - (string-append (assoc-ref inputs "jamvm") - "/bin/jamvm")) + (search-input-file inputs "/bin/jamvm")) (setenv "JAVAC" - (string-append (assoc-ref inputs "jikes") - "/bin/jikes")) + (search-input-file inputs "/bin/jikes")) (setenv "CLASSPATH" (string-append (assoc-ref inputs "jamvm") "/lib/rt.jar")) @@ -14163,8 +14161,7 @@ can be interpreted by IDEs and static analysis tools to improve code analysis.") "/dist/" jar-name)) (java-cp (string-append share "/" jar-name)) (bin (string-append %output "/bin")) - (java (string-append (assoc-ref inputs "jdk") - "/bin/java"))) + (java (search-input-file inputs "/bin/java"))) (install-file jar share) (mkdir-p bin) ;; Generate wrapper scripts for bin/, which invoke common diff --git a/gnu/packages/julia.scm b/gnu/packages/julia.scm index c637c36f61..97218656cc 100644 --- a/gnu/packages/julia.scm +++ b/gnu/packages/julia.scm @@ -286,7 +286,7 @@ libraries. It is also a bit like @code{ldd} and @code{otool -L}.") ;; call our version (substitute* "base/Makefile" (("\\$\\$\\(build_depsbindir\\)/libwhich") - (string-append (assoc-ref inputs "libwhich") "/bin/libwhich"))) + (search-input-file inputs "/bin/libwhich"))) #t)) (add-before 'check 'set-home ;; Some tests require a home directory to be set. diff --git a/gnu/packages/less.scm b/gnu/packages/less.scm index 32133943ae..c9b18ea36b 100644 --- a/gnu/packages/less.scm +++ b/gnu/packages/less.scm @@ -85,12 +85,11 @@ text editors.") (lambda* (#:key inputs #:allow-other-keys) (substitute* "lesspipe.sh" (("tput colors") - (string-append (assoc-ref inputs "ncurses") - "/bin/tput colors")) + (string-append (search-input-file inputs "/bin/tput") + " colors")) (("file -") - (string-append (assoc-ref inputs "file") - "/bin/file -"))) - #t))))) + (string-append (search-input-file inputs "/bin/file") + " -")))))))) (inputs `(("file" ,file) ("ncurses" ,ncurses))) ; for tput diff --git a/gnu/packages/libreoffice.scm b/gnu/packages/libreoffice.scm index 0dcdf46ff1..c1e7a58c59 100644 --- a/gnu/packages/libreoffice.scm +++ b/gnu/packages/libreoffice.scm @@ -6,7 +6,7 @@ ;;; Copyright © 2017 Thomas Danckaert ;;; Copyright © 2017–2021 Tobias Geerinckx-Rice ;;; Copyright © 2017 Andy Wingo -;;; Copyright © 2017, 2018, 2019 Ludovic Courtès +;;; Copyright © 2017, 2018, 2019, 2021 Ludovic Courtès ;;; Copyright © 2017, 2018, 2019 Marius Bakke ;;; Copyright © 2017 Rutger Helling ;;; Copyright © 2018, 2019 Ricardo Wurmus @@ -1228,10 +1228,7 @@ converting QuarkXPress file format. It supports versions 3.1 to 4.1.") (substitute* '("shell/source/unix/exec/shellexec.cxx" "shell/source/unix/misc/senddoc.sh") (("/usr/bin/xdg-open") - (string-append (assoc-ref inputs "xdg-utils") - "/bin/xdg-open"))) - - #t)) + (search-input-file inputs "/bin/xdg-open"))))) (add-after 'install 'reset-zip-timestamps (lambda* (#:key outputs #:allow-other-keys) (let ((out (assoc-ref outputs "out"))) diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm index ac584787b9..9e3ad367e2 100644 --- a/gnu/packages/linux.scm +++ b/gnu/packages/linux.scm @@ -3143,11 +3143,12 @@ processes currently causing I/O.") ;; it refers to the right ones. (substitute* '("lib/mount_util.c" "util/mount_util.c") (("/bin/(u?)mount" _ maybe-u) - (string-append (assoc-ref inputs "util-linux") - "/bin/" maybe-u "mount"))) - (substitute* "util/mount.fuse.c" - (("/bin/sh" command) - (string-append (assoc-ref inputs "bash-minimal") command))) + (search-input-file inputs + (string-append "bin/" + maybe-u "mount")))) + (substitute* '("util/mount.fuse.c") + (("/bin/sh") + (search-input-file inputs "/bin/sh"))) ;; This hack leads libfuse to search for 'fusermount' in ;; $PATH, where it may find a setuid-root binary, instead of @@ -4234,27 +4235,28 @@ country-specific regulations for the wireless spectrum.") (substitute* '("prog/pwm/pwmconfig" "prog/pwm/fancontrol") (("gnuplot") - (string-append (assoc-ref inputs "gnuplot") - "/bin/gnuplot")) + (search-input-file inputs "/bin/gnuplot")) (("cat ") - (string-append (assoc-ref inputs "coreutils") - "/bin/cat ")) + (string-append (search-input-file inputs "/bin/cat") + " ")) (("e?grep " match) - (string-append (assoc-ref inputs "grep") - "/bin/" match)) + (string-append (search-input-file inputs + (string-append + "/bin/" + (string-trim-right match))) + " ")) (("sed -e") - (string-append (assoc-ref inputs "sed") - "/bin/sed -e")) + (string-append (search-input-file inputs "/bin/sed") + " -e")) (("cut -d") - (string-append (assoc-ref inputs "coreutils") - "/bin/cut -d")) + (string-append (search-input-file inputs "/bin/cut") + " -d")) (("sleep ") - (string-append (assoc-ref inputs "coreutils") - "/bin/sleep ")) + (string-append (search-input-file inputs "/bin/sleep") + " ")) (("readlink -f") - (string-append (assoc-ref inputs "coreutils") - "/bin/readlink -f"))) - #t))))) + (string-append (search-input-file inputs "/bin/readlink") + " -f")))))))) (home-page "https://hwmon.wiki.kernel.org/lm_sensors") (synopsis "Utilities to read temperature/voltage/fan sensors") (description @@ -5152,7 +5154,7 @@ Bluetooth audio output devices like headphones or loudspeakers.") (("hid2hci --method") (string-append out "/lib/udev/hid2hci --method")) (("/sbin/udevadm") - (string-append (assoc-ref inputs "eudev") "/bin/udevadm"))) + (search-input-file inputs "/bin/udevadm"))) #t)))))) (native-inputs `(("pkg-config" ,pkg-config) @@ -7686,15 +7688,11 @@ the superuser to make device nodes.") (lambda* (#:key inputs #:allow-other-keys) (substitute* "scripts/fakeroot.in" (("getopt") - (string-append (assoc-ref inputs "util-linux") - "/bin/getopt")) + (search-input-file inputs "/bin/getopt")) (("sed") - (string-append (assoc-ref inputs "sed") - "/bin/sed")) + (search-input-file inputs "/bin/sed")) (("cut") - (string-append (assoc-ref inputs "coreutils") - "/bin/cut")) ) - #t)) + (search-input-file inputs "/bin/cut")) ))) (add-before 'configure 'setenv (lambda _ (setenv "LIBS" "-lacl") @@ -7795,10 +7793,8 @@ set as @code{LD_PRELOAD} to override the C library file system functions.") (replace 'build (lambda* (#:key inputs #:allow-other-keys) (with-directory-excursion "inputattach" - (invoke (string-append (assoc-ref inputs "gcc") - "/bin/gcc") - "-O2" "-o" "inputattach" "inputattach.c")) - #t)) + (invoke "gcc" "-O2" "-o" "inputattach" + "inputattach.c")))) (delete 'check) (replace 'install (lambda* (#:key outputs #:allow-other-keys) diff --git a/gnu/packages/lisp-xyz.scm b/gnu/packages/lisp-xyz.scm index dcb520d58a..72afc5cd68 100644 --- a/gnu/packages/lisp-xyz.scm +++ b/gnu/packages/lisp-xyz.scm @@ -15634,7 +15634,7 @@ related C functions to get information about the mounted file system.") (lambda* (#:key inputs #:allow-other-keys) (substitute* "src/unix/cl-diskspace-list-all-disks-with-df.lisp" (("grep") - (string-append (assoc-ref inputs "grep") "/bin/grep"))) + (search-input-file inputs "/bin/grep"))) (substitute* "src/unix/cl-diskspace-list-all-disks-with-df.lisp" (("/bin/df") (which "df"))) diff --git a/gnu/packages/lisp.scm b/gnu/packages/lisp.scm index be34b6c416..63f5ba744e 100644 --- a/gnu/packages/lisp.scm +++ b/gnu/packages/lisp.scm @@ -1106,12 +1106,11 @@ assembler, PEG) is less than 1MB.") (modify-phases %standard-phases (add-before 'install 'fix-utils-path (lambda* (#:key inputs #:allow-other-keys) - (let* ((coreutils (string-append (assoc-ref inputs "coreutils") "/bin/")) - (cat (string-append coreutils "cat")) - (paste (string-append coreutils "paste")) - (sort (string-append coreutils "sort")) - (basename (string-append coreutils "basename")) - (sed (string-append (assoc-ref inputs "sed") "/bin/sed"))) + (let* ((cat (search-input-file inputs "/bin/cat")) + (paste (search-input-file inputs "/bin/paste")) + (sort (search-input-file inputs "/bin/sort")) + (basename (search-input-file inputs "/bin/basename")) + (sed (search-input-file inputs "/bin/sed"))) (substitute* "lisp-repl-core-dumper" (("\\$\\(basename") (string-append "$(" basename)) (("\\") cat) diff --git a/gnu/packages/lua.scm b/gnu/packages/lua.scm index 73dfa0b675..7cadba6392 100644 --- a/gnu/packages/lua.scm +++ b/gnu/packages/lua.scm @@ -1193,7 +1193,7 @@ enabled.") (delete 'configure) (add-before 'build 'patch-lua-calls (lambda* (#:key inputs #:allow-other-keys) - (let ((lua (string-append (assoc-ref inputs "lua") "/bin/lua"))) + (let ((lua (search-input-file inputs "/bin/lua"))) (setenv "LUA" lua) (substitute* "old/launcher.lua" (("/usr/bin/env lua") lua)) @@ -1202,7 +1202,7 @@ enabled.") (lambda* (#:key inputs #:allow-other-keys) (substitute* "fennel" (("/usr/bin/env .*lua") - (string-append (assoc-ref inputs "lua") "/bin/lua"))) + (search-input-file inputs "/bin/lua"))) #t)) (delete 'check) (add-after 'install 'check diff --git a/gnu/packages/lxde.scm b/gnu/packages/lxde.scm index f81d7af3c4..bf32bc0994 100644 --- a/gnu/packages/lxde.scm +++ b/gnu/packages/lxde.scm @@ -398,9 +398,7 @@ with freedesktop.org standard.") "terminal_su=/run/setuid-programs/su") (("#graphical_su=/usr/bin/gksu") (string-append "graphical_su=" - (string-append (assoc-ref inputs "ktsuss") - "/bin/ktsuss")))) - #t))) + (search-input-file inputs "/bin/ktsuss"))))))) #:configure-flags (list (string-append "--with-preferable-sudo=" (assoc-ref %build-inputs "ktsuss") diff --git a/gnu/packages/mail.scm b/gnu/packages/mail.scm index a414eb2dda..496c0d6200 100644 --- a/gnu/packages/mail.scm +++ b/gnu/packages/mail.scm @@ -4120,7 +4120,7 @@ Git and exports them in maildir format or to an MDA through a pipe.") ;; 'git' is invoked in various files of the PublicInbox ;; perl module. `("PATH" ":" prefix - (,(string-append (assoc-ref inputs "git") "/bin"))))) + (,(dirname (search-input-file inputs "/bin/git")))))) (find-files (string-append out "/bin")))) #t))))) (native-inputs diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm index 0bfc6ef8c2..379ec222d2 100644 --- a/gnu/packages/maths.scm +++ b/gnu/packages/maths.scm @@ -1390,11 +1390,9 @@ extremely large and complex data collections.") "test/hdf5lib/junit.sh.in" "examples/runExample.sh.in") (("/usr/bin/test") - (string-append (assoc-ref inputs "coreutils") - "/bin/test")) + (search-input-file inputs "/bin/test")) (("/usr/bin/uname") - (string-append (assoc-ref inputs "coreutils") - "/bin/uname")) + (search-input-file inputs "/bin/uname")) (("CLASSPATH=[^\n]*") (string-append "CLASSPATH=" class-path))) (setenv "CLASSPATH" class-path)) @@ -3630,13 +3628,12 @@ to BMP, JPEG or PNG image formats.") (modify-phases %standard-phases (add-after 'unpack 'patch-paths (lambda* (#:key inputs #:allow-other-keys) - (let* ((sed (string-append (assoc-ref inputs "sed") "/bin/sed")) + (let* ((sed (search-input-file inputs "/bin/sed")) (coreutils (assoc-ref inputs "coreutils")) (dirname (string-append coreutils "/bin/dirname")) (head (string-append coreutils "/bin/head")) - (perl (string-append (assoc-ref inputs "perl") "/bin/perl")) - (python (string-append (assoc-ref inputs "python") - "/bin/python3"))) + (perl (search-input-file inputs "/bin/perl")) + (python (search-input-file inputs "/bin/python3"))) (substitute* "src/maxima.in" (("sed ") (string-append sed " ")) (("dirname") dirname) @@ -3670,8 +3667,7 @@ to BMP, JPEG or PNG image formats.") (let* ((gnuplot (assoc-ref inputs "gnuplot")) (out (assoc-ref outputs "out")) (datadir (string-append out "/share/maxima/" ,version)) - (binutils (string-append (assoc-ref inputs "binutils") - "/bin"))) + (binutils (dirname (search-input-file inputs "/bin/as")))) (with-directory-excursion out (mkdir-p "share/emacs") (mkdir-p "share/doc") @@ -6438,9 +6434,8 @@ of C, Java, or Ada programs.") (modify-phases %standard-phases (add-before 'configure 'export-shell (lambda* (#:key inputs #:allow-other-keys) - (setenv "CONFIG_SHELL" (string-append (assoc-ref inputs "bash") - "/bin/sh")) - #t))))) + (setenv "CONFIG_SHELL" + (search-input-file inputs "/bin/sh"))))))) (inputs `(("gmp" ,gmp))) (propagated-inputs diff --git a/gnu/packages/messaging.scm b/gnu/packages/messaging.scm index 29f9a0d08c..d289dbf170 100644 --- a/gnu/packages/messaging.scm +++ b/gnu/packages/messaging.scm @@ -282,9 +282,7 @@ user interfaces in a fast and easy way. It is based on GLib and ncurses.") (lambda* (#:key inputs #:allow-other-keys) (substitute* "protobufgen.sh" (("/bin/sh") - (string-append (assoc-ref inputs "bash") - "/bin/sh"))) - #t))))) + (search-input-file inputs "/bin/sh")))))))) (native-inputs `(("autoconf" ,autoconf) ("automake" ,automake) diff --git a/gnu/packages/music.scm b/gnu/packages/music.scm index 7c57b45029..492103b715 100644 --- a/gnu/packages/music.scm +++ b/gnu/packages/music.scm @@ -17,7 +17,7 @@ ;;; Copyright © 2018 nee ;;; Copyright © 2018, 2021 Stefan Reichör ;;; Copyright © 2018 Pierre Neidhardt -;;; Copyright © 2018, 2019 Ludovic Courtès +;;; Copyright © 2018, 2019, 2021 Ludovic Courtès ;;; Copyright © 2018 Björn Höfling ;;; Copyright © 2019 Gabriel Hondet ;;; Copyright © 2019 Timotej Lazar @@ -625,7 +625,7 @@ many input formats and provides a customisable Vi-style user interface.") ;; Replace hard-coded diff file name. (substitute* "tests/integration.c" (("/usr/bin/diff") - (string-append (assoc-ref inputs "diffutils") "/bin/diff"))) + (search-input-file inputs "/bin/diff"))) ;; Denemo's documentation says to use this command to run its ;; test suite. (invoke "make" "-C" "tests" "check"))) @@ -633,8 +633,7 @@ many input formats and provides a customisable Vi-style user interface.") ;; This phase sets the default path for lilypond to its current ;; location in the store. (lambda* (#:key inputs #:allow-other-keys) - (let* ((lilypond (string-append (assoc-ref inputs "lilypond") - "/bin/lilypond"))) + (let* ((lilypond (search-input-file inputs "/bin/lilypond"))) (substitute* "src/core/prefops.c" (("g_string_new \\(\"lilypond\"\\);") (string-append "g_string_new (\"" @@ -3316,8 +3315,7 @@ socket or command line.") (lambda* (#:key inputs #:allow-other-keys) (substitute* "curseradio/curseradio.py" (("/usr/bin/mpv") - (string-append (assoc-ref inputs "mpv") "/bin/mpv"))) - #t))))) + (search-input-file inputs "/bin/mpv")))))))) (propagated-inputs `(("python-lxml" ,python-lxml) ("python-requests" ,python-requests) diff --git a/gnu/packages/netpbm.scm b/gnu/packages/netpbm.scm index 96025661ca..11fe135a17 100644 --- a/gnu/packages/netpbm.scm +++ b/gnu/packages/netpbm.scm @@ -143,8 +143,7 @@ (("\"%s/gs\"") "\"%s/gsc\"") (("/usr/bin/gs") - (string-append (assoc-ref inputs "ghostscript") "/bin/gsc")))) - #t)) + (search-input-file inputs "/bin/gsc")))))) (add-before 'check 'setup-check (lambda _ ;; install temporarily into /tmp/netpbm diff --git a/gnu/packages/networking.scm b/gnu/packages/networking.scm index dfa91cd553..64cbec4c08 100644 --- a/gnu/packages/networking.scm +++ b/gnu/packages/networking.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2014, 2017, 2018 Ludovic Courtès +;;; Copyright © 2014, 2017, 2018, 2021 Ludovic Courtès ;;; Copyright © 2015, 2016, 2017, 2018, 2020 Ricardo Wurmus ;;; Copyright © 2015 Mark H Weaver ;;; Copyright © 2015, 2016, 2017, 2021 Stefan Reichör @@ -643,11 +643,12 @@ systems with no further dependencies.") "blueman-manager.in" "blueman-mechanism.in" "blueman-rfcomm-watcher.in" "blueman-sendto.in" "blueman-services.in" "blueman-tray.in") - (("@PYTHON@") (string-append (assoc-ref inputs "python") - "/bin/python" - ,(version-major+minor - (package-version python)))))) - #t)) + (("@PYTHON@") + (search-input-file inputs + (string-append + "/bin/python" + ,(version-major+minor + (package-version python))))))))) ;; Fix loading of external programs. (add-after 'unpack 'patch-external-programs (lambda* (#:key inputs #:allow-other-keys) @@ -657,12 +658,9 @@ systems with no further dependencies.") (string-append (assoc-ref inputs "bluez") "/libexec/bluetooth/bluetoothd")) (("/sbin/iptables") - (string-append (assoc-ref inputs "iptables") - "/sbin/iptables")) + (search-input-file inputs "/sbin/iptables")) (("/usr/sbin/pppd") - (string-append (assoc-ref inputs "ppp") - "/sbin/pppd"))) - #t)) + (search-input-file inputs "/sbin/pppd"))))) ;; Fix loading of pulseaudio libraries. (add-after 'unpack 'patch-pulseaudio-libraries (lambda* (#:key inputs #:allow-other-keys) @@ -1740,9 +1738,7 @@ TCP connection, TLS handshake and so on) in the terminal.") (lambda* (#:key inputs #:allow-other-keys) (substitute* "test-suite/testheaders.sh" (("/bin/true") - (string-append (assoc-ref inputs "coreutils") - "/bin/true"))) - #t))))) + (search-input-file inputs "/bin/true")))))))) (inputs `(("perl" ,perl) ("openldap" ,openldap) @@ -1837,8 +1833,8 @@ live network and disk I/O bandwidth monitor.") #t)) (add-after 'build 'absolutize-tools (lambda* (#:key inputs #:allow-other-keys) - (let ((ethtool (string-append (assoc-ref inputs "ethtool") - "/sbin/ethtool"))) + (let ((ethtool (search-input-file inputs + "/sbin/ethtool"))) (substitute* "scripts/airmon-ng" (("ethtool ") (string-append ethtool " "))) diff --git a/gnu/packages/node.scm b/gnu/packages/node.scm index 36c45e9c7a..6285138e06 100644 --- a/gnu/packages/node.scm +++ b/gnu/packages/node.scm @@ -2,7 +2,7 @@ ;;; Copyright © 2014 Cyrill Schenkel ;;; Copyright © 2015 Andreas Enge ;;; Copyright © 2015, 2016 David Thompson -;;; Copyright © 2016 Ludovic Courtès +;;; Copyright © 2016, 2021 Ludovic Courtès ;;; Copyright © 2017 Mike Gerwitz ;;; Copyright © 2018 Tobias Geerinckx-Rice ;;; Copyright © 2018, 2019, 2020, 2021 Marius Bakke @@ -169,10 +169,9 @@ (format #t "configure flags: ~s~%" flags) ;; Node's configure script expects the CC environment variable to ;; be set. - (setenv "CC" (string-append (assoc-ref inputs "gcc") "/bin/gcc")) + (setenv "CC" (search-input-file inputs "/bin/gcc")) (apply invoke - (string-append (assoc-ref inputs "python") - "/bin/python") + (search-input-file inputs "/bin/python") "configure" flags)))) (add-after 'patch-shebangs 'patch-npm-shebang (lambda* (#:key outputs #:allow-other-keys) @@ -387,8 +386,7 @@ Node.js and web browsers.") (delete 'configure) (replace 'build (lambda* (#:key inputs #:allow-other-keys) - (let ((esbuild (string-append (assoc-ref inputs "esbuild") - "/bin/esbuild"))) + (let ((esbuild (search-input-file inputs "/bin/esbuild"))) (invoke esbuild "--platform=node" "--outfile=lib/builder.js" @@ -443,8 +441,7 @@ Node.js and web browsers.") (delete 'configure) (replace 'build (lambda* (#:key inputs #:allow-other-keys) - (let ((esbuild (string-append (assoc-ref inputs "esbuild") - "/bin/esbuild"))) + (let ((esbuild (search-input-file inputs "/bin/esbuild"))) (invoke esbuild "--platform=node" "--outfile=lib/frontend.js" @@ -498,8 +495,7 @@ Node.js and web browsers.") (delete 'configure) (replace 'build (lambda* (#:key inputs #:allow-other-keys) - (let ((esbuild (string-append (assoc-ref inputs "esbuild") - "/bin/esbuild"))) + (let ((esbuild (search-input-file inputs "/bin/esbuild"))) (invoke esbuild "--platform=node" "--outfile=lib/api.js" @@ -552,8 +548,7 @@ parser definition into a C output.") (modify-phases %standard-phases (replace 'configure (lambda* (#:key inputs #:allow-other-keys) - (let ((esbuild (string-append (assoc-ref inputs "esbuild") - "/bin/esbuild"))) + (let ((esbuild (search-input-file inputs "/bin/esbuild"))) (invoke esbuild "--platform=node" "--outfile=bin/generate.js" @@ -639,8 +634,7 @@ source files.") ;; be set. (setenv "CC" ,(cc-for-target)) (apply invoke - (string-append (assoc-ref inputs "python") - "/bin/python3") + (search-input-file inputs "/bin/python3") "configure" flags)))) (replace 'patch-files (lambda* (#:key inputs #:allow-other-keys) diff --git a/gnu/packages/ocaml.scm b/gnu/packages/ocaml.scm index fd09459f24..d987201508 100644 --- a/gnu/packages/ocaml.scm +++ b/gnu/packages/ocaml.scm @@ -210,8 +210,7 @@ This package produces a native @command{ocamlc} and a bytecode @command{ocamllex (modify-phases %standard-phases (add-after 'unpack 'patch-/bin/sh-references (lambda* (#:key inputs #:allow-other-keys) - (let* ((sh (string-append (assoc-ref inputs "bash") - "/bin/sh")) + (let* ((sh (search-input-file inputs "/bin/sh")) (quoted-sh (string-append "\"" sh "\""))) (with-fluids ((%default-port-encoding #f)) (for-each @@ -805,8 +804,7 @@ the opam file format.") (add-before 'build 'pre-build (lambda* (#:key inputs make-flags #:allow-other-keys) (let ((bash (assoc-ref inputs "bash")) - (bwrap (string-append (assoc-ref inputs "bubblewrap") - "/bin/bwrap"))) + (bwrap (search-input-file inputs "/bin/bwrap"))) (substitute* "src/core/opamSystem.ml" (("\"/bin/sh\"") (string-append "\"" bash "/bin/sh\"")) @@ -3674,8 +3672,8 @@ and 4 (random based) according to RFC 4122.") (modify-phases %standard-phases (add-before 'configure 'set-shell (lambda* (#:key inputs #:allow-other-keys) - (setenv "CONFIG_SHELL" (string-append (assoc-ref inputs "bash") - "/bin/sh"))))))) + (setenv "CONFIG_SHELL" + (search-input-file inputs "/bin/sh"))))))) (inputs `(("lablgtk" ,lablgtk))) (properties `((upstream-name . "ocamlgraph"))) (home-page "http://ocamlgraph.lri.fr/") diff --git a/gnu/packages/orpheus.scm b/gnu/packages/orpheus.scm index d981be279c..8214311a18 100644 --- a/gnu/packages/orpheus.scm +++ b/gnu/packages/orpheus.scm @@ -76,12 +76,9 @@ ;; To avoid propagating the mpg321 and vorbis-tools inputs, we can ;; make the orpheus application execute the needed players from the ;; store. - (let ((ogg123 (string-append (assoc-ref inputs "vorbis-tools") - "/bin/ogg123")) - (mpg321 (string-append (assoc-ref inputs "mpg321") - "/bin/mpg321")) - (which (string-append (assoc-ref inputs "which") - "/bin/which"))) + (let ((ogg123 (search-input-file inputs "/bin/ogg123")) + (mpg321 (search-input-file inputs "/bin/mpg321")) + (which (search-input-file inputs "/bin/which"))) (substitute* "src/orpheusconf.cc" (("ogg123") ogg123) (("which") which) diff --git a/gnu/packages/password-utils.scm b/gnu/packages/password-utils.scm index 7da8b23fe1..504a908100 100644 --- a/gnu/packages/password-utils.scm +++ b/gnu/packages/password-utils.scm @@ -523,11 +523,11 @@ any X11 window.") (substitute* "contrib/dmenu/passmenu" (("dmenu=dmenu\n") (string-append "dmenu=" - (assoc-ref inputs "dmenu") "/bin/dmenu\n")) + (search-input-file inputs "/bin/dmenu") + "\n")) (("xdotool=\"xdotool") (string-append "xdotool=\"" - (assoc-ref inputs "xdotool") "/bin/xdotool"))) - #t)) + (search-input-file inputs "/bin/xdotool")))))) (add-after 'install 'install-passmenu (lambda* (#:key outputs #:allow-other-keys) (let* ((out (assoc-ref outputs "out")) diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm index f4d574e2b2..aa6b29df26 100644 --- a/gnu/packages/python.scm +++ b/gnu/packages/python.scm @@ -822,7 +822,7 @@ ease from the desktop to a microcontroller or embedded system.") (substitute* '("lib-python/3/subprocess.py") ;; Fix shell path (("/bin/sh") - (string-append (assoc-ref inputs "bash-minimal") "/bin/sh"))) + (search-input-file inputs "/bin/sh"))) (substitute* '("lib-python/3/distutils/unixccompiler.py") ;; gcc-toolchain does not provide symlink cc -> gcc (("\"cc\"") "\"gcc\"")) diff --git a/gnu/packages/qt.scm b/gnu/packages/qt.scm index 95618a9787..f80ea336d8 100644 --- a/gnu/packages/qt.scm +++ b/gnu/packages/qt.scm @@ -168,9 +168,7 @@ (lambda* (#:key inputs #:allow-other-keys) (substitute* "qt5ct.pro" (("\\$\\$\\[QT_INSTALL_BINS\\]/lrelease") - (string-append (assoc-ref inputs "qttools") - "/bin/lrelease"))) - #t)) + (search-input-file inputs "/bin/lrelease"))))) (replace 'configure (lambda* (#:key outputs #:allow-other-keys) (let* ((out (assoc-ref outputs "out"))) diff --git a/gnu/packages/radio.scm b/gnu/packages/radio.scm index 443b115d46..d8f4161eb7 100644 --- a/gnu/packages/radio.scm +++ b/gnu/packages/radio.scm @@ -723,9 +723,7 @@ to access different radio hardware.") (lambda* (#:key inputs #:allow-other-keys) (substitute* "git-version-gen" (("/bin/sh") - (string-append (assoc-ref inputs "bash") - "/bin/bash"))) - #t))))) + (search-input-file inputs "/bin/bash")))))))) (synopsis "DSP primitives for SDR") (description "This a C-language library for common DSP (Digital Signal Processing) diff --git a/gnu/packages/ruby.scm b/gnu/packages/ruby.scm index cfc91f73af..2fe60c4fa2 100644 --- a/gnu/packages/ruby.scm +++ b/gnu/packages/ruby.scm @@ -1,6 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2014, 2015 Pjotr Prins -;;; Copyright © 2014, 2015, 2016, 2017 Ludovic Courtès +;;; Copyright © 2014, 2015, 2016, 2017, 2021 Ludovic Courtès ;;; Copyright © 2014, 2015 Mark H Weaver ;;; Copyright © 2014, 2015 David Thompson ;;; Copyright © 2015, 2019 Ricardo Wurmus @@ -1175,8 +1175,7 @@ structure. Supports custom object formatting via plugins.") #t)) (add-after 'unpack 'patch-pandoc-path (lambda* (#:key inputs #:allow-other-keys) - (let ((pandoc (string-append (assoc-ref inputs "pandoc") - "/bin/pandoc"))) + (let ((pandoc (search-input-file inputs "/bin/pandoc"))) (substitute* "lib/pandoc-ruby.rb" (("@@pandoc_path = 'pandoc'") (format #f "@@pandoc_path = '~a'" pandoc))) @@ -4850,8 +4849,7 @@ you to merge elements inside a hash together recursively.") (lambda* (#:key inputs outputs #:allow-other-keys) ;; Make the default git binary an absolute path to the ;; store. - (let ((git (string-append (assoc-ref inputs "git") - "/bin/git")) + (let ((git (search-input-file inputs "/bin/git")) (config (string-append (assoc-ref outputs "out") "/lib/ruby/vendor_ruby/gems/git-" diff --git a/gnu/packages/rust.scm b/gnu/packages/rust.scm index 0e0c33068f..fd6233fc94 100644 --- a/gnu/packages/rust.scm +++ b/gnu/packages/rust.scm @@ -325,7 +325,7 @@ safety and thread safety guarantees.") (lambda* (#:key inputs #:allow-other-keys) (setenv "SHELL" (which "sh")) (setenv "CONFIG_SHELL" (which "sh")) - (setenv "CC" (string-append (assoc-ref inputs "gcc") "/bin/gcc")) + (setenv "CC" (search-input-file inputs "/bin/gcc")) ;; The Guix LLVM package installs only shared libraries. (setenv "LLVM_LINK_SHARED" "1"))) (add-after 'unpack 'neuter-tidy diff --git a/gnu/packages/screen.scm b/gnu/packages/screen.scm index af40bd73f9..502e8f11af 100644 --- a/gnu/packages/screen.scm +++ b/gnu/packages/screen.scm @@ -132,8 +132,7 @@ controlling terminal and attach to it later.") (add-after 'install 'wrap-python-scripts (lambda* (#:key inputs outputs #:allow-other-keys) - (let* ((python (string-append (assoc-ref inputs "python") - "/bin/python")) + (let* ((python (search-input-file inputs "/bin/python")) (out (assoc-ref outputs "out")) (config (string-append out "/bin/byobu-config")) (select (string-append out "/bin/byobu-select-session"))) diff --git a/gnu/packages/statistics.scm b/gnu/packages/statistics.scm index e03761f87f..bdc72d218b 100644 --- a/gnu/packages/statistics.scm +++ b/gnu/packages/statistics.scm @@ -216,8 +216,7 @@ This package also provides @command{xls2csv} to export Excel files to CSV.") #t)) (add-before 'configure 'patch-uname (lambda* (#:key inputs #:allow-other-keys) - (let ((uname-bin (string-append (assoc-ref inputs "coreutils") - "/bin/uname"))) + (let ((uname-bin (search-input-file inputs "/bin/uname"))) (substitute* "src/scripts/R.sh.in" (("uname") uname-bin))) #t)) diff --git a/gnu/packages/suckless.scm b/gnu/packages/suckless.scm index 65f4fa85a9..0f0491b39b 100644 --- a/gnu/packages/suckless.scm +++ b/gnu/packages/suckless.scm @@ -353,8 +353,8 @@ drawing.") (add-before 'build 'set-dmenu-and-xprop-file-name (lambda* (#:key inputs #:allow-other-keys) (substitute* "config.def.h" - (("dmenu") (string-append (assoc-ref inputs "dmenu") "/bin/dmenu")) - (("xprop") (string-append (assoc-ref inputs "xprop") "/bin/xprop"))) + (("dmenu") (search-input-file inputs "/bin/dmenu")) + (("xprop") (search-input-file inputs "/bin/xprop"))) #t))))) (inputs `(("dmenu" ,dmenu) diff --git a/gnu/packages/syndication.scm b/gnu/packages/syndication.scm index cda7569dfa..58db738130 100644 --- a/gnu/packages/syndication.scm +++ b/gnu/packages/syndication.scm @@ -599,7 +599,7 @@ that aims to be quite fast and comfortable to its user.") (add-after 'unpack 'patch-mpv-path (lambda* (#:key inputs #:allow-other-keys) (substitute* "gfeeds/confManager.py" - (("mpv") (string-append (assoc-ref inputs "mpv") "/bin/mpv"))) + (("mpv") (search-input-file inputs "/bin/mpv"))) #t)) (add-after 'install 'wrap-gfeeds (lambda* (#:key outputs #:allow-other-keys) diff --git a/gnu/packages/telephony.scm b/gnu/packages/telephony.scm index 37ff103c42..9924031993 100644 --- a/gnu/packages/telephony.scm +++ b/gnu/packages/telephony.scm @@ -556,8 +556,8 @@ address of one of the participants.") (lambda* (#:key inputs outputs #:allow-other-keys) (invoke "qmake" "main.pro" "QMAKE_LRELEASE=lrelease" (string-append "MUMBLE_PYTHON=" - (string-append (assoc-ref inputs "python") - "/bin/python3")) + (search-input-file inputs + "/bin/python3")) (string-append "CONFIG+=" (string-join ;; Options used are listed in the same order diff --git a/gnu/packages/terminals.scm b/gnu/packages/terminals.scm index 735373dfa7..496b725543 100644 --- a/gnu/packages/terminals.scm +++ b/gnu/packages/terminals.scm @@ -1350,7 +1350,7 @@ basic input/output.") (bin (string-append out "/bin")) (share (string-append out "/share")) (icons (string-append share "/icons/hicolor/scalable/apps")) - (tic (string-append (assoc-ref inputs "ncurses") "/bin/tic")) + (tic (search-input-file inputs "/bin/tic")) (man (string-append share "/man/man1")) (alacritty-bin "target/release/alacritty")) ;; Install the executable. diff --git a/gnu/packages/tex.scm b/gnu/packages/tex.scm index 681a1aa972..33d9064c80 100644 --- a/gnu/packages/tex.scm +++ b/gnu/packages/tex.scm @@ -466,8 +466,8 @@ files from LOCATIONS with expected checksum HASH. CODE is not currently in use. (cut member <> '("." "..")))))) (tlpkg-src (string-append tl-extra-root "/" tl-extra-dir "/tlpkg")) - (config.guess (string-append (assoc-ref inputs "config") - "/bin/config.guess"))) + (config.guess (search-input-file inputs + "/bin/config.guess"))) ;; Create symbolic links for the latex variants and their ;; man pages. diff --git a/gnu/packages/uml.scm b/gnu/packages/uml.scm index ad766beece..83f10a08a1 100644 --- a/gnu/packages/uml.scm +++ b/gnu/packages/uml.scm @@ -54,8 +54,7 @@ #t)) (add-after 'delete-extra-from-classpath 'patch-usr-bin-dot (lambda* (#:key inputs #:allow-other-keys) - (let ((dot (string-append (assoc-ref inputs "graphviz") - "/bin/dot"))) + (let ((dot (search-input-file inputs "/bin/dot"))) (substitute* "src/net/sourceforge/plantuml/cucadiagram/dot/GraphvizLinux.java" (("/usr/bin/dot") dot))) diff --git a/gnu/packages/version-control.scm b/gnu/packages/version-control.scm index 3691336d3f..8bdac8df53 100644 --- a/gnu/packages/version-control.scm +++ b/gnu/packages/version-control.scm @@ -1,7 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2013 Nikita Karetnikov ;;; Copyright © 2013 Cyril Roelandt -;;; Copyright © 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020 Ludovic Courtès +;;; Copyright © 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021 Ludovic Courtès ;;; Copyright © 2013, 2014 Andreas Enge ;;; Copyright © 2015, 2016 Mathieu Lirzin ;;; Copyright © 2014, 2015, 2016 Mark H Weaver @@ -1035,9 +1035,8 @@ a built-in cache to decrease server I/O pressure.") (assoc-ref inputs "git") "/bin/git" "'")) (("/usr/sbin/sendmail") - (string-append (assoc-ref inputs "sendmail") - "/usr/sbin/sendmail"))) - #t))))) + (search-input-file inputs + "/usr/sbin/sendmail")))))))) (inputs `(("git" ,git) ("sendmail" ,sendmail))) @@ -1424,8 +1423,7 @@ also walk each side of a merge and test those changes individually.") (delete 'build) (add-before 'install 'patch-scripts (lambda* (#:key inputs #:allow-other-keys) - (let ((perl (string-append (assoc-ref inputs "perl") - "/bin/perl"))) + (let ((perl (search-input-file inputs "/bin/perl"))) ;; This seems to take care of every shell script that ;; invokes Perl. (substitute* (find-files "." ".*") @@ -1462,8 +1460,7 @@ also walk each side of a merge and test those changes individually.") (substitute* '("src/lib/Gitolite/Hooks/PostUpdate.pm" "src/lib/Gitolite/Hooks/Update.pm") (("/usr/bin/perl") - (string-append (assoc-ref inputs "perl") - "/bin/perl"))) + (search-input-file inputs "/bin/perl"))) (substitute* "src/lib/Gitolite/Common.pm" (("\"ssh-keygen") @@ -1759,10 +1756,8 @@ history. It implements the changeset evolution concept for Mercurial.") (modify-phases %standard-phases (add-after 'unpack 'patch-paths (lambda* (#:key inputs #:allow-other-keys) - (let ((gpg (string-append (assoc-ref inputs "gnupg") - "/bin/gpg")) - (openssl (string-append (assoc-ref inputs "openssl") - "/bin/openssl"))) + (let ((gpg (search-input-file inputs "/bin/gpg")) + (openssl (search-input-file inputs "/bin/openssl"))) (substitute* "commitsigs.py" (("b'gpg',") (string-append "b'" gpg "',")) (("b'openssl',") (string-append "b'" openssl "',"))))))) @@ -2707,8 +2702,7 @@ directory full of HOWTOs.") #t)) (add-before 'install 'patch-git (lambda* (#:key inputs #:allow-other-keys) - (let ((git (string-append (assoc-ref inputs "git") - "/bin/git"))) + (let ((git (search-input-file inputs "/bin/git"))) (substitute* "bin/git-when-merged" (("'git'") (string-append "'" git "'"))) #t))) @@ -2752,8 +2746,7 @@ how information about the merge is displayed.") (delete 'configure) (add-before 'install 'patch-git (lambda* (#:key inputs #:allow-other-keys) - (let ((git (string-append (assoc-ref inputs "git") - "/bin/git"))) + (let ((git (search-input-file inputs "/bin/git"))) (substitute* "git-imerge" (("'git'") (string-append "'" git "'"))) #t))) @@ -3045,11 +3038,10 @@ defects faster.") (substitute* "tests/test_main.py" (("'gita\\\\n'") "'source\\n'") (("'gita'") "'source'")) - (invoke (string-append (assoc-ref inputs "git") "/bin/git") + (invoke (search-input-file inputs "/bin/git") "init") (add-installed-pythonpath inputs outputs) - (invoke (string-append (assoc-ref inputs "python-pytest") - "/bin/pytest") + (invoke (search-input-file inputs "/bin/pytest") "-vv" "tests"))) (add-after 'install 'install-shell-completions (lambda* (#:key outputs #:allow-other-keys) diff --git a/gnu/packages/video.scm b/gnu/packages/video.scm index b2bb7b8d3b..12b98fe9a1 100644 --- a/gnu/packages/video.scm +++ b/gnu/packages/video.scm @@ -2435,8 +2435,7 @@ other site that youtube-dl supports.") ;; Explicitly invoke the input ffmpeg, instead of whichever one ;; happens to be in the user's $PATH at run time. (lambda* (#:key inputs #:allow-other-keys) - (let ((ffmpeg (string-append (assoc-ref inputs "ffmpeg") - "/bin/ffmpeg"))) + (let ((ffmpeg (search-input-file inputs "/bin/ffmpeg"))) (substitute* "src/you_get/processor/ffmpeg.py" ;; Don't blindly replace all occurrences of ‘'ffmpeg'’: the ;; same string is also used when sniffing ffmpeg's output. diff --git a/gnu/packages/vim.scm b/gnu/packages/vim.scm index 609349cd8f..e14c5aadca 100644 --- a/gnu/packages/vim.scm +++ b/gnu/packages/vim.scm @@ -771,8 +771,7 @@ refactor Vim in order to: (modify-phases %standard-phases (add-after 'configure 'reference-nvim (lambda* (#:key inputs #:allow-other-keys) - (let ((nvim (string-append (assoc-ref inputs "neovim") - "/bin/nvim"))) + (let ((nvim (search-input-file inputs "/bin/nvim"))) ;; This substitution should change one line, and replaces the default ;; value in the struct of options with an absolute store reference. (substitute* "../source/src/main.c" diff --git a/gnu/packages/virtualization.scm b/gnu/packages/virtualization.scm index c3459ebb15..b223016d17 100644 --- a/gnu/packages/virtualization.scm +++ b/gnu/packages/virtualization.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2013, 2014, 2015, 2016, 2017, 2020 Ludovic Courtès +;;; Copyright © 2013, 2014, 2015, 2016, 2017, 2020, 2021 Ludovic Courtès ;;; Copyright © 2015, 2016, 2017, 2018 Mark H Weaver ;;; Copyright © 2016, 2017, 2018. 2019, 2020 Efraim Flashner ;;; Copyright © 2016, 2017 Ricardo Wurmus @@ -247,7 +247,7 @@ ;; Configure, build and install QEMU user-emulation static binaries. (add-after 'configure 'configure-user-static (lambda* (#:key inputs outputs #:allow-other-keys) - (let* ((gcc (string-append (assoc-ref inputs "gcc") "/bin/gcc")) + (let* ((gcc (search-input-file inputs "/bin/gcc")) (static (assoc-ref outputs "static")) ;; This is the common set of configure flags; it is ;; duplicated here to isolate this phase from manipulations @@ -1239,8 +1239,8 @@ virtualization library.") (lambda* (#:key inputs #:allow-other-keys) ;; Xen is not available for now - so only patch qemu. (substitute* "virtManager/createconn.py" - (("/usr(/bin/qemu-system)" _ suffix) - (string-append (assoc-ref inputs "qemu") suffix))) + (("/usr(/bin/qemu-system-[a-zA-Z0-9_-]+)" _ suffix) + (search-input-file inputs suffix))) #t)) (add-before 'wrap 'wrap-with-GI_TYPELIB_PATH (lambda* (#:key inputs outputs #:allow-other-keys) @@ -1371,9 +1371,7 @@ domains, their live performance and resource utilization statistics.") (("\\$\\(PYTHON\\)") "python2")) (substitute* "lib/Makefile" (("\\$\\(PYTHON\\)") - (string-append (assoc-ref inputs "python") - "/bin/python"))) - #t)) + (search-input-file inputs "/bin/python"))))) (add-before 'build 'fix-symlink (lambda* (#:key inputs #:allow-other-keys) ;; The file 'images/google/protobuf/descriptor.proto' points to diff --git a/gnu/packages/vpn.scm b/gnu/packages/vpn.scm index f3db1c198f..852d0038c7 100644 --- a/gnu/packages/vpn.scm +++ b/gnu/packages/vpn.scm @@ -1,6 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2013 Andreas Enge -;;; Copyright © 2013, 2016, 2018, 2019, 2020 Ludovic Courtès +;;; Copyright © 2013, 2016, 2018, 2019, 2020, 2021 Ludovic Courtès ;;; Copyright © 2014 Eric Bavier ;;; Copyright © 2015 Jeff Mickey ;;; Copyright © 2016, 2017, 2019, 2021 Efraim Flashner @@ -323,7 +323,7 @@ endpoints.") "/bin/" command))) (substitute* "src/libstrongswan/utils/process.c" (("/bin/sh") - (string-append (assoc-ref inputs "bash") "/bin/sh"))) + (search-input-file inputs "/bin/sh"))) (substitute* "src/libstrongswan/tests/suites/test_process.c" (("/bin/sh") (which "sh")) @@ -1115,8 +1115,7 @@ public keys and can roam across IP addresses.") (lambda* (#:key inputs #:allow-other-keys) (substitute* "l2tp.h" (("/usr/sbin/pppd") - (string-append (assoc-ref inputs "ppp") - "/sbin/pppd"))) + (search-input-file inputs "/sbin/pppd"))) (setenv "KERNELSRC" (assoc-ref inputs "linux-libre-headers")) #t))) diff --git a/gnu/packages/wm.scm b/gnu/packages/wm.scm index 51034cac4b..66440e5008 100644 --- a/gnu/packages/wm.scm +++ b/gnu/packages/wm.scm @@ -8,7 +8,7 @@ ;;; Copyright © 2016, 2019, 2020 Efraim Flashner ;;; Copyright © 2016 Al McElrath ;;; Copyright © 2016 Carlo Zancanaro -;;; Copyright © 2016, 2017, 2018, 2019 Ludovic Courtès +;;; Copyright © 2016, 2017, 2018, 2019, 2021 Ludovic Courtès ;;; Copyright © 2016, 2017, 2018, 2020 Nikita ;;; Copyright © 2016 doncatnip ;;; Copyright © 2016 Ivan Vilata i Balaguer @@ -613,14 +613,10 @@ Features include: (lambda* (#:key inputs outputs #:allow-other-keys) (let* ((out (assoc-ref outputs "out")) (icons (string-append out "/share/i3lock-fancy/icons/")) - (wmctrl (string-append (assoc-ref inputs "wmctrl") - "/bin/wmctrl")) - (mconvert (string-append (assoc-ref inputs "imagemagick") - "/bin/convert")) - (mimport (string-append (assoc-ref inputs "imagemagick") - "/bin/import")) - (awk (string-append (assoc-ref inputs "gawk") - "/bin/gawk"))) + (wmctrl (search-input-file inputs "/bin/wmctrl")) + (mconvert (search-input-file inputs "/bin/convert")) + (mimport (search-input-file inputs "/bin/import")) + (awk (search-input-file inputs "/bin/gawk"))) (substitute* "lock" (("\\$\\(command -V wmctrl\\)") wmctrl) diff --git a/gnu/packages/wxwidgets.scm b/gnu/packages/wxwidgets.scm index 54d385fd53..15a995462a 100644 --- a/gnu/packages/wxwidgets.scm +++ b/gnu/packages/wxwidgets.scm @@ -216,7 +216,7 @@ and many other languages.") (setenv "WXWIN" (assoc-ref inputs "wxwidgets")) ;; Copy the waf executable to the source directory since it needs ;; to be in a writable directory. - (copy-file (string-append (assoc-ref inputs "python-waf") "/bin/waf") + (copy-file (search-input-file inputs "/bin/waf") "bin/waf") (setenv "WAF" "bin/waf") ;; The build script tries to copy license files from the @@ -306,8 +306,9 @@ provide a 100% native look and feel for the application.") (setenv "WXWIN" (assoc-ref inputs "wxwidgets")) (use-modules (ice-9 popen) (ice-9 rdelim)) (let ((port (open-pipe* OPEN_READ - (string-append (assoc-ref inputs "wxwidgets") - "/bin/wx-config") "--cppflags"))) + (search-input-file inputs + "/bin/wx-config") + "--cppflags"))) (setenv "CPPFLAGS" (read-string port)) (close-pipe port)) #t))))) diff --git a/gnu/packages/xdisorg.scm b/gnu/packages/xdisorg.scm index 11e815bd72..d13392ae77 100644 --- a/gnu/packages/xdisorg.scm +++ b/gnu/packages/xdisorg.scm @@ -3,7 +3,7 @@ ;;; Copyright © 2014, 2015, 2016 Mark H Weaver ;;; Copyright © 2014 Eric Bavier ;;; Copyright © 2014, 2015, 2016 Alex Kost -;;; Copyright © 2013, 2015, 2017, 2018, 2019 Ludovic Courtès +;;; Copyright © 2013, 2015, 2017, 2018, 2019, 2021 Ludovic Courtès ;;; Copyright © 2015, 2016 Mathieu Lirzin ;;; Copyright © 2015 Alexander I.Grafov ;;; Copyright © 2015 Andy Wingo @@ -231,8 +231,7 @@ program.") (modify-phases %standard-phases (add-before 'build 'configure (lambda* (#:key inputs outputs #:allow-other-keys) - (let ((xrandr (string-append (assoc-ref inputs "xrandr") - "/bin/xrandr"))) + (let ((xrandr (search-input-file inputs "/bin/xrandr"))) (substitute* "contrib/etc/xdg/autostart/autorandr.desktop" (("/usr") (assoc-ref outputs "out"))) (substitute* "autorandr.py" diff --git a/gnu/packages/xorg.scm b/gnu/packages/xorg.scm index 9978480e4b..8d6dc21c4f 100644 --- a/gnu/packages/xorg.scm +++ b/gnu/packages/xorg.scm @@ -2,7 +2,7 @@ ;;; Copyright © 2013, 2014 Andreas Enge ;;; Copyright © 2014, 2015, 2017, 2018, 2020 Mark H Weaver ;;; Copyright © 2014, 2015 Eric Bavier -;;; Copyright © 2015, 2016, 2017, 2018, 2019, 2020 Ludovic Courtès +;;; Copyright © 2015, 2016, 2017, 2018, 2019, 2020, 2021 Ludovic Courtès ;;; Copyright © 2015 Eric Dvorsak ;;; Copyright © 2016 Mathieu Lirzin ;;; Copyright © 2015 Cyrill Schenkel @@ -2289,8 +2289,7 @@ X server: @code{handhelds}, @code{redglass} and @code{whiteglass}.") (delete 'configure) (add-before 'build 'set-inkscape-environment-variable (lambda* (#:key inputs #:allow-other-keys) - (let ((inkscape (string-append (assoc-ref inputs "inkscape") - "/bin/inkscape"))) + (let ((inkscape (search-input-file inputs "/bin/inkscape"))) (setenv "INKSCAPE" inkscape) #t))) (add-before 'build 'placate-inkscape-warnings @@ -3593,8 +3592,7 @@ X server.") (format #t "decompressing x86emu source code~%") (with-directory-excursion "libs" (let ((srcs (assoc-ref inputs "xorg-server-sources")) - (tar-binary (string-append (assoc-ref inputs "tar") - "/bin/tar"))) + (tar-binary (search-input-file inputs "/bin/tar"))) (invoke tar-binary "xvf" srcs "--strip-components=3" "--wildcards" "*/hw/xfree86/x86emu/") ;; extract license: @@ -4991,9 +4989,8 @@ protocol and arbitrary X extension protocol.") (wrap-program (string-append (assoc-ref outputs "out") "/bin/mkfontdir") `("PATH" ":" prefix - (,(string-append (assoc-ref inputs "mkfontscale") - "/bin")))) - #t))))) + (,(dirname + (search-input-file inputs "/bin/mkfontscale")))))))))) (inputs `(("mkfontscale" ,mkfontscale))) (native-inputs @@ -6430,7 +6427,8 @@ basic eye-candy effects.") ;; The trailing -- is intentional, so we only replace it inside ;; a command line. (("dbus-launch --") - (string-append (assoc-ref inputs "dbus") "/bin/dbus-launch --"))) + (string-append (search-input-file inputs "/bin/dbus-launch") + " --"))) ;; /run/user does not exist on guix system (substitute* "./xpra/scripts/config.py" (("socket-dir.*: \"\",") -- cgit v1.2.3 From 32111eb219089e7973d94ac5f14915b7621e6e7d Mon Sep 17 00:00:00 2001 From: Jakub Kądziołka Date: Sun, 14 Feb 2021 14:16:51 +0100 Subject: gnu: rust: Update to 1.50. * gnu/packages/rust.scm (rust): Change to 1.50. --- gnu/packages/rust.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gnu/packages/rust.scm') diff --git a/gnu/packages/rust.scm b/gnu/packages/rust.scm index fd6233fc94..72991aea72 100644 --- a/gnu/packages/rust.scm +++ b/gnu/packages/rust.scm @@ -859,4 +859,4 @@ safety and thread safety guarantees.") ;;; intermediate rusts are built for bootstrapping purposes and should not ;;; be relied upon. This is to ease maintenance and reduce the time ;;; required to build the full Rust bootstrap chain. -(define-public rust rust-1.49) +(define-public rust rust-1.50) -- cgit v1.2.3 From 33133a6ed32752b2ad2b974f7d63d9302c476a7f Mon Sep 17 00:00:00 2001 From: Maxim Cournoyer Date: Sat, 21 Aug 2021 01:01:23 -0400 Subject: gnu: rust: Bootstrap rust from 1.39.0 and optimize build time. Only stage 1 (rather than stage 2) rustc and cargo are built and the installation phase rewritten to not invoke the build tool, which helps to shorten the build time to about 10 minutes per Rust on a fast machine. The total build time should take less than 4h30, down from the current 8 hours on a Ryzen 3900X CPU. * gnu/packages/patches/rust-reproducible-builds.patch: Delete file. * gnu/packages/patches/rustc-1.39.0-src.patch: New file. * gnu/local.mk (dist_patch_DATA): Register it, and un-register rust-reproducible-builds.patch. * gnu/packages/rust.scm (%mrustc-commit): New variable. (%mrustc-source): Update to latest commit. (rust-1.29): Morph into... (rust-1.39): ... this. [source]: Adjust the snippet, patches and patch-flags fields. [inputs]: Replace llvm-7 by llvm (9). [make-flags]: Add the RUSTC_VERSION, MRUSTC_TARGET_VER and OUTDIR_SUF make variables. Remove the RUSTCSRC make variable. [phases]{copy-mrustc-and-patch}: Rename to... {setup-mrustc-sources}: ... this. A symbolic link is created inside the mrustc directory, pointing to the Rust 1.39.0 sources. {patch-makefiles}: Adjust directory. Patch date and git definitions. Edit out the RUSTC_SRC_DL prerequisite. Adjust the patching of a shebang. {patch-cargo-checksums}: Adjust. {configure-cargo-home}: New phase. {configure}: Create and add a 'cc' shim to PATH. {build}: Do not invoke make in parallel mode inside the run_rustc directory. (rust-1.30): Morph into... (rust-1.40): ... this, integrating the changes introduced between 1.30 and 1.40. [modules]: Properly import (guix build cargo-utils). [phases]{add-cc-shim-to-path}: New phase. {configure}: Increase the codegen-units value to 256. {build}: Only build stage 1 rustc and cargo, and group the commands into one invocation. {install}: Manually install the stage 1 build artifacts. {patch-cargo-checksums}: Remove the ad-hoc use-modules, no longer needed. [source]: Adjust. [arguments]: Set validate-runpath? to #f. [phases]{patch-cargo-checksums}: Remove phase. {configure}: Repatriate the jemalloc configuration changes from 1.40. [native-inputs]: Replace the rust-1.29 inputs by rust-1.39. Use regular jemalloc and llvm versions. (rust-1.41)[phases]: Add the patch-cargo-checksums phase. (rust-1.31, rust-1.32, rust-1.33, rust-1.34, rust-1.35, rust-1.36, rust-1.37) (rust-1.38, rust-1.39, rust-1.40): Delete variables. (rust-1.46)[phases]{install}: Group build, test and install commands. (rust-1.47)[phases]{build}: Override to adjust for the relocation of the standard library source directory. --- gnu/local.mk | 2 +- .../patches/rust-reproducible-builds.patch | 25 -- gnu/packages/patches/rustc-1.39.0-src.patch | 99 +++++ gnu/packages/rust.scm | 431 +++++++++------------ 4 files changed, 273 insertions(+), 284 deletions(-) delete mode 100644 gnu/packages/patches/rust-reproducible-builds.patch create mode 100644 gnu/packages/patches/rustc-1.39.0-src.patch (limited to 'gnu/packages/rust.scm') diff --git a/gnu/local.mk b/gnu/local.mk index cbb083e6ae..cd92b825a3 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1747,12 +1747,12 @@ dist_patch_DATA = \ %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/rustc-1.39.0-src.patch \ %D%/packages/patches/rust-coresimd-doctest.patch \ %D%/packages/patches/rust-ndarray-remove-blas-src-dep.patch \ %D%/packages/patches/rust-ndarray-0.13-remove-blas-src.patch \ %D%/packages/patches/rust-nettle-disable-vendor.patch \ %D%/packages/patches/rust-nettle-sys-disable-vendor.patch \ - %D%/packages/patches/rust-reproducible-builds.patch \ %D%/packages/patches/rust-openssl-sys-no-vendor.patch \ %D%/packages/patches/sbc-fix-build-non-x86.patch \ %D%/packages/patches/sbcl-burgled-batteries3-fix-signals.patch \ diff --git a/gnu/packages/patches/rust-reproducible-builds.patch b/gnu/packages/patches/rust-reproducible-builds.patch deleted file mode 100644 index ef7bf53b5d..0000000000 --- a/gnu/packages/patches/rust-reproducible-builds.patch +++ /dev/null @@ -1,25 +0,0 @@ -From b9ca108fcae2b738ca3f0c88c84ae5dc5a6f843f Mon Sep 17 00:00:00 2001 -From: Tim Ryan -Date: Mon, 14 May 2018 06:22:21 -0400 -Subject: [PATCH] Support reproducible builds by forcing window.search to use - stable key ordering. (#692) -See ---- - src/vendor/mdbook/src/renderer/html_handlebars/search.rs | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/src/vendor/mdbook/src/renderer/html_handlebars/search.rs b/src/vendor/mdbook/src/renderer/html_handlebars/search.rs -index d49772f8b..1ee66a511 100644 ---- a/src/vendor/mdbook/src/renderer/html_handlebars/search.rs -+++ b/src/vendor/mdbook/src/renderer/html_handlebars/search.rs -@@ -205,6 +205,10 @@ fn write_to_js(index: Index, search_config: &Search) -> Result { - searchoptions, - index, - }; -+ -+ // By converting to serde_json::Value as an intermediary, we use a -+ // BTreeMap internally and can force a stable ordering of map keys. -+ let json_contents = serde_json::to_value(&json_contents)?; - let json_contents = serde_json::to_string(&json_contents)?; - - Ok(format!("window.search = {};", json_contents)) diff --git a/gnu/packages/patches/rustc-1.39.0-src.patch b/gnu/packages/patches/rustc-1.39.0-src.patch new file mode 100644 index 0000000000..7859bd44d5 --- /dev/null +++ b/gnu/packages/patches/rustc-1.39.0-src.patch @@ -0,0 +1,99 @@ +# This modified patch is to disable the hunk applying to LLVM, unbundled in Guix. + +# Add mrustc slice length intrinsics +--- src/libcore/intrinsics.rs ++++ src/libcore/intrinsics.rs +@@ -685,4 +685,8 @@ + pub fn min_align_of_val(_: &T) -> usize; + ++ /// Obtain the length of a slice pointer ++ #[cfg(rust_compiler="mrustc")] ++ pub fn mrustc_slice_len(pointer: *const [T]) -> usize; ++ + /// Gets a static string slice containing the name of a type. + pub fn type_name() -> &'static str; + +--- src/libcore/slice/mod.rs ++++ src/libcore/slice/mod.rs +@@ -68,5 +68,8 @@ + pub const fn len(&self) -> usize { +- unsafe { +- crate::ptr::Repr { rust: self }.raw.len +- } ++ #[cfg(not(rust_compiler="mrustc"))] ++ #[cfg_attr(not(bootstrap), allow_internal_unstable(const_fn_union))] ++ const fn len_inner(s: &[T]) -> usize { unsafe { crate::ptr::Repr { rust: s }.raw.len } }; ++ #[cfg(rust_compiler="mrustc")] ++ const fn len_inner(s: &[T]) -> usize { unsafe { crate::intrinsics::mrustc_slice_len(s) } } ++ len_inner(self) + } +# +# Static-link rustc_codegen_llvm so the generated rustc is standalone +# > Note: Interacts with `rustc-1.39.0-overrides.toml` +# +--- src/librustc_interface/util.rs ++++ src/librustc_interface/util.rs +@@ -421,2 +421,4 @@ + pub fn get_codegen_sysroot(backend_name: &str) -> fn() -> Box { ++ #[cfg(rust_compiler="mrustc")] ++ { if(backend_name == "llvm") { extern "Rust" { fn __rustc_codegen_backend() -> Box; } return || unsafe { __rustc_codegen_backend() } } } + // For now we only allow this function to be called once as it'll dlopen a +# Disable most architecture intrinsics +--- src/stdarch/crates/std_detect/src/detect/mod.rs ++++ src/stdarch/crates/std_detect/src/detect/mod.rs +@@ -74,4 +74,7 @@ + // this run-time detection logic is never called. + #[path = "os/other.rs"] + mod os; ++ } else if #[cfg(rust_compiler="mrustc")] { ++ #[path = "os/other.rs"] ++ mod os; + } else if #[cfg(any(target_arch = "x86", target_arch = "x86_64"))] { +--- vendor/ppv-lite86/src/lib.rs ++++ vendor/ppv-lite86/src/lib.rs +@@ -12,10 +12,10 @@ +-#[cfg(all(feature = "simd", target_arch = "x86_64", not(miri)))] ++#[cfg(all(feature = "simd", target_arch = "x86_64", not(miri), not(rust_compiler="mrustc")))] + pub mod x86_64; +-#[cfg(all(feature = "simd", target_arch = "x86_64", not(miri)))] ++#[cfg(all(feature = "simd", target_arch = "x86_64", not(miri), not(rust_compiler="mrustc")))] + use self::x86_64 as arch; + +-#[cfg(any(miri, not(all(feature = "simd", any(target_arch = "x86_64")))))] ++#[cfg(any(miri, rust_compiler="mrustc", not(all(feature = "simd", any(target_arch = "x86_64")))))] + pub mod generic; +-#[cfg(any(miri, not(all(feature = "simd", any(target_arch = "x86_64")))))] ++#[cfg(any(miri, rust_compiler="mrustc", not(all(feature = "simd", any(target_arch = "x86_64")))))] + use self::generic as arch; + +# diff --git a/llvm/include/llvm/Demangle/MicrosoftDemangleNodes.h b/llvm/include/llvm/Demangle/MicrosoftDemangleNodes.h +# index da9d9d5bfdc0..3d47471f0ef0 100644 +# --- src/llvm-project/llvm/include/llvm/Demangle/MicrosoftDemangleNodes.h +# +++ src/llvm-project/llvm/include/llvm/Demangle/MicrosoftDemangleNodes.h +# @@ -16,6 +16,8 @@ +# #include "llvm/Demangle/DemangleConfig.h" +# #include "llvm/Demangle/StringView.h" +# #include +# +#include +# +#include + +# namespace llvm { +# namespace itanium_demangle { +## +## gcc (used by mrustc) has 16-byte uint128_t alignment, while rustc uses 8 +## +#--- src/libsyntax/ast.rs +#+++ src/libsyntax/ast.rs +#@@ -986,2 +986,2 @@ +#-#[cfg(target_arch = "x86_64")] +#-static_assert_size!(Expr, 96); +#+//#[cfg(target_arch = "x86_64")] +#+//static_assert_size!(Expr, 96); +#--- src/librustc/ty/sty.rs +#+++ src/librustc/ty/sty.rs +#@@ -2258,2 +2258,2 @@ +#-#[cfg(target_arch = "x86_64")] +#-static_assert_size!(Const<'_>, 40); +#+//#[cfg(target_arch = "x86_64")] +#+//static_assert_size!(Const<'_>, 40); + diff --git a/gnu/packages/rust.scm b/gnu/packages/rust.scm index 72991aea72..ea5bcaf198 100644 --- a/gnu/packages/rust.scm +++ b/gnu/packages/rust.scm @@ -118,37 +118,43 @@ (package-native-inputs base-rust)))))) ;;; Note: mrustc's only purpose is to be able to bootstap Rust; it's designed -;;; to be used in source form. +;;; to be used in source form. The latest support for bootstrapping from +;;; 1.39.0 is not yet released so use the latest commit (see: +;;; https://github.com/thepowersgang/mrustc/issues/185). +(define %mrustc-commit "474bec9cfd7862a20e7288cecd7fcf5e18648b9a") (define %mrustc-source - (let ((name "mrustc") - (version "0.9")) + (let* ((version "0.9") + (commit %mrustc-commit) + (revision "1") + (name "mrustc")) (origin (method git-fetch) (uri (git-reference (url "https://github.com/thepowersgang/mrustc") - (commit (string-append "v" version)))) - (file-name (git-file-name name version)) + (commit commit))) + (file-name (git-file-name name (git-version version revision commit))) (sha256 (base32 - "194ny7vsks5ygiw7d8yxjmp1qwigd71ilchis6xjl6bb2sj97rd2"))))) + "1zacz5qia0r457mv74wvrvznnv4az5g2w9j8ji9ssy727wljhvz7"))))) -;;; Rust 1.29 is special in that it is built with mrustc, which shortens the -;;; bootstrap path. Note: the build is non-deterministic. -(define-public rust-1.29 +;;; Rust 1.39 is special in that it is built with mrustc, which shortens the +;;; bootstrap path. +(define rust-1.39 (package (name "rust") - (version "1.29.2") + (version "1.39.0") (source (origin (method url-fetch) (uri (rust-uri version)) - (sha256 (base32 "1jb787080z754caa2w3w1amsygs4qlzj9rs1vy64firfmabfg22h")) + (sha256 (base32 "0mwkc1bnil2cfyf6nglpvbn2y0zfbv44zfhsd5qg4c9rm6vgd8dl")) (modules '((guix build utils))) (snippet '(for-each delete-file-recursively - '("src/jemalloc" - "src/llvm" - "src/llvm-emscripten"))) - (patches (search-patches "rust-reproducible-builds.patch")))) + '("src/llvm-emscripten" + "src/llvm-project" + "vendor/jemalloc-sys/jemalloc"))) + (patches (search-patches "rustc-1.39.0-src.patch")) + (patch-flags '("-p0")))) ;default is -p1 (outputs '("out" "cargo")) (properties '((timeout . 72000) ;20 hours (max-silent-time . 18000))) ;5 hours (for armel) @@ -156,9 +162,7 @@ (inputs `(("libcurl" ,curl) ("libssh2" ,libssh2) - ;; Use llvm-7, which enables rust to be built reproducibly. - ;; Versions newer than 7 fail to compile. - ("llvm" ,llvm-7) + ("llvm" ,llvm) ("openssl" ,openssl) ("zlib" ,zlib))) (native-inputs @@ -180,7 +184,10 @@ (list ,(string-append "RUSTC_TARGET=" (or (%current-target-system) (nix-system->gnu-triplet-for-rust))) - ,(string-append "RUSTCSRC=../")) + ,(string-append "RUSTC_VERSION=" version) + ,(string-append "MRUSTC_TARGET_VER=" + (version-major+minor version)) + "OUTDIR_SUF=") ;do not add version suffix to output dir #:phases (modify-phases %standard-phases (add-after 'unpack 'patch-reference-to-cc @@ -191,11 +198,15 @@ (substitute* (find-files "." "^link.rs$") (("\"cc\".as_ref") (format #f "~s.as_ref" (string-append gcc "/bin/gcc"))))))) - (add-after 'unpack 'copy-mrustc-and-patch + (add-after 'unpack 'setup-mrustc-sources (lambda* (#:key inputs #:allow-other-keys) - (copy-recursively (assoc-ref inputs "mrustc-source") "mrustc") - (invoke "patch" "-p0" "-i" "mrustc/rustc-1.29.0-src.patch"))) - (add-after 'copy-mrustc-and-patch 'patch-makefiles + (copy-recursively (assoc-ref inputs "mrustc-source") "../mrustc") + ;; The Makefile of mrustc expects the sources directory of rustc + ;; to be at this location, and it simplifies things to make it + ;; so. + (symlink (getcwd) + (string-append "../mrustc/rustc-" ,version "-src")))) + (add-after 'setup-mrustc-sources 'patch-makefiles ;; This disables building the (unbundled) LLVM. (lambda* (#:key inputs parallel-build? #:allow-other-keys) (let ((llvm (assoc-ref inputs "llvm")) @@ -203,7 +214,7 @@ (if parallel-build? (number->string (parallel-job-count)) "1")))) - (with-directory-excursion "mrustc" + (with-directory-excursion "../mrustc" (substitute* '("minicargo.mk" "run_rustc/Makefile") ;; Use the system-provided LLVM. @@ -213,27 +224,40 @@ "$(LLVM_CONFIG):\n") (("\\$Vcd \\$\\(RUSTCSRC\\)build && \\$\\(MAKE\\).*") "true\n")) - ;; Patch date. (substitute* "Makefile" - (("shell date") - "shell date -d @1")) + ;; Patch date and git obtained version information. + ((" -D VERSION_GIT_FULLHASH=.*") + (string-append + " -D VERSION_GIT_FULLHASH=\\\"" ,%mrustc-commit "\\\"" + " -D VERSION_GIT_BRANCH=\\\"master\\\"" + " -D VERSION_GIT_SHORTHASH=\\\"" + ,(string-take %mrustc-commit 7) "\\\"" + " -D VERSION_BUILDTIME=" + "\"\\\"Thu, 01 Jan 1970 00:00:01 +0000\\\"\"" + " -D VERSION_GIT_ISDIRTY=0\n")) + ;; Do not try to fetch sources from the Internet. + ((": \\$\\(RUSTC_SRC_DL\\)") + ":")) (substitute* "run_rustc/Makefile" (("[$]Vtime ") "$V ") ;; Unlock the number of parallel jobs for cargo. (("-j [[:digit:]]+ ") "") - ;; Patch the shebang of a generated wrapper for rustc, and - ;; make sure that \n newline escapes get interpreted - ;; correctly, specifying the '-e' option of echo. - (("echo '#!/bin/sh") - (string-append "echo -e '#!" (which "sh")))))))) - (add-after 'patch-source-shebangs 'patch-cargo-checksums + ;; Patch the shebang of a generated wrapper for rustc + (("#!/bin/sh") + (string-append "#!" (which "sh")))))))) + (add-after 'patch-generated-file-shebangs 'patch-cargo-checksums (lambda* _ - (substitute* "src/Cargo.lock" - (("(\"checksum .* = )\".*\"" all name) + (substitute* "Cargo.lock" + (("(checksum = )\".*\"" all name) (string-append name "\"" ,%cargo-reference-hash "\""))) - (generate-all-checksums "src/vendor"))) + (generate-all-checksums "vendor"))) + (add-before 'configure 'configure-cargo-home + (lambda _ + (let ((cargo-home (string-append (getcwd) "/.cargo"))) + (mkdir-p cargo-home) + (setenv "CARGO_HOME" cargo-home)))) (replace 'configure (lambda _ (setenv "CC" "gcc") @@ -242,29 +266,35 @@ (setenv "LLVM_LINK_SHARED" "1") ;; This is a workaround for ;; https://github.com/thepowersgang/mrustc/issues/138. - (setenv "LIBSSH2_SYS_USE_PKG_CONFIG" "yes"))) + (setenv "LIBSSH2_SYS_USE_PKG_CONFIG" "yes") + ;; rustc still insists on having 'cc' on PATH in some places + ;; (e.g. when building the 'test' library crate). + (mkdir-p "/tmp/bin") + (symlink (which "gcc") "/tmp/bin/cc") + (setenv "PATH" (string-append "/tmp/bin:" (getenv "PATH"))))) (delete 'patch-generated-file-shebangs) (replace 'build (lambda* (#:key make-flags parallel-build? #:allow-other-keys) - (let* ((job-count (if parallel-build? + (let* ((src-root (getcwd)) + (job-count (if parallel-build? (parallel-job-count) 1)) - (job-spec (string-append "-j" (number->string job-count))) - (make-flags* (cons job-spec make-flags))) + (job-spec (string-append "-j" (number->string job-count)))) ;; Adapted from: ;; https://github.com/dtolnay/bootstrap/blob/master/build.sh. - (chdir "mrustc") + (chdir "../mrustc") (setenv "MINICARGO_FLAGS" job-spec) (setenv "CARGO_BUILD_JOBS" (number->string job-count)) (display "Building rustc...\n") (apply invoke "make" "-f" "minicargo.mk" "output/rustc" - make-flags*) + job-spec make-flags) (display "Building cargo...\n") (apply invoke "make" "-f" "minicargo.mk" "output/cargo" - make-flags*) + job-spec make-flags) (display "Rebuilding stdlib with rustc...\n") - (with-directory-excursion "run_rustc" - (apply invoke "make" "RUST_SRC=../../src/" make-flags*))))) + ;; Note: invoking make with -j would cause a compiler error + ;; (unexpected panic). + (apply invoke "make" "-C" "run_rustc" make-flags)))) (replace 'install (lambda* (#:key inputs outputs #:allow-other-keys) (let* ((out (assoc-ref outputs "out")) @@ -291,31 +321,43 @@ safety and thread safety guarantees.") ;; Dual licensed. (license (list license:asl2.0 license:expat)))) -(define-public rust-1.30 +(define-public rust-1.40 (package (name "rust") - (version "1.30.1") - (source (origin - (inherit (package-source rust-1.29)) - (uri (rust-uri version)) - (sha256 - (base32 "0aavdc1lqv0cjzbqwl5n59yd0bqdlhn0zas61ljf38yrvc18k8rn")) - (snippet '(for-each delete-file-recursively - '("src/jemalloc" - "src/llvm" - "src/llvm-emscripten" - "src/tools/clang" - "src/tools/lldb"))))) + (version "1.40.0") + (source + (origin + (method url-fetch) + (uri (rust-uri version)) + (sha256 (base32 "1ba9llwhqm49w7sz3z0gqscj039m53ky9wxzhaj11z6yg1ah15yx")) + (modules '((guix build utils))) + ;; llvm-emscripten is no longer bundled, as that codegen backend got + ;; removed. + (snippet '(for-each delete-file-recursively + '("src/llvm-project" + "vendor/jemalloc-sys/jemalloc"))))) (outputs '("out" "cargo")) (properties '((timeout . 72000) ;20 hours (max-silent-time . 18000))) ;5 hours (for armel) (build-system gnu-build-system) + ;; Rust 1.40 does not ship rustc-internal libraries by default (see + ;; rustc-dev-split). This means that librustc_driver.so is no longer + ;; available in lib/rustlib/$target/lib, which is the directory + ;; included in the runpath of librustc_codegen_llvm-llvm.so. This is + ;; detected by our validate-runpath phase as an error, but it is + ;; harmless as the codegen backend is loaded by librustc_driver.so + ;; itself, which must at that point have been already loaded. As such, + ;; we skip validating the runpath for Rust 1.40. Rust 1.41 stopped + ;; putting the codegen backend in a separate library, which makes this + ;; workaround only necessary for this release. (arguments - ;; Only the final Rust is tested, not the intermediate bootstrap ones, - ;; for performance and simplicity. - `(#:tests? #f + `(#:validate-runpath? #f + ;; Only the final Rust is tested, not the intermediate bootstrap ones, + ;; for performance and simplicity. + #:tests? #f #:imported-modules ,%cargo-utils-modules ;for `generate-all-checksums' - #:modules ((guix build utils) + #:modules ((guix build cargo-utils) + (guix build utils) (guix build gnu-build-system) (ice-9 match) (srfi srfi-1)) @@ -328,6 +370,11 @@ safety and thread safety guarantees.") (setenv "CC" (search-input-file inputs "/bin/gcc")) ;; The Guix LLVM package installs only shared libraries. (setenv "LLVM_LINK_SHARED" "1"))) + (add-after 'unpack 'add-cc-shim-to-path + (lambda _ + (mkdir-p "/tmp/bin") + (symlink (which "gcc") "/tmp/bin/cc") + (setenv "PATH" (string-append "/tmp/bin:" (getenv "PATH"))))) (add-after 'unpack 'neuter-tidy ;; We often need to patch tests with various Guix-specific paths. ;; This often increases the line length and makes tidy, rustc's @@ -341,13 +388,6 @@ safety and thread safety guarantees.") (substitute* "src/bootstrap/builder.rs" ((".*::Tidy,.*") "")))) - (add-after 'patch-generated-file-shebangs 'patch-cargo-checksums - (lambda* _ - (use-modules (guix build cargo-utils)) - (substitute* "src/Cargo.lock" - (("(\"checksum .* = )\".*\"" all name) - (string-append name "\"" ,%cargo-reference-hash "\""))) - (generate-all-checksums "src/vendor"))) (replace 'configure (lambda* (#:key inputs outputs #:allow-other-keys) (let* ((out (assoc-ref outputs "out")) @@ -358,6 +398,14 @@ safety and thread safety guarantees.") (cargo (assoc-ref inputs "cargo-bootstrap")) (llvm (assoc-ref inputs "llvm")) (jemalloc (assoc-ref inputs "jemalloc"))) + ;; The compiler is no longer directly built against jemalloc, but + ;; rather via the jemalloc-sys crate (which vendors the jemalloc + ;; source). To use jemalloc we must enable linking to it (otherwise + ;; it would use the system allocator), and set an environment + ;; variable pointing to the compiled jemalloc. + (setenv "JEMALLOC_OVERRIDE" + (search-input-file inputs + "/lib/libjemalloc_pic.a")) (call-with-output-file "config.toml" (lambda (port) (display (string-append " @@ -373,6 +421,7 @@ submodules = false prefix = \"" out "\" sysconfdir = \"etc\" [rust] +jemalloc=true default-linker = \"" gcc "/bin/gcc" "\" channel = \"stable\" rpath = true @@ -381,7 +430,6 @@ llvm-config = \"" llvm "/bin/llvm-config" "\" cc = \"" gcc "/bin/gcc" "\" cxx = \"" gcc "/bin/g++" "\" ar = \"" binutils "/bin/ar" "\" -jemalloc = \"" jemalloc "/lib/libjemalloc_pic.a" "\" [dist] ") port)))))) (replace 'build @@ -390,20 +438,25 @@ jemalloc = \"" jemalloc "/lib/libjemalloc_pic.a" "\" "-j" (if parallel-build? (number->string (parallel-job-count)) "1")))) - (invoke "./x.py" job-spec "build") - (invoke "./x.py" job-spec "build" "src/tools/cargo")))) + (invoke "./x.py" job-spec "build" "--stage=1" + "src/libstd" + "src/tools/cargo")))) (replace 'install (lambda* (#:key outputs #:allow-other-keys) - (let ((out (assoc-ref outputs "out")) - (cargo-out (assoc-ref outputs "cargo"))) - (mkdir-p out) - (invoke "./x.py" "install") - (substitute* "config.toml" - ;; Adjust the prefix to the 'cargo' output. - (("prefix = \"[^\"]*\"") - (format #f "prefix = ~s" cargo-out))) - (mkdir-p cargo-out) - (invoke "./x.py" "install" "cargo")))) + (let* ((out (assoc-ref outputs "out")) + (cargo-out (assoc-ref outputs "cargo")) + (gnu-triplet ,(or (%current-target-system) + (nix-system->gnu-triplet-for-rust))) + (build (string-append "build/" gnu-triplet))) + ;; Manually do the installation instead of calling './x.py + ;; install', as that is slow and needlessly rebuilds some + ;; things. + (install-file (string-append build "/stage1/bin/rustc") + (string-append out "/bin")) + (copy-recursively (string-append build "/stage1/lib") + (string-append out "/lib")) + (install-file (string-append build "/stage1-tools-bin/cargo") + (string-append cargo-out "/bin"))))) (add-after 'install 'delete-install-logs (lambda* (#:key outputs #:allow-other-keys) (for-each (lambda (f) @@ -427,12 +480,12 @@ jemalloc = \"" jemalloc "/lib/libjemalloc_pic.a" "\" `(("cmake" ,cmake-minimal) ("pkg-config" ,pkg-config) ; For "cargo" ("python" ,python-wrapper) - ("rustc-bootstrap" ,rust-1.29) - ("cargo-bootstrap" ,rust-1.29 "cargo") + ("rustc-bootstrap" ,rust-1.39) + ("cargo-bootstrap" ,rust-1.39 "cargo") ("which" ,which))) (inputs - `(("jemalloc" ,jemalloc-4.5.0) - ("llvm" ,llvm-7) + `(("jemalloc" ,jemalloc) + ("llvm" ,llvm) ("openssl" ,openssl) ("libssh2" ,libssh2) ; For "cargo" ("libcurl" ,curl))) ; For "cargo" @@ -450,7 +503,7 @@ jemalloc = \"" jemalloc "/lib/libjemalloc_pic.a" "\" (variable "LIBRARY_PATH") (files '("lib" "lib64"))))) (supported-systems - (delete "i686-linux" ; fails to build, see bug #35519 + (delete "i686-linux" ; fails to build, see bug #35519 %supported-systems)) (synopsis "Compiler for the Rust progamming language") (description "Rust is a systems programming language that provides memory @@ -459,182 +512,26 @@ safety and thread safety guarantees.") ;; Dual licensed. (license (list license:asl2.0 license:expat)))) -(define-public rust-1.31 - (rust-bootstrapped-package - rust-1.30 "1.31.1" "0sk84ff0cklybcp0jbbxcw7lk7mrm6kb6km5nzd6m64dy0igrlli")) - -(define-public rust-1.32 - (let ((base-rust (rust-bootstrapped-package - rust-1.31 "1.32.0" - "0ji2l9xv53y27xy72qagggvq47gayr5lcv2jwvmfirx029vlqnac"))) - (package - (inherit base-rust) - (source - (origin - (inherit (package-source base-rust)) - (snippet '(for-each delete-file-recursively - '("src/llvm" - "src/llvm-emscripten" - "src/tools/clang" - "src/tools/lldb" - "vendor/jemalloc-sys/jemalloc"))) - ;; the vendor directory has moved to the root of - ;; the tarball, so we have to strip an extra prefix - (patch-flags '("-p2")))) - (arguments - (substitute-keyword-arguments (package-arguments base-rust) - ;; The test suite fails due to LLVM 7, required for the build to be - ;; reproducible. - ((#:tests? _ #t) - #f) - ((#:phases phases) - `(modify-phases ,phases - ;; Cargo.lock and the vendor/ directory have been moved to the - ;; root of the rust tarball - (replace 'patch-cargo-checksums - (lambda* _ - (use-modules (guix build cargo-utils)) - (substitute* "Cargo.lock" - (("(\"checksum .* = )\".*\"" all name) - (string-append name "\"" ,%cargo-reference-hash "\""))) - (generate-all-checksums "vendor"))) - (add-after 'configure 'override-jemalloc - (lambda* (#:key inputs #:allow-other-keys) - ;; The compiler is no longer directly built against jemalloc, - ;; but rather via the jemalloc-sys crate (which vendors the - ;; jemalloc source). To use jemalloc we must enable linking to - ;; it (otherwise it would use the system allocator), and set - ;; an environment variable pointing to the compiled jemalloc. - (substitute* "config.toml" - (("^jemalloc =.*$") "") - (("[[]rust[]]") "\n[rust]\njemalloc=true\n")) - (setenv "JEMALLOC_OVERRIDE" - (search-input-file inputs - "/lib/libjemalloc_pic.a"))))))))))) - -(define-public rust-1.33 - (let ((base-rust (rust-bootstrapped-package - rust-1.32 "1.33.0" - "152x91mg7bz4ygligwjb05fgm1blwy2i70s2j03zc9jiwvbsh0as"))) - (package - (inherit base-rust) - (source - (origin - (inherit (package-source base-rust)) - (patches '()) - (patch-flags '("-p1")))) - (inputs - ;; Upgrade jemalloc. - (alist-replace "jemalloc" (list jemalloc) (package-inputs base-rust)))))) - -(define-public rust-1.34 - (let ((base-rust (rust-bootstrapped-package - rust-1.33 "1.34.1" - "19s09k7y5j6g3y4d2rk6kg9pvq6ml94c49w6b72dmq8p9lk8bixh"))) - (package - (inherit base-rust) - (source - (origin - (inherit (package-source base-rust)) - (snippet '(for-each delete-file-recursively - '("src/llvm-emscripten" - "src/llvm-project" - "vendor/jemalloc-sys/jemalloc")))))))) - -(define-public rust-1.35 - (let ((base-rust (rust-bootstrapped-package - rust-1.34 "1.35.0" - "0bbizy6b7002v1rdhrxrf5gijclbyizdhkglhp81ib3bf5x66kas"))) - (package - (inherit base-rust) - (arguments - (substitute-keyword-arguments (package-arguments base-rust) - ((#:phases phases) - `(modify-phases ,phases - (delete 'disable-codegen-tests)))))))) - -(define-public rust-1.36 - (rust-bootstrapped-package - rust-1.35 "1.36.0" "06xv2p6zq03lidr0yaf029ii8wnjjqa894nkmrm6s0rx47by9i04")) - -(define-public rust-1.37 - (let ((base-rust (rust-bootstrapped-package - rust-1.36 "1.37.0" - "1hrqprybhkhs6d9b5pjskfnc5z9v2l2gync7nb39qjb5s0h703hj"))) - (package - (inherit base-rust) - (arguments - (substitute-keyword-arguments (package-arguments base-rust) - ((#:phases phases) - `(modify-phases ,phases - (add-before 'configure 'configure-cargo-home - (lambda _ - (let ((cargo-home (string-append (getcwd) "/.cargo"))) - (mkdir-p cargo-home) - (setenv "CARGO_HOME" cargo-home))))))))))) - -(define-public rust-1.38 - (rust-bootstrapped-package - rust-1.37 "1.38.0" "101dlpsfkq67p0hbwx4acqq6n90dj4bbprndizpgh1kigk566hk4")) - -(define-public rust-1.39 +(define-public rust-1.41 (let ((base-rust (rust-bootstrapped-package - rust-1.38 "1.39.0" - "0mwkc1bnil2cfyf6nglpvbn2y0zfbv44zfhsd5qg4c9rm6vgd8dl"))) + rust-1.40 "1.41.1" + "0ws5x0fxv57fyllsa6025h3q6j9v3m8nb3syl4x0hgkddq0kvj9q"))) (package (inherit base-rust) (arguments (substitute-keyword-arguments (package-arguments base-rust) + ((#:validate-runpath? _ #t) + #t) ((#:phases phases) `(modify-phases ,phases - (replace 'patch-cargo-checksums - ;; The Cargo.lock format changed. + (delete 'add-cc-shim-to-path) + (add-after 'patch-generated-file-shebangs 'patch-cargo-checksums (lambda* _ - (use-modules (guix build cargo-utils)) (substitute* "Cargo.lock" (("(checksum = )\".*\"" all name) (string-append name "\"" ,%cargo-reference-hash "\""))) (generate-all-checksums "vendor")))))))))) -(define-public rust-1.40 - (let ((base-rust (rust-bootstrapped-package - rust-1.39 "1.40.0" - "1ba9llwhqm49w7sz3z0gqscj039m53ky9wxzhaj11z6yg1ah15yx"))) - (package - (inherit base-rust) - (source - (origin - (inherit (package-source base-rust)) - ;; llvm-emscripten is no longer bundled, as that codegen backend - ;; got removed. - (snippet '(for-each delete-file-recursively - '("src/llvm-project" - "vendor/jemalloc-sys/jemalloc"))))) - ;; Rust 1.40 does not ship rustc-internal libraries by default (see - ;; rustc-dev-split). This means that librustc_driver.so is no longer - ;; available in lib/rustlib/$target/lib, which is the directory - ;; included in the runpath of librustc_codegen_llvm-llvm.so. This is - ;; detected by our validate-runpath phase as an error, but it is - ;; harmless as the codegen backend is loaded by librustc_driver.so - ;; itself, which must at that point have been already loaded. As such, - ;; we skip validating the runpath for Rust 1.40. Rust 1.41 stopped - ;; putting the codegen backend in a separate library, which makes this - ;; workaround only necessary for this release. - (arguments (substitute-keyword-arguments (package-arguments base-rust) - ((#:validate-runpath? _ #f) - #f)))))) - -(define-public rust-1.41 - (let ((base-rust (rust-bootstrapped-package - rust-1.40 "1.41.1" - "0ws5x0fxv57fyllsa6025h3q6j9v3m8nb3syl4x0hgkddq0kvj9q"))) - (package - (inherit base-rust) - (arguments - (substitute-keyword-arguments (package-arguments base-rust) - ((#:validate-runpath? _ #t) - #t)))))) - (define-public rust-1.42 (rust-bootstrapped-package rust-1.41 "1.42.0" "0x9lxs82may6c0iln0b908cxyn1cv7h03n5cmbx3j1bas4qzks6j")) @@ -687,9 +584,10 @@ safety and thread safety guarantees.") "-j" (if parallel-build? (number->string (parallel-job-count)) "1")))) - (invoke "./x.py" job-spec "build") - (invoke "./x.py" job-spec "build" "src/tools/cargo") - (invoke "./x.py" job-spec "build" "src/tools/rustfmt")))) + (invoke "./x.py" job-spec "build" + "library/std" ;rustc + "src/tools/cargo" + "src/tools/rustfmt")))) (replace 'check ;; Phase overridden to also test rustfmt. (lambda* (#:key tests? parallel-build? #:allow-other-keys) @@ -698,9 +596,10 @@ safety and thread safety guarantees.") "-j" (if parallel-build? (number->string (parallel-job-count)) "1")))) - (invoke "./x.py" job-spec "test" "-vv") - (invoke "./x.py" job-spec "test" "src/tools/cargo") - (invoke "./x.py" job-spec "test" "src/tools/rustfmt"))))) + (invoke "./x.py" job-spec "test" "-vv" + "library/std" + "src/tools/cargo" + "src/tools/rustfmt"))))) (replace 'install ;; Phase overridden to also install rustfmt. (lambda* (#:key outputs #:allow-other-keys) @@ -717,8 +616,24 @@ safety and thread safety guarantees.") (invoke "./x.py" "install" "rustfmt")))))))))) (define-public rust-1.47 - (rust-bootstrapped-package - rust-1.46 "1.47.0" "07fqd2vp7cf1ka3hr207dnnz93ymxml4935vp74g4is79h3dz19i")) + (let ((base-rust (rust-bootstrapped-package + rust-1.46 "1.47.0" + "07fqd2vp7cf1ka3hr207dnnz93ymxml4935vp74g4is79h3dz19i"))) + (package/inherit base-rust + (arguments + (substitute-keyword-arguments (package-arguments base-rust) + ((#:phases phases) + `(modify-phases ,phases + (replace 'build + ;; The standard library source location moved in this release. + (lambda* (#:key parallel-build? #:allow-other-keys) + (let ((job-spec (string-append + "-j" (if parallel-build? + (number->string (parallel-job-count)) + "1")))) + (invoke "./x.py" job-spec "build" "--stage=1" + "library/std" + "src/tools/cargo"))))))))))) (define-public rust-1.48 (rust-bootstrapped-package -- cgit v1.2.3 From bc4149818dbdc5490ec99e154fa1798ea39577f1 Mon Sep 17 00:00:00 2001 From: Maxim Cournoyer Date: Mon, 30 Aug 2021 08:40:49 -0400 Subject: gnu: rust: Add rust 1.54 and move all non-bootstrapping logic to it. * gnu/packages/rust.scm (rust-1.44): Do not replace LLVM version, for simplicity. It used to be required at this point because LLVM 7 was no longer supported for rust-1.44, but we're now using LLVM 9. (rust-1.46): Move all additional phases, doc output to rust-1.54. (rust-1.53, rust-1.54): New variables. (rust-1.54): Adjust snippet field. (rust): Set default Rust to the latest version, 1.54.0. [native-inputs]: Use the latest GDB. --- gnu/packages/rust.scm | 167 +++++++++++++++++++++++++------------------------- 1 file changed, 83 insertions(+), 84 deletions(-) (limited to 'gnu/packages/rust.scm') diff --git a/gnu/packages/rust.scm b/gnu/packages/rust.scm index ea5bcaf198..0cff15b98e 100644 --- a/gnu/packages/rust.scm +++ b/gnu/packages/rust.scm @@ -540,15 +540,11 @@ safety and thread safety guarantees.") (rust-bootstrapped-package rust-1.42 "1.43.0" "18akhk0wz1my6y9vhardriy2ysc482z0fnjdcgs9gy59kmnarxkm")) -;; This version needs llvm >= 8.0 and NOT 11 +;; This version requires llvm <= 11. (define-public rust-1.44 - (let ((base-rust (rust-bootstrapped-package - rust-1.43 "1.44.1" - "0ww4z2v3gxgn3zddqzwqya1gln04p91ykbrflnpdbmcd575n8bky"))) - (package - (inherit base-rust) - (inputs - (alist-replace "llvm" (list llvm-10) (package-inputs base-rust)))))) + (rust-bootstrapped-package + rust-1.43 "1.44.1" + "0ww4z2v3gxgn3zddqzwqya1gln04p91ykbrflnpdbmcd575n8bky")) (define-public rust-1.45 (let ((base-rust (rust-bootstrapped-package @@ -567,53 +563,8 @@ safety and thread safety guarantees.") "linker.env(\"LC_ALL\", \"en_US.UTF-8\");"))))))))))) (define-public rust-1.46 - (let ((base-rust (rust-bootstrapped-package - rust-1.45 "1.46.0" - "0a17jby2pd050s24cy4dfc0gzvgcl585v3vvyfilniyvjrqknsid"))) - (package - (inherit base-rust) - (outputs (cons "rustfmt" (package-outputs base-rust))) - (arguments - (substitute-keyword-arguments (package-arguments base-rust) - ((#:phases phases) - `(modify-phases ,phases - (replace 'build - ;; Phase overridden to also build rustfmt. - (lambda* (#:key parallel-build? #:allow-other-keys) - (let ((job-spec (string-append - "-j" (if parallel-build? - (number->string (parallel-job-count)) - "1")))) - (invoke "./x.py" job-spec "build" - "library/std" ;rustc - "src/tools/cargo" - "src/tools/rustfmt")))) - (replace 'check - ;; Phase overridden to also test rustfmt. - (lambda* (#:key tests? parallel-build? #:allow-other-keys) - (when tests? - (let ((job-spec (string-append - "-j" (if parallel-build? - (number->string (parallel-job-count)) - "1")))) - (invoke "./x.py" job-spec "test" "-vv" - "library/std" - "src/tools/cargo" - "src/tools/rustfmt"))))) - (replace 'install - ;; Phase overridden to also install rustfmt. - (lambda* (#:key outputs #:allow-other-keys) - (invoke "./x.py" "install") - (substitute* "config.toml" - ;; Adjust the prefix to the 'cargo' output. - (("prefix = \"[^\"]*\"") - (format #f "prefix = ~s" (assoc-ref outputs "cargo")))) - (invoke "./x.py" "install" "cargo") - (substitute* "config.toml" - ;; Adjust the prefix to the 'rustfmt' output. - (("prefix = \"[^\"]*\"") - (format #f "prefix = ~s" (assoc-ref outputs "rustfmt")))) - (invoke "./x.py" "install" "rustfmt")))))))))) + (rust-bootstrapped-package + rust-1.45 "1.46.0" "0a17jby2pd050s24cy4dfc0gzvgcl585v3vvyfilniyvjrqknsid")) (define-public rust-1.47 (let ((base-rust (rust-bootstrapped-package @@ -640,12 +591,44 @@ safety and thread safety guarantees.") rust-1.47 "1.48.0" "0fz4gbb5hp5qalrl9lcl8yw4kk7ai7wx511jb28nypbxninkwxhf")) (define-public rust-1.49 + (rust-bootstrapped-package + rust-1.48 "1.49.0" "0yf7kll517398dgqsr7m3gldzj0iwsp3ggzxrayckpqzvylfy2mm")) + +(define-public rust-1.50 + (rust-bootstrapped-package + rust-1.49 "1.50.0" "0pjs7j62maiyvkmhp9zrxl528g2n0fphp4rq6ap7aqdv0a6qz5wm")) + +(define-public rust-1.51 + (rust-bootstrapped-package + rust-1.50 "1.51.0" "0ixqkqglv3isxbvl4ldr4byrkx692wghsz3fasy1pn5kr2prnsvs")) + +;;; The LLVM requiriment has been bumped to version 10 in Rust 1.52. Use the +;;; latest available. +(define-public rust-1.52 (let ((base-rust (rust-bootstrapped-package - rust-1.48 "1.49.0" - "0yf7kll517398dgqsr7m3gldzj0iwsp3ggzxrayckpqzvylfy2mm"))) + rust-1.51 "1.52.1" + "165zs3xzp9dravybwslqs1qhn35agp6wacmzpymqg3qfdni26vrs"))) + (package + (inherit base-rust) + (inputs (alist-replace "llvm" (list llvm-12) + (package-inputs base-rust)))))) + +(define-public rust-1.53 + (rust-bootstrapped-package + rust-1.52 "1.53.0" "1f95p259dfp5ca118bg107rj3rqwlswy65dxn3hg8sqgl4wwmxsw")) + +(define-public rust-1.54 + (let ((base-rust + (rust-bootstrapped-package + rust-1.53 "1.54.0" + "0xk9dhfff16caambmwij67zgshd8v9djw6ha0fnnanlv7rii31dc"))) (package (inherit base-rust) - (outputs (cons "doc" (package-outputs base-rust))) + (source + (origin + (inherit (package-source base-rust)) + (snippet '(delete-file-recursively "src/llvm-project")))) + (outputs (cons "rustfmt" (package-outputs base-rust))) (arguments (substitute-keyword-arguments (package-arguments base-rust) ((#:tests? _ #f) @@ -743,35 +726,51 @@ safety and thread safety guarantees.") (substitute* "config.toml" (("^python =.*" all) (string-append all - "gdb = \"" gdb "/bin/gdb\"\n")))))))))) + "gdb = \"" gdb "/bin/gdb\"\n")))))) + (replace 'build + ;; Phase overridden to also build rustfmt. + (lambda* (#:key parallel-build? #:allow-other-keys) + (let ((job-spec (string-append + "-j" (if parallel-build? + (number->string (parallel-job-count)) + "1")))) + (invoke "./x.py" job-spec "build" + "library/std" ;rustc + "src/tools/cargo" + "src/tools/rustfmt")))) + (replace 'check + ;; Phase overridden to also test rustfmt. + (lambda* (#:key tests? parallel-build? #:allow-other-keys) + (when tests? + (let ((job-spec (string-append + "-j" (if parallel-build? + (number->string (parallel-job-count)) + "1")))) + (invoke "./x.py" job-spec "test" "-vv" + "library/std" + "src/tools/cargo" + "src/tools/rustfmt"))))) + (replace 'install + ;; Phase overridden to also install rustfmt. + (lambda* (#:key outputs #:allow-other-keys) + (invoke "./x.py" "install") + (substitute* "config.toml" + ;; Adjust the prefix to the 'cargo' output. + (("prefix = \"[^\"]*\"") + (format #f "prefix = ~s" (assoc-ref outputs "cargo")))) + (invoke "./x.py" "install" "cargo") + (substitute* "config.toml" + ;; Adjust the prefix to the 'rustfmt' output. + (("prefix = \"[^\"]*\"") + (format #f "prefix = ~s" (assoc-ref outputs "rustfmt")))) + (invoke "./x.py" "install" "rustfmt"))))))) ;; Add test inputs. - (native-inputs (cons* - ;; The tests fail when using GDB 10 (see: - ;; https://github.com/rust-lang/rust/issues/79009). - `("gdb" ,gdb-9.2) - `("procps" ,procps) - (package-native-inputs base-rust)))))) - -(define-public rust-1.50 - (rust-bootstrapped-package rust-1.49 "1.50.0" - "0pjs7j62maiyvkmhp9zrxl528g2n0fphp4rq6ap7aqdv0a6qz5wm")) - -(define-public rust-1.51 - (rust-bootstrapped-package rust-1.50 "1.51.0" - "0ixqkqglv3isxbvl4ldr4byrkx692wghsz3fasy1pn5kr2prnsvs")) - -(define-public rust-1.52 - (let ((base-rust - (rust-bootstrapped-package rust-1.51 "1.52.1" - "165zs3xzp9dravybwslqs1qhn35agp6wacmzpymqg3qfdni26vrs"))) - (package - (inherit base-rust) - (inputs - (alist-replace "llvm" (list llvm-12) - (package-inputs base-rust)))))) + (native-inputs (cons* `("gdb" ,gdb) + `("procps" ,procps) + (package-native-inputs base-rust)))))) ;;; Note: Only the latest versions of Rust are supported and tested. The ;;; intermediate rusts are built for bootstrapping purposes and should not ;;; be relied upon. This is to ease maintenance and reduce the time ;;; required to build the full Rust bootstrap chain. -(define-public rust rust-1.50) +(define-public rust rust-1.54) -- cgit v1.2.3 From 9635119a61a9ab1b023558727fcdf1816fdc7fc6 Mon Sep 17 00:00:00 2001 From: Maxim Cournoyer Date: Thu, 2 Sep 2021 23:05:14 -0400 Subject: gnu: Build all Rust packages using the latest rustc. The older Rusts are made private variables; they shouldn't be used by users as they are not tested and are only built at stage 1, which makes them unsuitable to compile Rust applications. * gnu/packages/crates-io.scm (rust-cargo-0.53)[arguments]: Remove #:rust argument. (rust-cxx-1, rust-cxx-build-1, rust-cxx-gen-0.7): Likewise. * gnu/packages/crates-io.scm (rust-cxx-gen-0.7, rust-cxxbridge-macro-1, rust-postgres-0.19): Likewise. (rust-rust-decimal-1, rust-sized-chunks-0.6, rust-socket2-0.4): Likewise. (rust-tokio-postgres-0.7, rust-im-rc-15): Likewise. * gnu/packages/gnome.scm (librsvg): Likewise. * gnu/packages/gnuzilla.scm (mozjs-78): Likewise. * gnu/packages/rust-apps.scm (hyperfine, tectonic rust-analyzer, rust-cargo-c): Likewise. * gnu/packages/shells.scm (nushell): Likewise. * gnu/packages/syndication.scm (newsboat): Likewise. * gnu/packages/rust.scm: (rust-1.39, rust-1.40, rust-1.41, rust-1.42) (rust-1.43, rust-1.44, rust-1.45, rust-1.46, rust-1.47, rust-1.48, rust-1.49) (rust-1.50, rust-1.51, rust-1.52, rust-1.53, rust-1.54): Make variables private. --- gnu/packages/crates-io.scm | 7 ++----- gnu/packages/gnuzilla.scm | 4 ++-- gnu/packages/rust-apps.scm | 9 +++------ gnu/packages/rust.scm | 30 +++++++++++++++--------------- gnu/packages/shells.scm | 3 +-- 5 files changed, 23 insertions(+), 30 deletions(-) (limited to 'gnu/packages/rust.scm') diff --git a/gnu/packages/crates-io.scm b/gnu/packages/crates-io.scm index c96bc65e14..3615352f5d 100644 --- a/gnu/packages/crates-io.scm +++ b/gnu/packages/crates-io.scm @@ -7724,7 +7724,6 @@ capabilities.") `(;; The test suite is disabled as the internal 'cargo-test-macro' and ;; 'cargo-test-support' crates are not included in the release. #:tests? #f - #:rust ,rust-1.52 ;transitively inherited from rust-sized-chunks #:cargo-inputs (("rust-anyhow" ,rust-anyhow-1) ("rust-atty" ,rust-atty-0.2) @@ -47325,8 +47324,7 @@ variants in pure Rust.") "07ix5fsdnpf2xsb0k5rbiwlmsicm2237fcx7blirp9p7pljr5mhn")))) (build-system cargo-build-system) (arguments - `(#:rust ,rust-1.52 ;requires the "if in const fn" feature - #:cargo-inputs + `(#:cargo-inputs (("rust-arbitrary" ,rust-arbitrary-1) ("rust-array-ops" ,rust-array-ops-0.1) ("rust-bitmaps" ,rust-bitmaps-2) @@ -60924,8 +60922,7 @@ file into an in-memory tree structure.") "0gsgcs1nn38r40973l6zr1v4d85f4s9qyl32n5f20jphf5z9ba1w")))) (build-system cargo-build-system) (arguments - `(#:rust ,rust-1.52 ;for rust-sized-chunks - #:cargo-inputs + `(#:cargo-inputs (("rust-arbitrary" ,rust-arbitrary-0.4) ("rust-bitmaps" ,rust-bitmaps-2) ("rust-proptest" ,rust-proptest-0.9) diff --git a/gnu/packages/gnuzilla.scm b/gnu/packages/gnuzilla.scm index 88ba14b01f..b96f59409e 100644 --- a/gnu/packages/gnuzilla.scm +++ b/gnu/packages/gnuzilla.scm @@ -574,8 +574,8 @@ in C/C++.") ("perl" ,perl) ("pkg-config" ,pkg-config) ("python" ,python-3) - ("rust" ,rust-1.41) - ("cargo" ,rust-1.41 "cargo"))) + ("rust" ,rust) + ("cargo" ,rust "cargo"))) (inputs `(("icu4c" ,icu4c) ("readline" ,readline) diff --git a/gnu/packages/rust-apps.scm b/gnu/packages/rust-apps.scm index 6d95b496c3..568b67a1b2 100644 --- a/gnu/packages/rust-apps.scm +++ b/gnu/packages/rust-apps.scm @@ -790,8 +790,7 @@ of the project is to be runnable on untrusted networks without crashing.") (base32 "0hzyqpjxya6g1ifb3hvjvj0zl2aigx898pz7h5pl46z50jp2pdc8")))) (build-system cargo-build-system) (arguments - `(#:rust ,rust-1.52 - #:cargo-build-flags '("--release" "--features" "external-harfbuzz") + `(#:cargo-build-flags '("--release" "--features" "external-harfbuzz") #:cargo-inputs (("rust-atty" ,rust-atty-0.2) ("rust-byte-unit" ,rust-byte-unit-4) @@ -969,8 +968,7 @@ runs a command whenever it detects modifications.") "06bc3s5kjwpyr2cq79p0306a9bqp3xp928d750ybby9npq2dvj3z")))) (build-system cargo-build-system) (arguments - `(#:rust ,rust-1.52 - #:install-source? #f ; virtual manifest + `(#:install-source? #f ; virtual manifest #:cargo-test-flags '("--release" "--" "--skip=tests::test_version_check" ;; It need rustc's version @@ -1097,8 +1095,7 @@ support for Rust.") "0fwdxhdj2963xr6xfqr56i7hikhsdv562vgxq2dj3h2mi3dil1k6")))) (build-system cargo-build-system) (arguments - `(#:rust ,rust-1.52 ;inherited from rust-cargo - #:cargo-inputs + `(#:cargo-inputs (("rust-cbindgen" ,rust-cbindgen-0.19) ("rust-cargo" ,rust-cargo-0.53) ; ("rust-anyhow" ,rust-anyhow-1) diff --git a/gnu/packages/rust.scm b/gnu/packages/rust.scm index 0cff15b98e..f7f05851f1 100644 --- a/gnu/packages/rust.scm +++ b/gnu/packages/rust.scm @@ -321,7 +321,7 @@ safety and thread safety guarantees.") ;; Dual licensed. (license (list license:asl2.0 license:expat)))) -(define-public rust-1.40 +(define rust-1.40 (package (name "rust") (version "1.40.0") @@ -512,7 +512,7 @@ safety and thread safety guarantees.") ;; Dual licensed. (license (list license:asl2.0 license:expat)))) -(define-public rust-1.41 +(define rust-1.41 (let ((base-rust (rust-bootstrapped-package rust-1.40 "1.41.1" "0ws5x0fxv57fyllsa6025h3q6j9v3m8nb3syl4x0hgkddq0kvj9q"))) @@ -532,21 +532,21 @@ safety and thread safety guarantees.") (string-append name "\"" ,%cargo-reference-hash "\""))) (generate-all-checksums "vendor")))))))))) -(define-public rust-1.42 +(define rust-1.42 (rust-bootstrapped-package rust-1.41 "1.42.0" "0x9lxs82may6c0iln0b908cxyn1cv7h03n5cmbx3j1bas4qzks6j")) -(define-public rust-1.43 +(define rust-1.43 (rust-bootstrapped-package rust-1.42 "1.43.0" "18akhk0wz1my6y9vhardriy2ysc482z0fnjdcgs9gy59kmnarxkm")) ;; This version requires llvm <= 11. -(define-public rust-1.44 +(define rust-1.44 (rust-bootstrapped-package rust-1.43 "1.44.1" "0ww4z2v3gxgn3zddqzwqya1gln04p91ykbrflnpdbmcd575n8bky")) -(define-public rust-1.45 +(define rust-1.45 (let ((base-rust (rust-bootstrapped-package rust-1.44 "1.45.2" "0273a1g3f59plyi1n0azf21qjzwml1yqdnj5z472crz37qggr8xp"))) @@ -562,11 +562,11 @@ safety and thread safety guarantees.") (("linker.env\\(\"LC_ALL\", \"C\"\\);") "linker.env(\"LC_ALL\", \"en_US.UTF-8\");"))))))))))) -(define-public rust-1.46 +(define rust-1.46 (rust-bootstrapped-package rust-1.45 "1.46.0" "0a17jby2pd050s24cy4dfc0gzvgcl585v3vvyfilniyvjrqknsid")) -(define-public rust-1.47 +(define rust-1.47 (let ((base-rust (rust-bootstrapped-package rust-1.46 "1.47.0" "07fqd2vp7cf1ka3hr207dnnz93ymxml4935vp74g4is79h3dz19i"))) @@ -586,25 +586,25 @@ safety and thread safety guarantees.") "library/std" "src/tools/cargo"))))))))))) -(define-public rust-1.48 +(define rust-1.48 (rust-bootstrapped-package rust-1.47 "1.48.0" "0fz4gbb5hp5qalrl9lcl8yw4kk7ai7wx511jb28nypbxninkwxhf")) -(define-public rust-1.49 +(define rust-1.49 (rust-bootstrapped-package rust-1.48 "1.49.0" "0yf7kll517398dgqsr7m3gldzj0iwsp3ggzxrayckpqzvylfy2mm")) -(define-public rust-1.50 +(define rust-1.50 (rust-bootstrapped-package rust-1.49 "1.50.0" "0pjs7j62maiyvkmhp9zrxl528g2n0fphp4rq6ap7aqdv0a6qz5wm")) -(define-public rust-1.51 +(define rust-1.51 (rust-bootstrapped-package rust-1.50 "1.51.0" "0ixqkqglv3isxbvl4ldr4byrkx692wghsz3fasy1pn5kr2prnsvs")) ;;; The LLVM requiriment has been bumped to version 10 in Rust 1.52. Use the ;;; latest available. -(define-public rust-1.52 +(define rust-1.52 (let ((base-rust (rust-bootstrapped-package rust-1.51 "1.52.1" "165zs3xzp9dravybwslqs1qhn35agp6wacmzpymqg3qfdni26vrs"))) @@ -613,11 +613,11 @@ safety and thread safety guarantees.") (inputs (alist-replace "llvm" (list llvm-12) (package-inputs base-rust)))))) -(define-public rust-1.53 +(define rust-1.53 (rust-bootstrapped-package rust-1.52 "1.53.0" "1f95p259dfp5ca118bg107rj3rqwlswy65dxn3hg8sqgl4wwmxsw")) -(define-public rust-1.54 +(define rust-1.54 (let ((base-rust (rust-bootstrapped-package rust-1.53 "1.54.0" diff --git a/gnu/packages/shells.scm b/gnu/packages/shells.scm index 7b3f463945..729269e5e5 100644 --- a/gnu/packages/shells.scm +++ b/gnu/packages/shells.scm @@ -969,8 +969,7 @@ files and text.") (base32 "1db521jrs0yxwmvkkl8wssa8qyi0m62n69l7xxl2gpyz1v8nvw76")))) (build-system cargo-build-system) (arguments - `(#:rust ,rust-1.52 - #:tests? #false ;missing files + `(#:tests? #false ;missing files #:features '("extra") #:cargo-inputs (("rust-ctrlc" ,rust-ctrlc-3) -- cgit v1.2.3 From e765ad091d861c99eae9fdd402214a2e2e90ed4d Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sat, 27 Nov 2021 22:27:09 +0100 Subject: gnu: rust: Add 'supported-systems' field. * gnu/packages/rust.scm (rust-1.39)[supported-systems]: New field. (rust-1.40)[supported-systems]: Remove. --- gnu/packages/rust.scm | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'gnu/packages/rust.scm') diff --git a/gnu/packages/rust.scm b/gnu/packages/rust.scm index f7f05851f1..2a43e88727 100644 --- a/gnu/packages/rust.scm +++ b/gnu/packages/rust.scm @@ -318,6 +318,11 @@ (description "Rust is a systems programming language that provides memory safety and thread safety guarantees.") (home-page "https://github.com/thepowersgang/mrustc") + + ;; So far mrustc is x86_64-only. It may support i686 soon: + ;; . + (supported-systems '("x86_64-linux")) + ;; Dual licensed. (license (list license:asl2.0 license:expat)))) @@ -502,9 +507,6 @@ ar = \"" binutils "/bin/ar" "\" (search-path-specification (variable "LIBRARY_PATH") (files '("lib" "lib64"))))) - (supported-systems - (delete "i686-linux" ; fails to build, see bug #35519 - %supported-systems)) (synopsis "Compiler for the Rust progamming language") (description "Rust is a systems programming language that provides memory safety and thread safety guarantees.") -- cgit v1.2.3