about summary refs log tree commit diff
path: root/pkgs/development/compilers/rust
diff options
context:
space:
mode:
authorgithub-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>2023-02-20 12:01:32 +0000
committerGitHub <noreply@github.com>2023-02-20 12:01:32 +0000
commit507feca6063e9360449e9a45ec6959a5199f82c3 (patch)
tree4f5e0abad09c724d6604451149dc8f3e2aa46d8a /pkgs/development/compilers/rust
parentb629ad5e83b58e73d73f023055469bd47d8d1263 (diff)
parentd3b78c31265fdb7e1d98a89c20da8e3c41d0a728 (diff)
downloadnixlib-507feca6063e9360449e9a45ec6959a5199f82c3.tar
nixlib-507feca6063e9360449e9a45ec6959a5199f82c3.tar.gz
nixlib-507feca6063e9360449e9a45ec6959a5199f82c3.tar.bz2
nixlib-507feca6063e9360449e9a45ec6959a5199f82c3.tar.lz
nixlib-507feca6063e9360449e9a45ec6959a5199f82c3.tar.xz
nixlib-507feca6063e9360449e9a45ec6959a5199f82c3.tar.zst
nixlib-507feca6063e9360449e9a45ec6959a5199f82c3.zip
Merge master into staging-next
Diffstat (limited to 'pkgs/development/compilers/rust')
-rw-r--r--pkgs/development/compilers/rust/clippy.nix13
-rw-r--r--pkgs/development/compilers/rust/rustc.nix6
2 files changed, 15 insertions, 4 deletions
diff --git a/pkgs/development/compilers/rust/clippy.nix b/pkgs/development/compilers/rust/clippy.nix
index 23b8e7effe12..499db45021ea 100644
--- a/pkgs/development/compilers/rust/clippy.nix
+++ b/pkgs/development/compilers/rust/clippy.nix
@@ -10,7 +10,7 @@ rustPlatform.buildRustPackage {
   # changes hash of vendor directory otherwise
   dontUpdateAutotoolsGnuConfigScripts = true;
 
-  buildInputs = [ rustc rustc.llvm ] ++ lib.optionals stdenv.isDarwin [ Security ];
+  buildInputs = [ rustc.llvm ] ++ lib.optionals stdenv.isDarwin [ Security ];
 
   # fixes: error: the option `Z` is only accepted on the nightly compiler
   RUSTC_BOOTSTRAP = 1;
@@ -20,14 +20,21 @@ rustPlatform.buildRustPackage {
   #   (/private/tmp/nix-build-clippy-1.36.0.drv-0/rustc-1.36.0-src/src/librustc_llvm)
   doCheck = false;
 
+  # Clippy uses the rustc_driver and std private libraries, and Rust's build process forces them to have
+  # an install name of `@rpath/...` [0] [1] instead of the standard on macOS, which is an absolute path
+  # to itself.
+  #
+  # [0]: https://github.com/rust-lang/rust/blob/f77f4d55bdf9d8955d3292f709bd9830c2fdeca5/src/bootstrap/builder.rs#L1543
+  # [1]: https://github.com/rust-lang/rust/blob/f77f4d55bdf9d8955d3292f709bd9830c2fdeca5/compiler/rustc_codegen_ssa/src/back/linker.rs#L323-L331
   preFixup = lib.optionalString stdenv.isDarwin ''
-    install_name_tool -add_rpath "${rustc}/lib" $out/bin/clippy-driver
+    install_name_tool -add_rpath "${rustc}/lib" "$out/bin/clippy-driver"
+    install_name_tool -add_rpath "${rustc}/lib" "$out/bin/cargo-clippy"
   '';
 
   meta = with lib; {
     homepage = "https://rust-lang.github.io/rust-clippy/";
     description = "A bunch of lints to catch common mistakes and improve your Rust code";
-    maintainers = with maintainers; [ basvandijk ];
+    maintainers = with maintainers; [ basvandijk ] ++ teams.rust.members;
     license = with licenses; [ mit asl20 ];
     platforms = platforms.unix;
   };
diff --git a/pkgs/development/compilers/rust/rustc.nix b/pkgs/development/compilers/rust/rustc.nix
index 60f07a64299a..130cb8326115 100644
--- a/pkgs/development/compilers/rust/rustc.nix
+++ b/pkgs/development/compilers/rust/rustc.nix
@@ -11,6 +11,8 @@
 , sha256
 , patches ? []
 , fd
+, ripgrep
+, wezterm
 , firefox
 , thunderbird
 }:
@@ -204,7 +206,9 @@ in stdenv.mkDerivation rec {
   passthru = {
     llvm = llvmShared;
     inherit llvmPackages;
-    tests = { inherit fd; } // lib.optionalAttrs stdenv.hostPlatform.isLinux { inherit firefox thunderbird; };
+    tests = {
+      inherit fd ripgrep wezterm;
+    } // lib.optionalAttrs stdenv.hostPlatform.isLinux { inherit firefox thunderbird; };
   };
 
   meta = with lib; {