| ... | @@ -1624,21 +1624,18 @@ fn buildOutputType( | ... | @@ -1624,21 +1624,18 @@ fn buildOutputType( |
| 1624 | if (arg_mode == .run) { | 1624 | if (arg_mode == .run) { |
| 1625 | break :l global_cache_directory; | 1625 | break :l global_cache_directory; |
| 1626 | } | 1626 | } |
| 1627 | const cache_dir_path = blk: { | 1627 | if (root_pkg) |pkg| { |
| 1628 | if (root_pkg) |pkg| { | 1628 | const cache_dir_path = try pkg.root_src_directory.join(arena, &[_][]const u8{"zig-cache"}); |
| 1629 | if (pkg.root_src_directory.path) |p| { | 1629 | const dir = try pkg.root_src_directory.handle.makeOpenPath("zig-cache", .{}); |
| 1630 | break :blk try fs.path.join(arena, &[_][]const u8{ p, "zig-cache" }); | 1630 | cleanup_local_cache_dir = dir; |
| 1631 | } | 1631 | break :l .{ |
| 1632 | } | 1632 | .handle = dir, |
| 1633 | break :blk "zig-cache"; | 1633 | .path = cache_dir_path, |
| 1634 | }; | 1634 | }; |
| 1635 | const cache_parent_dir = if (root_pkg) |pkg| pkg.root_src_directory.handle else fs.cwd(); | 1635 | } |
| 1636 | const dir = try cache_parent_dir.makeOpenPath("zig-cache", .{}); | 1636 | // Otherwise we really don't have a reasonable place to put the local cache directory, |
| 1637 | cleanup_local_cache_dir = dir; | 1637 | // so we utilize the global one. |
| 1638 | break :l .{ | 1638 | break :l global_cache_directory; |
| 1639 | .handle = dir, | | |
| 1640 | .path = cache_dir_path, | | |
| 1641 | }; | | |
| 1642 | }; | 1639 | }; |
| 1643 | | 1640 | |
| 1644 | if (build_options.have_llvm and emit_asm != .no) { | 1641 | if (build_options.have_llvm and emit_asm != .no) { |