[lto-nix] enable LTO for release builds using Nix

This commit is contained in:
Alex 2024-02-07 19:41:23 +01:00
parent 59930977e0
commit 2b92e8d7c6
Signed by: lx
GPG key ID: 0E496D15096376BE
2 changed files with 3 additions and 2 deletions

View file

@ -45,7 +45,7 @@ else let
inherit (rustLib) fetchCratesIo fetchCrateLocal fetchCrateGit fetchCrateAlternativeRegistry expandFeatures decideProfile genDrvsByProfile; inherit (rustLib) fetchCratesIo fetchCrateLocal fetchCrateGit fetchCrateAlternativeRegistry expandFeatures decideProfile genDrvsByProfile;
profilesByName = { profilesByName = {
dev = builtins.fromTOML "lto = \"off\"\n"; dev = builtins.fromTOML "lto = \"off\"\n";
release = builtins.fromTOML "debug = true\n"; release = builtins.fromTOML "codegen-units = 1\nlto = true\nopt-level = \"s\"\nstrip = true\n";
}; };
rootFeatures' = expandFeatures rootFeatures; rootFeatures' = expandFeatures rootFeatures;
overridableMkRustCrate = f: overridableMkRustCrate = f:

View file

@ -131,7 +131,8 @@ aws-sdk-config = "1.13"
aws-sdk-s3 = "1.14" aws-sdk-s3 = "1.14"
[profile.dev] [profile.dev]
lto = "thin" #lto = "thin" # disabled for now, adds 2-4 min to each CI build
lto = "off"
[profile.release] [profile.release]
lto = true lto = true