Merge pull request #65596 from arcnmx/pr-racer-update

rustracer: 2.0.14 -> 2.1.22
This commit is contained in:
Jörg Thalheim 2019-07-30 08:16:15 +01:00 committed by GitHub
commit 445c99794d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 33 additions and 51 deletions

View file

@ -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";

View file

@ -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;

View file

@ -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",
];

View file

@ -4,17 +4,20 @@ with rustPlatform;
buildRustPackage rec {
name = "racerd-${version}";
version = "2017-09-15";
version = "2019-03-20";
src = fetchFromGitHub {
owner = "jwilm";
repo = "racerd";
rev = "29cd4c6fd2a9301e49931c2e065b2e10c4b587e4";
sha256 = "0knz881mjhd8q2i8ydggaa7lfpiqy11wjmnv5p80n1d8zca6yb7z";
rev = "6f74488e58e42314a36ff000bae796fe54c1bdd1";
sha256 = "1lg7j2plxpn5l65jxhsm99vmy08ljdb666hm0y1nnmmzalrakrg1";
};
# a nightly compiler is required unless we use this cheat code.
RUSTC_BOOTSTRAP=1;
doCheck = false;
cargoSha256 = "0rxr8l5fhryxqf141sb2j4bjxdikj2hd7bnhbicgm35c9f6cir4m";
cargoSha256 = "15894qr0kpp5kivx0p71zmmfhfh8in0ydkvfirxh2r12x0r2jhdd";
buildInputs = [ makeWrapper ];
@ -23,7 +26,7 @@ buildRustPackage rec {
installPhase = ''
mkdir -p $out/bin
cp -p target/release/racerd $out/bin/
wrapProgram $out/bin/racerd --set RUST_SRC_PATH "$RUST_SRC_PATH"
wrapProgram $out/bin/racerd --set-default RUST_SRC_PATH "$RUST_SRC_PATH"
'';
meta = with stdenv.lib; {