diff options
Diffstat (limited to 'nixpkgs/pkgs/development/tools/rust/rust-analyzer')
3 files changed, 27 insertions, 14 deletions
diff --git a/nixpkgs/pkgs/development/tools/rust/rust-analyzer/default.nix b/nixpkgs/pkgs/development/tools/rust/rust-analyzer/default.nix index 7eccf4d0c37..8302d0a111e 100644 --- a/nixpkgs/pkgs/development/tools/rust/rust-analyzer/default.nix +++ b/nixpkgs/pkgs/development/tools/rust/rust-analyzer/default.nix @@ -2,10 +2,10 @@ { rust-analyzer-unwrapped = callPackage ./generic.nix rec { - rev = "2020-04-20"; + rev = "2020-08-03"; version = "unstable-${rev}"; - sha256 = "00v8b6pbm5fry6bfkrfd7phn0ps8annqrw9k71m3pd26sxnn1q5f"; - cargoSha256 = "0nd86gwlfjwdkcphpk8zvs95xxdm8p74wl7vcrx8fnvvfxnkpwmc"; + sha256 = "07xd9gwzjqnjsb5rnxfa9vxc6dmh04mbd1dcwxsz9fv9dcnsx21l"; + cargoSha256 = "0sa8yd3a6y2505w0n9l7d1v03c7dl07zw78fx5r3f4p3lc65n8b4"; }; rust-analyzer = callPackage ./wrapper.nix {} { diff --git a/nixpkgs/pkgs/development/tools/rust/rust-analyzer/generic.nix b/nixpkgs/pkgs/development/tools/rust/rust-analyzer/generic.nix index de755ec17ff..d5ac9eaa5ee 100644 --- a/nixpkgs/pkgs/development/tools/rust/rust-analyzer/generic.nix +++ b/nixpkgs/pkgs/development/tools/rust/rust-analyzer/generic.nix @@ -15,9 +15,7 @@ rustPlatform.buildRustPackage { inherit rev sha256; }; - preBuild = "pushd crates/rust-analyzer"; - # Do not checking other crates in checkPhase. - preInstall = "popd"; + buildAndTestSubdir = "crates/rust-analyzer"; cargoBuildFlags = lib.optional useJemalloc "--features=jemalloc"; @@ -26,6 +24,8 @@ rustPlatform.buildRustPackage { buildInputs = lib.optionals stdenv.hostPlatform.isDarwin [ darwin.apple_sdk.frameworks.CoreServices ]; + RUST_ANALYZER_REV = rev; + inherit doCheck; # Skip tests running `rustup` for `cargo fmt`. preCheck = '' @@ -35,6 +35,16 @@ rustPlatform.buildRustPackage { export RUST_SRC_PATH=${rustPlatform.rustcSrc} ''; + # Temporary disabled until #93119 is fixed. + doInstallCheck = false; + installCheckPhase = '' + runHook preInstallCheck + versionOutput="$($out/bin/rust-analyzer --version)" + echo "'rust-analyzer --version' returns: $versionOutput" + [[ "$versionOutput" == "rust-analyzer ${rev}" ]] + runHook postInstallCheck + ''; + meta = with stdenv.lib; { description = "An experimental modular compiler frontend for the Rust language"; homepage = "https://github.com/rust-analyzer/rust-analyzer"; diff --git a/nixpkgs/pkgs/development/tools/rust/rust-analyzer/update.sh b/nixpkgs/pkgs/development/tools/rust/rust-analyzer/update.sh index 92911254259..b0435be7208 100755 --- a/nixpkgs/pkgs/development/tools/rust/rust-analyzer/update.sh +++ b/nixpkgs/pkgs/development/tools/rust/rust-analyzer/update.sh @@ -49,13 +49,16 @@ sed "s/cargoSha256 = \".*\"/cargoSha256 = \"$cargo_sha256\"/" \ build_deps="../../../../misc/vscode-extensions/rust-analyzer/build-deps" # We need devDependencies to build vsix. jq '{ name, version, dependencies: (.dependencies + .devDependencies) }' "$node_src/package.json" \ - >"$build_deps/package.json" + >"$build_deps/package.json.new" -# FIXME: Lock the version of @type/vscode, the latest one (1.43.0) will cause build failure. -vscode_lock_ver="$(jq '.dependencies."@types/vscode".version' --raw-output "$node_src/package-lock.json")" -jq '.dependencies."@types/vscode" = "'$vscode_lock_ver'"' "$build_deps/package.json" >"$build_deps/package.json.new" -mv "$build_deps"/package.json{.new,} +if cmp --quiet "$build_deps"/package.json{.new,}; then + echo "package.json not changed, skip updating nodePackages" + rm "$build_deps"/package.json.new +else + echo "package.json changed, updating nodePackages" + mv "$build_deps"/package.json{.new,} -pushd "../../../node-packages" -./generate.sh -popd + pushd "../../../node-packages" + ./generate.sh + popd +fi |