Skip to content

Commit

Permalink
Make it easy to use "release = false" builds
Browse files Browse the repository at this point in the history
  • Loading branch information
kolloch committed Mar 12, 2020
1 parent 9423494 commit f2d16ac
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 5 deletions.
4 changes: 3 additions & 1 deletion crate2nix/Cargo.nix
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
, rootFeatures ? [ "default" ]
# If true, throw errors instead of issueing deprecation warnings.
, strictDeprecation ? false
# Whether to perform release builds: longer compile times, faster binaries.
, release ? true
}:

rec {
Expand Down Expand Up @@ -2878,7 +2880,7 @@ rec {
sha256 = crateConfig.sha256;
}
);
inherit features dependencies buildDependencies crateRenames;
inherit features dependencies buildDependencies crateRenames release;
}
);
in
Expand Down
2 changes: 2 additions & 0 deletions crate2nix/templates/build.nix.tera
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
, rootFeatures ? [ "default" ]
# If true, throw errors instead of issueing deprecation warnings.
, strictDeprecation ? false
# Whether to perform release builds: longer compile times, faster binaries.
, release ? true
}:

rec {
Expand Down
3 changes: 2 additions & 1 deletion crate2nix/templates/nix/crate2nix/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
, strictDeprecation ? true
, crates ? {}
, rootFeatures ? []
, release ? true
}:
rec {
# #}
Expand Down Expand Up @@ -243,7 +244,7 @@ rec {
sha256 = crateConfig.sha256;
}
);
inherit features dependencies buildDependencies crateRenames;
inherit features dependencies buildDependencies crateRenames release;
}
);
in
Expand Down
4 changes: 3 additions & 1 deletion sample_projects/bin_with_git_branch_dep/Cargo.nix
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
, rootFeatures ? [ "default" ]
# If true, throw errors instead of issueing deprecation warnings.
, strictDeprecation ? false
# Whether to perform release builds: longer compile times, faster binaries.
, release ? true
}:

rec {
Expand Down Expand Up @@ -344,7 +346,7 @@ rec {
sha256 = crateConfig.sha256;
}
);
inherit features dependencies buildDependencies crateRenames;
inherit features dependencies buildDependencies crateRenames release;
}
);
in
Expand Down
4 changes: 3 additions & 1 deletion sample_projects/bin_with_git_submodule_dep/Cargo.nix
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
, rootFeatures ? [ "default" ]
# If true, throw errors instead of issueing deprecation warnings.
, strictDeprecation ? false
# Whether to perform release builds: longer compile times, faster binaries.
, release ? true
}:

rec {
Expand Down Expand Up @@ -1518,7 +1520,7 @@ rec {
sha256 = crateConfig.sha256;
}
);
inherit features dependencies buildDependencies crateRenames;
inherit features dependencies buildDependencies crateRenames release;
}
);
in
Expand Down
3 changes: 2 additions & 1 deletion tests.nix
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ let
./. + "/${pregeneratedBuild}";
derivationAttr =
lib.attrByPath
derivationAttrPath null (buildTestPkgs.callPackage generatedCargoNix {});
derivationAttrPath null
(buildTestPkgs.callPackage generatedCargoNix { release = false; });
derivation =
if builtins.isNull customBuild
then
Expand Down

0 comments on commit f2d16ac

Please sign in to comment.