| author | |
| committer | |
| log | dbb11915bd03992ff9b64cd7f373faa428f0cedf |
| tree | 70556470246c0c54fa1e03a46c107ff737eff267 |
| parent | fe61b19b9667bcd9f4ce507683bcc224d5dad1de |
Closes https://github.com/ziglang/zig/issues/19284
As of 9f2cb920c055bc990cc9d593b8dc9eaa450d07b9 configuring the global
cache directory to a relative path causes errors of the following form
when cross compiling to `windows-gnu`.
```
error: unable to generate DLL import .lib file for kernel32: FileNotFound
```
The issue occurred because the `def_final_path` included the global
cache path as a prefix and later on the `def_final_file` was created
using that path with the global cache directory handle.1 files changed, 1 insertions(+), 1 deletions(-)
src/mingw.zig+1-1| ... | ... | @@ -268,7 +268,7 @@ pub fn buildImportLib(comp: *Compilation, lib_name: []const u8) !void { |
| 268 | 268 | |
| 269 | 269 | { |
| 270 | 270 | // new scope to ensure definition file is written before passing the path to WriteImportLibrary |
| 271 | const def_final_file = try comp.global_cache_directory.handle.createFile(def_final_path, .{ .truncate = true }); | |
| 271 | const def_final_file = try o_dir.createFile(final_def_basename, .{ .truncate = true }); | |
| 272 | 272 | defer def_final_file.close(); |
| 273 | 273 | try pp.prettyPrintTokens(def_final_file.writer()); |
| 274 | 274 | } |