Skip to content

Commit ff57a26

Browse files
authored
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 parent 1050785 commit ff57a26

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/std/Build/Step/Compile.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -691,7 +691,7 @@ pub fn isStaticLibrary(self: *Compile) bool {
691691
pub 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

0 commit comments

Comments
 (0)