| ... | ... | @@ -1656,21 +1656,18 @@ fn buildOutputType( |
| 1656 | 1656 | if (arg_mode == .run) { |
| 1657 | 1657 | break :l global_cache_directory; |
| 1658 | 1658 | } |
| 1659 | | const cache_dir_path = blk: { |
| 1660 | | if (root_pkg) |pkg| { |
| 1661 | | if (pkg.root_src_directory.path) |p| { |
| 1662 | | break :blk try fs.path.join(arena, &[_][]const u8{ p, "zig-cache" }); |
| 1663 | | } |
| 1664 | | } |
| 1665 | | break :blk "zig-cache"; |
| 1666 | | }; |
| 1667 | | const cache_parent_dir = if (root_pkg) |pkg| pkg.root_src_directory.handle else fs.cwd(); |
| 1668 | | const dir = try cache_parent_dir.makeOpenPath("zig-cache", .{}); |
| 1669 | | cleanup_local_cache_dir = dir; |
| 1670 | | break :l .{ |
| 1671 | | .handle = dir, |
| 1672 | | .path = cache_dir_path, |
| 1673 | | }; |
| 1659 | if (root_pkg) |pkg| { |
| 1660 | const cache_dir_path = try pkg.root_src_directory.join(arena, &[_][]const u8{"zig-cache"}); |
| 1661 | const dir = try pkg.root_src_directory.handle.makeOpenPath("zig-cache", .{}); |
| 1662 | cleanup_local_cache_dir = dir; |
| 1663 | break :l .{ |
| 1664 | .handle = dir, |
| 1665 | .path = cache_dir_path, |
| 1666 | }; |
| 1667 | } |
| 1668 | // Otherwise we really don't have a reasonable place to put the local cache directory, |
| 1669 | // so we utilize the global one. |
| 1670 | break :l global_cache_directory; |
| 1674 | 1671 | }; |
| 1675 | 1672 | |
| 1676 | 1673 | if (build_options.have_llvm and emit_asm != .no) { |