authorgravatar for egoist@egoistic.devxEgoist <egoist@egoistic.dev> 2023-06-03 20:45:08+00:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2023-06-03 16:45:08-04:00
logff57a264ad99562de16d9565d5bd4ac9cd964e5d
treef22cc6becf32e5282d2d391b953e77674cfab747
parent105078519a831878066fa995749d4b918d940b2c
signaturebadge-question-mark Signed by PGP key 4AEE18F83AFDEB23

Build: fix producesPdbFile logic (#15756)

Fixes bug causing ReleaseSmall to fail on Windows. Due to the change in default behavior of ReleaseSmall, debug info are stripped by default. However because `Compile.create` still defaults to null, `producesPdbFile` will report true for `lib/std/Build/Step/InstallArtifact.zig` causing it to fail on copying a file that does not exist. This commit change the default of strip depending on `optimize`.

1 files changed, 1 insertions(+), 1 deletions(-)

lib/std/Build/Step/Compile.zig+1-1
......@@ -691,7 +691,7 @@ pub fn isStaticLibrary(self: *Compile) bool {
691691pub fn producesPdbFile(self: *Compile) bool {
692692 if (!self.target.isWindows() and !self.target.isUefi()) return false;
693693 if (self.target.getObjectFormat() == .c) return false;
694 if (self.strip == true) return false;
694 if (self.strip == true or (self.strip == null and self.optimize == .ReleaseSmall)) return false;
695695 return self.isDynamicLibrary() or self.kind == .exe or self.kind == .@"test";
696696}
697697