summary refs log tree commit diff
path: root/pkgs/development/tools/rust
diff options
context:
space:
mode:
authorarcnmx <arcnmx@users.noreply.github.com>2019-07-29 21:59:24 -0700
committerarcnmx <arcnmx@users.noreply.github.com>2019-07-29 22:10:12 -0700
commit530e6004ef7abf969e5db7365ecbb45f94e3e5e7 (patch)
tree0f1873737d5904ee3f28639275f9084ad2280d66 /pkgs/development/tools/rust
parentab8240303888812364a4bc4a670730d3077fc04a (diff)
downloadnixpkgs-530e6004ef7abf969e5db7365ecbb45f94e3e5e7.tar
nixpkgs-530e6004ef7abf969e5db7365ecbb45f94e3e5e7.tar.gz
nixpkgs-530e6004ef7abf969e5db7365ecbb45f94e3e5e7.tar.bz2
nixpkgs-530e6004ef7abf969e5db7365ecbb45f94e3e5e7.tar.lz
nixpkgs-530e6004ef7abf969e5db7365ecbb45f94e3e5e7.tar.xz
nixpkgs-530e6004ef7abf969e5db7365ecbb45f94e3e5e7.tar.zst
nixpkgs-530e6004ef7abf969e5db7365ecbb45f94e3e5e7.zip
rustracer: 2.0.14 -> 2.1.22
Diffstat (limited to 'pkgs/development/tools/rust')
-rw-r--r--pkgs/development/tools/rust/racer/default.nix39
-rw-r--r--pkgs/development/tools/rust/racer/ignore-tests.patch22
-rw-r--r--pkgs/development/tools/rust/racer/rust-src.patch10
3 files changed, 25 insertions, 46 deletions
diff --git a/pkgs/development/tools/rust/racer/default.nix b/pkgs/development/tools/rust/racer/default.nix
index fabd61018af..c63caaf4850 100644
--- a/pkgs/development/tools/rust/racer/default.nix
+++ b/pkgs/development/tools/rust/racer/default.nix
@@ -2,30 +2,41 @@
 
 rustPlatform.buildRustPackage rec {
   name = "racer-${version}";
-  version = "2.0.14";
+  version = "2.1.22";
 
   src = fetchFromGitHub {
     owner = "racer-rust";
     repo = "racer";
-    rev = version;
-    sha256 = "0kgax74qa09axq7b175ph3psprgidwgsml83wm1qwdq16gpxiaif";
+    rev = "v${version}";
+    sha256 = "1n808h4jqxkvpjwmj8jgi4y5is5zvr8vn42mwb3yi13mix32cysa";
   };
 
-  cargoSha256 = "119xfkglpfq26bz411rjj31i088vr0847p571cxph5v3dfxbgz4y";
+  cargoSha256 = "0njaa9vk2i9g1c6sq20b7ls97nl532rfv3is7d8dwz51nrwk6jxs";
 
   buildInputs = [ makeWrapper ];
 
-  preCheck = ''
-    export RUST_SRC_PATH="${rustPlatform.rustcSrc}"
+  # a nightly compiler is required unless we use this cheat code.
+  RUSTC_BOOTSTRAP=1;
+
+  RUST_SRC_PATH = rustPlatform.rustcSrc;
+  postInstall = ''
+    wrapProgram $out/bin/racer --set-default RUST_SRC_PATH $rustcSrc
+  '';
+
+  checkPhase = ''
+    cargo test -- \
+      --skip nameres::test_do_file_search_std \
+      --skip util::test_get_rust_src_path_rustup_ok \
+      --skip util::test_get_rust_src_path_not_rust_source_tree \
+      --skip extern --skip completes_pub_fn --skip find_crate_doc \
+      --skip follows_use_local_package --skip follows_use_for_reexport \
+      --skip follows_rand_crate --skip get_completion_in_example_dir
+  '';
+
+  doInstallCheck = true;
+  installCheckPhase = ''
+    $out/bin/racer --version
   '';
-  patches = [
-    (substituteAll {
-      src = ./rust-src.patch;
-      inherit (rustPlatform) rustcSrc;
-    })
-    ./ignore-tests.patch
-  ];
-  doCheck = true;
 
   meta = with stdenv.lib; {
     description = "A utility intended to provide Rust code completion for editors and IDEs";
diff --git a/pkgs/development/tools/rust/racer/ignore-tests.patch b/pkgs/development/tools/rust/racer/ignore-tests.patch
deleted file mode 100644
index 021217b4094..00000000000
--- a/pkgs/development/tools/rust/racer/ignore-tests.patch
+++ /dev/null
@@ -1,22 +0,0 @@
-diff -Naur --strip-trailing-cr source.org/src/racer/nameres.rs source/src/racer/nameres.rs
---- source.org/src/racer/nameres.rs	2017-11-15 20:37:38.571644733 +0000
-+++ source/src/racer/nameres.rs	2017-11-15 20:23:20.521324031 +0000
-@@ -577,6 +577,7 @@
-     out.into_iter()
- }
- 
-+#[ignore]
- #[test]
- fn test_do_file_search() {
-     let cache = core::FileCache::default();
-diff -Naur --strip-trailing-cr source.org/src/racer/util.rs source/src/racer/util.rs
---- source.org/src/racer/util.rs	2017-11-15 19:37:55.095344120 +0000
-+++ source/src/racer/util.rs	2017-11-15 20:22:53.746624158 +0000
-@@ -475,6 +475,7 @@
- 
- }
- 
-+#[ignore]
- #[test]
- fn test_get_rust_src_path_missing() {
-     use std::env;
diff --git a/pkgs/development/tools/rust/racer/rust-src.patch b/pkgs/development/tools/rust/racer/rust-src.patch
deleted file mode 100644
index 2e794ac8887..00000000000
--- a/pkgs/development/tools/rust/racer/rust-src.patch
+++ /dev/null
@@ -1,10 +0,0 @@
---- source.org/src/racer/util.rs	1970-01-01 01:00:01.000000000 +0100
-+++ source/src/racer/util.rs	2017-11-15 16:50:12.904216242 +0000
-@@ -384,6 +384,7 @@
-     debug!("Nope. Trying default paths: /usr/local/src/rust/src and /usr/src/rust/src");
- 
-     let default_paths = [
-+        "@rustcSrc@",
-         "/usr/local/src/rust/src",
-         "/usr/src/rust/src",
-     ];