From 00b1ac5b234a59fdc6a8f5c7689d895d046d0952 Mon Sep 17 00:00:00 2001 From: Yureka Date: Fri, 10 Sep 2021 19:30:05 +0200 Subject: [PATCH 1/3] importCargoLock: git deps with rev, branch or tag Previously importCargoLog only recognized git dependencies with `rev =`. This adds support for git dependencies with `branch =` or `tag =`. --- pkgs/build-support/rust/import-cargo-lock.nix | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/pkgs/build-support/rust/import-cargo-lock.nix b/pkgs/build-support/rust/import-cargo-lock.nix index 83f4e0df4f2d..3973aff398ab 100644 --- a/pkgs/build-support/rust/import-cargo-lock.nix +++ b/pkgs/build-support/rust/import-cargo-lock.nix @@ -12,14 +12,15 @@ let # Parse a git source into different components. parseGit = src: let - parts = builtins.match ''git\+([^?]+)(\?rev=(.*))?#(.*)?'' src; - rev = builtins.elemAt parts 2; + parts = builtins.match ''git\+([^?]+)(\?(rev|tag|branch)=(.*))?#(.*)'' src; + type = builtins.elemAt parts 2; # rev, tag or branch + value = builtins.elemAt parts 3; in if parts == null then null else { url = builtins.elemAt parts 0; - sha = builtins.elemAt parts 3; - } // lib.optionalAttrs (rev != null) { inherit rev; }; + sha = builtins.elemAt parts 4; + } // lib.optionalAttrs (type != null) { inherit type value; }; packages = (builtins.fromTOML (builtins.readFile lockFile)).package; @@ -137,7 +138,7 @@ let cat > $out/.cargo-config < Date: Sat, 11 Sep 2021 09:10:54 +0200 Subject: [PATCH 2/3] importCargoLock: add tests for branch and tag --- .../rust/test/import-cargo-lock/default.nix | 4 +- .../git-dependency-branch/Cargo.lock | 72 +++++++++++++++++ .../git-dependency-branch/Cargo.toml | 8 ++ .../default.nix | 6 +- .../src/main.rs | 0 .../Cargo.lock | 14 ++-- .../Cargo.toml | 4 +- .../git-dependency-rev/default.nix | 21 +++++ .../git-dependency-rev/src/main.rs | 9 +++ .../git-dependency-tag/Cargo.lock | 81 +++++++++++++++++++ .../git-dependency-tag/Cargo.toml | 8 ++ .../git-dependency-tag/default.nix | 21 +++++ .../git-dependency-tag/src/main.rs | 9 +++ .../git-dependency/Cargo.lock | 12 +-- .../git-dependency/Cargo.toml | 2 +- .../git-dependency/default.nix | 2 +- 16 files changed, 254 insertions(+), 19 deletions(-) create mode 100644 pkgs/build-support/rust/test/import-cargo-lock/git-dependency-branch/Cargo.lock create mode 100644 pkgs/build-support/rust/test/import-cargo-lock/git-dependency-branch/Cargo.toml rename pkgs/build-support/rust/test/import-cargo-lock/{git-dependency-no-rev => git-dependency-branch}/default.nix (60%) rename pkgs/build-support/rust/test/import-cargo-lock/{git-dependency-no-rev => git-dependency-branch}/src/main.rs (100%) rename pkgs/build-support/rust/test/import-cargo-lock/{git-dependency-no-rev => git-dependency-rev}/Cargo.lock (76%) rename pkgs/build-support/rust/test/import-cargo-lock/{git-dependency-no-rev => git-dependency-rev}/Cargo.toml (51%) create mode 100644 pkgs/build-support/rust/test/import-cargo-lock/git-dependency-rev/default.nix create mode 100644 pkgs/build-support/rust/test/import-cargo-lock/git-dependency-rev/src/main.rs create mode 100644 pkgs/build-support/rust/test/import-cargo-lock/git-dependency-tag/Cargo.lock create mode 100644 pkgs/build-support/rust/test/import-cargo-lock/git-dependency-tag/Cargo.toml create mode 100644 pkgs/build-support/rust/test/import-cargo-lock/git-dependency-tag/default.nix create mode 100644 pkgs/build-support/rust/test/import-cargo-lock/git-dependency-tag/src/main.rs diff --git a/pkgs/build-support/rust/test/import-cargo-lock/default.nix b/pkgs/build-support/rust/test/import-cargo-lock/default.nix index 2dd525a8ac3f..ad2d46dd2d4c 100644 --- a/pkgs/build-support/rust/test/import-cargo-lock/default.nix +++ b/pkgs/build-support/rust/test/import-cargo-lock/default.nix @@ -3,6 +3,8 @@ { basic = callPackage ./basic { }; gitDependency = callPackage ./git-dependency { }; - gitDependencyNoRev = callPackage ./git-dependency-no-rev { }; + gitDependencyRev = callPackage ./git-dependency-rev { }; + gitDependencyTag = callPackage ./git-dependency-tag { }; + gitDependencyBranch = callPackage ./git-dependency-branch { }; maturin = callPackage ./maturin { }; } diff --git a/pkgs/build-support/rust/test/import-cargo-lock/git-dependency-branch/Cargo.lock b/pkgs/build-support/rust/test/import-cargo-lock/git-dependency-branch/Cargo.lock new file mode 100644 index 000000000000..e832b2e5ba4f --- /dev/null +++ b/pkgs/build-support/rust/test/import-cargo-lock/git-dependency-branch/Cargo.lock @@ -0,0 +1,72 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "getrandom" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9495705279e7140bf035dde1f6e750c162df8b625267cd52cc44e0b156732c8" +dependencies = [ + "cfg-if", + "libc", + "wasi", +] + +[[package]] +name = "git-dependency-branch" +version = "0.1.0" +dependencies = [ + "rand", +] + +[[package]] +name = "libc" +version = "0.2.94" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "18794a8ad5b29321f790b55d93dfba91e125cb1a9edbd4f8e3150acc771c1a5e" + +[[package]] +name = "ppv-lite86" +version = "0.2.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac74c624d6b2d21f425f752262f42188365d7b8ff1aff74c82e45136510a4857" + +[[package]] +name = "rand" +version = "0.8.4" +source = "git+https://github.com/rust-random/rand.git?branch=master#fcc5baf31565a94f63dce41c2e739e6f182475f4" +dependencies = [ + "libc", + "rand_chacha", + "rand_core", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "git+https://github.com/rust-random/rand.git?branch=master#fcc5baf31565a94f63dce41c2e739e6f182475f4" +dependencies = [ + "ppv-lite86", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.6.3" +source = "git+https://github.com/rust-random/rand.git?branch=master#fcc5baf31565a94f63dce41c2e739e6f182475f4" +dependencies = [ + "getrandom", +] + +[[package]] +name = "wasi" +version = "0.10.2+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" diff --git a/pkgs/build-support/rust/test/import-cargo-lock/git-dependency-branch/Cargo.toml b/pkgs/build-support/rust/test/import-cargo-lock/git-dependency-branch/Cargo.toml new file mode 100644 index 000000000000..0702c5ad8a07 --- /dev/null +++ b/pkgs/build-support/rust/test/import-cargo-lock/git-dependency-branch/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "git-dependency-branch" +version = "0.1.0" +authors = ["Daniël de Kok "] +edition = "2018" + +[dependencies] +rand = { git = "https://github.com/rust-random/rand.git", branch = "master" } diff --git a/pkgs/build-support/rust/test/import-cargo-lock/git-dependency-no-rev/default.nix b/pkgs/build-support/rust/test/import-cargo-lock/git-dependency-branch/default.nix similarity index 60% rename from pkgs/build-support/rust/test/import-cargo-lock/git-dependency-no-rev/default.nix rename to pkgs/build-support/rust/test/import-cargo-lock/git-dependency-branch/default.nix index fc36edc40772..f274d86c52b8 100644 --- a/pkgs/build-support/rust/test/import-cargo-lock/git-dependency-no-rev/default.nix +++ b/pkgs/build-support/rust/test/import-cargo-lock/git-dependency-branch/default.nix @@ -1,7 +1,7 @@ { rustPlatform }: rustPlatform.buildRustPackage { - pname = "git-dependency-no-rev"; + pname = "git-dependency-branch"; version = "0.1.0"; src = ./.; @@ -9,13 +9,13 @@ rustPlatform.buildRustPackage { cargoLock = { lockFile = ./Cargo.lock; outputHashes = { - "rand-0.8.3" = "0ya2hia3cn31qa8894s3av2s8j5bjwb6yq92k0jsnlx7jid0jwqa"; + "rand-0.8.4" = "1ilk9wvfw3mdm57g199ys8f5nrgdrh0n3a4c8b7nz6lgnqvfrv6z"; }; }; doInstallCheck = true; installCheckPhase = '' - $out/bin/git-dependency-no-rev + $out/bin/git-dependency-branch ''; } diff --git a/pkgs/build-support/rust/test/import-cargo-lock/git-dependency-no-rev/src/main.rs b/pkgs/build-support/rust/test/import-cargo-lock/git-dependency-branch/src/main.rs similarity index 100% rename from pkgs/build-support/rust/test/import-cargo-lock/git-dependency-no-rev/src/main.rs rename to pkgs/build-support/rust/test/import-cargo-lock/git-dependency-branch/src/main.rs diff --git a/pkgs/build-support/rust/test/import-cargo-lock/git-dependency-no-rev/Cargo.lock b/pkgs/build-support/rust/test/import-cargo-lock/git-dependency-rev/Cargo.lock similarity index 76% rename from pkgs/build-support/rust/test/import-cargo-lock/git-dependency-no-rev/Cargo.lock rename to pkgs/build-support/rust/test/import-cargo-lock/git-dependency-rev/Cargo.lock index 54b9c7c5739d..684d9419479d 100644 --- a/pkgs/build-support/rust/test/import-cargo-lock/git-dependency-no-rev/Cargo.lock +++ b/pkgs/build-support/rust/test/import-cargo-lock/git-dependency-rev/Cargo.lock @@ -1,5 +1,7 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. +version = 3 + [[package]] name = "cfg-if" version = "1.0.0" @@ -18,7 +20,7 @@ dependencies = [ ] [[package]] -name = "git-dependency-no-rev" +name = "git-dependency-rev" version = "0.1.0" dependencies = [ "rand", @@ -39,7 +41,7 @@ checksum = "ac74c624d6b2d21f425f752262f42188365d7b8ff1aff74c82e45136510a4857" [[package]] name = "rand" version = "0.8.3" -source = "git+https://github.com/rust-random/rand.git#f0e01ee0a7257753cc51b291f62666f4765923ef" +source = "git+https://github.com/rust-random/rand.git?rev=0.8.3#6ecbe2626b2cc6110a25c97b1702b347574febc7" dependencies = [ "libc", "rand_chacha", @@ -50,7 +52,7 @@ dependencies = [ [[package]] name = "rand_chacha" version = "0.3.0" -source = "git+https://github.com/rust-random/rand.git#f0e01ee0a7257753cc51b291f62666f4765923ef" +source = "git+https://github.com/rust-random/rand.git?rev=0.8.3#6ecbe2626b2cc6110a25c97b1702b347574febc7" dependencies = [ "ppv-lite86", "rand_core", @@ -58,8 +60,8 @@ dependencies = [ [[package]] name = "rand_core" -version = "0.6.2" -source = "git+https://github.com/rust-random/rand.git#f0e01ee0a7257753cc51b291f62666f4765923ef" +version = "0.6.1" +source = "git+https://github.com/rust-random/rand.git?rev=0.8.3#6ecbe2626b2cc6110a25c97b1702b347574febc7" dependencies = [ "getrandom", ] @@ -67,7 +69,7 @@ dependencies = [ [[package]] name = "rand_hc" version = "0.3.0" -source = "git+https://github.com/rust-random/rand.git#f0e01ee0a7257753cc51b291f62666f4765923ef" +source = "git+https://github.com/rust-random/rand.git?rev=0.8.3#6ecbe2626b2cc6110a25c97b1702b347574febc7" dependencies = [ "rand_core", ] diff --git a/pkgs/build-support/rust/test/import-cargo-lock/git-dependency-no-rev/Cargo.toml b/pkgs/build-support/rust/test/import-cargo-lock/git-dependency-rev/Cargo.toml similarity index 51% rename from pkgs/build-support/rust/test/import-cargo-lock/git-dependency-no-rev/Cargo.toml rename to pkgs/build-support/rust/test/import-cargo-lock/git-dependency-rev/Cargo.toml index 770dfb86f523..3500325ae579 100644 --- a/pkgs/build-support/rust/test/import-cargo-lock/git-dependency-no-rev/Cargo.toml +++ b/pkgs/build-support/rust/test/import-cargo-lock/git-dependency-rev/Cargo.toml @@ -1,8 +1,8 @@ [package] -name = "git-dependency-no-rev" +name = "git-dependency-rev" version = "0.1.0" authors = ["Daniël de Kok "] edition = "2018" [dependencies] -rand = { git = "https://github.com/rust-random/rand.git" } +rand = { git = "https://github.com/rust-random/rand.git", rev = "0.8.3" } diff --git a/pkgs/build-support/rust/test/import-cargo-lock/git-dependency-rev/default.nix b/pkgs/build-support/rust/test/import-cargo-lock/git-dependency-rev/default.nix new file mode 100644 index 000000000000..40487d6829a2 --- /dev/null +++ b/pkgs/build-support/rust/test/import-cargo-lock/git-dependency-rev/default.nix @@ -0,0 +1,21 @@ +{ rustPlatform }: + +rustPlatform.buildRustPackage { + pname = "git-dependency-rev"; + version = "0.1.0"; + + src = ./.; + + cargoLock = { + lockFile = ./Cargo.lock; + outputHashes = { + "rand-0.8.3" = "0l3p174bpwia61vcvxz5mw65a13ri3wy94z04xrnyy5lzciykz4f"; + }; + }; + + doInstallCheck = true; + + installCheckPhase = '' + $out/bin/git-dependency-rev + ''; +} diff --git a/pkgs/build-support/rust/test/import-cargo-lock/git-dependency-rev/src/main.rs b/pkgs/build-support/rust/test/import-cargo-lock/git-dependency-rev/src/main.rs new file mode 100644 index 000000000000..50b4ed799e43 --- /dev/null +++ b/pkgs/build-support/rust/test/import-cargo-lock/git-dependency-rev/src/main.rs @@ -0,0 +1,9 @@ +use rand::Rng; + +fn main() { + let mut rng = rand::thread_rng(); + + // Always draw zero :). + let roll: u8 = rng.gen_range(0..1); + assert_eq!(roll, 0); +} diff --git a/pkgs/build-support/rust/test/import-cargo-lock/git-dependency-tag/Cargo.lock b/pkgs/build-support/rust/test/import-cargo-lock/git-dependency-tag/Cargo.lock new file mode 100644 index 000000000000..9f8ec19a366a --- /dev/null +++ b/pkgs/build-support/rust/test/import-cargo-lock/git-dependency-tag/Cargo.lock @@ -0,0 +1,81 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "getrandom" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9495705279e7140bf035dde1f6e750c162df8b625267cd52cc44e0b156732c8" +dependencies = [ + "cfg-if", + "libc", + "wasi", +] + +[[package]] +name = "git-dependency-tag" +version = "0.1.0" +dependencies = [ + "rand", +] + +[[package]] +name = "libc" +version = "0.2.94" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "18794a8ad5b29321f790b55d93dfba91e125cb1a9edbd4f8e3150acc771c1a5e" + +[[package]] +name = "ppv-lite86" +version = "0.2.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac74c624d6b2d21f425f752262f42188365d7b8ff1aff74c82e45136510a4857" + +[[package]] +name = "rand" +version = "0.8.3" +source = "git+https://github.com/rust-random/rand.git?tag=0.8.3#6ecbe2626b2cc6110a25c97b1702b347574febc7" +dependencies = [ + "libc", + "rand_chacha", + "rand_core", + "rand_hc", +] + +[[package]] +name = "rand_chacha" +version = "0.3.0" +source = "git+https://github.com/rust-random/rand.git?tag=0.8.3#6ecbe2626b2cc6110a25c97b1702b347574febc7" +dependencies = [ + "ppv-lite86", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.6.1" +source = "git+https://github.com/rust-random/rand.git?tag=0.8.3#6ecbe2626b2cc6110a25c97b1702b347574febc7" +dependencies = [ + "getrandom", +] + +[[package]] +name = "rand_hc" +version = "0.3.0" +source = "git+https://github.com/rust-random/rand.git?tag=0.8.3#6ecbe2626b2cc6110a25c97b1702b347574febc7" +dependencies = [ + "rand_core", +] + +[[package]] +name = "wasi" +version = "0.10.2+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" diff --git a/pkgs/build-support/rust/test/import-cargo-lock/git-dependency-tag/Cargo.toml b/pkgs/build-support/rust/test/import-cargo-lock/git-dependency-tag/Cargo.toml new file mode 100644 index 000000000000..1bda7336c263 --- /dev/null +++ b/pkgs/build-support/rust/test/import-cargo-lock/git-dependency-tag/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "git-dependency-tag" +version = "0.1.0" +authors = ["Daniël de Kok "] +edition = "2018" + +[dependencies] +rand = { git = "https://github.com/rust-random/rand.git", tag = "0.8.3" } diff --git a/pkgs/build-support/rust/test/import-cargo-lock/git-dependency-tag/default.nix b/pkgs/build-support/rust/test/import-cargo-lock/git-dependency-tag/default.nix new file mode 100644 index 000000000000..2a2f860ac8a1 --- /dev/null +++ b/pkgs/build-support/rust/test/import-cargo-lock/git-dependency-tag/default.nix @@ -0,0 +1,21 @@ +{ rustPlatform }: + +rustPlatform.buildRustPackage { + pname = "git-dependency-tag"; + version = "0.1.0"; + + src = ./.; + + cargoLock = { + lockFile = ./Cargo.lock; + outputHashes = { + "rand-0.8.3" = "0l3p174bpwia61vcvxz5mw65a13ri3wy94z04xrnyy5lzciykz4f"; + }; + }; + + doInstallCheck = true; + + installCheckPhase = '' + $out/bin/git-dependency-tag + ''; +} diff --git a/pkgs/build-support/rust/test/import-cargo-lock/git-dependency-tag/src/main.rs b/pkgs/build-support/rust/test/import-cargo-lock/git-dependency-tag/src/main.rs new file mode 100644 index 000000000000..50b4ed799e43 --- /dev/null +++ b/pkgs/build-support/rust/test/import-cargo-lock/git-dependency-tag/src/main.rs @@ -0,0 +1,9 @@ +use rand::Rng; + +fn main() { + let mut rng = rand::thread_rng(); + + // Always draw zero :). + let roll: u8 = rng.gen_range(0..1); + assert_eq!(roll, 0); +} diff --git a/pkgs/build-support/rust/test/import-cargo-lock/git-dependency/Cargo.lock b/pkgs/build-support/rust/test/import-cargo-lock/git-dependency/Cargo.lock index 50600ef4caa5..fa71865b3e5f 100644 --- a/pkgs/build-support/rust/test/import-cargo-lock/git-dependency/Cargo.lock +++ b/pkgs/build-support/rust/test/import-cargo-lock/git-dependency/Cargo.lock @@ -1,5 +1,7 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. +version = 3 + [[package]] name = "cfg-if" version = "1.0.0" @@ -39,7 +41,7 @@ checksum = "ac74c624d6b2d21f425f752262f42188365d7b8ff1aff74c82e45136510a4857" [[package]] name = "rand" version = "0.8.3" -source = "git+https://github.com/rust-random/rand.git?rev=0.8.3#6ecbe2626b2cc6110a25c97b1702b347574febc7" +source = "git+https://github.com/rust-random/rand.git#f0e01ee0a7257753cc51b291f62666f4765923ef" dependencies = [ "libc", "rand_chacha", @@ -50,7 +52,7 @@ dependencies = [ [[package]] name = "rand_chacha" version = "0.3.0" -source = "git+https://github.com/rust-random/rand.git?rev=0.8.3#6ecbe2626b2cc6110a25c97b1702b347574febc7" +source = "git+https://github.com/rust-random/rand.git#f0e01ee0a7257753cc51b291f62666f4765923ef" dependencies = [ "ppv-lite86", "rand_core", @@ -58,8 +60,8 @@ dependencies = [ [[package]] name = "rand_core" -version = "0.6.1" -source = "git+https://github.com/rust-random/rand.git?rev=0.8.3#6ecbe2626b2cc6110a25c97b1702b347574febc7" +version = "0.6.2" +source = "git+https://github.com/rust-random/rand.git#f0e01ee0a7257753cc51b291f62666f4765923ef" dependencies = [ "getrandom", ] @@ -67,7 +69,7 @@ dependencies = [ [[package]] name = "rand_hc" version = "0.3.0" -source = "git+https://github.com/rust-random/rand.git?rev=0.8.3#6ecbe2626b2cc6110a25c97b1702b347574febc7" +source = "git+https://github.com/rust-random/rand.git#f0e01ee0a7257753cc51b291f62666f4765923ef" dependencies = [ "rand_core", ] diff --git a/pkgs/build-support/rust/test/import-cargo-lock/git-dependency/Cargo.toml b/pkgs/build-support/rust/test/import-cargo-lock/git-dependency/Cargo.toml index 11ee8b1763e6..a902dea9fcd0 100644 --- a/pkgs/build-support/rust/test/import-cargo-lock/git-dependency/Cargo.toml +++ b/pkgs/build-support/rust/test/import-cargo-lock/git-dependency/Cargo.toml @@ -5,4 +5,4 @@ authors = ["Daniël de Kok "] edition = "2018" [dependencies] -rand = { git = "https://github.com/rust-random/rand.git", rev = "0.8.3" } +rand = { git = "https://github.com/rust-random/rand.git" } diff --git a/pkgs/build-support/rust/test/import-cargo-lock/git-dependency/default.nix b/pkgs/build-support/rust/test/import-cargo-lock/git-dependency/default.nix index 17276c5f5c3c..944de9b45cb5 100644 --- a/pkgs/build-support/rust/test/import-cargo-lock/git-dependency/default.nix +++ b/pkgs/build-support/rust/test/import-cargo-lock/git-dependency/default.nix @@ -9,7 +9,7 @@ rustPlatform.buildRustPackage { cargoLock = { lockFile = ./Cargo.lock; outputHashes = { - "rand-0.8.3" = "0l3p174bpwia61vcvxz5mw65a13ri3wy94z04xrnyy5lzciykz4f"; + "rand-0.8.3" = "0ya2hia3cn31qa8894s3av2s8j5bjwb6yq92k0jsnlx7jid0jwqa"; }; }; From f21712edaa61d8c0b0f577751de08f3a4f10ee46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Sat, 11 Sep 2021 11:14:58 +0200 Subject: [PATCH 3/3] importCargoLock: add docs how to run these tests --- pkgs/build-support/rust/test/import-cargo-lock/default.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/build-support/rust/test/import-cargo-lock/default.nix b/pkgs/build-support/rust/test/import-cargo-lock/default.nix index ad2d46dd2d4c..95f1711d2da7 100644 --- a/pkgs/build-support/rust/test/import-cargo-lock/default.nix +++ b/pkgs/build-support/rust/test/import-cargo-lock/default.nix @@ -1,5 +1,7 @@ { callPackage }: +# Build like this from nixpkgs root: +# $ nix-build -A tests.importCargoLock { basic = callPackage ./basic { }; gitDependency = callPackage ./git-dependency { };