lol

rust: update cargo builder to fetch registry dynamically

The biggest benefit is that we no longer have to update the registry
package. This means that just about any cargo package can be built by
nix. No longer does `cargo update` need to be feared because it will
update to packages newer then what is available in nixpkgs.

Instead of fetching the cargo registry this bundles all the source code
into a "vendor/" folder.

This also uses the new --frozen and --locked flags which is nice.

Currently cargo-vendor only provides binaries for Linux and
macOS 64-bit. This can be solved by building it for the other
architectures and uploading it somewhere (like the NixOS cache).

This also has the downside that it requires a change to everyone's deps
hash. And if the old one is used because it was cached it will fail to
build as it will attempt to use the old version. For this reason the
attribute has been renamed to `cargoSha256`.

Authors:
* Kevin Cox <kevincox@kevincox.ca>
* Jörg Thalheim <Mic92@users.noreply.github.com>
* zimbatm <zimbatm@zimbatm.com>

authored by

Kevin Cox and committed by zimbatm.tngl.sh 5f8cf004 d170c2ce

+200 -433
+10 -11
doc/languages-frameworks/rust.md
··· 9 To install the rust compiler and cargo put 10 11 ``` 12 - rustStable.rustc 13 - rustStable.cargo 14 ``` 15 16 - into the `environment.systemPackages` or bring them into scope with 17 - `nix-shell -p rustStable.rustc -p rustStable.cargo`. 18 19 - There are also `rustBeta` and `rustNightly` package sets available. 20 - These are not updated very regularly. For daily builds use either rustup from 21 - nixpkgs or use the [Rust nightlies overlay](#using-the-rust-nightlies-overlay). 22 23 ## Packaging Rust applications 24 ··· 38 sha256 = "0y5d1n6hkw85jb3rblcxqas2fp82h3nghssa4xqrhqnz25l799pj"; 39 }; 40 41 - depsSha256 = "0q68qyl2h6i0qsz82z840myxlnjay8p1w5z7hfyr8fqp7wgwa9cx"; 42 43 meta = with stdenv.lib; { 44 description = "A utility that combines the usability of The Silver Searcher with the raw speed of grep"; ··· 50 } 51 ``` 52 53 - `buildRustPackage` requires a `depsSha256` attribute which is computed over 54 all crate sources of this package. Currently it is obtained by inserting a 55 fake checksum into the expression and building the package once. The correct 56 checksum can be then take from the failed build. ··· 76 77 The latest version can be installed with the following command: 78 79 - $ nix-env -Ai nixos.rustChannels.stable.rust 80 81 Or using the attribute with nix-shell: 82 83 - $ nix-shell -p nixos.rustChannels.stable.rust 84 85 To install the beta or nightly channel, "stable" should be substituted by 86 "nightly" or "beta", or
··· 9 To install the rust compiler and cargo put 10 11 ``` 12 + rust 13 ``` 14 15 + into the `environment.systemPackages` or bring them into 16 + scope with `nix-shell -p rust`. 17 18 + For daily builds (beta and nightly) use either rustup from 19 + nixpkgs or use the [Rust nightlies 20 + overlay](#using-the-rust-nightlies-overlay). 21 22 ## Packaging Rust applications 23 ··· 37 sha256 = "0y5d1n6hkw85jb3rblcxqas2fp82h3nghssa4xqrhqnz25l799pj"; 38 }; 39 40 + cargoSha256 = "0q68qyl2h6i0qsz82z840myxlnjay8p1w5z7hfyr8fqp7wgwa9cx"; 41 42 meta = with stdenv.lib; { 43 description = "A utility that combines the usability of The Silver Searcher with the raw speed of grep"; ··· 49 } 50 ``` 51 52 + `buildRustPackage` requires a `cargoSha256` attribute which is computed over 53 all crate sources of this package. Currently it is obtained by inserting a 54 fake checksum into the expression and building the package once. The correct 55 checksum can be then take from the failed build. ··· 75 76 The latest version can be installed with the following command: 77 78 + $ nix-env -Ai nixos.latest.rustChannels.stable.rust 79 80 Or using the attribute with nix-shell: 81 82 + $ nix-shell -p nixos.latest.rustChannels.stable.rust 83 84 To install the beta or nightly channel, "stable" should be substituted by 85 "nightly" or "beta", or
+1 -1
pkgs/applications/altcoins/ethabi.nix
··· 13 sha256 = "1rg7ydvnhlg8w6blilm3cv6v4q51x1hgrbkln2ikhpdq0vakp5fd"; 14 }; 15 16 - depsSha256 = "1n4rxipna307r4xppb2iaads7kpa3yjv99fimvpn8l0f999ir2rz"; 17 18 cargoBuildFlags = ["--features cli"]; 19
··· 13 sha256 = "1rg7ydvnhlg8w6blilm3cv6v4q51x1hgrbkln2ikhpdq0vakp5fd"; 14 }; 15 16 + cargoSha256 = "0i9617qwc6d4jvlbydwk03rcsnyvxzpbn2ms10ds4r6x7jy2a4sy"; 17 18 cargoBuildFlags = ["--features cli"]; 19
+2 -1
pkgs/applications/altcoins/ethrun.nix
··· 13 sha256 = "1w651g4p2mc4ljp20l8lwvfx3l3fzyp6gf2izr85vyb1wjbaccqn"; 14 }; 15 16 - depsSha256 = "14x8pbjgkz0g724lnvd9mi2alqd6fipjljw6xsraf9gqwijn1knq"; 17 18 meta = { 19 description = "Directly run Ethereum bytecode"; 20 homepage = https://github.com/dapphub/ethrun/; 21 maintainers = [stdenv.lib.maintainers.dbrock]; 22 inherit version; 23 }; 24 }
··· 13 sha256 = "1w651g4p2mc4ljp20l8lwvfx3l3fzyp6gf2izr85vyb1wjbaccqn"; 14 }; 15 16 + cargoSha256 = "14x8pbjgkz0g724lnvd9mi2alqd6fipjljw6xsraf9gqwijn1kn0"; 17 18 meta = { 19 description = "Directly run Ethereum bytecode"; 20 homepage = https://github.com/dapphub/ethrun/; 21 maintainers = [stdenv.lib.maintainers.dbrock]; 22 + broken = true; # mark temporary as broken 23 inherit version; 24 }; 25 }
+1 -1
pkgs/applications/altcoins/zcash/librustzcash/default.nix
··· 11 sha256 = "02l1f46frpvw1r6k1wfh77mrsnmsdvifqx0vnscxz4xgb9ia9d1c"; 12 }; 13 14 - depsSha256 = "02qx8zdhmj7rmhqqq5q9428x9mlrjxxcnn4yhnygz9gfgvada2hx"; 15 16 installPhase = '' 17 mkdir -p $out/lib
··· 11 sha256 = "02l1f46frpvw1r6k1wfh77mrsnmsdvifqx0vnscxz4xgb9ia9d1c"; 12 }; 13 14 + cargoSha256 = "1b0kal53ggcr59hbrsdj8fifjycahrmzwq677n9h3fywv4r237m6"; 15 16 installPhase = '' 17 mkdir -p $out/lib
+2 -1
pkgs/applications/misc/alacritty/default.nix
··· 38 sha256 = "0h37x12r33xwz9vf1n8y24c0ph5w17lhkpfi5q6lbpgidvbs6fyx"; 39 }; 40 41 - depsSha256 = "05gkl2zg546i2pm0gx11s56f7dk72qpm39kml1d2myj81s0vyb5z"; 42 43 buildInputs = [ 44 cmake ··· 69 dontPatchELF = true; 70 71 meta = with stdenv.lib; { 72 description = "GPU-accelerated terminal emulator"; 73 homepage = https://github.com/jwilm/alacritty; 74 license = with licenses; [ asl20 ];
··· 38 sha256 = "0h37x12r33xwz9vf1n8y24c0ph5w17lhkpfi5q6lbpgidvbs6fyx"; 39 }; 40 41 + cargoSha256 = "0w3j92kd27pny37pfvlv6qsnbb1lgphmfbhvvng0z96r2b1wjviz"; 42 43 buildInputs = [ 44 cmake ··· 69 dontPatchELF = true; 70 71 meta = with stdenv.lib; { 72 + broken = true; 73 description = "GPU-accelerated terminal emulator"; 74 homepage = https://github.com/jwilm/alacritty; 75 license = with licenses; [ asl20 ];
+2 -1
pkgs/applications/networking/cluster/habitat/default.nix
··· 14 sha256 = "0pqrm85pd9hqn5fwqjbyyrrfh4k7q9mi9qy9hm8yigk5l8mw44y1"; 15 }; 16 17 - depsSha256 = "1ahfm5agvabqqqgjsyjb95xxbc7mng1mdyclcakwp1m1qdkxx9py"; 18 19 buildInputs = [ libsodium libarchive openssl ]; 20 ··· 35 license = licenses.asl20; 36 maintainers = [ maintainers.rushmorem ]; 37 platforms = [ "x86_64-linux" "x86_64-darwin" ]; 38 }; 39 }
··· 14 sha256 = "0pqrm85pd9hqn5fwqjbyyrrfh4k7q9mi9qy9hm8yigk5l8mw44y1"; 15 }; 16 17 + cargoSha256 = "1ahfm5agvabqqqgjsyjb95xxbc7mng1mdyclcakwp1m1qdkxx9p0"; 18 19 buildInputs = [ libsodium libarchive openssl ]; 20 ··· 35 license = licenses.asl20; 36 maintainers = [ maintainers.rushmorem ]; 37 platforms = [ "x86_64-linux" "x86_64-darwin" ]; 38 + broken = true; # mark temporary as broken due git dependencies 39 }; 40 }
+1 -1
pkgs/applications/networking/dyndns/cfdyndns/default.nix
··· 12 sha256 = "1mcdjykrgh0jq6k6y664lai8sbgzk6j7k0r944f43vg63d1jql5b"; 13 }; 14 15 - depsSha256 = "0whs3fgmpb6g1mjajs3qs9g613x5dal4x6ghzzkpl73a9pgydkpn"; 16 17 buildInputs = [ makeWrapper openssl ]; 18
··· 12 sha256 = "1mcdjykrgh0jq6k6y664lai8sbgzk6j7k0r944f43vg63d1jql5b"; 13 }; 14 15 + cargoSha256 = "0k9d6pxsb4gvkqs00g71c1nnz773iccg4vajgn33qdym6m6qsjwy"; 16 17 buildInputs = [ makeWrapper openssl ]; 18
+1 -1
pkgs/applications/version-management/git-and-tools/git-dit/default.nix
··· 23 sha256 = "1sx6sc2dj3l61gbiqz8vfyhw5w4xjdyfzn1ixz0y8ipm579yc7a2"; 24 }; 25 26 - depsSha256 = "1z2n3z5wkh5z5vc976yscq77fgjszwzwlrp7g17hmsbhzx6x170h"; 27 28 nativeBuildInputs = [ 29 cmake
··· 23 sha256 = "1sx6sc2dj3l61gbiqz8vfyhw5w4xjdyfzn1ixz0y8ipm579yc7a2"; 24 }; 25 26 + cargoSha256 = "08zbvjwjdpv2sbj6mh73py82inhs18jvmh8m9k4l94fcz6ykgqwr"; 27 28 nativeBuildInputs = [ 29 cmake
+1 -1
pkgs/applications/version-management/pijul/default.nix
··· 18 19 doCheck = false; 20 21 - depsSha256 = "1qzzpnkyw1bn5fnj06c80f7985v1q0rqcphrrrkpbi33lg5mzgbv"; 22 23 meta = with stdenv.lib; { 24 description = "A distributed version control system";
··· 18 19 doCheck = false; 20 21 + cargoSha256 = "0r69vghjd6b30v0qjsipyv56n92iwvyxmllrnwjzjf5pzhhjl7sy"; 22 23 meta = with stdenv.lib; { 24 description = "A distributed version control system";
+2 -1
pkgs/applications/window-managers/way-cooler/default.nix
··· 14 sha256 = "10s01x54kwjm2c85v57i6g3pvj5w3wpkjblj036mmd865fla1brb"; 15 }; 16 17 - depsSha256 = "1k5xbw2zhm5z650mxdbxixr90im53wlpjdvq2pbnx2snqm84idlc"; 18 19 buildInputs = [ wlc dbus_libs dbus_glib cairo libxkbcommon ]; 20 21 nativeBuildInputs = [ pkgconfig ]; 22 23 meta = with stdenv.lib; { 24 description = "Customizable Wayland compositor (window manager)"; 25 longDescription = '' 26 Way Cooler is a customizable tiling window manager written in Rust
··· 14 sha256 = "10s01x54kwjm2c85v57i6g3pvj5w3wpkjblj036mmd865fla1brb"; 15 }; 16 17 + cargoSha256 = "06qivlybmmc49ksv4232sm1r4hp923xsq4c2ksa4i2azdzc1csdc"; 18 19 buildInputs = [ wlc dbus_libs dbus_glib cairo libxkbcommon ]; 20 21 nativeBuildInputs = [ pkgconfig ]; 22 23 meta = with stdenv.lib; { 24 + broken = true; 25 description = "Customizable Wayland compositor (window manager)"; 26 longDescription = '' 27 Way Cooler is a customizable tiling window manager written in Rust
+2 -1
pkgs/applications/window-managers/wtftw/default.nix
··· 9 sha256 = "1r74nhcwiy2rmifzjhdal3jcqz4jz48nfvhdyw4gasa6nxp3msdl"; 10 }; 11 12 - depsSha256 = "0z7h8ybh2db3xl8qxbzby5lncdaijixzmbn1j8a45lbky1xiix71"; 13 14 nativeBuildInputs = [ pkgconfig ]; 15 buildInputs = [ libXinerama libX11 ]; ··· 31 ''; 32 33 meta = with stdenv.lib; { 34 description = "A tiling window manager in Rust"; 35 homepage = https://github.com/Kintaro/wtftw; 36 license = stdenv.lib.licenses.bsd3;
··· 9 sha256 = "1r74nhcwiy2rmifzjhdal3jcqz4jz48nfvhdyw4gasa6nxp3msdl"; 10 }; 11 12 + cargoSha256 = "0z92ml84b5652zgwzn08a8vvxksaa54jql66sfpdz1mvjwhgdmvn"; 13 14 nativeBuildInputs = [ pkgconfig ]; 15 buildInputs = [ libXinerama libX11 ]; ··· 31 ''; 32 33 meta = with stdenv.lib; { 34 + broken = true; 35 description = "A tiling window manager in Rust"; 36 homepage = https://github.com/Kintaro/wtftw; 37 license = stdenv.lib.licenses.bsd3;
+32
pkgs/build-support/rust/cargo-vendor.nix
···
··· 1 + { fetchurl, stdenv }: 2 + let 3 + inherit (stdenv) system; 4 + 5 + version = "0.1.12"; 6 + 7 + hashes = { 8 + x86_64-linux = "1hxlavcxy374yypfamlkygjg662lhll8j434qcvdawkvlidg5ii5"; 9 + x86_64-darwin = "1jkvhh710gwjnnjx59kaplx2ncfvkx9agfa76rr94sbjqq4igddm"; 10 + }; 11 + hash = hashes. ${system} or (throw "missing bootstrap hash for platform ${system}"); 12 + 13 + platforms = { 14 + x86_64-linux = "x86_64-unknown-linux-musl"; 15 + x86_64-darwin = "x86_64-apple-darwin"; 16 + }; 17 + platform = platforms . ${system}; 18 + 19 + in stdenv.mkDerivation { 20 + name = "cargo-vendor-${version}"; 21 + 22 + src = fetchurl { 23 + url = "https://github.com/alexcrichton/cargo-vendor/releases/download/${version}/cargo-vendor-${version}-${platform}.tar.gz"; 24 + sha256 = hash; 25 + }; 26 + 27 + phases = "unpackPhase installPhase"; 28 + 29 + installPhase = '' 30 + install -Dm755 cargo-vendor $out/bin/cargo-vendor 31 + ''; 32 + }
+22 -67
pkgs/build-support/rust/default.nix
··· 1 - { stdenv, callPackage, path, cacert, git, rust, rustRegistry }: 2 - 3 let 4 - rustRegistry' = rustRegistry; 5 in 6 - { name, depsSha256 7 - , rustRegistry ? rustRegistry' 8 , src ? null 9 , srcs ? null 10 , sourceRoot ? null ··· 18 let 19 lib = stdenv.lib; 20 21 - fetchDeps = import ./fetchcargo.nix { 22 - inherit stdenv cacert git rust rustRegistry; 23 - }; 24 - 25 - cargoDeps = fetchDeps { 26 inherit name src srcs sourceRoot cargoUpdateHook; 27 - sha256 = depsSha256; 28 }; 29 30 in stdenv.mkDerivation (args // { 31 - inherit cargoDeps rustRegistry; 32 33 patchRegistryDeps = ./patch-registry-deps; 34 ··· 43 postUnpack = '' 44 eval "$cargoDepsHook" 45 46 - echo "Using cargo deps from $cargoDeps" 47 - 48 - cp -a "$cargoDeps" deps 49 - chmod +w deps -R 50 - 51 - # It's OK to use /dev/null as the URL because by the time we do this, cargo 52 - # won't attempt to update the registry anymore, so the URL is more or less 53 - # irrelevant 54 55 - cat <<EOF > deps/config 56 - [registry] 57 - index = "file:///dev/null" 58 EOF 59 60 - export CARGO_HOME="$(realpath deps)" 61 export RUST_LOG=${logLevel} 62 export SSL_CERT_FILE=${cacert}/etc/ssl/certs/ca-bundle.crt 63 - 64 - # Let's find out which $indexHash cargo uses for file:///dev/null 65 - (cd $sourceRoot && cargo fetch &>/dev/null) || true 66 - cd deps 67 - indexHash="$(basename $(echo registry/index/*))" 68 - 69 - echo "Using indexHash '$indexHash'" 70 - 71 - rm -rf -- "registry/cache/$indexHash" \ 72 - "registry/index/$indexHash" 73 - 74 - mv registry/cache/HASH "registry/cache/$indexHash" 75 - 76 - echo "Using rust registry from $rustRegistry" 77 - ln -s "$rustRegistry" "registry/index/$indexHash" 78 - 79 - # Retrieved the Cargo.lock file which we saved during the fetch 80 - cd .. 81 - mv deps/Cargo.lock $sourceRoot/ 82 - 83 - ( 84 - cd $sourceRoot 85 - 86 - cargo fetch 87 - cargo clean 88 - ) 89 '' + (args.postUnpack or ""); 90 91 - prePatch = '' 92 - # Patch registry dependencies, using the scripts in $patchRegistryDeps 93 - ( 94 - set -euo pipefail 95 - 96 - cd $NIX_BUILD_TOP/deps/registry/src/* 97 - 98 - for script in $patchRegistryDeps/*; do 99 - # Run in a subshell so that directory changes and shell options don't 100 - # affect any following commands 101 - 102 - ( . $script) 103 - done 104 - ) 105 - '' + (args.prePatch or ""); 106 - 107 buildPhase = with builtins; args.buildPhase or '' 108 runHook preBuild 109 echo "Running cargo build --release ${concatStringsSep " " cargoBuildFlags}" 110 - cargo build --release ${concatStringsSep " " cargoBuildFlags} 111 runHook postBuild 112 ''; 113 ··· 126 find target/release -maxdepth 1 -executable -exec cp "{}" $out/bin \; 127 runHook postInstall 128 ''; 129 })
··· 1 + { fetchurl, stdenv, path, cacert, git, rust }: 2 let 3 + cargoVendor = import ./cargo-vendor.nix { 4 + inherit fetchurl stdenv; 5 + }; 6 + 7 + fetchcargo = import ./fetchcargo.nix { 8 + inherit stdenv cacert git rust cargoVendor; 9 + }; 10 in 11 + { name, cargoSha256 12 , src ? null 13 , srcs ? null 14 , sourceRoot ? null ··· 22 let 23 lib = stdenv.lib; 24 25 + cargoDeps = fetchcargo { 26 inherit name src srcs sourceRoot cargoUpdateHook; 27 + sha256 = cargoSha256; 28 }; 29 30 in stdenv.mkDerivation (args // { 31 + inherit cargoDeps; 32 33 patchRegistryDeps = ./patch-registry-deps; 34 ··· 43 postUnpack = '' 44 eval "$cargoDepsHook" 45 46 + mkdir .cargo 47 + cat >.cargo/config <<-EOF 48 + [source.crates-io] 49 + registry = 'https://github.com/rust-lang/crates.io-index' 50 + replace-with = 'vendored-sources' 51 52 + [source.vendored-sources] 53 + directory = '$cargoDeps' 54 EOF 55 56 export RUST_LOG=${logLevel} 57 export SSL_CERT_FILE=${cacert}/etc/ssl/certs/ca-bundle.crt 58 '' + (args.postUnpack or ""); 59 60 buildPhase = with builtins; args.buildPhase or '' 61 runHook preBuild 62 echo "Running cargo build --release ${concatStringsSep " " cargoBuildFlags}" 63 + cargo build --release --frozen ${concatStringsSep " " cargoBuildFlags} 64 runHook postBuild 65 ''; 66 ··· 79 find target/release -maxdepth 1 -executable -exec cp "{}" $out/bin \; 80 runHook postInstall 81 ''; 82 + 83 + passthru = { inherit cargoDeps; }; 84 })
-209
pkgs/build-support/rust/fetch-cargo-deps
··· 1 - # copied from libgit2 source code 'repo-template.h' 2 - makeGitTemplate() { 3 - local target="$1" 4 - mkdir -p -m777 "$target/info" "$target/pack" "$target/objects" "$target/refs" 5 - mkdir -p -m777 "$target/refs/heads" "$target/refs/tags" "$target/objects/info" "$target/objects/pack" 6 - cat <<'EOF' > "$target/description" 7 - Unnamed repository; edit this file 'description' to name the repository. 8 - EOF 9 - chmod 666 "$target/description" 10 - cat <<'EOF' > "$target/info/exclude" 11 - # File patterns to ignore; see `git help ignore` for more information. 12 - # Lines that start with '#' are comments. 13 - EOF 14 - } 15 - 16 - fetchCargoDeps() { 17 - src=$(realpath $1) 18 - out=$(realpath $2) 19 - 20 - echo "Fetching $src to $out" 21 - 22 - mkdir $out 23 - 24 - # Configure git template dir to make libgit2 more deterministic 25 - # 26 - # Without a template dir, libgit2 defaults to /usr/share/git-core/templates, 27 - # which can vary between systems if sandboxed builds aren't used. 28 - # 29 - # Note: we explictly set --tmpdir for mktemp here to make it more friendly 30 - # for nix-shell users, where $TMPDIR is not necessarily set to NIX_BUILD_TOP 31 - echo "Setting up git templatedir" 32 - export GIT_TEMPLATE_DIR="$(mktemp -d --tmpdir=$NIX_BUILD_TOP git-template.XXX)" 33 - makeGitTemplate "$GIT_TEMPLATE_DIR" 34 - export XDG_CONFIG_HOME="$(mktemp -d --tmpdir=$NIX_BUILD_TOP home.XXX)" 35 - mkdir -p $XDG_CONFIG_HOME/git 36 - cat <<EOF > $XDG_CONFIG_HOME/git/config 37 - [init] 38 - templatedir = $GIT_TEMPLATE_DIR 39 - EOF 40 - 41 - # Configure cargo to fetch from a local copy of the crates.io registry 42 - 43 - echo "Using rust registry from $rustRegistry" 44 - 45 - cat <<EOF > $out/config 46 - [registry] 47 - index = "file://$rustRegistry" 48 - EOF 49 - 50 - export CARGO_HOME=$out 51 - cd $src 52 - 53 - if [[ ! -f Cargo.lock ]]; then 54 - echo 55 - echo "ERROR: The Cargo.lock file doesn't exist" 56 - echo 57 - echo "Cargo.lock is needed to make sure that depsSha256 doesn't change" 58 - echo "when the registry is updated." 59 - echo 60 - 61 - exit 1 62 - fi 63 - 64 - # We need to do the following string replacement so that 'cargo fetch' 65 - # doesn't ignore the versions specified in Cargo.lock 66 - substituteInPlace Cargo.lock \ 67 - --replace "registry+https://github.com/rust-lang/crates.io-index" \ 68 - "registry+file://$rustRegistry" 69 - 70 - # Do any possible 'cargo update -p <pkgName> --precise <version>' ad-hoc updates 71 - eval "$cargoUpdateHook" 72 - 73 - # Do the fetch 74 - cargo fetch --verbose 75 - 76 - # Now that we have fetched everything, let's make the output deterministic 77 - 78 - # Cargo uses the following directory structure for fetched data, where 79 - # $indexHash is a hash of the registry index URL: 80 - # 81 - # 82 - # /config: 83 - # 84 - # Cargo config file. We'll delete this because it's not deterministic, 85 - # and instead recreate it just before running 'cargo build'. 86 - # 87 - # /registry/cache/$indexHash/: 88 - # 89 - # This is where tarballs of registry package dependencies are kept 90 - # We'll need to keep this, but make sure $indexHash is a fixed name. 91 - # 92 - # /registry/index/$indexHash/: 93 - # 94 - # A copy of the registry index is kept here. We can delete this, and 95 - # instead, just before running 'cargo build', we'll symlink this 96 - # directory to our static copy of the registry in the Nix store. 97 - # 98 - # /registry/src/$indexHash/{pkgName-pkgVersion}/: 99 - # 100 - # Here cargo keeps extracted sources of the cached tarballs. 101 - # We'll just delete this because cargo will re-populate them from the 102 - # tarballs. 103 - # 104 - # /git/db/{domain-hash}/: 105 - # 106 - # Here cargo keeps the `.git` directories of git dependencies. 107 - # We'll need to keep these, but make them deterministic. 108 - # 109 - # /git/checkouts/{domain-hash}/{branchName}/: 110 - # 111 - # Here cargo keeps checked-out sources of the git dependencies. 112 - # We can delete this, because cargo will re-populate them from the above 113 - # `.git` directories. 114 - # 115 - # Let's start 116 - 117 - # Remove cargo config file, which points to the ever-changing registry 118 - rm $out/config 119 - 120 - # Save the Cargo.lock file into the output, so that we don't have to do another 121 - # 'cargo update' during the build (which would try to access the network) for 122 - # any ad-hoc package updates (through $cargoUpdateHook). 123 - # 124 - # We need to replace the rustRegistry URL with something deterministic. 125 - # Since the URL won't actually be accessed anymore, it's fine to use /dev/null. 126 - 127 - substituteInPlace Cargo.lock \ 128 - --replace "registry+file://$rustRegistry" \ 129 - "registry+file:///dev/null" 130 - mv Cargo.lock $out/ 131 - 132 - 133 - # Let's replace $indexHash with something more deterministic 134 - mv $out/registry/cache/* $out/registry/cache/HASH 135 - 136 - # The registry index changes all the time, so it's not deterministic 137 - # We'll symlink it before running 'cargo build' 138 - rm -rf $out/registry/index/* 139 - 140 - # Make git DBs deterministic 141 - # TODO: test with git submodules 142 - [[ ! -d $out/git/checkouts ]] || (cd $out/git/checkouts && for name in *; do 143 - revs="" 144 - cd "$out/git/checkouts/$name" 145 - while read dir; do 146 - # extract substring: [dir = "./xxx/yyy/.git"] => [branch = "xxx/yyy"] 147 - branch="${dir:2:$((${#dir}-7))}" 148 - 149 - cd "$out/git/checkouts/$name/$branch" 150 - rev="$(git rev-parse HEAD)" 151 - revs="$rev $revs" 152 - done < <(find . -type d -name .git -print) 153 - 154 - echo "List of revs to keep for git db $name: $revs" 155 - 156 - ( 157 - # The following code was adapted from nix-prefetch-git 158 - 159 - cd "$out/git/db/$name" 160 - 161 - export GIT_DIR=. 162 - 163 - # Remove all remote branches 164 - git branch -r | while read branch; do 165 - git branch -rD "$branch" >&2 166 - done 167 - 168 - # Remove all tags 169 - git tag | while read tag; do 170 - git tag -d "$tag" >&2 171 - done 172 - 173 - # Remove all local branches 174 - branchrefs=() 175 - eval "$(git for-each-ref --shell --format='branchrefs+=(%(refname))' refs/heads/)" 176 - 177 - for branchref in "${branchrefs[@]}"; do 178 - git update-ref -d "$branchref" >&2 179 - done 180 - 181 - # Create ad-hoc branches for the revs we need 182 - echo "$revs" | while read -d " " rev; do 183 - echo "Creating git branch b_$rev $rev" 184 - git branch b_$rev $rev 185 - done 186 - 187 - # Remove files that have timestamps or otherwise have non-deterministic 188 - # properties. 189 - rm -rf logs/ hooks/ index FETCH_HEAD ORIG_HEAD refs/remotes/origin/HEAD config 190 - 191 - # Do a full repack. Must run single-threaded, or else we lose determinism. 192 - git config pack.threads 1 193 - git repack -A -d -f 194 - rm -f config 195 - 196 - # Garbage collect unreferenced objects. 197 - git gc --prune=all 198 - ) 199 - done) 200 - 201 - # Remove unneeded outputs 202 - [[ ! -d $out/registry/src ]] || rm -rf $out/registry/src 203 - [[ ! -d $out/git/checkouts ]] || rm -rf $out/git/checkouts 204 - 205 - # XXX: provide some debugging output to see find out why we are seeing 206 - # sporadic hash mismatches 207 - find $out ! -type f 208 - find $out -type f -exec sha256sum {} + 209 - }
···
+18 -7
pkgs/build-support/rust/fetchcargo.nix
··· 1 - { stdenv, cacert, git, rust, rustRegistry }: 2 { name ? "cargo-deps", src, srcs, sourceRoot, sha256, cargoUpdateHook ? "" }: 3 - 4 stdenv.mkDerivation { 5 - name = "${name}-fetch"; 6 - buildInputs = [ rust.cargo rust.rustc git ]; 7 - inherit src srcs sourceRoot rustRegistry cargoUpdateHook; 8 9 phases = "unpackPhase installPhase"; 10 11 installPhase = '' 12 - source ${./fetch-cargo-deps} 13 14 export SSL_CERT_FILE=${cacert}/etc/ssl/certs/ca-bundle.crt 15 16 - fetchCargoDeps . "$out" 17 ''; 18 19 outputHashAlgo = "sha256";
··· 1 + { stdenv, cacert, git, rust, cargoVendor }: 2 { name ? "cargo-deps", src, srcs, sourceRoot, sha256, cargoUpdateHook ? "" }: 3 stdenv.mkDerivation { 4 + name = "${name}-vendor"; 5 + buildInputs = [ cacert cargoVendor git rust.cargo ]; 6 + inherit src srcs sourceRoot; 7 8 phases = "unpackPhase installPhase"; 9 10 installPhase = '' 11 + if [[ ! -f Cargo.lock ]]; then 12 + echo 13 + echo "ERROR: The Cargo.lock file doesn't exist" 14 + echo 15 + echo "Cargo.lock is needed to make sure that cargoSha256 doesn't change" 16 + echo "when the registry is updated." 17 + echo 18 + 19 + exit 1 20 + fi 21 22 export SSL_CERT_FILE=${cacert}/etc/ssl/certs/ca-bundle.crt 23 + export CARGO_HOME=$(mktemp -d cargo-home.XXX) 24 25 + cargo vendor 26 + 27 + cp -ar vendor $out 28 ''; 29 30 outputHashAlgo = "sha256";
+2 -2
pkgs/development/compilers/rust/cargo.nix
··· 1 { stdenv, fetchFromGitHub, file, curl, pkgconfig, python, openssl, cmake, zlib 2 , makeWrapper, libiconv, cacert, rustPlatform, rustc, libgit2 3 - , version, srcSha, depsSha256 4 , patches ? []}: 5 6 rustPlatform.buildRustPackage rec { ··· 14 sha256 = srcSha; 15 }; 16 17 - inherit depsSha256; 18 inherit patches; 19 20 passthru.rustc = rustc;
··· 1 { stdenv, fetchFromGitHub, file, curl, pkgconfig, python, openssl, cmake, zlib 2 , makeWrapper, libiconv, cacert, rustPlatform, rustc, libgit2 3 + , version, srcSha, cargoSha256 4 , patches ? []}: 5 6 rustPlatform.buildRustPackage rec { ··· 14 sha256 = srcSha; 15 }; 16 17 + inherit cargoSha256; 18 inherit patches; 19 20 passthru.rustc = rustc;
+2 -2
pkgs/development/compilers/rust/default.nix
··· 22 }; 23 24 patches = [ 25 - ./patches/darwin-disable-fragile-tcp-tests.patch 26 ] ++ stdenv.lib.optional stdenv.needsPax ./patches/grsec.patch; 27 28 }; ··· 30 cargo = callPackage ./cargo.nix rec { 31 version = "0.21.1"; 32 srcSha = "1nz7sz7rzc6i1c0nzf6kmnmaq1l3hgrg19s589q7k309r6m7p7f7"; 33 - depsSha256 = "0pzfn1zjgklr0fw9zi9sxrwr08q3wcvdl9ybxrk3ld7ps5h9wmsi"; 34 35 inherit rustc; # the rustc that will be wrapped by cargo 36 inherit rustPlatform; # used to build cargo
··· 22 }; 23 24 patches = [ 25 + ./patches/0001-Disable-fragile-tests-libstd-net-tcp-on-Darwin-Linux.patch 26 ] ++ stdenv.lib.optional stdenv.needsPax ./patches/grsec.patch; 27 28 }; ··· 30 cargo = callPackage ./cargo.nix rec { 31 version = "0.21.1"; 32 srcSha = "1nz7sz7rzc6i1c0nzf6kmnmaq1l3hgrg19s589q7k309r6m7p7f7"; 33 + cargoSha256 = "02gdh71jkhmr17q5gam079ig5dvpw1fms3v6k5h2bg3fclw7kkrs"; 34 35 inherit rustc; # the rustc that will be wrapped by cargo 36 inherit rustPlatform; # used to build cargo
+53
pkgs/development/compilers/rust/patches/0001-Disable-fragile-tests-libstd-net-tcp-on-Darwin-Linux.patch
···
··· 1 + From 26d3b70abec1adf773522643b31ce9c03439916a Mon Sep 17 00:00:00 2001 2 + From: Joerg Thalheim <joerg@thalheim.io> 3 + Date: Tue, 10 Oct 2017 00:40:20 +0100 4 + Subject: [PATCH] Disable fragile tests libstd::net::tcp on Darwin/Linux 5 + 6 + Signed-off-by: Joerg Thalheim <joerg@thalheim.io> 7 + --- 8 + src/libstd/net/tcp.rs | 8 +++++++- 9 + 1 file changed, 7 insertions(+), 1 deletion(-) 10 + 11 + diff --git a/src/libstd/net/tcp.rs b/src/libstd/net/tcp.rs 12 + index 8d1e7882e5..2c223fb315 100644 13 + --- a/src/libstd/net/tcp.rs 14 + +++ b/src/libstd/net/tcp.rs 15 + @@ -949,6 +949,7 @@ mod tests { 16 + }) 17 + } 18 + 19 + + #[cfg_attr(target_os = "macos", ignore)] 20 + #[test] 21 + fn write_close() { 22 + each_ip(&mut |addr| { 23 + @@ -1421,7 +1422,10 @@ mod tests { 24 + 25 + // FIXME: re-enabled bitrig/openbsd tests once their socket timeout code 26 + // no longer has rounding errors. 27 + - #[cfg_attr(any(target_os = "bitrig", target_os = "netbsd", target_os = "openbsd"), ignore)] 28 + + #[cfg_attr(any(target_os = "bitrig", 29 + + target_os = "netbsd", 30 + + target_os = "openbsd", 31 + + target_os = "macos"), ignore)] 32 + #[test] 33 + fn timeouts() { 34 + let addr = next_test_ip4(); 35 + @@ -1500,6 +1504,7 @@ mod tests { 36 + assert_eq!(false, t!(stream.nodelay())); 37 + } 38 + 39 + + #[cfg_attr(target_os = "macos", ignore)] 40 + #[test] 41 + fn ttl() { 42 + let ttl = 100; 43 + @@ -1568,6 +1573,7 @@ mod tests { 44 + }) 45 + } 46 + 47 + + #[cfg_attr(target_os = "linux", ignore)] 48 + #[test] 49 + fn connect_timeout_unroutable() { 50 + // this IP is unroutable, so connections should always time out, 51 + -- 52 + 2.14.2 53 +
-44
pkgs/development/compilers/rust/patches/darwin-disable-fragile-tcp-tests.patch
··· 1 - From 1d8a91d5b09cb762fe890d04bfb61b9eefd0624a Mon Sep 17 00:00:00 2001 2 - From: Moritz Ulrich <moritz@tarn-vedra.de> 3 - Date: Sun, 8 Jan 2017 10:28:17 +0100 4 - Subject: [PATCH] Disable libstd::net::tcp::{ttl, timeouts} on Darwin 5 - 6 - --- 7 - src/libstd/net/tcp.rs | 7 ++++++- 8 - 1 file changed, 6 insertions(+), 1 deletion(-) 9 - 10 - diff --git a/src/libstd/net/tcp.rs b/src/libstd/net/tcp.rs 11 - index 0e7c5b0671..d42fd26267 100644 12 - --- a/src/libstd/net/tcp.rs 13 - +++ b/src/libstd/net/tcp.rs 14 - @@ -551,6 +551,7 @@ mod tests { 15 - }) 16 - } 17 - 18 - + #[cfg_attr(target_os = "macos", ignore)] 19 - #[test] 20 - fn write_close() { 21 - each_ip(&mut |addr| { 22 - @@ -1022,7 +1023,10 @@ mod tests { 23 - 24 - // FIXME: re-enabled bitrig/openbsd tests once their socket timeout code 25 - // no longer has rounding errors. 26 - - #[cfg_attr(any(target_os = "bitrig", target_os = "netbsd", target_os = "openbsd"), ignore)] 27 - + #[cfg_attr(any(target_os = "bitrig", 28 - + target_os = "netbsd", 29 - + target_os = "openbsd", 30 - + target_os = "macos"), ignore)] 31 - #[test] 32 - fn timeouts() { 33 - let addr = next_test_ip4(); 34 - @@ -1101,6 +1105,7 @@ mod tests { 35 - assert_eq!(false, t!(stream.nodelay())); 36 - } 37 - 38 - + #[cfg_attr(target_os = "macos", ignore)] 39 - #[test] 40 - fn ttl() { 41 - let ttl = 100; 42 - -- 43 - 2.11.0 44 -
···
+4 -4
pkgs/development/misc/loc/default.nix
··· 3 with rustPlatform; 4 5 buildRustPackage rec { 6 - version = "0.3.4"; 7 name = "loc-${version}"; 8 9 src = fetchFromGitHub { 10 owner = "cgag"; 11 repo = "loc"; 12 - rev = "9f3590f6299a1be3560f00de7f4f8bef61a02642"; 13 - sha256 = "0dga8prwnnmsa616jh64wzic957ff0491xghm0bjlns35ajc8lif"; 14 }; 15 16 - depsSha256 = "1xcfhbnz208dk7xb748v8kv28zbhyr7wqg9gsgbiw3lnvc2a3nn6"; 17 18 meta = { 19 homepage = http://github.com/cgag/loc;
··· 3 with rustPlatform; 4 5 buildRustPackage rec { 6 + version = "2017-06-23"; 7 name = "loc-${version}"; 8 9 src = fetchFromGitHub { 10 owner = "cgag"; 11 repo = "loc"; 12 + rev = "bbea575f56879ef614d57a42a6b79fd45b9a8b38"; 13 + sha256 = "0agyhi55rh248fmlsip4fi1iw4xv3433q7bcb2lpjfnjpzxxlvfn"; 14 }; 15 16 + cargoSha256 = "0f3i8av9g19r2nhr9m8ca8s23kq294c5kqyvx155l6p76r7a9kvb"; 17 18 meta = { 19 homepage = http://github.com/cgag/loc;
+1 -1
pkgs/development/tools/clog-cli/default.nix
··· 13 sha256 = "1wxglc4n1dar5qphhj5pab7ps34cjr7jy611fwn72lz0f6c7jp3z"; 14 }; 15 16 - depsSha256 = "0gkg3bxx7nxsvff33n7pif731djfvlzk0msia27h0wq0mazq7kw3"; 17 18 meta = { 19 description = "Generate changelogs from local git metadata";
··· 13 sha256 = "1wxglc4n1dar5qphhj5pab7ps34cjr7jy611fwn72lz0f6c7jp3z"; 14 }; 15 16 + cargoSha256 = "1pi8fh6vz6m5hr38wm0v0hxp1yxm1ma8yzish3b78zkv8f90kmv0"; 17 18 meta = { 19 description = "Generate changelogs from local git metadata";
+14 -4
pkgs/development/tools/git-series/default.nix
··· 1 - { stdenv, fetchFromGitHub, rustPlatform, openssl, cmake, perl, pkgconfig, zlib }: 2 3 with rustPlatform; 4 ··· 13 sha256 = "07mgq5h6r1gf3jflbv2khcz32bdazw7z1s8xcsafdarnm13ps014"; 14 }; 15 16 - depsSha256 = "1xypk9ck7znca0nqm61m5ngpz6q7c0wydlpwxq4mnkd1np27xn53"; 17 18 nativeBuildInputs = [ cmake pkgconfig perl ]; 19 buildInputs = [ openssl zlib ]; 20 21 postBuild = '' 22 - mkdir -p "$out/man/man1" 23 - cp "$src/git-series.1" "$out/man/man1" 24 ''; 25 26 meta = with stdenv.lib; {
··· 1 + { stdenv, fetchFromGitHub, fetchpatch, rustPlatform, openssl, cmake, perl, pkgconfig, zlib }: 2 3 with rustPlatform; 4 ··· 13 sha256 = "07mgq5h6r1gf3jflbv2khcz32bdazw7z1s8xcsafdarnm13ps014"; 14 }; 15 16 + cargoSha256 = "06w864f73kijq24xzljfaf47d97aqyg4md3crzbq8hns157m3sv2"; 17 + 18 + cargoDepsHook = '' 19 + ( 20 + cd ${name}-src 21 + # see https://github.com/git-series/git-series/pull/56 22 + patch -p1 < ${fetchpatch { 23 + url = "https://github.com/Mic92/git-series/commit/3aa30a47d74ebf90b444dccdf8c153f07f119483.patch"; 24 + sha256 = "06v8br9skvy75kcw2zgbswxyk82sqzc8smkbqpzmivxlc2i9rnh0"; 25 + }} 26 + ) 27 + ''; 28 29 nativeBuildInputs = [ cmake pkgconfig perl ]; 30 buildInputs = [ openssl zlib ]; 31 32 postBuild = '' 33 + install -D "$src/git-series.1" "$out/man/man1/git-series.1" 34 ''; 35 36 meta = with stdenv.lib; {
+2 -1
pkgs/development/tools/misc/tokei/default.nix
··· 11 sha256 = "1bzs3mr6f9bna39b9ddwwq0raas07nbn106mnq3widxg59i0gxhd"; 12 }; 13 14 - depsSha256 = "1cz93mrpxmyrza0ipdyg2a6mynl66plpsb446wxnmmy7y7zd6xbf"; 15 16 installPhase = '' 17 mkdir -p $out/bin ··· 19 ''; 20 21 meta = with stdenv.lib; { 22 description = "Count code, quickly"; 23 homepage = https://github.com/Aaronepower/tokei; 24 license = licenses.mit;
··· 11 sha256 = "1bzs3mr6f9bna39b9ddwwq0raas07nbn106mnq3widxg59i0gxhd"; 12 }; 13 14 + cargoSha256 = "0y0rkxhkv31v5sa0425dwskd80i6srwbqhqkrw1g1kbmbs9y0vxz"; 15 16 installPhase = '' 17 mkdir -p $out/bin ··· 19 ''; 20 21 meta = with stdenv.lib; { 22 + broken = true; 23 description = "Count code, quickly"; 24 homepage = https://github.com/Aaronepower/tokei; 25 license = licenses.mit;
+1 -1
pkgs/development/tools/rq/default.nix
··· 13 sha256 = "066f6sdy0vrp113wlg18q9p0clyrg9iqbj17ly0yn8dxr5iar002"; 14 }; 15 16 - depsSha256 = "138h0q2a2gghfjpwfi11zw4rkipvmglb7srqz56ibbw2xliid2wl"; 17 18 buildInputs = [ llvmPackages.clang-unwrapped v8 ]; 19
··· 13 sha256 = "066f6sdy0vrp113wlg18q9p0clyrg9iqbj17ly0yn8dxr5iar002"; 14 }; 15 16 + cargoSha256 = "0c4awm1d87b396d3g3mp1md5p92i5a64a9jdawpr8mwjd0bly05m"; 17 18 buildInputs = [ llvmPackages.clang-unwrapped v8 ]; 19
+1 -1
pkgs/development/tools/rust/bindgen/default.nix
··· 24 wrapProgram $out/bin/bindgen --set LIBCLANG_PATH "${llvmPackages.clang-unwrapped}/lib" 25 ''; 26 27 - depsSha256 = "06b5zyw9p7h73h30c1nlnwjb0zmkfx52wqsl9b14y9hx51g9bw0r"; 28 29 doCheck = false; # A test fails because it can't find standard headers in NixOS 30
··· 24 wrapProgram $out/bin/bindgen --set LIBCLANG_PATH "${llvmPackages.clang-unwrapped}/lib" 25 ''; 26 27 + cargoSha256 = "128skg31lc9v8i7ghfb3wyiazivqfvzhi1mvmjcl0gkx1hi5006v"; 28 29 doCheck = false; # A test fails because it can't find standard headers in NixOS 30
+1 -1
pkgs/development/tools/rust/racer/default.nix
··· 11 sha256 = "06k50f2vj2w08afh3nrlhs0amcvw2i45bhfwr70sgs395xicjswp"; 12 }; 13 14 - depsSha256 = "1gywnjbjl9jalbq6wkfmbczav4qbhgw2h8lyxkyppnhw9y4j0nc1"; 15 16 buildInputs = [ makeWrapper ]; 17
··· 11 sha256 = "06k50f2vj2w08afh3nrlhs0amcvw2i45bhfwr70sgs395xicjswp"; 12 }; 13 14 + cargoSha256 = "1w5imxyqlyv24dvzncq6dy01zn2x8p1aciyvzh8ac1x1wdjcacjc"; 15 16 buildInputs = [ makeWrapper ]; 17
+1 -1
pkgs/development/tools/rust/racerd/default.nix
··· 14 15 doCheck = false; 16 17 - depsSha256 = "0db18m0vxzvg821gb5g8njhlnxw7im81m089i4982n8hmnhm1497"; 18 19 buildInputs = [ makeWrapper ]; 20
··· 14 15 doCheck = false; 16 17 + cargoSha256 = "1h7hm7vkk1grah6pn5ydfi5pzc2kd48lh2kxim5jlvrxhd2dingg"; 18 19 buildInputs = [ makeWrapper ]; 20
+2 -1
pkgs/development/tools/rust/rainicorn/default.nix
··· 13 sha256 = "07vh4g120sx569wkzclq91blkkd7q7z582pl8vz0li1l9ij8md01"; 14 }; 15 16 - depsSha256 = "1ckrf77s1glrqi0gvrv9wqmip4i97dk0arn0iz87jg4q2wfss85k"; 17 18 meta = with stdenv.lib; { 19 description = "Rust IDEs. parse-analysis"; 20 homepage = https://github.com/RustDT/Rainicorn; 21 license = with licenses; [ mit asl20 ];
··· 13 sha256 = "07vh4g120sx569wkzclq91blkkd7q7z582pl8vz0li1l9ij8md01"; 14 }; 15 16 + cargoSha256 = "14kd25mw6m20blqcr221cclcqxw0j229zxq8hsaay6q7jgv0c7a0"; 17 18 meta = with stdenv.lib; { 19 + broken = true; 20 description = "Rust IDEs. parse-analysis"; 21 homepage = https://github.com/RustDT/Rainicorn; 22 license = with licenses; [ mit asl20 ];
+1 -1
pkgs/development/tools/rust/rustfmt/default.nix
··· 11 sha256 = "12l3ff0s0pzhcf5jbs8wqawjk4jghhhz8j6dq1n5201yvny12jlr"; 12 }; 13 14 - depsSha256 = "1nnb2lpzjf6hv1a7cw3cbkc22fb54rsp6h87wzmqi4hsy1csff7a"; 15 16 meta = with stdenv.lib; { 17 description = "A tool for formatting Rust code according to style guidelines";
··· 11 sha256 = "12l3ff0s0pzhcf5jbs8wqawjk4jghhhz8j6dq1n5201yvny12jlr"; 12 }; 13 14 + cargoSha256 = "0gppki9mgx99xipapg36ydwk1bplygnz6sbyzbg46vhn10iggfwm"; 15 16 meta = with stdenv.lib; { 17 description = "A tool for formatting Rust code according to style guidelines";
+1 -1
pkgs/development/tools/rust/rustup/default.nix
··· 6 name = "rustup-${version}"; 7 version = "1.3.0"; 8 9 - depsSha256 = "078hssgffgpakv735p1xg60kic151r2dvpdr9sipb63lwqr4dxfb"; 10 11 src = fetchFromGitHub { 12 owner = "rust-lang-nursery";
··· 6 name = "rustup-${version}"; 7 version = "1.3.0"; 8 9 + cargoSha256 = "1yd7k0jpx78p5bp6iyzgbyj7pjz8vyjg9g7fmf1bl60jsbdpgv3g"; 10 11 src = fetchFromGitHub { 12 owner = "rust-lang-nursery";
+1 -1
pkgs/misc/tw-rs/default.nix
··· 14 buildInputs = [ perl zlib openssl ] 15 ++ stdenv.lib.optional stdenv.isDarwin curl; 16 17 - depsSha256 = "1lg1jh6f9w28i94vaj62r859g6raalxmxabvw7av6sqr0hr56p05"; 18 19 meta = with stdenv.lib; { 20 description = "Twitter command-line interface written in rust";
··· 14 buildInputs = [ perl zlib openssl ] 15 ++ stdenv.lib.optional stdenv.isDarwin curl; 16 17 + cargoSha256 = "0c3324b7z77kiwc6whbppfmrli254fr1nyd0vpsxvpc0av3279jg"; 18 19 meta = with stdenv.lib; { 20 description = "Twitter command-line interface written in rust";
+1 -1
pkgs/shells/ion/default.nix
··· 13 sha256 = "0c2haw9qiwysyp1xj6qla8d6zpsdlygagzh86sk04c2b4ssyaca3"; 14 }; 15 16 - depsSha256 = "0w2jgbrcx57js8ihzs5acp6b1niw1c7khdxrv14y3z9mmm9j55hs"; 17 18 meta = with stdenv.lib; { 19 description = "Modern system shell with simple (and powerful) syntax";
··· 13 sha256 = "0c2haw9qiwysyp1xj6qla8d6zpsdlygagzh86sk04c2b4ssyaca3"; 14 }; 15 16 + cargoSha256 = "0ydi44710as0bb442zryzx30nk4mscdw3gsahwprnsvvaril33rn"; 17 18 meta = with stdenv.lib; { 19 description = "Modern system shell with simple (and powerful) syntax";
+1 -1
pkgs/tools/admin/intecture/agent.nix
··· 14 sha256 = "0j27qdgyxybaixggh7k57mpm6rifimn4z2vydk463msc8b3kgywj"; 15 }; 16 17 - depsSha256 = "1n57i9wkak76ram748mwq0dn32d041ajd31laqc13c76pp29agrp"; 18 19 buildInputs = [ openssl zeromq czmq zlib ]; 20
··· 14 sha256 = "0j27qdgyxybaixggh7k57mpm6rifimn4z2vydk463msc8b3kgywj"; 15 }; 16 17 + cargoSha256 = "1fcl2nnplcic729cmvall2k7wf3jdm7dspvlbxji99bn813ackig"; 18 19 buildInputs = [ openssl zeromq czmq zlib ]; 20
+1 -1
pkgs/tools/admin/intecture/auth.nix
··· 14 sha256 = "0c7ar3pc7n59lzfy74lwz51p09s2bglc870rfr4c0vmc91jl0pj2"; 15 }; 16 17 - depsSha256 = "0wzr8hk63gh3nm8f7dbzwj8pgc3cm8p8mr2q7bbgvri1a5i83sfb"; 18 19 buildInputs = [ openssl zeromq czmq zlib ]; 20
··· 14 sha256 = "0c7ar3pc7n59lzfy74lwz51p09s2bglc870rfr4c0vmc91jl0pj2"; 15 }; 16 17 + cargoSha256 = "0q3mrcvl1yyrx4a88kanjlfcx6slf7r79i0dh4w81sj6gp07sssm"; 18 19 buildInputs = [ openssl zeromq czmq zlib ]; 20
+1 -1
pkgs/tools/admin/intecture/cli.nix
··· 14 sha256 = "16a5fkpyqkf8w20k3ircc1d0qmif7nygkzxj6mzk9609dlb0dmxq"; 15 }; 16 17 - depsSha256 = "0nax7h7f5qgalgxsfidrxrv1ybl5xvrpc1k7xc1kmaf955gqmc46"; 18 19 buildInputs = [ openssl zeromq czmq zlib ]; 20
··· 14 sha256 = "16a5fkpyqkf8w20k3ircc1d0qmif7nygkzxj6mzk9609dlb0dmxq"; 15 }; 16 17 + cargoSha256 = "0qwbgwxrjc0dvjbpqa59jixy5nq7lng2c1z91rw48qc91v7fa664"; 18 19 buildInputs = [ openssl zeromq czmq zlib ]; 20
+1 -1
pkgs/tools/filesystems/btrfs-dedupe/default.nix
··· 12 sha256 = "0qy1g4crhfgs2f5cmrsjv6qscg3r66gb8n6sxhimm9ksivhjyyjp"; 13 }; 14 15 - depsSha256 = "04jlz7nzsmg86i73w75i8rmlbk635xrg8m1dfac8h17dwb29yj6a"; 16 17 buildInputs = [ lzo zlib ]; 18
··· 12 sha256 = "0qy1g4crhfgs2f5cmrsjv6qscg3r66gb8n6sxhimm9ksivhjyyjp"; 13 }; 14 15 + cargoSha256 = "0dmn9bccicxhqcj9zrsxxp0vb5ma12a1hs9brpc22n4g1qy4yzcn"; 16 17 buildInputs = [ lzo zlib ]; 18
+1 -1
pkgs/tools/misc/exa/default.nix
··· 6 name = "exa-${version}"; 7 version = "0.8.0"; 8 9 - depsSha256 = "0yz41prkjs5rmvdhr9k58a52l7hvwy5mfg8rcpsq4ybgf601lja2"; 10 11 src = fetchFromGitHub { 12 owner = "ogham";
··· 6 name = "exa-${version}"; 7 version = "0.8.0"; 8 9 + cargoSha256 = "08zzn3a32xfjkmpawcjppn1mr26ws3iv40cckiz8ldz4qc8y9gdh"; 10 11 src = fetchFromGitHub { 12 owner = "ogham";
+1 -1
pkgs/tools/misc/fd/default.nix
··· 11 sha256 = "1aw4pgsmvzzqlvbxzv5jnw42nf316qfhvr50b58iqi2dxy8z8cmv"; 12 }; 13 14 - depsSha256 = "17fjlmdwp8582dvv68b5h3zzvmd71yd9sw9xalyrrww46h7fd84g"; 15 16 meta = { 17 description = "A simple, fast and user-friendly alternative to find";
··· 11 sha256 = "1aw4pgsmvzzqlvbxzv5jnw42nf316qfhvr50b58iqi2dxy8z8cmv"; 12 }; 13 14 + cargoSha256 = "1v9wg4dq4c7i85bkdhd79bj8gx7200z6np05wsyj2ycbv97p095j"; 15 16 meta = { 17 description = "A simple, fast and user-friendly alternative to find";
+1 -1
pkgs/tools/misc/heatseeker/default.nix
··· 13 sha256 = "1fcrbjwnhcz71i70ppy0rcgk5crwwmbkm9nrk1kapvks33pv0az7"; 14 }; 15 16 - depsSha256 = "05mj84a5k65ai492grwg03c3wq6ardhs114bv951fgysc9rs07p5"; 17 18 # some tests require a tty, this variable turns them off for Travis CI, 19 # which we can also make use of
··· 13 sha256 = "1fcrbjwnhcz71i70ppy0rcgk5crwwmbkm9nrk1kapvks33pv0az7"; 14 }; 15 16 + cargoSha256 = "0kqkzjd90v19qvl3iv1vv2fi8h0z75b0yn0z5jq8w4m94fvh0p95"; 17 18 # some tests require a tty, this variable turns them off for Travis CI, 19 # which we can also make use of
+2 -1
pkgs/tools/package-management/cargo-edit/default.nix
··· 15 16 buildInputs = [ zlib openssl ]; 17 18 - depsSha256 = "1v7ir56j6biximnnhyvadd98azcj3i5hc8aky0am2nf0swq0jimq"; 19 20 meta = with stdenv.lib; { 21 description = "A utility for managing cargo dependencies from the command line"; ··· 23 license = with licenses; [ mit ]; 24 maintainers = with maintainers; [ jb55 ]; 25 platforms = platforms.all; 26 }; 27 }
··· 15 16 buildInputs = [ zlib openssl ]; 17 18 + cargoSha256 = "1m4yb7472g1n900dh3xqvdcywk3v01slj3bkk7bk7a9p5x1kyjfn"; 19 20 meta = with stdenv.lib; { 21 description = "A utility for managing cargo dependencies from the command line"; ··· 23 license = with licenses; [ mit ]; 24 maintainers = with maintainers; [ jb55 ]; 25 platforms = platforms.all; 26 + broken = true; 27 }; 28 }
+1 -1
pkgs/tools/package-management/nix-index/default.nix
··· 12 rev = "v${version}"; 13 sha256 = "1lmg65yqkwf2a5qxm3dmv8158kqhnriir062vlgar5wimf409rm5"; 14 }; 15 - depsSha256 = "0v145fi9bfiwvsdy7hz9lw4m2f2j8sxvixfzmjwfnq4klm51c8yl"; 16 nativeBuildInputs = [ pkgconfig ]; 17 buildInputs = [ openssl curl]; 18
··· 12 rev = "v${version}"; 13 sha256 = "1lmg65yqkwf2a5qxm3dmv8158kqhnriir062vlgar5wimf409rm5"; 14 }; 15 + cargoSha256 = "0cxdrzjmqq3ywdh0f5mzkcf50hbbgd3bak4398v2ls5gy5s9fcz2"; 16 nativeBuildInputs = [ pkgconfig ]; 17 buildInputs = [ openssl curl]; 18
+1 -1
pkgs/tools/text/ripgrep/default.nix
··· 13 sha256 = "1cnvwxbznmsn1gand8hhy5zadax5p67lvm46fkj1a1s89f158w3a"; 14 }; 15 16 - depsSha256 = "1kx9xazhj93xa3cnys39wwr84qqjqrlsbbi5ih71vxppskdpvd6m"; 17 18 preFixup = '' 19 mkdir -p "$out/man/man1"
··· 13 sha256 = "1cnvwxbznmsn1gand8hhy5zadax5p67lvm46fkj1a1s89f158w3a"; 14 }; 15 16 + cargoSha256 = "00y2vdnrg02clqin9pg57s9micrp66f6y49wq89cmykrfg3r8cwf"; 17 18 preFixup = '' 19 mkdir -p "$out/man/man1"
+2 -1
pkgs/tools/text/staccato/default.nix
··· 11 sha256 = "1zbd1gx0ik2r7bavcid776j37g6rzd3f6cs94kq1qar4gyf1gqjm"; 12 }; 13 14 - depsSha256 = "1gwfkh3ck8n3zcy43ch2mnc28a6y10p3srhnx9dh8gwnwbpb733c"; 15 16 meta = { 17 description = "A command line program that lets you compute statistics from values from a file or standard input"; 18 longDescription = '' 19 Staccato (`st` for short) is a command line program that lets you
··· 11 sha256 = "1zbd1gx0ik2r7bavcid776j37g6rzd3f6cs94kq1qar4gyf1gqjm"; 12 }; 13 14 + cargoSha256 = "074mfyanwdykg6wci2ia63wcnnyik741g8n624pac215sg4i95h7"; 15 16 meta = { 17 + broken = true; 18 description = "A command line program that lets you compute statistics from values from a file or standard input"; 19 longDescription = '' 20 Staccato (`st` for short) is a command line program that lets you
+1 -1
pkgs/tools/text/xsv/default.nix
··· 13 sha256 = "0z1z3b6nzaid510jaikkawvpmv4kjphzz84p0hppq6vcp5jy00s2"; 14 }; 15 16 - depsSha256 = "13hy835871zxdnakwsr4bjm4krahlz4aqk5lh0rw78avfla89q9q"; 17 18 meta = with stdenv.lib; { 19 description = "A fast CSV toolkit written in Rust";
··· 13 sha256 = "0z1z3b6nzaid510jaikkawvpmv4kjphzz84p0hppq6vcp5jy00s2"; 14 }; 15 16 + cargoSha256 = "0pdzh2xr40dgwravh3i58g602bpszj6c8inggzgmq2kfk8ck6rgj"; 17 18 meta = with stdenv.lib; { 19 description = "A fast CSV toolkit written in Rust";
+1 -1
pkgs/tools/typesetting/tectonic/default.nix
··· 14 sha256 = "0k5vkn112bjwh4wnxryzqz79dlja64k7s105mf3yaik136hqnmqv"; 15 }; 16 17 - depsSha256 = "1vxvkh1v9x6j4ggbh6sysi5i3089hrs0mjbp910a1jljiav7l8nj"; 18 19 nativeBuildInputs = [ pkgconfig ]; 20
··· 14 sha256 = "0k5vkn112bjwh4wnxryzqz79dlja64k7s105mf3yaik136hqnmqv"; 15 }; 16 17 + cargoSha256 = "03bqhgz8c4ipdkd3g448bcrr6d188h87vskcfcc3mqlcxg77b8q5"; 18 19 nativeBuildInputs = [ pkgconfig ]; 20
-1
pkgs/top-level/aliases.nix
··· 130 robomongo = robo3t; #added 2017-09-28 131 rssglx = rss-glx; #added 2015-03-25 132 rubygems = throw "deprecated 2016-03-02: rubygems is now bundled with ruby"; 133 - rustUnstable = rustNightly; # added 2016-11-29 134 rxvt_unicode_with-plugins = rxvt_unicode-with-plugins; # added 2015-04-02 135 samsungUnifiedLinuxDriver = samsung-unified-linux-driver; # added 2016-01-25 136 saneBackends = sane-backends; # added 2016-01-02
··· 130 robomongo = robo3t; #added 2017-09-28 131 rssglx = rss-glx; #added 2015-03-25 132 rubygems = throw "deprecated 2016-03-02: rubygems is now bundled with ruby"; 133 rxvt_unicode_with-plugins = rxvt_unicode-with-plugins; # added 2015-04-02 134 samsungUnifiedLinuxDriver = samsung-unified-linux-driver; # added 2016-01-25 135 saneBackends = sane-backends; # added 2016-01-02
-2
pkgs/top-level/all-packages.nix
··· 6179 rust = callPackage ../development/compilers/rust { }; 6180 inherit (rust) cargo rustc; 6181 6182 - rustRegistry = callPackage ./rust-packages.nix { }; 6183 - 6184 rustPlatform = recurseIntoAttrs (makeRustPlatform rust); 6185 6186 makeRustPlatform = rust: lib.fix (self:
··· 6179 rust = callPackage ../development/compilers/rust { }; 6180 inherit (rust) cargo rustc; 6181 6182 rustPlatform = recurseIntoAttrs (makeRustPlatform rust); 6183 6184 makeRustPlatform = rust: lib.fix (self:
-46
pkgs/top-level/rust-packages.nix
··· 1 - # This file defines the source of Rust / cargo's crates registry 2 - # 3 - # buildRustPackage will automatically download dependencies from the registry 4 - # version that we define here. If you're having problems downloading / finding 5 - # a Rust library, try updating this to a newer commit. 6 - 7 - { stdenv, fetchFromGitHub, git }: 8 - 9 - stdenv.mkDerivation { 10 - name = "rustRegistry-2017-10-08"; 11 - 12 - src = fetchFromGitHub { 13 - owner = "rust-lang"; 14 - repo = "crates.io-index"; 15 - rev = "78ab44cf22c2ce5d40e562ffc7df7ab10ac12b86"; 16 - sha256 = "0fa3l3px6b89ap63h40bhn2x50zf5j65jrgbb7j103j0cdayk2l0"; 17 - }; 18 - phases = [ "unpackPhase" "installPhase" ]; 19 - installPhase = '' 20 - # For some reason, cargo doesn't like fetchgit's git repositories, not even 21 - # if we set leaveDotGit to true, set the fetchgit branch to 'master' and clone 22 - # the repository (tested with registry rev 23 - # 965b634156cc5c6f10c7a458392bfd6f27436e7e), failing with the message: 24 - # 25 - # "Target OID for the reference doesn't exist on the repository" 26 - # 27 - # So we'll just have to create a new git repository from scratch with the 28 - # contents downloaded with fetchgit... 29 - 30 - mkdir -p $out 31 - 32 - cp -r ./* $out/ 33 - 34 - cd $out 35 - 36 - git="${git}/bin/git" 37 - 38 - $git init 39 - $git config --local user.email "example@example.com" 40 - $git config --local user.name "example" 41 - $git add . 42 - $git commit --quiet -m 'Rust registry commit' 43 - 44 - touch $out/touch . "$out/.cargo-index-lock" 45 - ''; 46 - }
···