Skip to content

Commit a047100

Browse files
committed
Auto detect workspace_member for git sources.
Cargo does this for git repositories as well: rust-lang/cargo#1462 (comment) This will fix #33, #53 -- integration tests pending. It depends on a nixpkgs buildRustCrate feature PR: NixOS/nixpkgs#82155
1 parent 9423494 commit a047100

File tree

8 files changed

+708
-0
lines changed

8 files changed

+708
-0
lines changed

crate2nix/templates/build.nix.tera

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ rec {
105105
{%- elif crate.source.LocalDirectory.path %}
106106
src = (builtins.filterSource sourceFilter {{crate.source.LocalDirectory.path | safe}});
107107
{%- elif crate.source.Git %}
108+
workspace_member = null;
108109
src = pkgs.fetchgit {
109110
url = {{crate.source.Git.url}};
110111
rev = {{crate.source.Git.rev}};

sample_projects/bin_with_git_branch_dep/Cargo.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ rec {
9898
crateName = "nix-base32";
9999
version = "0.1.2-alpha.0";
100100
edition = "2018";
101+
workspace_member = null;
101102
src = pkgs.fetchgit {
102103
url = "https://github.com/kolloch/nix-base32";
103104
rev = "42f5544e51187f0c7535d453fcffb4b524c99eb2";

sample_projects/bin_with_git_submodule_dep/Cargo.nix

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -736,6 +736,7 @@ rec {
736736
crateName = "librocksdb-sys";
737737
version = "6.2.4";
738738
edition = "2015";
739+
workspace_member = null;
739740
src = pkgs.fetchgit {
740741
url = "https://github.com/rust-rocksdb/rust-rocksdb";
741742
rev = "64bd09899306d23dfd1504465bd1e9adb15fb9ca";
@@ -980,6 +981,7 @@ rec {
980981
crateName = "rocksdb";
981982
version = "0.13.0";
982983
edition = "2015";
984+
workspace_member = null;
983985
src = pkgs.fetchgit {
984986
url = "https://github.com/rust-rocksdb/rust-rocksdb";
985987
rev = "64bd09899306d23dfd1504465bd1e9adb15fb9ca";

sample_projects/sub_dir_crates/Cargo.lock

Lines changed: 19 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)