| author | |
| committer | |
| log | 2008d0f7c9cfb0ab5ea908c216751dbc335d1735 |
| tree | 335b4dabfafa222eb5f94befbdb9211d74a7e5cb |
| parent | d750a78b2c0265bd7bb2b924c4c739cad5aa6666 |
| parent | 3b77f1ed7e69e8347e41c2f93dfdfc22f5ac07dd |
| signature |
rename zig-cache to .zig-cache9 files changed, 34 insertions(+), 34 deletions(-)
lib/compiler/fmt.zig+1-1| ... | ... | @@ -236,7 +236,7 @@ fn fmtPathDir( |
| 236 | 236 | while (try dir_it.next()) |entry| { |
| 237 | 237 | const is_dir = entry.kind == .directory; |
| 238 | 238 | |
| 239 | if (is_dir and (mem.eql(u8, entry.name, "zig-cache") or mem.eql(u8, entry.name, "zig-out"))) continue; | |
| 239 | if (mem.startsWith(u8, entry.name, ".")) continue; | |
| 240 | 240 | |
| 241 | 241 | if (is_dir or entry.kind == .file and (mem.endsWith(u8, entry.name, ".zig") or mem.endsWith(u8, entry.name, ".zon"))) { |
| 242 | 242 | const full_path = try fs.path.join(fmt.gpa, &[_][]const u8{ file_path, entry.name }); |
lib/std/debug.zig+1-1| ... | ... | @@ -1526,7 +1526,7 @@ test printLineFromFileAnyOs { |
| 1526 | 1526 | var test_dir = std.testing.tmpDir(.{}); |
| 1527 | 1527 | defer test_dir.cleanup(); |
| 1528 | 1528 | // Relies on testing.tmpDir internals which is not ideal, but LineInfo requires paths. |
| 1529 | const test_dir_path = try join(allocator, &.{ "zig-cache", "tmp", test_dir.sub_path[0..] }); | |
| 1529 | const test_dir_path = try join(allocator, &.{ ".zig-cache", "tmp", test_dir.sub_path[0..] }); | |
| 1530 | 1530 | defer allocator.free(test_dir_path); |
| 1531 | 1531 | |
| 1532 | 1532 | // Cases |
lib/std/fs/test.zig+5-5| ... | ... | @@ -325,7 +325,7 @@ test "accessAbsolute" { |
| 325 | 325 | const allocator = arena.allocator(); |
| 326 | 326 | |
| 327 | 327 | const base_path = blk: { |
| 328 | const relative_path = try fs.path.join(allocator, &.{ "zig-cache", "tmp", tmp.sub_path[0..] }); | |
| 328 | const relative_path = try fs.path.join(allocator, &.{ ".zig-cache", "tmp", tmp.sub_path[0..] }); | |
| 329 | 329 | break :blk try fs.realpathAlloc(allocator, relative_path); |
| 330 | 330 | }; |
| 331 | 331 | |
| ... | ... | @@ -344,7 +344,7 @@ test "openDirAbsolute" { |
| 344 | 344 | const allocator = arena.allocator(); |
| 345 | 345 | |
| 346 | 346 | const base_path = blk: { |
| 347 | const relative_path = try fs.path.join(allocator, &.{ "zig-cache", "tmp", tmp.sub_path[0..], "subdir" }); | |
| 347 | const relative_path = try fs.path.join(allocator, &.{ ".zig-cache", "tmp", tmp.sub_path[0..], "subdir" }); | |
| 348 | 348 | break :blk try fs.realpathAlloc(allocator, relative_path); |
| 349 | 349 | }; |
| 350 | 350 | |
| ... | ... | @@ -407,7 +407,7 @@ test "readLinkAbsolute" { |
| 407 | 407 | const allocator = arena.allocator(); |
| 408 | 408 | |
| 409 | 409 | const base_path = blk: { |
| 410 | const relative_path = try fs.path.join(allocator, &.{ "zig-cache", "tmp", tmp.sub_path[0..] }); | |
| 410 | const relative_path = try fs.path.join(allocator, &.{ ".zig-cache", "tmp", tmp.sub_path[0..] }); | |
| 411 | 411 | break :blk try fs.realpathAlloc(allocator, relative_path); |
| 412 | 412 | }; |
| 413 | 413 | |
| ... | ... | @@ -990,7 +990,7 @@ test "renameAbsolute" { |
| 990 | 990 | const allocator = arena.allocator(); |
| 991 | 991 | |
| 992 | 992 | const base_path = blk: { |
| 993 | const relative_path = try fs.path.join(allocator, &.{ "zig-cache", "tmp", tmp_dir.sub_path[0..] }); | |
| 993 | const relative_path = try fs.path.join(allocator, &.{ ".zig-cache", "tmp", tmp_dir.sub_path[0..] }); | |
| 994 | 994 | break :blk try fs.realpathAlloc(allocator, relative_path); |
| 995 | 995 | }; |
| 996 | 996 | |
| ... | ... | @@ -1772,7 +1772,7 @@ test "'.' and '..' in absolute functions" { |
| 1772 | 1772 | const allocator = arena.allocator(); |
| 1773 | 1773 | |
| 1774 | 1774 | const base_path = blk: { |
| 1775 | const relative_path = try fs.path.join(allocator, &.{ "zig-cache", "tmp", tmp.sub_path[0..] }); | |
| 1775 | const relative_path = try fs.path.join(allocator, &.{ ".zig-cache", "tmp", tmp.sub_path[0..] }); | |
| 1776 | 1776 | break :blk try fs.realpathAlloc(allocator, relative_path); |
| 1777 | 1777 | }; |
| 1778 | 1778 |
lib/std/posix/test.zig+7-7| ... | ... | @@ -101,7 +101,7 @@ test "open smoke test" { |
| 101 | 101 | const allocator = arena.allocator(); |
| 102 | 102 | |
| 103 | 103 | const base_path = blk: { |
| 104 | const relative_path = try fs.path.join(allocator, &[_][]const u8{ "zig-cache", "tmp", tmp.sub_path[0..] }); | |
| 104 | const relative_path = try fs.path.join(allocator, &[_][]const u8{ ".zig-cache", "tmp", tmp.sub_path[0..] }); | |
| 105 | 105 | break :blk try fs.realpathAlloc(allocator, relative_path); |
| 106 | 106 | }; |
| 107 | 107 | |
| ... | ... | @@ -1022,7 +1022,7 @@ test "rename smoke test" { |
| 1022 | 1022 | const allocator = arena.allocator(); |
| 1023 | 1023 | |
| 1024 | 1024 | const base_path = blk: { |
| 1025 | const relative_path = try fs.path.join(allocator, &[_][]const u8{ "zig-cache", "tmp", tmp.sub_path[0..] }); | |
| 1025 | const relative_path = try fs.path.join(allocator, &[_][]const u8{ ".zig-cache", "tmp", tmp.sub_path[0..] }); | |
| 1026 | 1026 | break :blk try fs.realpathAlloc(allocator, relative_path); |
| 1027 | 1027 | }; |
| 1028 | 1028 | |
| ... | ... | @@ -1079,7 +1079,7 @@ test "access smoke test" { |
| 1079 | 1079 | const allocator = arena.allocator(); |
| 1080 | 1080 | |
| 1081 | 1081 | const base_path = blk: { |
| 1082 | const relative_path = try fs.path.join(allocator, &[_][]const u8{ "zig-cache", "tmp", tmp.sub_path[0..] }); | |
| 1082 | const relative_path = try fs.path.join(allocator, &[_][]const u8{ ".zig-cache", "tmp", tmp.sub_path[0..] }); | |
| 1083 | 1083 | break :blk try fs.realpathAlloc(allocator, relative_path); |
| 1084 | 1084 | }; |
| 1085 | 1085 | |
| ... | ... | @@ -1153,7 +1153,7 @@ test "read with empty buffer" { |
| 1153 | 1153 | |
| 1154 | 1154 | // Get base abs path |
| 1155 | 1155 | const base_path = blk: { |
| 1156 | const relative_path = try fs.path.join(allocator, &[_][]const u8{ "zig-cache", "tmp", tmp.sub_path[0..] }); | |
| 1156 | const relative_path = try fs.path.join(allocator, &[_][]const u8{ ".zig-cache", "tmp", tmp.sub_path[0..] }); | |
| 1157 | 1157 | break :blk try fs.realpathAlloc(allocator, relative_path); |
| 1158 | 1158 | }; |
| 1159 | 1159 | |
| ... | ... | @@ -1178,7 +1178,7 @@ test "pread with empty buffer" { |
| 1178 | 1178 | |
| 1179 | 1179 | // Get base abs path |
| 1180 | 1180 | const base_path = blk: { |
| 1181 | const relative_path = try fs.path.join(allocator, &[_][]const u8{ "zig-cache", "tmp", tmp.sub_path[0..] }); | |
| 1181 | const relative_path = try fs.path.join(allocator, &[_][]const u8{ ".zig-cache", "tmp", tmp.sub_path[0..] }); | |
| 1182 | 1182 | break :blk try fs.realpathAlloc(allocator, relative_path); |
| 1183 | 1183 | }; |
| 1184 | 1184 | |
| ... | ... | @@ -1203,7 +1203,7 @@ test "write with empty buffer" { |
| 1203 | 1203 | |
| 1204 | 1204 | // Get base abs path |
| 1205 | 1205 | const base_path = blk: { |
| 1206 | const relative_path = try fs.path.join(allocator, &[_][]const u8{ "zig-cache", "tmp", tmp.sub_path[0..] }); | |
| 1206 | const relative_path = try fs.path.join(allocator, &[_][]const u8{ ".zig-cache", "tmp", tmp.sub_path[0..] }); | |
| 1207 | 1207 | break :blk try fs.realpathAlloc(allocator, relative_path); |
| 1208 | 1208 | }; |
| 1209 | 1209 | |
| ... | ... | @@ -1228,7 +1228,7 @@ test "pwrite with empty buffer" { |
| 1228 | 1228 | |
| 1229 | 1229 | // Get base abs path |
| 1230 | 1230 | const base_path = blk: { |
| 1231 | const relative_path = try fs.path.join(allocator, &[_][]const u8{ "zig-cache", "tmp", tmp.sub_path[0..] }); | |
| 1231 | const relative_path = try fs.path.join(allocator, &[_][]const u8{ ".zig-cache", "tmp", tmp.sub_path[0..] }); | |
| 1232 | 1232 | break :blk try fs.realpathAlloc(allocator, relative_path); |
| 1233 | 1233 | }; |
| 1234 | 1234 |
lib/std/testing.zig+3-3| ... | ... | @@ -563,11 +563,11 @@ pub fn tmpDir(opts: std.fs.Dir.OpenDirOptions) TmpDir { |
| 563 | 563 | _ = std.fs.base64_encoder.encode(&sub_path, &random_bytes); |
| 564 | 564 | |
| 565 | 565 | const cwd = std.fs.cwd(); |
| 566 | var cache_dir = cwd.makeOpenPath("zig-cache", .{}) catch | |
| 567 | @panic("unable to make tmp dir for testing: unable to make and open zig-cache dir"); | |
| 566 | var cache_dir = cwd.makeOpenPath(".zig-cache", .{}) catch | |
| 567 | @panic("unable to make tmp dir for testing: unable to make and open .zig-cache dir"); | |
| 568 | 568 | defer cache_dir.close(); |
| 569 | 569 | const parent_dir = cache_dir.makeOpenPath("tmp", .{}) catch |
| 570 | @panic("unable to make tmp dir for testing: unable to make and open zig-cache/tmp dir"); | |
| 570 | @panic("unable to make tmp dir for testing: unable to make and open .zig-cache/tmp dir"); | |
| 571 | 571 | const dir = parent_dir.makeOpenPath(&sub_path, opts) catch |
| 572 | 572 | @panic("unable to make tmp dir for testing: unable to make and open the tmp dir"); |
| 573 | 573 |
src/Package/Fetch.zig+6-6| ... | ... | @@ -2000,7 +2000,7 @@ test "zip" { |
| 2000 | 2000 | try bw.flush(); |
| 2001 | 2001 | } |
| 2002 | 2002 | |
| 2003 | const zip_path = try std.fmt.allocPrint(gpa, "zig-cache/tmp/{s}/test.zip", .{tmp.sub_path}); | |
| 2003 | const zip_path = try std.fmt.allocPrint(gpa, ".zig-cache/tmp/{s}/test.zip", .{tmp.sub_path}); | |
| 2004 | 2004 | defer gpa.free(zip_path); |
| 2005 | 2005 | |
| 2006 | 2006 | var fb: TestFetchBuilder = undefined; |
| ... | ... | @@ -2033,7 +2033,7 @@ test "zip with one root folder" { |
| 2033 | 2033 | try bw.flush(); |
| 2034 | 2034 | } |
| 2035 | 2035 | |
| 2036 | const zip_path = try std.fmt.allocPrint(gpa, "zig-cache/tmp/{s}/test.zip", .{tmp.sub_path}); | |
| 2036 | const zip_path = try std.fmt.allocPrint(gpa, ".zig-cache/tmp/{s}/test.zip", .{tmp.sub_path}); | |
| 2037 | 2037 | defer gpa.free(zip_path); |
| 2038 | 2038 | |
| 2039 | 2039 | var fb: TestFetchBuilder = undefined; |
| ... | ... | @@ -2069,7 +2069,7 @@ test "tarball with duplicate paths" { |
| 2069 | 2069 | |
| 2070 | 2070 | const tarball_name = "duplicate_paths.tar.gz"; |
| 2071 | 2071 | try saveEmbedFile(tarball_name, tmp.dir); |
| 2072 | const tarball_path = try std.fmt.allocPrint(gpa, "zig-cache/tmp/{s}/{s}", .{ tmp.sub_path, tarball_name }); | |
| 2072 | const tarball_path = try std.fmt.allocPrint(gpa, ".zig-cache/tmp/{s}/{s}", .{ tmp.sub_path, tarball_name }); | |
| 2073 | 2073 | defer gpa.free(tarball_path); |
| 2074 | 2074 | |
| 2075 | 2075 | // Run tarball fetch, expect to fail |
| ... | ... | @@ -2101,7 +2101,7 @@ test "tarball with excluded duplicate paths" { |
| 2101 | 2101 | |
| 2102 | 2102 | const tarball_name = "duplicate_paths_excluded.tar.gz"; |
| 2103 | 2103 | try saveEmbedFile(tarball_name, tmp.dir); |
| 2104 | const tarball_path = try std.fmt.allocPrint(gpa, "zig-cache/tmp/{s}/{s}", .{ tmp.sub_path, tarball_name }); | |
| 2104 | const tarball_path = try std.fmt.allocPrint(gpa, ".zig-cache/tmp/{s}/{s}", .{ tmp.sub_path, tarball_name }); | |
| 2105 | 2105 | defer gpa.free(tarball_path); |
| 2106 | 2106 | |
| 2107 | 2107 | // Run tarball fetch, should succeed |
| ... | ... | @@ -2145,7 +2145,7 @@ test "tarball without root folder" { |
| 2145 | 2145 | |
| 2146 | 2146 | const tarball_name = "no_root.tar.gz"; |
| 2147 | 2147 | try saveEmbedFile(tarball_name, tmp.dir); |
| 2148 | const tarball_path = try std.fmt.allocPrint(gpa, "zig-cache/tmp/{s}/{s}", .{ tmp.sub_path, tarball_name }); | |
| 2148 | const tarball_path = try std.fmt.allocPrint(gpa, ".zig-cache/tmp/{s}/{s}", .{ tmp.sub_path, tarball_name }); | |
| 2149 | 2149 | defer gpa.free(tarball_path); |
| 2150 | 2150 | |
| 2151 | 2151 | // Run tarball fetch, should succeed |
| ... | ... | @@ -2176,7 +2176,7 @@ test "set executable bit based on file content" { |
| 2176 | 2176 | |
| 2177 | 2177 | const tarball_name = "executables.tar.gz"; |
| 2178 | 2178 | try saveEmbedFile(tarball_name, tmp.dir); |
| 2179 | const tarball_path = try std.fmt.allocPrint(gpa, "zig-cache/tmp/{s}/{s}", .{ tmp.sub_path, tarball_name }); | |
| 2179 | const tarball_path = try std.fmt.allocPrint(gpa, ".zig-cache/tmp/{s}/{s}", .{ tmp.sub_path, tarball_name }); | |
| 2180 | 2180 | defer gpa.free(tarball_path); |
| 2181 | 2181 | |
| 2182 | 2182 | // $ tar -tvf executables.tar.gz |
src/main.zig+4-4| ... | ... | @@ -123,6 +123,7 @@ const debug_usage = normal_usage ++ |
| 123 | 123 | ; |
| 124 | 124 | |
| 125 | 125 | const usage = if (build_options.enable_debug_extensions) debug_usage else normal_usage; |
| 126 | const default_local_zig_cache_basename = ".zig-cache"; | |
| 126 | 127 | |
| 127 | 128 | var log_scopes: std.ArrayListUnmanaged([]const u8) = .{}; |
| 128 | 129 | |
| ... | ... | @@ -3107,14 +3108,13 @@ fn buildOutputType( |
| 3107 | 3108 | |
| 3108 | 3109 | // search upwards from cwd until we find directory with build.zig |
| 3109 | 3110 | const cwd_path = try process.getCwdAlloc(arena); |
| 3110 | const zig_cache = "zig-cache"; | |
| 3111 | 3111 | var dirname: []const u8 = cwd_path; |
| 3112 | 3112 | while (true) { |
| 3113 | 3113 | const joined_path = try fs.path.join(arena, &.{ |
| 3114 | 3114 | dirname, Package.build_zig_basename, |
| 3115 | 3115 | }); |
| 3116 | 3116 | if (fs.cwd().access(joined_path, .{})) |_| { |
| 3117 | const cache_dir_path = try fs.path.join(arena, &.{ dirname, zig_cache }); | |
| 3117 | const cache_dir_path = try fs.path.join(arena, &.{ dirname, default_local_zig_cache_basename }); | |
| 3118 | 3118 | const dir = try fs.cwd().makeOpenPath(cache_dir_path, .{}); |
| 3119 | 3119 | cleanup_local_cache_dir = dir; |
| 3120 | 3120 | break :l .{ .handle = dir, .path = cache_dir_path }; |
| ... | ... | @@ -4869,9 +4869,9 @@ fn cmdBuild(gpa: Allocator, arena: Allocator, args: []const []const u8) !void { |
| 4869 | 4869 | .path = local_cache_dir_path, |
| 4870 | 4870 | }; |
| 4871 | 4871 | } |
| 4872 | const cache_dir_path = try build_root.directory.join(arena, &[_][]const u8{"zig-cache"}); | |
| 4872 | const cache_dir_path = try build_root.directory.join(arena, &.{default_local_zig_cache_basename}); | |
| 4873 | 4873 | break :l .{ |
| 4874 | .handle = try build_root.directory.handle.makeOpenPath("zig-cache", .{}), | |
| 4874 | .handle = try build_root.directory.handle.makeOpenPath(default_local_zig_cache_basename, .{}), | |
| 4875 | 4875 | .path = cache_dir_path, |
| 4876 | 4876 | }; |
| 4877 | 4877 | }; |
test/src/Cases.zig+6-6| ... | ... | @@ -1449,14 +1449,14 @@ fn runCases(self: *Cases, zig_exe_path: []const u8) !void { |
| 1449 | 1449 | var global_tmp = std.testing.tmpDir(.{}); |
| 1450 | 1450 | defer global_tmp.cleanup(); |
| 1451 | 1451 | |
| 1452 | var cache_dir = try global_tmp.dir.makeOpenPath("zig-cache", .{}); | |
| 1452 | var cache_dir = try global_tmp.dir.makeOpenPath(".zig-cache", .{}); | |
| 1453 | 1453 | defer cache_dir.close(); |
| 1454 | const tmp_dir_path = try std.fs.path.join(self.gpa, &[_][]const u8{ ".", "zig-cache", "tmp", &global_tmp.sub_path }); | |
| 1454 | const tmp_dir_path = try std.fs.path.join(self.gpa, &[_][]const u8{ ".", ".zig-cache", "tmp", &global_tmp.sub_path }); | |
| 1455 | 1455 | defer self.gpa.free(tmp_dir_path); |
| 1456 | 1456 | |
| 1457 | 1457 | const global_cache_directory: Compilation.Directory = .{ |
| 1458 | 1458 | .handle = cache_dir, |
| 1459 | .path = try std.fs.path.join(self.gpa, &[_][]const u8{ tmp_dir_path, "zig-cache" }), | |
| 1459 | .path = try std.fs.path.join(self.gpa, &[_][]const u8{ tmp_dir_path, ".zig-cache" }), | |
| 1460 | 1460 | }; |
| 1461 | 1461 | defer self.gpa.free(global_cache_directory.path.?); |
| 1462 | 1462 | |
| ... | ... | @@ -1529,16 +1529,16 @@ fn runOneCase( |
| 1529 | 1529 | var tmp = std.testing.tmpDir(.{}); |
| 1530 | 1530 | defer tmp.cleanup(); |
| 1531 | 1531 | |
| 1532 | var cache_dir = try tmp.dir.makeOpenPath("zig-cache", .{}); | |
| 1532 | var cache_dir = try tmp.dir.makeOpenPath(".zig-cache", .{}); | |
| 1533 | 1533 | defer cache_dir.close(); |
| 1534 | 1534 | |
| 1535 | 1535 | const tmp_dir_path = try std.fs.path.join( |
| 1536 | 1536 | arena, |
| 1537 | &[_][]const u8{ ".", "zig-cache", "tmp", &tmp.sub_path }, | |
| 1537 | &[_][]const u8{ ".", ".zig-cache", "tmp", &tmp.sub_path }, | |
| 1538 | 1538 | ); |
| 1539 | 1539 | const local_cache_path = try std.fs.path.join( |
| 1540 | 1540 | arena, |
| 1541 | &[_][]const u8{ tmp_dir_path, "zig-cache" }, | |
| 1541 | &[_][]const u8{ tmp_dir_path, ".zig-cache" }, | |
| 1542 | 1542 | ); |
| 1543 | 1543 | |
| 1544 | 1544 | const zig_cache_directory: Compilation.Directory = .{ |
tools/doctest.zig+1-1| ... | ... | @@ -22,7 +22,7 @@ const usage = |
| 22 | 22 | \\ -o output Where to write output HTML docs to |
| 23 | 23 | \\ --zig zig Path to the zig compiler |
| 24 | 24 | \\ --zig-lib-dir dir Override the zig compiler library path |
| 25 | \\ --cache-root dir Path to local zig-cache/ | |
| 25 | \\ --cache-root dir Path to local .zig-cache/ | |
| 26 | 26 | \\ |
| 27 | 27 | ; |
| 28 | 28 |