diff --git a/crate2nix/Cargo.nix b/crate2nix/Cargo.nix index 21e953c1..43264043 100644 --- a/crate2nix/Cargo.nix +++ b/crate2nix/Cargo.nix @@ -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 { @@ -2878,7 +2880,7 @@ rec { sha256 = crateConfig.sha256; } ); - inherit features dependencies buildDependencies crateRenames; + inherit features dependencies buildDependencies crateRenames release; } ); in diff --git a/crate2nix/templates/build.nix.tera b/crate2nix/templates/build.nix.tera index d219ae60..bf18a230 100644 --- a/crate2nix/templates/build.nix.tera +++ b/crate2nix/templates/build.nix.tera @@ -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 { diff --git a/crate2nix/templates/nix/crate2nix/default.nix b/crate2nix/templates/nix/crate2nix/default.nix index f2b74f0e..db8403b5 100644 --- a/crate2nix/templates/nix/crate2nix/default.nix +++ b/crate2nix/templates/nix/crate2nix/default.nix @@ -9,6 +9,7 @@ , strictDeprecation ? true , crates ? {} , rootFeatures ? [] +, release ? true }: rec { # #} @@ -243,7 +244,7 @@ rec { sha256 = crateConfig.sha256; } ); - inherit features dependencies buildDependencies crateRenames; + inherit features dependencies buildDependencies crateRenames release; } ); in diff --git a/sample_projects/bin_with_git_branch_dep/Cargo.nix b/sample_projects/bin_with_git_branch_dep/Cargo.nix index 9b06035e..f2a1e0fc 100644 --- a/sample_projects/bin_with_git_branch_dep/Cargo.nix +++ b/sample_projects/bin_with_git_branch_dep/Cargo.nix @@ -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 { @@ -344,7 +346,7 @@ rec { sha256 = crateConfig.sha256; } ); - inherit features dependencies buildDependencies crateRenames; + inherit features dependencies buildDependencies crateRenames release; } ); in diff --git a/sample_projects/bin_with_git_submodule_dep/Cargo.nix b/sample_projects/bin_with_git_submodule_dep/Cargo.nix index b16f350e..80a48ac3 100644 --- a/sample_projects/bin_with_git_submodule_dep/Cargo.nix +++ b/sample_projects/bin_with_git_submodule_dep/Cargo.nix @@ -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 { @@ -1518,7 +1520,7 @@ rec { sha256 = crateConfig.sha256; } ); - inherit features dependencies buildDependencies crateRenames; + inherit features dependencies buildDependencies crateRenames release; } ); in diff --git a/tests.nix b/tests.nix index f598ffe7..fbf5c015 100644 --- a/tests.nix +++ b/tests.nix @@ -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