zig

fork of https://codeberg.org/ziglang/zig
Log | Files | Refs | README | LICENSE

commit ff57a264ad99562de16d9565d5bd4ac9cd964e5d (tree)
parent 105078519a831878066fa995749d4b918d940b2c
Author: xEgoist <101279047+xEgoist@users.noreply.github.com>
Date:   Sat,  3 Jun 2023 20:45:08 +0000

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`.
Diffstat:
Mlib/std/Build/Step/Compile.zig | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

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