From f510a2b93b75ee02e4a17816d2808a37c7b84c3a Mon Sep 17 00:00:00 2001 From: Nikolai Merinov Date: Sat, 30 Jun 2018 14:34:49 +0500 Subject: gnu: rust: Update to 1.27.0. * gnu/packages/rust.scm (rust): Rename to... (rust-1.26): ...this. (rust): New variable. * gnu/packages/patches/rust-bootstrap-stage0-test.patch: New file. --- .../patches/rust-bootstrap-stage0-test.patch | 55 ++++++++++++++++++++++ gnu/packages/rust.scm | 23 ++++++++- 2 files changed, 77 insertions(+), 1 deletion(-) create mode 100644 gnu/packages/patches/rust-bootstrap-stage0-test.patch diff --git a/gnu/packages/patches/rust-bootstrap-stage0-test.patch b/gnu/packages/patches/rust-bootstrap-stage0-test.patch new file mode 100644 index 0000000000..e8484903e5 --- /dev/null +++ b/gnu/packages/patches/rust-bootstrap-stage0-test.patch @@ -0,0 +1,55 @@ +Bootstrap tests failed with local stage0 cargo and rustc +Backported changes from https://github.com/rust-lang/rust/pull/51977 + +From 0834d9d771e912f51deca6c25699e44734624546 Mon Sep 17 00:00:00 2001 +From: Nikolai Merinov +Date: Mon, 2 Jul 2018 01:45:35 +0500 +Subject: [PATCH] bootstrap: tests should use rustc from config.toml + +Tests should always use "rustc" and "cargo" from config.toml instead +of assuming that stage0 binaries was downloaded to build directory. +--- + src/bootstrap/bootstrap.py | 2 ++ + src/bootstrap/config.rs | 6 ++---- + 2 files changed, 4 insertions(+), 4 deletions(-) + +diff --git a/src/bootstrap/bootstrap.py b/src/bootstrap/bootstrap.py +index 487440becf..1701f7b83a 100644 +--- a/src/bootstrap/bootstrap.py ++++ b/src/bootstrap/bootstrap.py +@@ -788,6 +788,8 @@ def bootstrap(help_triggered): + env["BOOTSTRAP_PARENT_ID"] = str(os.getpid()) + env["BOOTSTRAP_PYTHON"] = sys.executable + env["BUILD_DIR"] = build.build_dir ++ env["CARGO"] = build.cargo() ++ env["RUSTC"] = build.rustc() + run(args, env=env, verbose=build.verbose) + + +diff --git a/src/bootstrap/config.rs b/src/bootstrap/config.rs +index 6dd6291be2..d1a0deb583 100644 +--- a/src/bootstrap/config.rs ++++ b/src/bootstrap/config.rs +@@ -23,7 +23,6 @@ use std::cmp; + + use num_cpus; + use toml; +-use util::exe; + use cache::{INTERNER, Interned}; + use flags::Flags; + pub use flags::Subcommand; +@@ -362,9 +361,8 @@ impl Config { + config.src = Config::path_from_python("SRC"); + config.out = Config::path_from_python("BUILD_DIR"); + +- let stage0_root = config.out.join(&config.build).join("stage0/bin"); +- config.initial_rustc = stage0_root.join(exe("rustc", &config.build)); +- config.initial_cargo = stage0_root.join(exe("cargo", &config.build)); ++ config.initial_rustc = Config::path_from_python("RUSTC"); ++ config.initial_cargo = Config::path_from_python("CARGO"); + + config + } +-- +2.17.1 + diff --git a/gnu/packages/rust.scm b/gnu/packages/rust.scm index 6d3554a3a7..bb6fea99a0 100644 --- a/gnu/packages/rust.scm +++ b/gnu/packages/rust.scm @@ -564,7 +564,7 @@ jemalloc = \"" jemalloc "/lib/libjemalloc_pic.a" "\" (("codegen-tests = false") "")))) (delete 'ignore-glibc-2.27-incompatible-test)))))))) -(define-public rust +(define-public rust-1.26 (let ((base-rust (rust-bootstrapped-package rust-1.25 "1.26.2" "0047ais0fvmqvngqkdsxgrzhb0kljg8wy85b01kbbjc88hqcz7pv" @@ -611,3 +611,24 @@ jemalloc = \"" jemalloc "/lib/libjemalloc_pic.a" "\" ;; This test wants to update the crate index. (("fn no_index_update") "#[ignore]\nfn no_index_update")) #t))))))))) + +(define-public rust + (let ((base-rust + (rust-bootstrapped-package rust-1.26 "1.27.0" + "089d7rhw55zpvnw71dj8vil6qrylvl4xjr4m8bywjj83d4zq1f9c" + #:patches + '("rust-coresimd-doctest.patch" + "rust-bootstrap-stage0-test.patch")))) + (package + (inherit base-rust) + (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))))))))) -- cgit v1.2.3