From patchwork Tue Mar 12 02:21:53 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivan Petkov X-Patchwork-Id: 1372 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 439F016D94; Tue, 12 Mar 2019 02:23:12 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, T_DKIM_INVALID,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTP id 841E616D92 for ; Tue, 12 Mar 2019 02:23:11 +0000 (GMT) Received: from localhost ([127.0.0.1]:43743 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h3X4Q-0000Tz-PT for patchwork@mira.cbaines.net; Mon, 11 Mar 2019 22:23:10 -0400 Received: from eggs.gnu.org ([209.51.188.92]:47333) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h3X4K-0000TB-RV for guix-patches@gnu.org; Mon, 11 Mar 2019 22:23:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h3X4I-00026I-O1 for guix-patches@gnu.org; Mon, 11 Mar 2019 22:23:04 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:54348) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h3X4I-00025Y-Ev for guix-patches@gnu.org; Mon, 11 Mar 2019 22:23:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1h3X4I-0004Km-AV for guix-patches@gnu.org; Mon, 11 Mar 2019 22:23:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#34820] [PATCH] gnu: rust: Update to 1.32.0 Resent-From: Ivan Petkov Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 12 Mar 2019 02:23:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 34820 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 34820@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.155235733016558 (code B ref -1); Tue, 12 Mar 2019 02:23:02 +0000 Received: (at submit) by debbugs.gnu.org; 12 Mar 2019 02:22:10 +0000 Received: from localhost ([127.0.0.1]:39655 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1h3X3R-0004Iz-70 for submit@debbugs.gnu.org; Mon, 11 Mar 2019 22:22:09 -0400 Received: from eggs.gnu.org ([209.51.188.92]:32829) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1h3X3P-0004Im-Ho for submit@debbugs.gnu.org; Mon, 11 Mar 2019 22:22:08 -0400 Received: from lists.gnu.org ([209.51.188.17]:53332) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1h3X3K-0001hB-E2 for submit@debbugs.gnu.org; Mon, 11 Mar 2019 22:22:02 -0400 Received: from eggs.gnu.org ([209.51.188.92]:47209) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h3X3I-0000OH-FM for guix-patches@gnu.org; Mon, 11 Mar 2019 22:22:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h3X3G-0001g9-EV for guix-patches@gnu.org; Mon, 11 Mar 2019 22:22:00 -0400 Received: from mail-pg1-x543.google.com ([2607:f8b0:4864:20::543]:34124) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h3X3G-0001ff-06 for guix-patches@gnu.org; Mon, 11 Mar 2019 22:21:58 -0400 Received: by mail-pg1-x543.google.com with SMTP id v12so617177pgq.1 for ; Mon, 11 Mar 2019 19:21:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:content-transfer-encoding:mime-version:date:subject:cc:to :message-id; bh=IwxVibVxE715Ar/h0dahdZ7d/yJ69zD/jcjm23p/xec=; b=JdAaIsdfOmgVWX976eleWAQERuOAyVPm+AdiMrMnULL1Ioz3T5tCdnrvNqW4fkwmg4 PWtTz5duHGAOYt6IZilYgKFUIht3E5/CVV5gH1eVS0EB1hWOR6Z5ePoIvOuQF8SZeeuC ADSl4J5y2bWko+Jizu/k3ZYouBrHc/pJSSMfjedhUVMbOcDM1RnCLrxulnWvlPkdNBL2 YNTqzaFpjseTRETORo3USENHAP11Vp3R4KELlPzEMjKt9xdxaQMbBRIgXtUJA+AY6PGq vT8BQEW1X7vdW6m5MOyeWMlKHEtL51Mrx/NmYf3G83CZJ6FKoXTJRZMrsZXE69SKwyls OGNw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:content-transfer-encoding:mime-version:date :subject:cc:to:message-id; bh=IwxVibVxE715Ar/h0dahdZ7d/yJ69zD/jcjm23p/xec=; b=d4kKbfC4rQDdXOgfnOUjph8DaZJTMYlfVV6Czhp/7tFPu6fuIw00l6AVs2yA5B+16b Ev9hN0UPjGW94FoXUvHVoA2UjsJYjGQKO8wYiB1js6ihgsrwS0rr8n+xyfMjR5Pop+2r MCS5s94QtVrmQ0rWXNOsYhEHvyn9hxaB9jm1S6tntRDvaL/llrKwYqukTZqt1K1g0Y0o Rf0f86DoiKX3wRapRPngDPo7Q4vb1yWFew3HZQLcYuaymbF701uU3g7q5EurJk6FQfLg 6lsyfBR7oKLdirWKp5adPOGIpXuBfyvE8u7h7zDR+rIKfrREieGTI3hgyREe4GCCaWes YY4A== X-Gm-Message-State: APjAAAWWWv7ncP9DkidP0YJZcLSvIAcc+E/gCCTal25kF2nhLjqlaoHP aEVpmuDljd2bFsekIRsfsHz/4rjAoOE= X-Google-Smtp-Source: APXvYqw0xnngqlBqh6+ZDTmsePKFmtp9iMQ4+KYt0FMfYfmgI3PkyEICoXMJKdmATzxEWjS7P6qruQ== X-Received: by 2002:a63:d347:: with SMTP id u7mr33233500pgi.269.1552357315836; Mon, 11 Mar 2019 19:21:55 -0700 (PDT) Received: from ?IPv6:2601:602:9a00:1784:1c6c:3497:4259:be89? ([2601:602:9a00:1784:1c6c:3497:4259:be89]) by smtp.gmail.com with ESMTPSA id s6sm9482617pgm.90.2019.03.11.19.21.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 Mar 2019 19:21:55 -0700 (PDT) From: Ivan Petkov Mime-Version: 1.0 (Mac OS X Mail 11.5 \(3445.9.1\)) Date: Mon, 11 Mar 2019 19:21:53 -0700 Message-Id: <9E833478-6D25-4549-B90A-8244CCED81DD@gmail.com> X-Mailer: Apple Mail (2.3445.9.1) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 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" X-getmail-retrieved-from-mailbox: Patches * gnu/packages/rust.scm (rust-source): Rename to... (rust-source-pre-1.32): ... this. (rust-source): New variable. (rust-bootstrapped-package-pre-1.32): New variable. (rust): Rename to... (rust-1.32): ...this. (rust): New variable --- gnu/packages/rust.scm | 189 ++++++++++++++++++++++++++++++++---------- 1 file changed, 143 insertions(+), 46 deletions(-) diff --git a/gnu/packages/rust.scm b/gnu/packages/rust.scm index be916743fb..5aa70cc962 100644 --- a/gnu/packages/rust.scm +++ b/gnu/packages/rust.scm @@ -70,7 +70,10 @@ (_ (nix-system->gnu-triplet system)))) -(define* (rust-source version hash #:key (patches '())) +(define* (rust-source-pre-1.32 version hash + #:key + (patches '()) + (patch-flags '("-p1"))) (origin (method url-fetch) (uri (string-append "https://static.rust-lang.org/dist/" @@ -78,16 +81,51 @@ (sha256 (base32 hash)) (modules '((guix build utils))) (snippet '(begin (delete-file-recursively "src/llvm") #t)) - (patches (map search-patch patches)))) + (patches (map search-patch patches)) + (patch-flags patch-flags))) + +(define* (rust-bootstrapped-package-pre-1.32 base-rust version checksum + #:key + (patches '()) + (patch-flags '("-p1"))) + "Bootstrap rust VERSION with source checksum CHECKSUM patched with PATCHES using BASE-RUST. +Specific to rust versions before 1.32." + (package + (inherit base-rust) + (version version) + (source + (rust-source-pre-1.32 version checksum #:patches patches #:patch-flags patch-flags)) + (native-inputs + (alist-replace "cargo-bootstrap" (list base-rust "cargo") + (alist-replace "rustc-bootstrap" (list base-rust) + (package-native-inputs base-rust)))))) + +(define* (rust-source version hash + #:key + (patches '()) + (patch-flags '("-p1"))) + (origin + (method url-fetch) + (uri (string-append "https://static.rust-lang.org/dist/" + "rustc-" version "-src.tar.gz")) + (sha256 (base32 hash)) + (modules '((guix build utils))) + (snippet '(begin (delete-file-recursively "src/llvm") + (delete-file-recursively "vendor/jemalloc-sys/jemalloc") + #t)) + (patches (map search-patch patches)) + (patch-flags patch-flags))) (define* (rust-bootstrapped-package base-rust version checksum - #:key (patches '())) + #:key + (patches '()) + (patch-flags '("-p1"))) "Bootstrap rust VERSION with source checksum CHECKSUM patched with PATCHES using BASE-RUST." (package (inherit base-rust) (version version) (source - (rust-source version checksum #:patches patches)) + (rust-source version checksum #:patches patches #:patch-flags patch-flags)) (native-inputs (alist-replace "cargo-bootstrap" (list base-rust "cargo") (alist-replace "rustc-bootstrap" (list base-rust) @@ -116,7 +154,7 @@ ("flex" ,flex) ;; Required for the libstd sources. ("rustc" - ,(rust-source "1.19.0" "0l8c14qsf42rmkqy92ahij4vf356dbyspxcips1aswpvad81y8qm")))) + ,(rust-source-pre-1.32 "1.19.0" "0l8c14qsf42rmkqy92ahij4vf356dbyspxcips1aswpvad81y8qm")))) (arguments `(#:test-target "local_tests" #:make-flags (list (string-append "LLVM_CONFIG=" @@ -189,7 +227,7 @@ safety and thread safety guarantees.") (package (name "rust") (version "1.19.0") - (source (rust-source version "0l8c14qsf42rmkqy92ahij4vf356dbyspxcips1aswpvad81y8qm" + (source (rust-source-pre-1.32 version "0l8c14qsf42rmkqy92ahij4vf356dbyspxcips1aswpvad81y8qm" #:patches '("rust-1.19-mrustc.patch"))) (outputs '("out" "cargo")) (properties '((timeout . 72000) ;20 hours @@ -425,7 +463,7 @@ safety and thread safety guarantees.") (define-public rust-1.20 (let ((base-rust - (rust-bootstrapped-package rust-1.19 "1.20.0" + (rust-bootstrapped-package-pre-1.32 rust-1.19 "1.20.0" "0542y4rnzlsrricai130mqyxl8r6rd991frb4qsnwb27yigqg91a"))) (package (inherit base-rust) @@ -564,7 +602,7 @@ jemalloc = \"" jemalloc "/lib/libjemalloc_pic.a" "\" #t)))))))))) (define-public rust-1.21 - (let ((base-rust (rust-bootstrapped-package rust-1.20 "1.21.0" + (let ((base-rust (rust-bootstrapped-package-pre-1.32 rust-1.20 "1.21.0" "1yj8lnxybjrybp00fqhxw8fpr641dh8wcn9mk44xjnsb4i1c21qp"))) (package (inherit base-rust) @@ -580,7 +618,7 @@ jemalloc = \"" jemalloc "/lib/libjemalloc_pic.a" "\" #t))))))))) (define-public rust-1.22 - (let ((base-rust (rust-bootstrapped-package rust-1.21 "1.22.1" + (let ((base-rust (rust-bootstrapped-package-pre-1.32 rust-1.21 "1.22.1" "1lrzzp0nh7s61wgfs2h6ilaqi6iq89f1pd1yaf65l87bssyl4ylb"))) (package (inherit base-rust) @@ -596,7 +634,7 @@ jemalloc = \"" jemalloc "/lib/libjemalloc_pic.a" "\" #t))))))))) (define-public rust-1.23 - (let ((base-rust (rust-bootstrapped-package rust-1.22 "1.23.0" + (let ((base-rust (rust-bootstrapped-package-pre-1.32 rust-1.22 "1.23.0" "14fb8vhjzsxlbi6yrn1r6fl5dlbdd1m92dn5zj5gmzfwf4w9ar3l"))) (package (inherit base-rust) @@ -615,8 +653,8 @@ jemalloc = \"" jemalloc "/lib/libjemalloc_pic.a" "\" (define-public rust-1.24 (let ((base-rust - (rust-bootstrapped-package rust-1.23 "1.24.1" - "1vv10x2h9kq7fxh2v01damdq8pvlp5acyh1kzcda9sfjx12kv99y"))) + (rust-bootstrapped-package-pre-1.32 rust-1.23 "1.24.1" + "1vv10x2h9kq7fxh2v01damdq8pvlp5acyh1kzcda9sfjx12kv99y"))) (package (inherit base-rust) (arguments @@ -637,7 +675,7 @@ jemalloc = \"" jemalloc "/lib/libjemalloc_pic.a" "\" ;;; 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" + (rust-bootstrapped-package-pre-1.32 rust-1.24 "1.25.0" "0baxjr99311lvwdq0s38bipbnj72pn6fgbk6lcq7j555xq53mxpf" #:patches '("rust-1.25-accept-more-detailed-gdb-lines.patch")))) (package @@ -668,7 +706,7 @@ jemalloc = \"" jemalloc "/lib/libjemalloc_pic.a" "\" (define-public rust-1.26 (let ((base-rust - (rust-bootstrapped-package rust-1.25 "1.26.2" + (rust-bootstrapped-package-pre-1.32 rust-1.25 "1.26.2" "0047ais0fvmqvngqkdsxgrzhb0kljg8wy85b01kbbjc88hqcz7pv" #:patches '("rust-coresimd-doctest.patch" "rust-1.25-accept-more-detailed-gdb-lines.patch")))) @@ -723,13 +761,13 @@ jemalloc = \"" jemalloc "/lib/libjemalloc_pic.a" "\" (define-public rust-1.27 (let ((base-rust - (rust-bootstrapped-package rust-1.26 "1.27.2" - "0pg1s37bhx9zqbynxyydq5j6q7kij9vxkcv8maz0m25prm88r0cs" - #:patches - '("rust-coresimd-doctest.patch" - "rust-bootstrap-stage0-test.patch" - "rust-1.25-accept-more-detailed-gdb-lines.patch" - "rust-reproducible-builds.patch")))) + (rust-bootstrapped-package-pre-1.32 rust-1.26 "1.27.2" + "0pg1s37bhx9zqbynxyydq5j6q7kij9vxkcv8maz0m25prm88r0cs" + #:patches + '("rust-coresimd-doctest.patch" + "rust-bootstrap-stage0-test.patch" + "rust-1.25-accept-more-detailed-gdb-lines.patch" + "rust-reproducible-builds.patch")))) (package (inherit base-rust) (arguments @@ -752,13 +790,13 @@ jemalloc = \"" jemalloc "/lib/libjemalloc_pic.a" "\" (define-public rust-1.28 (let ((base-rust - (rust-bootstrapped-package rust-1.27 "1.28.0" - "11k4rn77bca2rikykkk9fmprrgjswd4x4kaq7fia08vgkir82nhx" - #:patches - '("rust-coresimd-doctest.patch" - "rust-bootstrap-stage0-test.patch" - "rust-1.25-accept-more-detailed-gdb-lines.patch" - "rust-reproducible-builds.patch")))) + (rust-bootstrapped-package-pre-1.32 rust-1.27 "1.28.0" + "11k4rn77bca2rikykkk9fmprrgjswd4x4kaq7fia08vgkir82nhx" + #:patches + '("rust-coresimd-doctest.patch" + "rust-bootstrap-stage0-test.patch" + "rust-1.25-accept-more-detailed-gdb-lines.patch" + "rust-reproducible-builds.patch")))) (package (inherit base-rust) (inputs @@ -786,22 +824,22 @@ jemalloc = \"" jemalloc "/lib/libjemalloc_pic.a" "\" (define-public rust-1.29 (let ((base-rust - (rust-bootstrapped-package rust-1.28 "1.29.2" - "1jb787080z754caa2w3w1amsygs4qlzj9rs1vy64firfmabfg22h" - #:patches - '("rust-1.25-accept-more-detailed-gdb-lines.patch" - "rust-reproducible-builds.patch")))) + (rust-bootstrapped-package-pre-1.32 rust-1.28 "1.29.2" + "1jb787080z754caa2w3w1amsygs4qlzj9rs1vy64firfmabfg22h" + #:patches + '("rust-1.25-accept-more-detailed-gdb-lines.patch" + "rust-reproducible-builds.patch")))) (package (inherit base-rust)))) (define-public rust-1.30 (let ((base-rust - (rust-bootstrapped-package rust-1.29 "1.30.1" - "0aavdc1lqv0cjzbqwl5n59yd0bqdlhn0zas61ljf38yrvc18k8rn" - #:patches - '("rust-1.25-accept-more-detailed-gdb-lines.patch" - "rust-1.30-gdb-llvm.patch" - "rust-reproducible-builds.patch")))) + (rust-bootstrapped-package-pre-1.32 rust-1.29 "1.30.1" + "0aavdc1lqv0cjzbqwl5n59yd0bqdlhn0zas61ljf38yrvc18k8rn" + #:patches + '("rust-1.25-accept-more-detailed-gdb-lines.patch" + "rust-1.30-gdb-llvm.patch" + "rust-reproducible-builds.patch")))) (package (inherit base-rust) (inputs @@ -838,14 +876,14 @@ jemalloc = \"" jemalloc "/lib/libjemalloc_pic.a" "\" ;; moved elsewhere, so the patch doesn't apply. (delete 'disable-amd64-avx-test)))))))) -(define-public rust +(define-public rust-1.31 (let ((base-rust - (rust-bootstrapped-package rust-1.30 "1.31.1" - "0sk84ff0cklybcp0jbbxcw7lk7mrm6kb6km5nzd6m64dy0igrlli" - #:patches - '("rust-1.25-accept-more-detailed-gdb-lines.patch" - "rust-1.30-gdb-llvm.patch" - "rust-reproducible-builds.patch")))) + (rust-bootstrapped-package-pre-1.32 rust-1.30 "1.31.1" + "0sk84ff0cklybcp0jbbxcw7lk7mrm6kb6km5nzd6m64dy0igrlli" + #:patches + '("rust-1.25-accept-more-detailed-gdb-lines.patch" + "rust-1.30-gdb-llvm.patch" + "rust-reproducible-builds.patch")))) (package (inherit base-rust) (arguments @@ -874,3 +912,62 @@ jemalloc = \"" jemalloc "/lib/libjemalloc_pic.a" "\" (substitute* "src/libstd/process.rs" (("```rust") "```rust,no_run")) #t))))))))) + +(define-public rust + (let ((base-rust + (rust-bootstrapped-package rust-1.31 "1.32.0" + "0ji2l9xv53y27xy72qagggvq47gayr5lcv2jwvmfirx029vlqnac" + #: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")))) + (package + (inherit base-rust) + (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) + ((#: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* _ + (substitute* "Cargo.lock" + (("(\"checksum .* = )\".*\"" all name) + (string-append name "\"" ,%cargo-reference-hash "\""))) + (for-each + (lambda (filename) + (use-modules (guix build cargo-utils)) + (delete-file filename) + (let* ((dir (dirname filename))) + (display (string-append + "patch-cargo-checksums: generate-checksums for " + dir "\n")) + (generate-checksums dir ,%cargo-reference-project-file))) + (find-files "vendor" ".cargo-checksum.json")) + #t)) + (add-after 'enable-codegen-tests '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" (string-append (assoc-ref inputs "jemalloc") + "/lib/libjemalloc_pic.a")) + #t)) + (add-after 'patch-tests 'disable-amd64-avx-test + ;; That test would fail on x86_64 machines without avx. + (lambda* _ + (substitute* "src/test/ui/issues/issue-44056.rs" + (("only-x86_64") "ignore-test")) + #t)) + ;; Remove no longer relevant steps + (delete 'remove-flaky-test) + (delete 'patch-aarch64-test))))))))