diff options
| author | Maxim Cournoyer <maxim@guixotic.coop> | 2025-09-08 11:20:14 +0900 |
|---|---|---|
| committer | Andreas Enge <andreas@enge.fr> | 2026-02-21 10:14:47 +0100 |
| commit | cb03f5ffa9549a71ed93ec9271349015974827ff (patch) | |
| tree | eab944b43b8fac7e9ef4ee51f32a41107b870d4e /gnu/packages/rust.scm | |
| parent | d0402ae222a2993204f5b37e65ded9f88bb86bc2 (diff) | |
gnu: rust: Update to 1.90.
* gnu/packages/rust.scm (rust): Update to 1.90.
[source]: Delete field.
[#:modules]: Add (srfi srfi-26).
[#:phases] {disable-tests-using-cargo-publish}: Register new tests to disable.
{patch-process-tests}: Adjust for file name change.
{unpack-libunwind}: New phase.
{patch-cargo-checksums}: Override phase.
[inputs]: Delete field.
[native-inputs]: Update clang-source to that of clang-runtime-21.
Change-Id: I711e05ee889f4ba266d31e8c6bc9e73c112e99f3
Diffstat (limited to 'gnu/packages/rust.scm')
| -rw-r--r-- | gnu/packages/rust.scm | 126 |
1 files changed, 57 insertions, 69 deletions
diff --git a/gnu/packages/rust.scm b/gnu/packages/rust.scm index 72c902e6199..4ab1f7717d6 100644 --- a/gnu/packages/rust.scm +++ b/gnu/packages/rust.scm | |||
| @@ -11,7 +11,7 @@ | |||
| 11 | ;;; Copyright © 2020, 2021 Jakub Kądziołka <kuba@kadziolka.net> | 11 | ;;; Copyright © 2020, 2021 Jakub Kądziołka <kuba@kadziolka.net> |
| 12 | ;;; Copyright © 2020 Pierre Langlois <pierre.langlois@gmx.com> | 12 | ;;; Copyright © 2020 Pierre Langlois <pierre.langlois@gmx.com> |
| 13 | ;;; Copyright © 2020 Matthew James Kraai <kraai@ftbfs.org> | 13 | ;;; Copyright © 2020 Matthew James Kraai <kraai@ftbfs.org> |
| 14 | ;;; Copyright © 2021 Maxim Cournoyer <maxim@guixotic.coop> | 14 | ;;; Copyright © 2021, 2025 Maxim Cournoyer <maxim@guixotic.coop> |
| 15 | ;;; Copyright © 2021 (unmatched parenthesis <paren@disroot.org> | 15 | ;;; Copyright © 2021 (unmatched parenthesis <paren@disroot.org> |
| 16 | ;;; Copyright © 2022 Zheng Junjie <873216071@qq.com> | 16 | ;;; Copyright © 2022 Zheng Junjie <873216071@qq.com> |
| 17 | ;;; Copyright © 2022 Jim Newsome <jnewsome@torproject.org> | 17 | ;;; Copyright © 2022 Jim Newsome <jnewsome@torproject.org> |
| @@ -1373,7 +1373,8 @@ safety and thread safety guarantees.") | |||
| 1373 | 1373 | ||
| 1374 | (define-public rust-1.86 | 1374 | (define-public rust-1.86 |
| 1375 | (let ((base-rust | 1375 | (let ((base-rust |
| 1376 | (rust-bootstrapped-package rust-1.85 "1.86.0" | 1376 | (rust-bootstrapped-package |
| 1377 | rust-1.85 "1.86.0" | ||
| 1377 | "107d3vbmwhn4b71gzr1kv31jwwyld7dxj9yj8jh00ygndll2fah2"))) | 1378 | "107d3vbmwhn4b71gzr1kv31jwwyld7dxj9yj8jh00ygndll2fah2"))) |
| 1378 | (package | 1379 | (package |
| 1379 | (inherit base-rust) | 1380 | (inherit base-rust) |
| @@ -1446,6 +1447,11 @@ safety and thread safety guarantees.") | |||
| 1446 | `(modify-phases ,phases | 1447 | `(modify-phases ,phases |
| 1447 | (replace 'build | 1448 | (replace 'build |
| 1448 | ;; Just building stage 1 no longer builds cargo. | 1449 | ;; Just building stage 1 no longer builds cargo. |
| 1450 | |||
| 1451 | ;; TODO: Try reverting to use "./x.py install rustc std cargo" | ||
| 1452 | ;; when Rust 1.91 comes out, which should no longer rebuild | ||
| 1453 | ;; things unnecessarily. If this works, the 'post-install' | ||
| 1454 | ;; phase carried from earlier should no longer be necessary. | ||
| 1449 | (lambda* (#:key parallel-build? #:allow-other-keys) | 1455 | (lambda* (#:key parallel-build? #:allow-other-keys) |
| 1450 | (let ((job-spec (string-append | 1456 | (let ((job-spec (string-append |
| 1451 | "-j" (if parallel-build? | 1457 | "-j" (if parallel-build? |
| @@ -1457,7 +1463,8 @@ safety and thread safety guarantees.") | |||
| 1457 | 1463 | ||
| 1458 | (define-public rust-1.88 | 1464 | (define-public rust-1.88 |
| 1459 | (let ((base-rust | 1465 | (let ((base-rust |
| 1460 | (rust-bootstrapped-package rust-1.87 "1.88.0" | 1466 | (rust-bootstrapped-package |
| 1467 | rust-1.87 "1.88.0" | ||
| 1461 | "1gngrxjfqiyybyamzn8s4rfbhk7jss1vrmnijg8y72l46i2595rs"))) | 1468 | "1gngrxjfqiyybyamzn8s4rfbhk7jss1vrmnijg8y72l46i2595rs"))) |
| 1462 | (package | 1469 | (package |
| 1463 | (inherit base-rust) | 1470 | (inherit base-rust) |
| @@ -1622,69 +1629,20 @@ ge13ca993e8ccb9ba9847cc330696e02839f328f7/jemalloc")) | |||
| 1622 | ;;; Here we take the latest included Rust, make it public, and re-enable tests | 1629 | ;;; Here we take the latest included Rust, make it public, and re-enable tests |
| 1623 | ;;; and extra components such as rustfmt. | 1630 | ;;; and extra components such as rustfmt. |
| 1624 | (define-public rust | 1631 | (define-public rust |
| 1625 | (let ((base-rust rust-1.85)) | 1632 | (let ((base-rust rust-1.90)) |
| 1626 | (package | 1633 | (package |
| 1627 | (inherit base-rust) | 1634 | (inherit base-rust) |
| 1628 | (properties (append | 1635 | (properties (append |
| 1629 | (alist-delete 'hidden? (package-properties base-rust)) | 1636 | (alist-delete 'hidden? (package-properties base-rust)) |
| 1630 | ;; Keep in sync with the llvm used to build rust. | 1637 | ;; Keep in sync with the llvm used to build rust. |
| 1631 | (clang-compiler-cpu-architectures "19"))) | 1638 | (clang-compiler-cpu-architectures "21"))) |
| 1632 | (outputs (cons* "rust-src" "tools" (package-outputs base-rust))) | 1639 | (outputs (cons* "rust-src" "tools" (package-outputs base-rust))) |
| 1633 | (source | ||
| 1634 | (origin | ||
| 1635 | (inherit (package-source base-rust)) | ||
| 1636 | (snippet | ||
| 1637 | '(begin | ||
| 1638 | (for-each delete-file-recursively | ||
| 1639 | '("src/llvm-project" | ||
| 1640 | "vendor/jemalloc-sys-0.3.2/jemalloc" | ||
| 1641 | "vendor/jemalloc-sys-0.5.3+5.3.0-patched/jemalloc" | ||
| 1642 | "vendor/openssl-src-111.17.0+1.1.1m/openssl" | ||
| 1643 | "vendor/openssl-src-111.28.2+1.1.1w/openssl" | ||
| 1644 | "vendor/tikv-jemalloc-sys-0.5.4+5.3.0-patched/jemalloc" | ||
| 1645 | "vendor/tikv-jemalloc-sys-0.6.0+5.3.0-1-ge13ca993e8ccb9ba9847cc330696e02839f328f7/jemalloc" | ||
| 1646 | ;; These are referenced by the cargo output | ||
| 1647 | ;; so we unbundle them. | ||
| 1648 | "vendor/curl-sys-0.4.52+curl-7.81.0/curl" | ||
| 1649 | "vendor/curl-sys-0.4.74+curl-8.9.0/curl" | ||
| 1650 | "vendor/curl-sys-0.4.78+curl-8.11.0/curl" | ||
| 1651 | "vendor/libffi-sys-2.3.0/libffi" | ||
| 1652 | "vendor/libz-sys-1.1.3/src/zlib" | ||
| 1653 | "vendor/libz-sys-1.1.20/src/zlib")) | ||
| 1654 | ;; Use the packaged nghttp2 | ||
| 1655 | (for-each | ||
| 1656 | (lambda (ver) | ||
| 1657 | (let ((vendored-dir (format #f "vendor/libnghttp2-sys-~a/nghttp2" ver)) | ||
| 1658 | (build-rs (format #f "vendor/libnghttp2-sys-~a/build.rs" ver))) | ||
| 1659 | (delete-file-recursively vendored-dir) | ||
| 1660 | (delete-file build-rs) | ||
| 1661 | (with-output-to-file build-rs | ||
| 1662 | (lambda _ | ||
| 1663 | (format #t "fn main() {~@ | ||
| 1664 | println!(\"cargo:rustc-link-lib=nghttp2\");~@ | ||
| 1665 | }~%"))))) | ||
| 1666 | '("0.1.10+1.61.0" | ||
| 1667 | "0.1.7+1.45.0")) | ||
| 1668 | ;; Remove vendored dynamically linked libraries. | ||
| 1669 | ;; find . -not -type d -executable -exec file {} \+ | grep ELF | ||
| 1670 | ;; Also remove the bundled (mostly Windows) libraries. | ||
| 1671 | (for-each delete-file | ||
| 1672 | (find-files "vendor" "\\.(a|dll|exe|lib)$")) | ||
| 1673 | ;; Adjust vendored dependency to explicitly use rustix with libc backend. | ||
| 1674 | (for-each | ||
| 1675 | (lambda (ver) | ||
| 1676 | (let ((f (format #f "vendor/tempfile-~a/Cargo.toml" ver))) | ||
| 1677 | (substitute* f | ||
| 1678 | (("features = \\[\"fs\"" all) | ||
| 1679 | (string-append all ", \"use-libc\""))))) | ||
| 1680 | '("3.3.0" | ||
| 1681 | "3.4.0" | ||
| 1682 | "3.10.1" | ||
| 1683 | "3.14.0")))))) | ||
| 1684 | (arguments | 1640 | (arguments |
| 1685 | (substitute-keyword-arguments | 1641 | (substitute-keyword-arguments |
| 1686 | (strip-keyword-arguments '(#:tests?) | 1642 | (strip-keyword-arguments '(#:tests?) |
| 1687 | (package-arguments base-rust)) | 1643 | (package-arguments base-rust)) |
| 1644 | ((#:modules modules) | ||
| 1645 | (cons '(srfi srfi-26) modules)) | ||
| 1688 | ((#:phases phases) | 1646 | ((#:phases phases) |
| 1689 | `(modify-phases ,phases | 1647 | `(modify-phases ,phases |
| 1690 | (add-after 'unpack 'relax-gdb-auto-load-safe-path | 1648 | (add-after 'unpack 'relax-gdb-auto-load-safe-path |
| @@ -1733,15 +1691,24 @@ ge13ca993e8ccb9ba9847cc330696e02839f328f7/jemalloc")) | |||
| 1733 | '("fn case"))) | 1691 | '("fn case"))) |
| 1734 | (substitute* "git_shallow.rs" | 1692 | (substitute* "git_shallow.rs" |
| 1735 | ,@(make-ignore-test-list | 1693 | ,@(make-ignore-test-list |
| 1736 | '("fn gitoxide_clones_git_dependency_with_shallow_protocol_and_git2_is_used_for_followup_fetches" | 1694 | '("fn gitoxide_clones_registry_with_shallow_protocol_and_aborts_and_updates_again" |
| 1737 | "fn gitoxide_clones_registry_with_shallow_protocol_and_aborts_and_updates_again" | ||
| 1738 | "fn gitoxide_clones_registry_with_shallow_protocol_and_follow_up_fetch_maintains_shallowness" | 1695 | "fn gitoxide_clones_registry_with_shallow_protocol_and_follow_up_fetch_maintains_shallowness" |
| 1739 | "fn gitoxide_clones_registry_with_shallow_protocol_and_follow_up_with_git2_fetch" | 1696 | "fn gitoxide_clones_registry_with_shallow_protocol_and_follow_up_with_git2_fetch" |
| 1740 | "fn gitoxide_clones_registry_without_shallow_protocol_and_follow_up_fetch_uses_shallowness" | 1697 | "fn gitoxide_clones_registry_without_shallow_protocol_and_follow_up_fetch_uses_shallowness" |
| 1741 | "fn gitoxide_shallow_clone_followed_by_non_shallow_update" | ||
| 1742 | "fn gitoxide_clones_shallow_two_revs_same_deps" | 1698 | "fn gitoxide_clones_shallow_two_revs_same_deps" |
| 1699 | "fn gitoxide_fetch_complete_index_then_shallow" | ||
| 1700 | "fn gitoxide_fetch_shallow_dep_branch_and_rev" | ||
| 1701 | "fn gitoxide_fetch_shallow_dep_branch_to_rev" | ||
| 1702 | "fn gitoxide_fetch_shallow_dep_then_git2_fetch_complete" | ||
| 1703 | "fn gitoxide_fetch_shallow_dep_then_gitoxide_fetch_complete" | ||
| 1704 | "fn gitoxide_fetch_shallow_dep_two_revs" | ||
| 1705 | "fn gitoxide_fetch_shallow_index_then_abort_and_update" | ||
| 1706 | "fn gitoxide_fetch_shallow_index_then_git2_fetch_complete" | ||
| 1707 | "fn gitoxide_fetch_shallow_index_then_preserve_shallow" | ||
| 1743 | "fn gitoxide_git_dependencies_switch_from_branch_to_rev" | 1708 | "fn gitoxide_git_dependencies_switch_from_branch_to_rev" |
| 1744 | "fn shallow_deps_work_with_revisions_and_branches_mixed_on_same_dependency"))) | 1709 | "fn gitoxide_shallow_clone_followed_by_non_shallow_update" |
| 1710 | "fn shallow_deps_work_with_revisions_and_branches_mixed_on_same_dependency" | ||
| 1711 | "fn gitoxide_clones_git_dependency_with_shallow_protocol_and_git2_is_used_for_followup_fetches"))) | ||
| 1745 | (substitute* "install.rs" | 1712 | (substitute* "install.rs" |
| 1746 | ,@(make-ignore-test-list | 1713 | ,@(make-ignore-test-list |
| 1747 | '("fn failed_install_retains_temp_directory"))) | 1714 | '("fn failed_install_retains_temp_directory"))) |
| @@ -1867,7 +1834,7 @@ ge13ca993e8ccb9ba9847cc330696e02839f328f7/jemalloc")) | |||
| 1867 | ;; The three tests which are known to fail upstream on QEMU | 1834 | ;; The three tests which are known to fail upstream on QEMU |
| 1868 | ;; emulation on aarch64 and riscv64 also fail on x86_64 in | 1835 | ;; emulation on aarch64 and riscv64 also fail on x86_64 in |
| 1869 | ;; Guix's build system. Skip them on all builds. | 1836 | ;; Guix's build system. Skip them on all builds. |
| 1870 | (substitute* "sys/pal/unix/process/process_common/tests.rs" | 1837 | (substitute* "sys/process/unix/common/tests.rs" |
| 1871 | ;; We can't use make-ignore-test-list because we will get | 1838 | ;; We can't use make-ignore-test-list because we will get |
| 1872 | ;; build errors due to the double [ignore] block. | 1839 | ;; build errors due to the double [ignore] block. |
| 1873 | (("target_arch = \"arm\"" arm) | 1840 | (("target_arch = \"arm\"" arm) |
| @@ -1900,9 +1867,33 @@ ge13ca993e8ccb9ba9847cc330696e02839f328f7/jemalloc")) | |||
| 1900 | (lambda* (#:key inputs #:allow-other-keys) | 1867 | (lambda* (#:key inputs #:allow-other-keys) |
| 1901 | (mkdir-p "src/llvm-project/compiler-rt") | 1868 | (mkdir-p "src/llvm-project/compiler-rt") |
| 1902 | (copy-recursively | 1869 | (copy-recursively |
| 1903 | (string-append (assoc-ref inputs "clang-source") | 1870 | (string-append (assoc-ref inputs "clang-source") |
| 1904 | "/compiler-rt") | 1871 | "/compiler-rt") |
| 1905 | "src/llvm-project/compiler-rt"))) | 1872 | "src/llvm-project/compiler-rt"))) |
| 1873 | (add-after 'unpack 'unpack-libunwind | ||
| 1874 | (lambda* (#:key inputs #:allow-other-keys) | ||
| 1875 | (mkdir-p "src/llvm-project/libunwind") | ||
| 1876 | (copy-recursively | ||
| 1877 | (string-append (assoc-ref inputs "clang-source") | ||
| 1878 | "/libunwind") | ||
| 1879 | "src/llvm-project/libunwind"))) | ||
| 1880 | (replace 'patch-cargo-checksums | ||
| 1881 | (lambda _ | ||
| 1882 | (substitute* | ||
| 1883 | (append '("Cargo.lock" | ||
| 1884 | "src/bootstrap/Cargo.lock") | ||
| 1885 | (find-files "compiler" "Cargo.lock") | ||
| 1886 | (find-files "library" "Cargo.lock") | ||
| 1887 | (find-files "src/doc" "Cargo.lock") | ||
| 1888 | (remove | ||
| 1889 | ;; Don't mess with the lock files in the Cargo | ||
| 1890 | ;; testsuite; it messes up the tests. | ||
| 1891 | (cut string-contains <> | ||
| 1892 | "cargo/tests/testsuite") | ||
| 1893 | (find-files "src/tools" "Cargo.lock"))) | ||
| 1894 | (("(checksum = )\".*\"" all name) | ||
| 1895 | (string-append name "\"" ,%cargo-reference-hash "\""))) | ||
| 1896 | (generate-all-checksums "vendor"))) | ||
| 1906 | (add-after 'configure 'enable-profiling | 1897 | (add-after 'configure 'enable-profiling |
| 1907 | (lambda _ | 1898 | (lambda _ |
| 1908 | (substitute* "config.toml" | 1899 | (substitute* "config.toml" |
| @@ -2014,12 +2005,9 @@ exec -a \"$0\" \"~a\" \"$@\"" | |||
| 2014 | "/lib/rustlib/src/rust/library") | 2005 | "/lib/rustlib/src/rust/library") |
| 2015 | (string-append bin "/.rust-analyzer-real")))) | 2006 | (string-append bin "/.rust-analyzer-real")))) |
| 2016 | (chmod (string-append bin "/rust-analyzer") #o755)))))))) | 2007 | (chmod (string-append bin "/rust-analyzer") #o755)))))))) |
| 2017 | (inputs | ||
| 2018 | (modify-inputs (package-inputs base-rust) | ||
| 2019 | (prepend curl libffi `(,nghttp2 "lib") zlib))) | ||
| 2020 | (native-inputs (cons* | 2008 | (native-inputs (cons* |
| 2021 | ;; Keep in sync with the llvm used to build rust. | 2009 | ;; Keep in sync with the llvm used to build rust. |
| 2022 | `("clang-source" ,(package-source clang-runtime-19)) | 2010 | `("clang-source" ,(package-source clang-runtime-21)) |
| 2023 | ;; Add test inputs. | 2011 | ;; Add test inputs. |
| 2024 | `("gdb" ,gdb/pinned) | 2012 | `("gdb" ,gdb/pinned) |
| 2025 | `("procps" ,procps) | 2013 | `("procps" ,procps) |
