From patchwork Sun May 18 16:06:42 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Maxim Cournoyer X-Patchwork-Id: 42728 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 6C2D927BC4A; Sun, 18 May 2025 17:08:38 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-6.4 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL, RCVD_IN_VALIDITY_SAFE,SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 9C58527BC49 for ; Sun, 18 May 2025 17:08:35 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uGgYb-0002i3-Bt; Sun, 18 May 2025 12:08:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uGgYX-0002ha-CO for guix-patches@gnu.org; Sun, 18 May 2025 12:08:06 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uGgYW-0002w3-Rl for guix-patches@gnu.org; Sun, 18 May 2025 12:08:04 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:From:To:Subject; bh=JOpw9E0tckLng3ZsRqPBTfC7SXzNnU4myQRRRk3pTKw=; b=XUDAZ6JWPpA6psCVRnWdLrExl6Og1Z08+wHhbn5K4UWeQubv1AvxJhGrcBEY3b1vjiye6VtChbuAwgAF4Kkf3RGc68NjQUY97dNO6t9HW+hSRGKIXmb/gaFh87Hy7wMIVo4AxW96FBXv3Y3dazeqtWd84A2t7gmLze1OSnhXH5RA3QpQmDMMJOfokFnzim931J785VOd++1yjF1ZMCCBt1r/LDNxHeLrkT7H5R7Ks8WfhIKti7aSqwFUnm260NeZtIYHbjv1Z39JOGpoc1OT5n1Yhnb71C5ae+8CDVyD0gMhXItihf3mwgbbyWR4DuvcILiJ4GfzJsIkZYJfIKnBTQ==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1uGgYU-000355-Kd; Sun, 18 May 2025 12:08:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#78484] [PATCH] rust: Bootstrap from version 1.74.0. Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: divya@subvertising.org, efraim@flashner.co.il, hako@ultrarare.space, steve@futurile.net, guix-patches@gnu.org Resent-Date: Sun, 18 May 2025 16:08:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 78484 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 78484@debbugs.gnu.org Cc: Maxim Cournoyer , Divya Ranjan Pattanaik , Efraim Flashner , Hilton Chain , Steve George X-Debbugs-Original-To: guix-patches@gnu.org X-Debbugs-Original-Xcc: Divya Ranjan Pattanaik , Efraim Flashner , Hilton Chain , Steve George Received: via spool by submit@debbugs.gnu.org id=B.174758444911763 (code B ref -1); Sun, 18 May 2025 16:08:02 +0000 Received: (at submit) by debbugs.gnu.org; 18 May 2025 16:07:29 +0000 Received: from localhost ([127.0.0.1]:59335 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uGgXo-00033Q-IT for submit@debbugs.gnu.org; Sun, 18 May 2025 12:07:29 -0400 Received: from lists.gnu.org ([2001:470:142::17]:52094) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uGgXj-00032x-Cd for submit@debbugs.gnu.org; Sun, 18 May 2025 12:07:18 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uGgXb-0002Wf-7S for guix-patches@gnu.org; Sun, 18 May 2025 12:07:08 -0400 Received: from mail-pf1-x42e.google.com ([2607:f8b0:4864:20::42e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uGgXW-0002rj-Au for guix-patches@gnu.org; Sun, 18 May 2025 12:07:06 -0400 Received: by mail-pf1-x42e.google.com with SMTP id d2e1a72fcca58-74264d1832eso4783751b3a.0 for ; Sun, 18 May 2025 09:07:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1747584420; x=1748189220; darn=gnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=JOpw9E0tckLng3ZsRqPBTfC7SXzNnU4myQRRRk3pTKw=; b=Gf+dtT/ITaTB7H1NXJ7wWaRh5SSeKXifZXQ7fXHb9zZT2lLQ2g9kN1tIJN7G5NvbOO 0/uL53QDO7pVuAyE3aEE5WK/YRyeVJaHGIuuM8une7mqZL5bQ27oPqZ7KFOHAukjYxhQ JWQrkXyMRZEztvW61rkWlcYtjbPnAa4jmQCeuwvOBBntRLShLquIZdA6EsTmpKJ+BBDa FHtT02VqXf915kfySiFYIBpS5mYgORnmMavx2HcTaIlOhFp8VdxBPTxxrS9a/rgAlL7A YZ15hbtwropCOWvhuamG7mNcEFuYWOMkg2KHhx29IM1fAERLt/XweDLgHZ9Ebhcni056 6+XQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1747584420; x=1748189220; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=JOpw9E0tckLng3ZsRqPBTfC7SXzNnU4myQRRRk3pTKw=; b=KUYUV0d4pCtK6Vjn1vqiI+Ti4Qkc9VUh8hdmT+gdr+qItWkrxLD82SV6Y+58avX9Rp kFfTjqJg5g5pcBAuMFqXPf7We6Is1ZzKUR5ICHGjEOSQ2ZBd0CygIT8xF0WFJm2PAFev zgczTKMMQ+wHFA8SjiAV7dzyx4cWhRxzFdVrvP7syw+gUayMGZ6CFqK7/gKGCUu+3Gnc qYij/vXUW0VmVFsqeFThx1iVNewuw8Cnw7j6G66lM7CNDY1uJrP5TPaQgRoDeSvWQppQ Zs6h5DjSyn3z9X64ZcO8JsMzcMPLt++6MUkfnlo1HeJsI/TsVY/GL+Zpi/KLVO90XyLT V7mw== X-Gm-Message-State: AOJu0YzPK4CNNU/HIlvrmp+usKKWvDjq++JJ/5JU3wYUGN9r9DfdyYmq KGOb1aOb5mAnjD1LqLSePtYmzA4VAb7nFSVVYqNFB/o4HBIyHhV2LXxafA4OwA== X-Gm-Gg: ASbGncuu5AbR4dAbUt3gt7lhx26HCguUu52FYtXqsdByfcUHVK/0fdQjbzv+CU4QfR4 TlqH7rXdeE56ujkMJs9CGnRetTydRZsyS2TuhPj4QqKp1X+v439OZtIvTwd7jqPBRobJwt33StN VRNM1KplCA1MxdtNBzv0HHv0U20H27uEty1Ii3u7X91RazMfb8u9fH2SwGUhgaEoVGxp/Dm+/7M HTcD9IG+4aiKuhAJNaQPF1Y3FB83Ke3LUk8cJtK5SqB18dvAafuC59lkeYmX5NvIyiS7eAN14F8 UlW22qFTHIiFDNgWCoyD4p/GE9SE6R4mn/aUoqlYflzCMq6HiXZ2Ka4UxwtyWTV5fXqHjUs= X-Google-Smtp-Source: AGHT+IEPuClBoN7Qb5mgB5VPU0o930eddzRGz9lPhbEuGyRmtjAfj27xRvklm79w1RZp7DCmCH9s8w== X-Received: by 2002:a05:6a00:4b08:b0:730:95a6:3761 with SMTP id d2e1a72fcca58-742a97a720bmr14889365b3a.3.1747584419283; Sun, 18 May 2025 09:06:59 -0700 (PDT) Received: from localhost.localdomain ([2405:6586:be0:0:83c8:d31d:2cec:f542]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-742a970ba0csm4866622b3a.54.2025.05.18.09.06.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 18 May 2025 09:06:58 -0700 (PDT) From: Maxim Cournoyer Date: Mon, 19 May 2025 01:06:42 +0900 Message-ID: X-Mailer: git-send-email 2.49.0 MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::42e; envelope-from=maxim.cournoyer@gmail.com; helo=mail-pf1-x42e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches This is made possible thanks to mrustc's continued advances. * gnu/packages/rust.scm (%mrustc-commit): Update. (%mrustc-source): Update to version 0.11.2. (rust-bootstrap): Update to 1.74.0. [source]: Update snippet. [inputs]: Replace llvm-13 with llvm-15. Replace openssl-1.1 with openssl. (rust-1.55): Adapt into... (rust-1.75): ... this. (rust-1.76) [arguments] <#:phases>: Add patch-cargo-checksums. [source]: Do not inherit modules, snippet. Clear patches. [inputs]: Replace llvm-13 with llvm-15. (rust-1.56, rust-1.57, rust-1.58, rust-1.59, rust-1.60) (rust-1.61, rust-1.62, rust-1.63, rust-1.64, rust-1.65) (rust-1.66, rust-1.67, rust-1.68, rust-1.69, rust-1.70) (rust-1.71, rust-1.72, rust-1.73, rust-1.74): Delete variables. Change-Id: Ifdf13f83103a087a5ff7ea8b44206a2ef310dafc --- gnu/packages/rust.scm | 480 ++++-------------------------------------- 1 file changed, 38 insertions(+), 442 deletions(-) base-commit: 6b5fc4812981f2cadffcc5d39e48cd8e02ee73af diff --git a/gnu/packages/rust.scm b/gnu/packages/rust.scm index abaf7166fd5..37afe2f2861 100644 --- a/gnu/packages/rust.scm +++ b/gnu/packages/rust.scm @@ -11,7 +11,7 @@ ;;; Copyright © 2020, 2021 Jakub Kądziołka ;;; Copyright © 2020 Pierre Langlois ;;; Copyright © 2020 Matthew James Kraai -;;; Copyright © 2021 Maxim Cournoyer +;;; Copyright © 2021, 2025 Maxim Cournoyer ;;; Copyright © 2021 (unmatched parenthesis ;;; Copyright © 2022 Zheng Junjie <873216071@qq.com> ;;; Copyright © 2022 Jim Newsome @@ -128,11 +128,11 @@ (define* (rust-bootstrapped-package base-rust version checksum) ;;; Note: mrustc's only purpose is to be able to bootstap Rust; it's designed ;;; to be used in source form. -(define %mrustc-commit "5e01a76097265f4bb27b18885b9af3f2778180f9") +(define %mrustc-commit "2a9ab55bbaa706544858ab0968180e665fe7ff4a") (define %mrustc-source - (let* ((version "0.11.0") + (let* ((version "0.11.2") (commit %mrustc-commit) - (revision "1") + (revision "0") (name "mrustc")) (origin (method git-fetch) @@ -141,7 +141,7 @@ (define %mrustc-source (commit %mrustc-commit))) (file-name (git-file-name name (git-version version revision commit))) (sha256 - (base32 "1yyjfl1z6d5r9sv7zl90kqyjw1lqd2cqzwh2syi7yvrpslhihrhy")) + (base32 "177c4yr62gh9g85h3w472ybkl9mh2cx6hpp3k6n7i2zbcpd7wvqx")) (patches (search-patches "mrustc-patches.patch")) (modules '((guix build utils))) (snippet @@ -155,17 +155,17 @@ (define %mrustc-source (substitute* "minicargo.mk" (("--features vendored-openssl") ""))))))) -;;; Rust 1.54 is special in that it is built with mrustc, which shortens the +;;; Rust 1.74 is special in that it is built with mrustc, which shortens the ;;; bootstrap path. (define-public rust-bootstrap (package (name "rust") - (version "1.54.0") + (version "1.74.0") (source (origin (method url-fetch) (uri (rust-uri version)) - (sha256 (base32 "0xk9dhfff16caambmwij67zgshd8v9djw6ha0fnnanlv7rii31dc")) + (sha256 (base32 "0j8hrwjjjjf7spy0hy7gami96swhfzr6kandfzzdri91qd5mhaw8")) (modules '((guix build utils))) (snippet '(begin @@ -175,17 +175,14 @@ (define-public rust-bootstrap "vendor/tikv-jemalloc-sys/jemalloc")) ;; Remove vendored dynamically linked libraries. ;; find . -not -type d -executable -exec file {} \+ | grep ELF - (delete-file "vendor/vte/vim10m_match") - (delete-file "vendor/vte/vim10m_table") ;; Also remove the bundled (mostly Windows) libraries. - ;; find vendor -not -type d -exec file {} \+ | grep PE32 (for-each delete-file (find-files "vendor" "\\.(a|dll|exe|lib)$")) - ;; Adjust some sources for llvm-13, see llvm commit - ;; acce401068e78a8c5dc9e06802111ffad3da763f - (substitute* (find-files "." "powerpc64le_unknown_linux_gnu.rs") - (("e-m:e-i64:64-n32:64-v256:256:256-v512:512:512") - "e-m:e-i64:64-n32:64-S128-v256:256:256-v512:512:512")))))) + ;; Adjust vendored dependency to explicitly use rustix with libc backend. + (substitute* "vendor/tempfile/Cargo.toml" + (("features = \\[\"fs\"" all) + (string-append all ", \"use-libc\""))))) + (patches (search-patches "rust-1.70-fix-rustix-build.patch")))) (outputs '("out" "cargo")) (properties '((hidden? . #t) (timeout . 129600) ;36 hours @@ -193,8 +190,8 @@ (define-public rust-bootstrap (build-system gnu-build-system) (inputs (list bash-minimal - llvm-13 - openssl-1.1 + llvm-15 + openssl zlib)) (native-inputs `(("pkg-config" ,pkg-config) @@ -212,14 +209,14 @@ (define-public rust-bootstrap ,#~(let ((source #$(package-source this-package))) (list (string-append "RUSTC_TARGET=" #$(platform-rust-target - (lookup-platform-by-target-or-system - (or (%current-target-system) - (%current-system))))) + (lookup-platform-by-target-or-system + (or (%current-target-system) + (%current-system))))) (string-append "RUSTC_VERSION=" #$version) (string-append "MRUSTC_TARGET_VER=" #$(version-major+minor version)) (string-append "RUSTC_SRC_TARBALL=" source) - "OUTDIR_SUF=")) ;do not add version suffix to output dir + "OUTDIR_SUF=")) ;do not add version suffix to output dir #:phases (modify-phases %standard-phases (replace 'unpack @@ -274,7 +271,7 @@ (define-public rust-bootstrap (parallel-job-count) 1))) ;; Adapted from: - ;; https://github.com/dtolnay/bootstrap/blob/master/build-1.54.0.sh. + ;; https://github.com/dtolnay/bootstrap/blob/master/build-1.74.0.sh. ;; Use PARLEVEL since both minicargo and mrustc use it ;; to set the level of parallelism. (setenv "PARLEVEL" (number->string job-count)) @@ -290,7 +287,6 @@ (define-public rust-bootstrap (display "Building LIBS...\n") (apply invoke "make" "-f" "minicargo.mk" "LIBS" make-flags) - ;; The psm crate FTBFS on ppc64le with gcc. (display "Building rustc...\n") (apply invoke "make" "-f" "minicargo.mk" "output/rustc" make-flags) @@ -311,11 +307,11 @@ (define-public rust-bootstrap (cargo-bin (string-append cargo "/bin")) (lib (string-append out "/lib")) (system-lib-prefix - (string-append lib "/rustlib/" - ,(platform-rust-target - (lookup-platform-by-target-or-system - (or (%current-target-system) - (%current-system)))) "/lib"))) + (string-append lib "/rustlib/" + ,(platform-rust-target + (lookup-platform-by-target-or-system + (or (%current-target-system) + (%current-system)))) "/lib"))) (mkdir-p (dirname rustc)) (copy-file "run_rustc/output/prefix/bin/rustc_binary" rustc) (wrap-program rustc @@ -339,34 +335,18 @@ (define-public rust-bootstrap ;; Dual licensed. (license (list license:asl2.0 license:expat)))) -(define-public rust-1.55 +(define-public rust-1.75 (package (name "rust") - (version "1.55.0") + (version "1.75.0") (source (origin + (inherit (package-source rust-bootstrap)) (method url-fetch) (uri (rust-uri version)) - (sha256 (base32 "07l28f7grdmi65naq71pbmvdd61hwcpi40ry7kp7dy7m233rldxj")) - (modules '((guix build utils))) - (snippet - '(begin - (for-each delete-file-recursively - '("src/llvm-project" - "vendor/openssl-src/openssl" - "vendor/tikv-jemalloc-sys/jemalloc")) - ;; Remove vendored dynamically linked libraries. - ;; find . -not -type d -executable -exec file {} \+ | grep ELF - (delete-file "vendor/vte/vim10m_match") - (delete-file "vendor/vte/vim10m_table") - ;; Also remove the bundled (mostly Windows) libraries. - ;; find vendor -not -type d -exec file {} \+ | grep PE32 - (for-each delete-file - (find-files "vendor" "\\.(a|dll|exe|lib)$")) - ;; Add support for riscv64-linux. - (substitute* "vendor/tikv-jemallocator/src/lib.rs" - ((" target_arch = \"s390x\"," all) - (string-append all "\n target_arch = \"riscv64\","))))))) + (sha256 + (base32 "1260mf3066ki6y55pvr35lnf54am6z96a3ap3hniwd4xpi2rywsv")) + (patches '()))) (outputs '("out" "cargo")) (properties '((hidden? . #t) (timeout . 72000) ;20 hours @@ -492,7 +472,7 @@ (define-public rust-1.55 ("cargo-bootstrap" ,rust-bootstrap "cargo"))) (inputs `(("bash" ,bash-minimal) - ("llvm" ,llvm-13) + ("llvm" ,llvm-15) ("openssl" ,openssl))) ;; rustc invokes gcc, so we need to set its search paths accordingly. (native-search-paths @@ -506,411 +486,27 @@ (define-public rust-1.55 ;; Dual licensed. (license (list license:asl2.0 license:expat)))) -(define-public rust-1.56 +(define-public rust-1.76 (let ((base-rust (rust-bootstrapped-package - rust-1.55 "1.56.1" - "04cmqx7nn63hzz7z27b2b0dj2qx18rck9ifvip43s6dampx8v2f3"))) - (package - (inherit base-rust) - (arguments - (substitute-keyword-arguments - (strip-keyword-arguments '(#:validate-runpath?) - (package-arguments base-rust)) - ((#:phases phases) - `(modify-phases ,phases - (delete 'add-cc-shim-to-path) - (add-after 'patch-generated-file-shebangs 'patch-cargo-checksums - (lambda _ - (substitute* "Cargo.lock" - (("(checksum = )\".*\"" all name) - (string-append name "\"" ,%cargo-reference-hash "\""))) - (generate-all-checksums "vendor")))))))))) - -(define-public rust-1.57 - (rust-bootstrapped-package - ;; Verified that it *doesn't* build with 1.55. e.g.: - ;; * feature `edition2021` is required - rust-1.56 "1.57.0" "06jw8ka2p3kls8p0gd4p0chhhb1ia1mlvj96zn78n7qvp71zjiim")) - -(define-public rust-1.58 - (rust-bootstrapped-package - ;; Verified that it *doesn't* build with 1.56. e.g.: - ;; * error: attributes starting with `rustc` are reserved for use by the - ;; `rustc` compiler - ;; * error: cannot find attribute `rustc_do_not_const_check` in this scope - ;; * error[E0522]: definition of an unknown language item: - ;; `const_eval_select_ct` - rust-1.57 "1.58.1" "1iq7kj16qfpkx8gvw50d8rf7glbm6s0pj2y1qkrz7mi56vfsyfd8")) - -(define-public rust-1.59 - (let ((base-rust - (rust-bootstrapped-package - ;; Verified that it *doesn't* build with 1.57. e.g.: - ;; * error: `doc(primitive)` should never have been stable - ;; * error[E0522]: definition of an unknown language item: - ;; `generator_return` - ;; * error[E0206]: the trait `Copy` may not be implemented for this type - rust-1.58 "1.59.0" "1yc5bwcbmbwyvpfq7zvra78l0r8y3lbv60kbr62fzz2vx2pfxj57"))) - (package - (inherit base-rust) - (arguments - (if (target-riscv64?) - (substitute-keyword-arguments (package-arguments base-rust) - ((#:phases phases) - `(modify-phases ,phases - (add-after 'unpack 'revert-riscv-pause-instruction - (lambda _ - ;; This fails with: - ;; error: unknown directive, referring to '.insn'. - ;; This is due to building with llvm < 14. - ;; https://github.com/rust-lang/stdarch/issues/1291 - ;; Partial roll-back from this commit: - ;; https://github.com/rust-lang/stdarch/pull/1271 - (substitute* - "library/stdarch/crates/core_arch/src/riscv_shared/mod.rs" - (("\\.insn i 0x0F, 0, x0, x0, 0x010") ".word 0x0100000F"))))))) - (package-arguments base-rust)))))) - -(define-public rust-1.60 - (rust-bootstrapped-package - ;; Verified that it *doesn't* build with 1.58. e.g.: - ;; * error: unknown codegen option: `symbol-mangling-version` - rust-1.59 "1.60.0" "1drqr0a26x1rb2w3kj0i6abhgbs3jx5qqkrcwbwdlx7n3inq5ji0")) - -(define-public rust-1.61 - (let ((base-rust - (rust-bootstrapped-package - rust-1.60 "1.61.0" "1vfs05hkf9ilk19b2vahqn8l6k17pl9nc1ky9kgspaascx8l62xd"))) - (package - (inherit base-rust) - (source - (origin - (inherit (package-source base-rust)) - (snippet - '(begin - (for-each delete-file-recursively - '("src/llvm-project" - "vendor/openssl-src/openssl" - "vendor/tikv-jemalloc-sys/jemalloc")) - ;; Remove vendored dynamically linked libraries. - ;; find . -not -type d -executable -exec file {} \+ | grep ELF - (delete-file "vendor/vte/vim10m_match") - (delete-file "vendor/vte/vim10m_table") - ;; Also remove the bundled (mostly Windows) libraries. - (for-each delete-file - (find-files "vendor" "\\.(a|dll|exe|lib)$"))))))))) - -(define-public rust-1.62 - (rust-bootstrapped-package - rust-1.61 "1.62.1" "0gqkg34ic77dcvsz69qbdng6g3zfhl6hnhx7ha1mjkyrzipvxb3j")) - -(define-public rust-1.63 - (rust-bootstrapped-package - rust-1.62 "1.63.0" "1l4rrbzhxv88pnfq94nbyb9m6lfnjwixma3mwjkmvvs2aqlq158z")) - -(define-public rust-1.64 - (let ((base-rust - (rust-bootstrapped-package - rust-1.63 "1.64.0" "018j720b2n12slp4xk64jc6shkncd46d621qdyzh2a8s3r49zkdk"))) - (package - (inherit base-rust) - (source - (origin - (inherit (package-source base-rust)) - (snippet - '(begin - (for-each delete-file-recursively - '("src/llvm-project" - "vendor/openssl-src/openssl" - "vendor/tikv-jemalloc-sys/jemalloc")) - ;; ERROR: could not find native static library - ;; `rustix_outline_powerpc64`, perhaps an -L flag is missing? - ;; Adjust rustix to always build with cc. - (substitute* "src/bootstrap/Cargo.lock" - (("\"errno\",") "\"cc\",\n \"errno\",")) - ;; Add a dependency on the the 'cc' feature of rustix. - (substitute* "vendor/fd-lock/Cargo.toml" - (("\"fs\"") "\"fs\", \"cc\"")) - ;; Remove vendored dynamically linked libraries. - ;; find . -not -type d -executable -exec file {} \+ | grep ELF - (delete-file "vendor/vte/vim10m_match") - (delete-file "vendor/vte/vim10m_table") - ;; Also remove the bundled (mostly Windows) libraries. - (for-each delete-file - (find-files "vendor" "\\.(a|dll|exe|lib)$")))) - (patches (search-patches "rust-1.64-fix-riscv64-bootstrap.patch")) - (patch-flags '("-p1" "--reverse")))) - (arguments - (substitute-keyword-arguments (package-arguments base-rust) - ((#:phases phases) - `(modify-phases ,phases - (replace 'patch-cargo-checksums - (lambda _ - (substitute* '("Cargo.lock" - "src/bootstrap/Cargo.lock" - "src/tools/rust-analyzer/Cargo.lock") - (("(checksum = )\".*\"" all name) - (string-append name "\"" ,%cargo-reference-hash "\""))) - (generate-all-checksums "vendor")))))))))) - -(define-public rust-1.65 - (let ((base-rust - (rust-bootstrapped-package - rust-1.64 "1.65.0" "0f005kc0vl7qyy298f443i78ibz71hmmh820726bzskpyrkvna2q"))) - (package - (inherit base-rust) - (source - (origin - (inherit (package-source base-rust)) - (patches '()) - (patch-flags '("-p1"))))))) - -(define-public rust-1.66 - (rust-bootstrapped-package - rust-1.65 "1.66.1" "1fjr94gsicsxd2ypz4zm8aad1zdbiccr7qjfbmq8f8f7jhx96g2v")) - -(define-public rust-1.67 - (let ((base-rust - (rust-bootstrapped-package - rust-1.66 "1.67.1" "0vpzv6rm3w1wbni17ryvcw83k5klhghklylfdza3nnp8blz3sj26"))) - (package - (inherit base-rust) - (source - (origin - (inherit (package-source base-rust)) - (snippet - '(begin - (for-each delete-file-recursively - '("src/llvm-project" - "vendor/openssl-src/openssl" - "vendor/tikv-jemalloc-sys/jemalloc")) - ;; Adjust rustix to always build with cc. - (substitute* '("Cargo.lock" - "src/bootstrap/Cargo.lock") - (("\"errno\",") "\"cc\",\n \"errno\",")) - ;; Add a dependency on the the 'cc' feature of rustix. - (substitute* "vendor/fd-lock/Cargo.toml" - (("\"fs\"") "\"fs\", \"cc\"")) - (substitute* "vendor/is-terminal/Cargo.toml" - (("\"termios\"") "\"termios\", \"cc\"")) - ;; Remove vendored dynamically linked libraries. - ;; find . -not -type d -executable -exec file {} \+ | grep ELF - (delete-file "vendor/vte/vim10m_match") - (delete-file "vendor/vte/vim10m_table") - ;; Also remove the bundled (mostly Windows) libraries. - (for-each delete-file - (find-files "vendor" "\\.(a|dll|exe|lib)$")))))) - (inputs (modify-inputs (package-inputs base-rust) - (replace "llvm" llvm-15)))))) - -(define-public rust-1.68 - (rust-bootstrapped-package - rust-1.67 "1.68.2" "15ifyd5jj8rd979dkakp887hgmhndr68pqaqvd2hqkfdywirqcwk")) - -(define-public rust-1.69 - (let ((base-rust - (rust-bootstrapped-package - rust-1.68 "1.69.0" - "03zn7kx5bi5mdfsqfccj4h8gd6abm7spj0kjsfxwlv5dcwc9f1gv"))) - (package - (inherit base-rust) - (source - (origin - (inherit (package-source base-rust)) - (snippet - '(begin - (for-each delete-file-recursively - '("src/llvm-project" - "vendor/openssl-src/openssl" - "vendor/tikv-jemalloc-sys/jemalloc")) - ;; Adjust rustix to always build with cc. - (substitute* '("Cargo.lock" - "src/bootstrap/Cargo.lock") - (("\"errno\",") "\"cc\",\n \"errno\",")) - ;; Add a dependency on the the 'cc' feature of rustix. - (substitute* "vendor/fd-lock/Cargo.toml" - (("\"fs\"") "\"fs\", \"cc\"")) - (substitute* "vendor/is-terminal/Cargo.toml" - (("\"termios\"") "\"termios\", \"cc\"")) - ;; Also remove the bundled (mostly Windows) libraries. - (for-each delete-file - (find-files "vendor" "\\.(a|dll|exe|lib)$"))))))))) - -(define-public rust-1.70 - (let ((base-rust - (rust-bootstrapped-package - rust-1.69 "1.70.0" - "0z6j7d0ni0rmfznv0w3mrf882m11kyh51g2bxkj40l3s1c0axgxj"))) - (package - (inherit base-rust) - (source - (origin - (inherit (package-source base-rust)) - (snippet - '(begin - (for-each delete-file-recursively - '("src/llvm-project" - "vendor/openssl-src/openssl" - "vendor/tikv-jemalloc-sys/jemalloc")) - ;; Adjust rustix to always build with cc. - (substitute* "Cargo.lock" - (("\"errno\",") "\"cc\",\n \"errno\",")) - ;; Add a dependency on the the 'cc' feature of rustix. - (substitute* '("vendor/is-terminal/Cargo.toml" - "vendor/is-terminal-0.4.4/Cargo.toml") - (("\"termios\"") "\"termios\", \"cc\"")) - ;; Also remove the bundled (mostly Windows) libraries. - (for-each delete-file - (find-files "vendor" "\\.(a|dll|exe|lib)$")))) - ;; Rust 1.70 adds the rustix library which depends on the vendored - ;; fd-lock crate. The fd-lock crate uses Outline assembly which expects - ;; a precompiled static library. Enabling the "cc" feature tells the - ;; build.rs script to compile the assembly files instead of searching - ;; for a precompiled library. - (patches (search-patches "rust-1.70-fix-rustix-build.patch"))))))) - -(define-public rust-1.71 - (let ((base-rust - (rust-bootstrapped-package - rust-1.70 "1.71.1" "0bj79syjap1kgpg9pc0r4jxc0zkxwm6phjf3digsfafms580vabg"))) + rust-1.75 "1.76.0" + "08f06shp6l72qrv5fwg1is7yzr6kwj8av0l9h5k243bz781zyp4y"))) (package (inherit base-rust) - (source - (origin - (inherit (package-source base-rust)) - (snippet - '(begin - (for-each delete-file-recursively - '("src/llvm-project" - "vendor/openssl-src/openssl" - "vendor/tikv-jemalloc-sys/jemalloc")) - ;; Adjust rustix to always build with cc. - (substitute* '("Cargo.lock" - "src/tools/cargo/Cargo.lock") - (("\"errno\",") "\"cc\",\n \"errno\",")) - ;; Add a dependency on the the 'cc' feature of rustix. - (substitute* '("vendor/is-terminal/Cargo.toml" - "vendor/is-terminal-0.4.6/Cargo.toml") - (("\"termios\"") "\"termios\", \"cc\"")) - ;; Also remove the bundled (mostly Windows) libraries. - (for-each delete-file - (find-files "vendor" "\\.(a|dll|exe|lib)$")))))) (arguments (substitute-keyword-arguments (package-arguments base-rust) ((#:phases phases) `(modify-phases ,phases - (replace 'patch-cargo-checksums + (add-after 'patch-generated-file-shebangs 'patch-cargo-checksums (lambda _ (substitute* (cons* "Cargo.lock" "src/bootstrap/Cargo.lock" (find-files "src/tools" "Cargo.lock")) (("(checksum = )\".*\"" all name) (string-append name "\"" ,%cargo-reference-hash "\""))) - (generate-all-checksums "vendor")))))))))) - -(define-public rust-1.72 - (let ((base-rust - (rust-bootstrapped-package - rust-1.71 "1.72.1" "15gqd1jzhnc16a7gjmav4x1v83jjbzyjh1gvcdfvpkajd9gq8j3z"))) - (package - (inherit base-rust) - (source - (origin - (inherit (package-source base-rust)) - (snippet - '(begin - (for-each delete-file-recursively - '("src/llvm-project" - "vendor/openssl-src/openssl" - "vendor/tikv-jemalloc-sys/jemalloc")) - ;; Remove vendored dynamically linked libraries. - ;; find . -not -type d -executable -exec file {} \+ | grep ELF - ;; Also remove the bundled (mostly Windows) libraries. - (for-each delete-file - (find-files "vendor" "\\.(a|dll|exe|lib)$")) - ;; Adjust some crates to explicitly use rustix with the libc backend. - (substitute* '("vendor/is-terminal/Cargo.toml" - "vendor/is-terminal-0.4.7/Cargo.toml") - (("\"termios\"") "\"termios\", \"use-libc\"")) - (substitute* "compiler/rustc_driver/Cargo.toml" - (("rustix = \"=0.37.11\"") - (string-append "rustix = { version = \"=0.37.11\"," - " features = [\"use-libc\"] }")))))))))) - -(define-public rust-1.73 - (let ((base-rust (rust-bootstrapped-package rust-1.72 "1.73.0" - "0fmvn7vg3qg9xprgfwv10g3ygy8i4j4bkcxcr1xdy89d3xnjxmln"))) - (package - (inherit base-rust) - (source - (origin - (inherit (package-source base-rust)) - (snippet - '(begin - (for-each delete-file-recursively - '("src/llvm-project" - "vendor/openssl-src/openssl" - "vendor/tikv-jemalloc-sys/jemalloc")) - ;; Remove vendored dynamically linked libraries. - ;; find . -not -type d -executable -exec file {} \+ | grep ELF - ;; Also remove the bundled (mostly Windows) libraries. - (for-each delete-file - (find-files "vendor" "\\.(a|dll|exe|lib)$")) - ;; Adjust vendored dependency to explicitly use rustix with libc backend. - (substitute* "vendor/tempfile-3.6.0/Cargo.toml" - (("features = \\[\"fs\"" all) - (string-append all ", \"use-libc\"")))))))))) - -(define-public rust-1.74 - (let ((base-rust (rust-bootstrapped-package rust-1.73 "1.74.1" - "07930r17dkj3dnsrmilywb6p9i2g2jx56ndfpa2wh8crzhi3xnv7"))) - (package - (inherit base-rust) - (source - (origin - (inherit (package-source base-rust)) - (snippet - '(begin - (for-each delete-file-recursively - '("src/llvm-project" - "vendor/openssl-src/openssl" - "vendor/tikv-jemalloc-sys/jemalloc")) - ;; Remove vendored dynamically linked libraries. - ;; find . -not -type d -executable -exec file {} \+ | grep ELF - ;; Also remove the bundled (mostly Windows) libraries. - (for-each delete-file - (find-files "vendor" "\\.(a|dll|exe|lib)$")) - ;; Adjust vendored dependency to explicitly use rustix with libc backend. - (substitute* "vendor/tempfile/Cargo.toml" - (("features = \\[\"fs\"" all) - (string-append all ", \"use-libc\""))))))) - (arguments - (if (target-riscv64?) - (substitute-keyword-arguments (package-arguments base-rust) - ((#:phases phases) - `(modify-phases ,phases - ;; This phase is no longer needed. - (delete 'revert-riscv-pause-instruction)))) - (package-arguments base-rust)))))) - -(define-public rust-1.75 - (let ((base-rust (rust-bootstrapped-package rust-1.74 "1.75.0" - "1260mf3066ki6y55pvr35lnf54am6z96a3ap3hniwd4xpi2rywsv"))) - (package - (inherit base-rust) - (source - (origin - (inherit (package-source base-rust)) - (patches '())))))) - -(define-public rust-1.76 - (let ((base-rust (rust-bootstrapped-package rust-1.75 "1.76.0" - "08f06shp6l72qrv5fwg1is7yzr6kwj8av0l9h5k243bz781zyp4y"))) - (package - (inherit base-rust) + (generate-all-checksums "vendor"))))))) ;; Need llvm >= 16.0 (inputs (modify-inputs (package-inputs base-rust) - (replace "llvm" llvm-17)))))) + (replace "llvm" llvm-17)))))) (define-public rust-1.77 (let ((base-rust (rust-bootstrapped-package rust-1.76 "1.77.1"