rust-analyzer: fix version display and add check
This commit is contained in:
parent
c90e6dd06d
commit
ddacdbc953
|
@ -24,6 +24,8 @@ rustPlatform.buildRustPackage {
|
||||||
buildInputs = lib.optionals stdenv.hostPlatform.isDarwin
|
buildInputs = lib.optionals stdenv.hostPlatform.isDarwin
|
||||||
[ darwin.apple_sdk.frameworks.CoreServices ];
|
[ darwin.apple_sdk.frameworks.CoreServices ];
|
||||||
|
|
||||||
|
RUST_ANALYZER_REV = rev;
|
||||||
|
|
||||||
inherit doCheck;
|
inherit doCheck;
|
||||||
# Skip tests running `rustup` for `cargo fmt`.
|
# Skip tests running `rustup` for `cargo fmt`.
|
||||||
preCheck = ''
|
preCheck = ''
|
||||||
|
@ -33,6 +35,15 @@ rustPlatform.buildRustPackage {
|
||||||
export RUST_SRC_PATH=${rustPlatform.rustcSrc}
|
export RUST_SRC_PATH=${rustPlatform.rustcSrc}
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
doInstallCheck = true;
|
||||||
|
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; {
|
meta = with stdenv.lib; {
|
||||||
description = "An experimental modular compiler frontend for the Rust language";
|
description = "An experimental modular compiler frontend for the Rust language";
|
||||||
homepage = "https://github.com/rust-analyzer/rust-analyzer";
|
homepage = "https://github.com/rust-analyzer/rust-analyzer";
|
||||||
|
|
Loading…
Reference in New Issue