aboutsummaryrefslogtreecommitdiff
path: root/nixpkgs/pkgs/development/compilers/rust
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/compilers/rust')
-rw-r--r--nixpkgs/pkgs/development/compilers/rust/0001-Allow-getting-no_std-from-the-config-file.patch52
-rw-r--r--nixpkgs/pkgs/development/compilers/rust/1_42.nix44
-rw-r--r--nixpkgs/pkgs/development/compilers/rust/1_44.nix (renamed from nixpkgs/pkgs/development/compilers/rust/1_43.nix)22
-rw-r--r--nixpkgs/pkgs/development/compilers/rust/1_45.nix42
-rw-r--r--nixpkgs/pkgs/development/compilers/rust/cargo.nix8
-rw-r--r--nixpkgs/pkgs/development/compilers/rust/clippy.nix3
-rw-r--r--nixpkgs/pkgs/development/compilers/rust/rls/default.nix20
-rw-r--r--nixpkgs/pkgs/development/compilers/rust/rustc.nix12
-rw-r--r--nixpkgs/pkgs/development/compilers/rust/rustfmt.nix13
9 files changed, 85 insertions, 131 deletions
diff --git a/nixpkgs/pkgs/development/compilers/rust/0001-Allow-getting-no_std-from-the-config-file.patch b/nixpkgs/pkgs/development/compilers/rust/0001-Allow-getting-no_std-from-the-config-file.patch
deleted file mode 100644
index 0b9359221a7..00000000000
--- a/nixpkgs/pkgs/development/compilers/rust/0001-Allow-getting-no_std-from-the-config-file.patch
+++ /dev/null
@@ -1,52 +0,0 @@
-From 036c87c82793f1da9f98445e8e27462cc19bbe0a Mon Sep 17 00:00:00 2001
-From: John Ericson <John.Ericson@Obsidian.Systems>
-Date: Sat, 22 Feb 2020 14:38:38 -0500
-Subject: [PATCH] Allow getting `no_std` from the config file
-
-Currently, it is only set correctly in the sanity checking implicit
-default fallback code. Having a config file at all will for force
-`no_std = false`.
----
- src/bootstrap/config.rs | 3 +++
- src/bootstrap/sanity.rs | 4 +---
- 2 files changed, 4 insertions(+), 3 deletions(-)
-
-diff --git a/src/bootstrap/config.rs b/src/bootstrap/config.rs
-index 110c8b844d5..83a6934d477 100644
---- a/src/bootstrap/config.rs
-+++ b/src/bootstrap/config.rs
-@@ -350,6 +350,7 @@ struct TomlTarget {
- musl_root: Option<String>,
- wasi_root: Option<String>,
- qemu_rootfs: Option<String>,
-+ no_std: Option<bool>,
- }
-
- impl Config {
-@@ -610,6 +611,8 @@ impl Config {
- target.musl_root = cfg.musl_root.clone().map(PathBuf::from);
- target.wasi_root = cfg.wasi_root.clone().map(PathBuf::from);
- target.qemu_rootfs = cfg.qemu_rootfs.clone().map(PathBuf::from);
-+ target.no_std
-+ = cfg.no_std.unwrap_or(triple.contains("-none-") || triple.contains("nvptx"));
-
- config.target_config.insert(INTERNER.intern_string(triple.clone()), target);
- }
-diff --git a/src/bootstrap/sanity.rs b/src/bootstrap/sanity.rs
-index 8ff7056e628..76e721ed8e3 100644
---- a/src/bootstrap/sanity.rs
-+++ b/src/bootstrap/sanity.rs
-@@ -194,9 +194,7 @@ pub fn check(build: &mut Build) {
-
- if target.contains("-none-") || target.contains("nvptx") {
- if build.no_std(*target).is_none() {
-- let target = build.config.target_config.entry(target.clone()).or_default();
--
-- target.no_std = true;
-+ build.config.target_config.entry(target.clone()).or_default();
- }
-
- if build.no_std(*target) == Some(false) {
---
-2.24.1
-
diff --git a/nixpkgs/pkgs/development/compilers/rust/1_42.nix b/nixpkgs/pkgs/development/compilers/rust/1_42.nix
deleted file mode 100644
index 8717aaf76a2..00000000000
--- a/nixpkgs/pkgs/development/compilers/rust/1_42.nix
+++ /dev/null
@@ -1,44 +0,0 @@
-# New rust versions should first go to staging.
-# Things to check after updating:
-# 1. Rustc should produce rust binaries on x86_64-linux, aarch64-linux and x86_64-darwin:
-# i.e. nix-shell -p fd or @GrahamcOfBorg build fd on github
-# This testing can be also done by other volunteers as part of the pull
-# request review, in case platforms cannot be covered.
-# 2. The LLVM version used for building should match with rust upstream.
-# 3. Firefox and Thunderbird should still build on x86_64-linux.
-
-{ stdenv, lib
-, buildPackages
-, newScope, callPackage
-, CoreFoundation, Security
-, llvmPackages_5
-, pkgsBuildTarget, pkgsBuildBuild
-} @ args:
-
-import ./default.nix {
- rustcVersion = "1.42.0";
- rustcSha256 = "0x9lxs82may6c0iln0b908cxyn1cv7h03n5cmbx3j1bas4qzks6j";
-
- # Note: the version MUST be one version prior to the version we're
- # building
- bootstrapVersion = "1.41.0";
-
- # fetch hashes by running `print-hashes.sh 1.42.0`
- bootstrapHashes = {
- i686-unknown-linux-gnu = "a93a34f9cf3d35de2496352cb615b42b792eb09db3149b3a278efd2c58fa7897";
- x86_64-unknown-linux-gnu = "343ba8ef7397eab7b3bb2382e5e4cb08835a87bff5c8074382c0b6930a41948b";
- arm-unknown-linux-gnueabihf = "d0b33fcc97eeb96d716b30573c7e66affdf9077ecdecb30df2498b49f8284047";
- armv7-unknown-linux-gnueabihf = "3c8e787fb4f4f304a065e78c38010f0b5722d809f9dafb0e904084bf0f54f7be";
- aarch64-unknown-linux-gnu = "79ddfb5e2563d0ee09a567fbbe121a2aed3c3bc61255b2787f2dd42183a10f27";
- i686-apple-darwin = "628134b3fbaf5c0e7a25bd9a2b8d25f6e68bb256c8b04a3332ec979f5a1cd339";
- x86_64-apple-darwin = "b6504003ab70b11f278e0243a43ba9d6bf75e8ad6819b4058a2b6e3991cc8d7a";
- };
-
- selectRustPackage = pkgs: pkgs.rust_1_42;
-
- rustcPatches = [
- ./0001-Allow-getting-no_std-from-the-config-file.patch
- ];
-}
-
-(builtins.removeAttrs args [ "fetchpatch" ])
diff --git a/nixpkgs/pkgs/development/compilers/rust/1_43.nix b/nixpkgs/pkgs/development/compilers/rust/1_44.nix
index a1a9d17fcd5..9fc268d152b 100644
--- a/nixpkgs/pkgs/development/compilers/rust/1_43.nix
+++ b/nixpkgs/pkgs/development/compilers/rust/1_44.nix
@@ -16,24 +16,24 @@
} @ args:
import ./default.nix {
- rustcVersion = "1.43.0";
- rustcSha256 = "18akhk0wz1my6y9vhardriy2ysc482z0fnjdcgs9gy59kmnarxkm";
+ rustcVersion = "1.44.1";
+ rustcSha256 = "0ww4z2v3gxgn3zddqzwqya1gln04p91ykbrflnpdbmcd575n8bky";
# Note: the version MUST be one version prior to the version we're
# building
- bootstrapVersion = "1.42.0";
+ bootstrapVersion = "1.43.1";
- # fetch hashes by running `print-hashes.sh 1.43.0`
+ # fetch hashes by running `print-hashes.sh 1.44.1`
bootstrapHashes = {
- i686-unknown-linux-gnu = "1c89c12c8fc1a45dcbcb9ee2e21cc634b8453f1d4cdd658269263de686aab4e4";
- x86_64-unknown-linux-gnu = "7d1e07ad9c8a33d8d039def7c0a131c5917aa3ea0af3d0cc399c6faf7b789052";
- arm-unknown-linux-gnueabihf = "6cf776b910d08fb0d1f88be94464e7b20a50f9d8b2ec6372c3c385aec0b70e7a";
- armv7-unknown-linux-gnueabihf = "a36e7f2bd148e325a7b8e7131b4226266cf522b1a2b12d585dad9c38ef68f4d9";
- aarch64-unknown-linux-gnu = "fdd39f856a062af265012861949ff6654e2b7103be034d046bec84ebe46e8d2d";
- x86_64-apple-darwin = "db1055c46e0d54b99da05e88c71fea21b3897e74a4f5ff9390e934f3f050c0a8";
+ i686-unknown-linux-gnu = "0626fa8a6a2387021413d740543f7496656d81115e2284e4ef73217128398990";
+ x86_64-unknown-linux-gnu = "25cd71b95bba0daef56bad8c943a87368c4185b90983f4412f46e3e2418c0505";
+ arm-unknown-linux-gnueabihf = "16b9c4861565a195323d144fd0f54c0ae794ee3d2a867682f8aedbdacaad5a6c";
+ armv7-unknown-linux-gnueabihf = "0c32a5958a358a031e6ca52074cfd45256688dc334db315199f5dbbf7562e5b1";
+ aarch64-unknown-linux-gnu = "fbb612387a64c9da2869725afffc1f66a72d6e7ba6667ba717cd52c33080b7fb";
+ x86_64-apple-darwin = "e1c3e1426a9e615079159d6b619319235e3ca7b395e7603330375bfffcbb7003";
};
- selectRustPackage = pkgs: pkgs.rust_1_43;
+ selectRustPackage = pkgs: pkgs.rust_1_44;
rustcPatches = [
];
diff --git a/nixpkgs/pkgs/development/compilers/rust/1_45.nix b/nixpkgs/pkgs/development/compilers/rust/1_45.nix
new file mode 100644
index 00000000000..1a634d3f51e
--- /dev/null
+++ b/nixpkgs/pkgs/development/compilers/rust/1_45.nix
@@ -0,0 +1,42 @@
+# New rust versions should first go to staging.
+# Things to check after updating:
+# 1. Rustc should produce rust binaries on x86_64-linux, aarch64-linux and x86_64-darwin:
+# i.e. nix-shell -p fd or @GrahamcOfBorg build fd on github
+# This testing can be also done by other volunteers as part of the pull
+# request review, in case platforms cannot be covered.
+# 2. The LLVM version used for building should match with rust upstream.
+# 3. Firefox and Thunderbird should still build on x86_64-linux.
+
+{ stdenv, lib
+, buildPackages
+, newScope, callPackage
+, CoreFoundation, Security
+, llvmPackages_5
+, pkgsBuildTarget, pkgsBuildBuild
+} @ args:
+
+import ./default.nix {
+ rustcVersion = "1.45.2";
+ rustcSha256 = "0273a1g3f59plyi1n0azf21qjzwml1yqdnj5z472crz37qggr8xp";
+
+ # Note: the version MUST be one version prior to the version we're
+ # building
+ bootstrapVersion = "1.44.1";
+
+ # fetch hashes by running `print-hashes.sh 1.45.0`
+ bootstrapHashes = {
+ i686-unknown-linux-gnu = "e69689b0a1b66599cf83e7dd54f839419007e44376195e93e301a3175da3d854";
+ x86_64-unknown-linux-gnu = "a41df89a461a580536aeb42755e43037556fba2e527dd13a1e1bb0749de28202";
+ arm-unknown-linux-gnueabihf = "ea18ccdfb62a153c2d43d013fdec56993cc9267f1cdc6f3834df8a2b9b468f08";
+ armv7-unknown-linux-gnueabihf = "d44294732cf268ea84908f1135f574ab9489132a332eaa9d5bda547374b15d54";
+ aarch64-unknown-linux-gnu = "a2d74ebeec0b6778026b6c37814cdc91d14db3b0d8b6d69d036216f4d9cf7e49";
+ x86_64-apple-darwin = "a5464e7bcbce9647607904a4afa8362382f1fc55d39e7bbaf4483ac00eb5d56a";
+ };
+
+ selectRustPackage = pkgs: pkgs.rust_1_45;
+
+ rustcPatches = [
+ ];
+}
+
+(builtins.removeAttrs args [ "fetchpatch" ])
diff --git a/nixpkgs/pkgs/development/compilers/rust/cargo.nix b/nixpkgs/pkgs/development/compilers/rust/cargo.nix
index 65614b9480e..e820b982620 100644
--- a/nixpkgs/pkgs/development/compilers/rust/cargo.nix
+++ b/nixpkgs/pkgs/development/compilers/rust/cargo.nix
@@ -9,8 +9,7 @@ rustPlatform.buildRustPackage {
# the rust source tarball already has all the dependencies vendored, no need to fetch them again
cargoVendorDir = "vendor";
- preBuild = "pushd src/tools/cargo";
- postBuild = "popd";
+ buildAndTestSubdir = "src/tools/cargo";
passthru.rustc = rustc;
@@ -39,6 +38,11 @@ rustPlatform.buildRustPackage {
--set SSL_CERT_FILE "${cacert}/etc/ssl/certs/ca-bundle.crt"
installManPage src/tools/cargo/src/etc/man/*
+
+ installShellCompletion --bash --name cargo \
+ src/tools/cargo/src/etc/cargo.bashcomp.sh
+
+ installShellCompletion --zsh src/tools/cargo/src/etc/_cargo
'';
checkPhase = ''
diff --git a/nixpkgs/pkgs/development/compilers/rust/clippy.nix b/nixpkgs/pkgs/development/compilers/rust/clippy.nix
index 4857b587847..0546ad9bac1 100644
--- a/nixpkgs/pkgs/development/compilers/rust/clippy.nix
+++ b/nixpkgs/pkgs/development/compilers/rust/clippy.nix
@@ -5,8 +5,7 @@ rustPlatform.buildRustPackage {
# the rust source tarball already has all the dependencies vendored, no need to fetch them again
cargoVendorDir = "vendor";
- preBuild = "pushd src/tools/clippy";
- postBuild = "popd";
+ buildAndTestSubdir = "src/tools/clippy";
# changes hash of vendor directory otherwise
dontUpdateAutotoolsGnuConfigScripts = true;
diff --git a/nixpkgs/pkgs/development/compilers/rust/rls/default.nix b/nixpkgs/pkgs/development/compilers/rust/rls/default.nix
index 4cf507fbf5c..06b1b9b1e64 100644
--- a/nixpkgs/pkgs/development/compilers/rust/rls/default.nix
+++ b/nixpkgs/pkgs/development/compilers/rust/rls/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, rustPlatform
+{ stdenv, makeWrapper, fetchFromGitHub, rustPlatform
, openssh, openssl, pkgconfig, cmake, zlib, curl, libiconv
, CoreFoundation, Security }:
@@ -10,8 +10,9 @@ rustPlatform.buildRustPackage {
dontUpdateAutotoolsGnuConfigScripts = true;
cargoVendorDir = "vendor";
+ buildAndTestSubdir = "src/tools/rls";
+
preBuild = ''
- pushd src/tools/rls
# client tests are flaky
rm tests/client.rs
'';
@@ -19,27 +20,34 @@ rustPlatform.buildRustPackage {
# a nightly compiler is required unless we use this cheat code.
RUSTC_BOOTSTRAP=1;
+ # As of rustc 1.45.0, these env vars are required to build rls
+ # (due to https://github.com/rust-lang/rust/pull/72001)
+ CFG_RELEASE = "${rustPlatform.rust.rustc.version}-nightly";
+ CFG_RELEASE_CHANNEL = "nightly";
+
# rls-rustc links to rustc_private crates
CARGO_BUILD_RUSTFLAGS = if stdenv.isDarwin then "-C rpath" else null;
nativeBuildInputs = [ pkgconfig cmake ];
- buildInputs = [ openssh openssl curl zlib libiconv rustPlatform.rust.rustc.llvm ]
+ buildInputs = [ openssh openssl curl zlib libiconv makeWrapper rustPlatform.rust.rustc.llvm ]
++ (stdenv.lib.optionals stdenv.isDarwin [ CoreFoundation Security ]);
doCheck = true;
- preInstall = "popd";
-
doInstallCheck = true;
installCheckPhase = ''
$out/bin/rls --version
'';
+ RUST_SRC_PATH = rustPlatform.rustcSrc;
+ postInstall = ''
+ wrapProgram $out/bin/rls --set-default RUST_SRC_PATH ${rustPlatform.rustcSrc}
+ '';
+
meta = with stdenv.lib; {
description = "Rust Language Server - provides information about Rust programs to IDEs and other tools";
homepage = "https://github.com/rust-lang/rls/";
license = with licenses; [ asl20 /* or */ mit ];
maintainers = with maintainers; [ symphorien ];
- platforms = platforms.all;
};
}
diff --git a/nixpkgs/pkgs/development/compilers/rust/rustc.nix b/nixpkgs/pkgs/development/compilers/rust/rustc.nix
index 40de5f61e03..65d8920c4a4 100644
--- a/nixpkgs/pkgs/development/compilers/rust/rustc.nix
+++ b/nixpkgs/pkgs/development/compilers/rust/rustc.nix
@@ -1,6 +1,6 @@
{ stdenv, removeReferencesTo, pkgsBuildBuild, pkgsBuildHost, pkgsBuildTarget
, fetchurl, file, python3
-, llvm_9, darwin, cmake, rust, rustPlatform
+, llvm_10, darwin, cmake, rust, rustPlatform
, pkgconfig, openssl
, which, libffi
, withBundledLLVM ? false
@@ -14,12 +14,12 @@ let
inherit (stdenv.lib) optionals optional optionalString;
inherit (darwin.apple_sdk.frameworks) Security;
- llvmSharedForBuild = pkgsBuildBuild.llvm_9.override { enableSharedLibraries = true; };
- llvmSharedForHost = pkgsBuildHost.llvm_9.override { enableSharedLibraries = true; };
- llvmSharedForTarget = pkgsBuildTarget.llvm_9.override { enableSharedLibraries = true; };
+ llvmSharedForBuild = pkgsBuildBuild.llvm_10.override { enableSharedLibraries = true; };
+ llvmSharedForHost = pkgsBuildHost.llvm_10.override { enableSharedLibraries = true; };
+ llvmSharedForTarget = pkgsBuildTarget.llvm_10.override { enableSharedLibraries = true; };
# For use at runtime
- llvmShared = llvm_9.override { enableSharedLibraries = true; };
+ llvmShared = llvm_10.override { enableSharedLibraries = true; };
in stdenv.mkDerivation rec {
pname = "rustc";
inherit version;
@@ -90,7 +90,7 @@ in stdenv.mkDerivation rec {
"${setBuild}.llvm-config=${llvmSharedForBuild}/bin/llvm-config"
"${setHost}.llvm-config=${llvmSharedForHost}/bin/llvm-config"
"${setTarget}.llvm-config=${llvmSharedForTarget}/bin/llvm-config"
- ] ++ optionals stdenv.isLinux [
+ ] ++ optionals (stdenv.isLinux && !stdenv.targetPlatform.isRedox) [
"--enable-profiler" # build libprofiler_builtins
];
diff --git a/nixpkgs/pkgs/development/compilers/rust/rustfmt.nix b/nixpkgs/pkgs/development/compilers/rust/rustfmt.nix
index f8ed0bce2e0..6215c936c6d 100644
--- a/nixpkgs/pkgs/development/compilers/rust/rustfmt.nix
+++ b/nixpkgs/pkgs/development/compilers/rust/rustfmt.nix
@@ -6,8 +6,7 @@ rustPlatform.buildRustPackage rec {
# the rust source tarball already has all the dependencies vendored, no need to fetch them again
cargoVendorDir = "vendor";
- preBuild = "pushd src/tools/rustfmt";
- preInstall = "popd";
+ buildAndTestSubdir = "src/tools/rustfmt";
# changes hash of vendor directory otherwise
dontUpdateAutotoolsGnuConfigScripts = true;
@@ -17,17 +16,15 @@ rustPlatform.buildRustPackage rec {
# As of 1.0.0 and rustc 1.30 rustfmt requires a nightly compiler
RUSTC_BOOTSTRAP = 1;
- # we run tests in debug mode so tests look for a debug build of
- # rustfmt. Anyway this adds nearly no compilation time.
- preCheck = ''
- cargo build
- '';
+ # As of rustc 1.45.0, these env vars are required to build rustfmt (due to
+ # https://github.com/rust-lang/rust/pull/72001)
+ CFG_RELEASE = "${rustPlatform.rust.rustc.version}-nightly";
+ CFG_RELEASE_CHANNEL = "nightly";
meta = with stdenv.lib; {
description = "A tool for formatting Rust code according to style guidelines";
homepage = "https://github.com/rust-lang-nursery/rustfmt";
license = with licenses; [ mit asl20 ];
maintainers = with maintainers; [ globin basvandijk ];
- platforms = platforms.all;
};
}