diff options
Diffstat (limited to 'pkgs/development/tools/rust')
14 files changed, 77 insertions, 154 deletions
diff --git a/pkgs/development/tools/rust/cargo-c/default.nix b/pkgs/development/tools/rust/cargo-c/default.nix index 41c03923ec05..ee0074f7d839 100644 --- a/pkgs/development/tools/rust/cargo-c/default.nix +++ b/pkgs/development/tools/rust/cargo-c/default.nix @@ -5,7 +5,7 @@ rustPlatform.buildRustPackage rec { pname = "cargo-c"; - version = "0.6.15"; + version = "0.6.18"; src = stdenv.mkDerivation rec { name = "${pname}-source-${version}"; @@ -14,11 +14,11 @@ rustPlatform.buildRustPackage rec { owner = "lu-zero"; repo = pname; rev = "v${version}"; - sha256 = "04hrk3vy8294vxcsggdpcs8hg3ykzj2564ifsqc4zwz4b4wd1p8l"; + sha256 = "1dh5z210nl8grjxb8zxch8h7799w61bah7r2j0s07091rcpfsrsb"; }; cargoLock = fetchurl { url = "https://github.com/lu-zero/${pname}/releases/download/v${version}/Cargo.lock"; - sha256 = "0rqb6ssqsdlm8zbshbxkwxlyy7j7p2gyficavzz33cw9g6fpmzbd"; + sha256 = "1h5wmfmm2a2ilyw3ar88rqm7yvdc2vhyx4pgg781615ax52fhjli"; }; installPhase = '' @@ -28,7 +28,7 @@ rustPlatform.buildRustPackage rec { ''; }; - cargoSha256 = "1q2s28nqd6l9qmhmdksdjjlypxry5ff18i2pgwmgiilcry51mj4b"; + cargoSha256 = "0ll9p2rbnw46zd9m2bmdmn99v9jjjf8i33xpkvd1rx42ki7sys62"; nativeBuildInputs = [ pkg-config ]; buildInputs = [ openssl ] diff --git a/pkgs/development/tools/rust/cargo-cache/default.nix b/pkgs/development/tools/rust/cargo-cache/default.nix index 0f3571045d67..3271e7951fac 100644 --- a/pkgs/development/tools/rust/cargo-cache/default.nix +++ b/pkgs/development/tools/rust/cargo-cache/default.nix @@ -21,6 +21,6 @@ rustPlatform.buildRustPackage rec { description = "Manage cargo cache (\${CARGO_HOME}, ~/.cargo/), print sizes of dirs and remove dirs selectively"; homepage = "https://github.com/matthiaskrgr/cargo-cache"; license = with licenses; [ asl20 /* or */ mit ]; - maintainers = with maintainers; [ filalex77 ]; + maintainers = with maintainers; [ Br1ght0ne ]; }; } diff --git a/pkgs/development/tools/rust/cargo-embed/default.nix b/pkgs/development/tools/rust/cargo-embed/default.nix index a9c18b021bf5..e4c5d8ab48c7 100644 --- a/pkgs/development/tools/rust/cargo-embed/default.nix +++ b/pkgs/development/tools/rust/cargo-embed/default.nix @@ -20,7 +20,7 @@ rustPlatform.buildRustPackage rec { meta = with lib; { description = "A cargo extension for working with microcontrollers"; - homepage = "http://probe.rs/"; + homepage = "https://probe.rs/"; license = with licenses; [ asl20 /* or */ mit ]; maintainers = with maintainers; [ fooker ]; }; diff --git a/pkgs/development/tools/rust/cargo-expand/default.nix b/pkgs/development/tools/rust/cargo-expand/default.nix index c32a87e7839f..09650e8a3868 100644 --- a/pkgs/development/tools/rust/cargo-expand/default.nix +++ b/pkgs/development/tools/rust/cargo-expand/default.nix @@ -2,16 +2,16 @@ rustPlatform.buildRustPackage rec { pname = "cargo-expand"; - version = "1.0.0"; + version = "1.0.4"; src = fetchFromGitHub { owner = "dtolnay"; repo = pname; rev = version; - sha256 = "0bdv6h3mzmv46pdyvwl0v0bg719dlsxlx378ws6vgi1cga24g37i"; + sha256 = "09jdqf1f8kl2c3k4cp8j3qqb96gclhncvfdwg2l3bmh5r10id9b3"; }; - cargoSha256 = "0qpihfgfqxw5fyhn124c5lbfaxr717bqf8mrbagh3vdgvk75j0qz"; + cargoSha256 = "0mx01h2zv7mpyi8s1545b7hjxn9aslzpbngrq4ii9rfqznz3r8k9"; meta = with lib; { description = diff --git a/pkgs/development/tools/rust/cargo-flash/default.nix b/pkgs/development/tools/rust/cargo-flash/default.nix index e5d23c9258cd..dbd79f179aa3 100644 --- a/pkgs/development/tools/rust/cargo-flash/default.nix +++ b/pkgs/development/tools/rust/cargo-flash/default.nix @@ -20,7 +20,7 @@ rustPlatform.buildRustPackage rec { meta = with lib; { description = "A cargo extension for working with microcontrollers"; - homepage = "http://probe.rs/"; + homepage = "https://probe.rs/"; license = with licenses; [ asl20 /* or */ mit ]; maintainers = with maintainers; [ fooker ]; }; diff --git a/pkgs/development/tools/rust/cargo-make/default.nix b/pkgs/development/tools/rust/cargo-make/default.nix index 4249e55247ca..881a53872c96 100644 --- a/pkgs/development/tools/rust/cargo-make/default.nix +++ b/pkgs/development/tools/rust/cargo-make/default.nix @@ -4,11 +4,11 @@ rustPlatform.buildRustPackage rec { pname = "cargo-make"; - version = "0.32.8"; + version = "0.32.9"; src = fetchCrate { inherit pname version; - sha256 = "sha256-TwutU4RjiYtxc2vT67Bgqe/WRHi5aXwgzvZu7Wk4Cao="; + sha256 = "0f6avprq0d65v5fk3kn2kvw3w024f21yq6v8y7d9rbwqxxf87jlf"; }; nativeBuildInputs = [ pkg-config ]; @@ -16,7 +16,7 @@ rustPlatform.buildRustPackage rec { buildInputs = [ openssl ] ++ stdenv.lib.optionals stdenv.isDarwin [ Security SystemConfiguration ]; - cargoSha256 = "sha256-HzRriPVaMn6qDu6h/NQjILglO4/0//8J1orV4Uz+XEI="; + cargoSha256 = "0v0657hh8ivqaq4sn0saaiz06shxavhrh9mksjlzj7c2ym6cxkih"; # Some tests fail because they need network access. # However, Travis ensures a proper build. diff --git a/pkgs/development/tools/rust/cargo-udeps/default.nix b/pkgs/development/tools/rust/cargo-udeps/default.nix index cc3aa00b27d0..840f2ae27c3c 100644 --- a/pkgs/development/tools/rust/cargo-udeps/default.nix +++ b/pkgs/development/tools/rust/cargo-udeps/default.nix @@ -2,16 +2,16 @@ rustPlatform.buildRustPackage rec { pname = "cargo-udeps"; - version = "0.1.15"; + version = "0.1.16"; src = fetchFromGitHub { owner = "est31"; repo = pname; rev = "v${version}"; - sha256 = "0qnmz7sxbwnjdsl17h876szxd04z0q9arbl1ib45b6346x7mq8n4"; + sha256 = "1h89xq91gbnbagfmvig5lkxyl08qwgdaf9vr55p599pmv190xq8s"; }; - cargoSha256 = "1jnbf0a3bggjf0wapr9xdj9hwfpgki2csg7rhg5maqavm8m0mirm"; + cargoSha256 = "17931z5nbigfzvvhr6k64s2j9p1sp9nvmy5fyf92j3ci02dplm5c"; nativeBuildInputs = [ pkgconfig ]; diff --git a/pkgs/development/tools/rust/cbindgen/default.nix b/pkgs/development/tools/rust/cbindgen/default.nix index dc04f4cb1123..0b557af42585 100644 --- a/pkgs/development/tools/rust/cbindgen/default.nix +++ b/pkgs/development/tools/rust/cbindgen/default.nix @@ -24,6 +24,6 @@ rustPlatform.buildRustPackage rec { description = "A project for generating C bindings from Rust code"; homepage = "https://github.com/eqrion/cbindgen"; license = licenses.mpl20; - maintainers = with maintainers; [ jtojnar andir ]; + maintainers = with maintainers; [ jtojnar ]; }; } diff --git a/pkgs/development/tools/rust/crate2nix/default.nix b/pkgs/development/tools/rust/crate2nix/default.nix new file mode 100644 index 000000000000..a941d43bb9d8 --- /dev/null +++ b/pkgs/development/tools/rust/crate2nix/default.nix @@ -0,0 +1,47 @@ +{ lib +, rustPlatform +, fetchFromGitHub +, makeWrapper + +, cargo +, nix +, nix-prefetch-git +}: + +rustPlatform.buildRustPackage rec { + pname = "crate2nix"; + version = "0.8.0"; + + src = fetchFromGitHub + { + owner = "kolloch"; + repo = pname; + rev = version; + sha256 = "sha256-pqg1BsEq3kGmUzt1zpQvXgdnRcIsiuIyvtUBi3VxtZ4="; + } + "/crate2nix"; + + cargoSha256 = "sha256-dAMWrGNMleQ3lDbG46Hr4qvCyxR+QcPOUZw9r2/CxV4="; + + nativeBuildInputs = [ makeWrapper ]; + + # Tests use nix(1), which tries (and fails) to set up /nix/var inside the + # sandbox + doCheck = false; + + postFixup = '' + wrapProgram $out/bin/crate2nix \ + --suffix PATH ":" ${lib.makeBinPath [ cargo nix nix-prefetch-git ]} + ''; + + meta = with lib; { + description = "A Nix build file generator for Rust crates."; + longDescription = '' + Crate2nix generates Nix files from Cargo.toml/lock files + so that you can build every crate individually in a Nix sandbox. + ''; + homepage = "https://github.com/kolloch/crate2nix"; + license = licenses.asl20; + maintainers = with maintainers; [ kolloch andir cole-h ]; + platforms = platforms.all; + }; +} diff --git a/pkgs/development/tools/rust/rust-analyzer/default.nix b/pkgs/development/tools/rust/rust-analyzer/default.nix index 2e6db32966d4..a398b7e504df 100644 --- a/pkgs/development/tools/rust/rust-analyzer/default.nix +++ b/pkgs/development/tools/rust/rust-analyzer/default.nix @@ -2,10 +2,10 @@ { rust-analyzer-unwrapped = callPackage ./generic.nix rec { - rev = "2020-10-19"; + rev = "2020-11-09"; version = "unstable-${rev}"; - sha256 = "1xvyk1d26zn1d9i42h78qsm6bg57nhn1rgr46jwa46gsb31nabjh"; - cargoSha256 = "18s5yrc9fdj2ndylwyf07l0kmwxka7mnbj254xmq3g7ragw71xjw"; + sha256 = "sha256-SX9dvx2JtYZBxA3+dHQKX/jrjbAMy37/SAybDjlYcSs="; + cargoSha256 = "sha256-+td+wMmI+MyGz9oPC+SPO2TmAV0+3lOORNY7xf6s3vI="; }; rust-analyzer = callPackage ./wrapper.nix {} { diff --git a/pkgs/development/tools/rust/rust-analyzer/generic.nix b/pkgs/development/tools/rust/rust-analyzer/generic.nix index ca72f91953cf..1bab5b951837 100644 --- a/pkgs/development/tools/rust/rust-analyzer/generic.nix +++ b/pkgs/development/tools/rust/rust-analyzer/generic.nix @@ -16,11 +16,6 @@ rustPlatform.buildRustPackage { inherit rev sha256; }; - # FIXME: Temporary fixes for our rust 1.46.0 - patches = [ - ./no-track_env_var.patch # Requires rustc 1.47.0 - ]; - buildAndTestSubdir = "crates/rust-analyzer"; cargoBuildFlags = lib.optional useMimalloc "--features=mimalloc"; @@ -34,7 +29,7 @@ rustPlatform.buildRustPackage { inherit doCheck; preCheck = lib.optionalString doCheck '' - export RUST_SRC_PATH=${rustPlatform.rustcSrc} + export RUST_SRC_PATH=${rustPlatform.rustLibSrc} ''; doInstallCheck = true; diff --git a/pkgs/development/tools/rust/rust-analyzer/no-track_env_var.patch b/pkgs/development/tools/rust/rust-analyzer/no-track_env_var.patch deleted file mode 100644 index f5173c4bacbc..000000000000 --- a/pkgs/development/tools/rust/rust-analyzer/no-track_env_var.patch +++ /dev/null @@ -1,120 +0,0 @@ -This patch revert 3d169bd3f4cdc2dc3dd09eadbbc17c19214d69f3 (Add track_env_var to the proc macro server). - -diff --git a/crates/proc_macro_srv/src/proc_macro/bridge/client.rs b/crates/proc_macro_srv/src/proc_macro/bridge/client.rs -index 55d6330cc..cb4b3bdb0 100644 ---- a/crates/proc_macro_srv/src/proc_macro/bridge/client.rs -+++ b/crates/proc_macro_srv/src/proc_macro/bridge/client.rs -@@ -160,7 +160,6 @@ macro_rules! define_handles { - } - define_handles! { - 'owned: -- FreeFunctions, - TokenStream, - TokenStreamBuilder, - TokenStreamIter, -diff --git a/crates/proc_macro_srv/src/proc_macro/bridge/mod.rs b/crates/proc_macro_srv/src/proc_macro/bridge/mod.rs -index b97886eb9..aeb05aad4 100644 ---- a/crates/proc_macro_srv/src/proc_macro/bridge/mod.rs -+++ b/crates/proc_macro_srv/src/proc_macro/bridge/mod.rs -@@ -57,10 +57,6 @@ use std::thread; - macro_rules! with_api { - ($S:ident, $self:ident, $m:ident) => { - $m! { -- FreeFunctions { -- fn drop($self: $S::FreeFunctions); -- fn track_env_var(var: &str, value: Option<&str>); -- }, - TokenStream { - fn drop($self: $S::TokenStream); - fn clone($self: &$S::TokenStream) -> $S::TokenStream; -diff --git a/crates/proc_macro_srv/src/proc_macro/bridge/server.rs b/crates/proc_macro_srv/src/proc_macro/bridge/server.rs -index 3acb239af..45d41ac02 100644 ---- a/crates/proc_macro_srv/src/proc_macro/bridge/server.rs -+++ b/crates/proc_macro_srv/src/proc_macro/bridge/server.rs -@@ -11,8 +11,6 @@ use super::client::HandleStore; - /// Declare an associated item of one of the traits below, optionally - /// adjusting it (i.e., adding bounds to types and default bodies to methods). - macro_rules! associated_item { -- (type FreeFunctions) => -- (type FreeFunctions: 'static;); - (type TokenStream) => - (type TokenStream: 'static + Clone;); - (type TokenStreamBuilder) => -diff --git a/crates/proc_macro_srv/src/proc_macro/mod.rs b/crates/proc_macro_srv/src/proc_macro/mod.rs -index fc6e7344f..ee0dc9722 100644 ---- a/crates/proc_macro_srv/src/proc_macro/mod.rs -+++ b/crates/proc_macro_srv/src/proc_macro/mod.rs -@@ -924,25 +924,3 @@ impl fmt::Debug for Literal { - self.0.fmt(f) - } - } -- --pub mod tracked_env { -- use std::env::{self, VarError}; -- use std::ffi::OsStr; -- -- /// Retrieve an environment variable and add it to build dependency info. -- /// Build system executing the compiler will know that the variable was accessed during -- /// compilation, and will be able to rerun the build when the value of that variable changes. -- /// Besides the dependency tracking this function should be equivalent to `env::var` from the -- /// standard library, except that the argument must be UTF-8. -- pub fn var<K: AsRef<OsStr> + AsRef<str>>(key: K) -> Result<String, VarError> { -- use std::ops::Deref; -- -- let key: &str = key.as_ref(); -- let value = env::var(key); -- super::bridge::client::FreeFunctions::track_env_var( -- key, -- value.as_ref().map(|t| t.deref()).ok(), -- ); -- value -- } --} -diff --git a/crates/proc_macro_srv/src/rustc_server.rs b/crates/proc_macro_srv/src/rustc_server.rs -index c5fe3591e..7d1695c86 100644 ---- a/crates/proc_macro_srv/src/rustc_server.rs -+++ b/crates/proc_macro_srv/src/rustc_server.rs -@@ -242,8 +242,6 @@ impl TokenStreamBuilder { - } - } - --pub struct FreeFunctions; -- - #[derive(Clone)] - pub struct TokenStreamIter { - trees: IntoIter<TokenTree>, -@@ -256,7 +254,6 @@ pub struct Rustc { - } - - impl server::Types for Rustc { -- type FreeFunctions = FreeFunctions; - type TokenStream = TokenStream; - type TokenStreamBuilder = TokenStreamBuilder; - type TokenStreamIter = TokenStreamIter; -@@ -270,13 +267,6 @@ impl server::Types for Rustc { - type MultiSpan = Vec<Span>; - } - --impl server::FreeFunctions for Rustc { -- fn track_env_var(&mut self, _var: &str, _value: Option<&str>) { -- // FIXME: track env var accesses -- // https://github.com/rust-lang/rust/pull/71858 -- } --} -- - impl server::TokenStream for Rustc { - fn new(&mut self) -> Self::TokenStream { - Self::TokenStream::new() -diff --git a/xtask/src/install.rs b/xtask/src/install.rs -index fcc4f05e4..d829790d7 100644 ---- a/xtask/src/install.rs -+++ b/xtask/src/install.rs -@@ -7,7 +7,7 @@ use anyhow::{bail, format_err, Context, Result}; - use crate::not_bash::{pushd, run}; - - // Latest stable, feel free to send a PR if this lags behind. --const REQUIRED_RUST_VERSION: u32 = 47; -+const REQUIRED_RUST_VERSION: u32 = 46; - - pub struct InstallCmd { - pub client: Option<ClientOpt>, diff --git a/pkgs/development/tools/rust/rust-analyzer/update.sh b/pkgs/development/tools/rust/rust-analyzer/update.sh index b0435be72083..f08ea67cf22d 100755 --- a/pkgs/development/tools/rust/rust-analyzer/update.sh +++ b/pkgs/development/tools/rust/rust-analyzer/update.sh @@ -24,24 +24,24 @@ echo "$old_rev -> $rev" sha256=$(nix-prefetch -f "$nixpkgs" rust-analyzer-unwrapped.src --rev "$rev") # Clear cargoSha256 to avoid inconsistency. -sed -e "s/rev = \".*\"/rev = \"$rev\"/" \ - -e "s/sha256 = \".*\"/sha256 = \"$sha256\"/" \ - -e "s/cargoSha256 = \".*\"/cargoSha256 = \"\"/" \ +sed -e "s#rev = \".*\"#rev = \"$rev\"#" \ + -e "s#sha256 = \".*\"#sha256 = \"$sha256\"#" \ + -e "s#cargoSha256 = \".*\"#cargoSha256 = \"\"#" \ --in-place ./default.nix node_src="$(nix-build "$nixpkgs" -A rust-analyzer.src --no-out-link)/editors/code" # Check vscode compatibility req_vscode_ver="$(jq '.engines.vscode' "$node_src/package.json" --raw-output)" req_vscode_ver="${req_vscode_ver#^}" -cur_vscode_ver="$(nix eval --raw -f "$nixpkgs" vscode.version)" -if [[ "$(nix eval "(builtins.compareVersions \"$req_vscode_ver\" \"$cur_vscode_ver\")")" -gt 0 ]]; then +cur_vscode_ver="$(nix-instantiate --eval --strict "$nixpkgs" -A vscode.version | tr -d '"')" +if [[ "$(nix-instantiate --eval --strict -E "(builtins.compareVersions \"$req_vscode_ver\" \"$cur_vscode_ver\")")" -gt 0 ]]; then echo "vscode $cur_vscode_ver is incompatible with the extension requiring ^$req_vscode_ver" exit 1 fi echo "Prebuilding for cargoSha256" cargo_sha256=$(nix-prefetch "{ sha256 }: (import $nixpkgs {}).rust-analyzer-unwrapped.cargoDeps.overrideAttrs (_: { outputHash = sha256; })") -sed "s/cargoSha256 = \".*\"/cargoSha256 = \"$cargo_sha256\"/" \ +sed "s#cargoSha256 = \".*\"#cargoSha256 = \"$cargo_sha256\"#" \ --in-place ./default.nix # Update vscode extension diff --git a/pkgs/development/tools/rust/rust-analyzer/wrapper.nix b/pkgs/development/tools/rust/rust-analyzer/wrapper.nix index 8ca3ff1a6d20..bed206281826 100644 --- a/pkgs/development/tools/rust/rust-analyzer/wrapper.nix +++ b/pkgs/development/tools/rust/rust-analyzer/wrapper.nix @@ -4,7 +4,8 @@ lib.makeOverridable ({ unwrapped, pname ? "rust-analyzer", version ? unwrapped.version, - rustcSrc ? rustPlatform.rustcSrc, + # Use name from `RUST_SRC_PATH` + rustSrc ? rustPlatform.rustLibSrc, }: runCommandNoCC "${pname}-${version}" { inherit pname version; inherit (unwrapped) src meta; @@ -12,5 +13,5 @@ lib.makeOverridable ({ } '' mkdir -p $out/bin makeWrapper ${unwrapped}/bin/rust-analyzer $out/bin/rust-analyzer \ - --set-default RUST_SRC_PATH "${rustcSrc}" + --set-default RUST_SRC_PATH "${rustSrc}" '') |