| ... | @@ -352,11 +352,6 @@ pub const File = struct { | ... | @@ -352,11 +352,6 @@ pub const File = struct { |
| 352 | } | 352 | } |
| 353 | switch (base.tag) { | 353 | switch (base.tag) { |
| 354 | .macho => if (base.file) |f| { | 354 | .macho => if (base.file) |f| { |
| 355 | if (base.intermediary_basename != null) { | | |
| 356 | // The file we have open is not the final file that we want to | | |
| 357 | // make executable, so we don't have to close it. | | |
| 358 | return; | | |
| 359 | } | | |
| 360 | if (comptime builtin.target.isDarwin() and builtin.target.cpu.arch == .aarch64) { | 355 | if (comptime builtin.target.isDarwin() and builtin.target.cpu.arch == .aarch64) { |
| 361 | if (base.options.target.cpu.arch == .aarch64) { | 356 | if (base.options.target.cpu.arch == .aarch64) { |
| 362 | // XNU starting with Big Sur running on arm64 is caching inodes of running binaries. | 357 | // XNU starting with Big Sur running on arm64 is caching inodes of running binaries. |
| ... | @@ -371,8 +366,10 @@ pub const File = struct { | ... | @@ -371,8 +366,10 @@ pub const File = struct { |
| 371 | try emit.directory.handle.copyFile(emit.sub_path, emit.directory.handle, emit.sub_path, .{}); | 366 | try emit.directory.handle.copyFile(emit.sub_path, emit.directory.handle, emit.sub_path, .{}); |
| 372 | } | 367 | } |
| 373 | } | 368 | } |
| 374 | f.close(); | 369 | if (base.intermediary_basename == null) { |
| 375 | base.file = null; | 370 | f.close(); |
| | 371 | base.file = null; |
| | 372 | } |
| 376 | }, | 373 | }, |
| 377 | .coff, .elf, .plan9 => if (base.file) |f| { | 374 | .coff, .elf, .plan9 => if (base.file) |f| { |
| 378 | if (base.intermediary_basename != null) { | 375 | if (base.intermediary_basename != null) { |