From d9d06470463b781cf70d99015ee55a0707efdb4c Mon Sep 17 00:00:00 2001 From: Symphorien Gibol Date: Fri, 16 Aug 2019 19:03:38 +0200 Subject: [PATCH] rls: tie version to rustc's --- pkgs/development/compilers/rust/default.nix | 1 + .../{tools => compilers}/rust/rls/default.nix | 24 +++++++++---------- pkgs/top-level/all-packages.nix | 4 +--- 3 files changed, 13 insertions(+), 16 deletions(-) rename pkgs/development/{tools => compilers}/rust/rls/default.nix (76%) diff --git a/pkgs/development/compilers/rust/default.nix b/pkgs/development/compilers/rust/default.nix index 660f3cca7c6..a39cd785cf7 100644 --- a/pkgs/development/compilers/rust/default.nix +++ b/pkgs/development/compilers/rust/default.nix @@ -66,6 +66,7 @@ inherit CoreFoundation Security; }; clippy = self.callPackage ./clippy.nix { inherit Security; }; + rls = self.callPackage ./rls { inherit CoreFoundation Security; }; }); }; } diff --git a/pkgs/development/tools/rust/rls/default.nix b/pkgs/development/compilers/rust/rls/default.nix similarity index 76% rename from pkgs/development/tools/rust/rls/default.nix rename to pkgs/development/compilers/rust/rls/default.nix index 454c5da7143..470611242e0 100644 --- a/pkgs/development/tools/rust/rls/default.nix +++ b/pkgs/development/compilers/rust/rls/default.nix @@ -4,17 +4,17 @@ rustPlatform.buildRustPackage rec { pname = "rls"; - # with rust 1.x you can only build rls version 1.x.y - version = "1.36.0"; + inherit (rustPlatform.rust.rustc) src version; - src = fetchFromGitHub { - owner = "rust-lang"; - repo = pname; - rev = version; - sha256 = "1mclv0admxv48pndyqghxc4nf1amhbd700cgrzjshf9jrnffxmrn"; - }; + # changes hash of vendor directory otherwise + dontUpdateAutotoolsGnuConfigScripts = true; - cargoSha256 = "1yli9540510xmzqnzfi3p6rh23bjqsviflqw95a0fawf2rnj8sin"; + cargoVendorDir = "vendor"; + preBuild = '' + pushd src/tools/rls + # client tests are flaky + rm tests/client.rs + ''; # a nightly compiler is required unless we use this cheat code. RUSTC_BOOTSTRAP=1; @@ -27,10 +27,8 @@ rustPlatform.buildRustPackage rec { ++ (stdenv.lib.optionals stdenv.isDarwin [ CoreFoundation Security ]); doCheck = true; - preCheck = '' - # client tests are flaky - rm tests/client.rs - ''; + + preInstall = "popd"; doInstallCheck = true; installCheckPhase = '' diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 629707ea5c9..41771e41991 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -8288,9 +8288,7 @@ in pyo3-pack = callPackage ../development/tools/rust/pyo3-pack { }; rainicorn = callPackage ../development/tools/rust/rainicorn { }; - rls = callPackage ../development/tools/rust/rls { - inherit (darwin.apple_sdk.frameworks) CoreFoundation Security; - }; + inherit (rustPackages) rls; rustfmt = rustPackages.rustfmt; rustracer = callPackage ../development/tools/rust/racer { inherit (darwin.apple_sdk.frameworks) Security;