| ... | ... | @@ -684,7 +684,7 @@ pub const Directories = struct { |
| 684 | 684 | global, |
| 685 | 685 | }, |
| 686 | 686 | wasi_preopens: switch (builtin.target.os.tag) { |
| 687 | | .wasi => std.fs.wasi.Preopens, |
| 687 | .wasi => fs.wasi.Preopens, |
| 688 | 688 | else => void, |
| 689 | 689 | }, |
| 690 | 690 | self_exe_path: switch (builtin.target.os.tag) { |
| ... | ... | @@ -741,7 +741,7 @@ pub const Directories = struct { |
| 741 | 741 | .local_cache = local_cache, |
| 742 | 742 | }; |
| 743 | 743 | } |
| 744 | | fn openWasiPreopen(preopens: std.fs.wasi.Preopens, name: []const u8) Cache.Directory { |
| 744 | fn openWasiPreopen(preopens: fs.wasi.Preopens, name: []const u8) Cache.Directory { |
| 745 | 745 | return .{ |
| 746 | 746 | .path = if (std.mem.eql(u8, name, ".")) null else name, |
| 747 | 747 | .handle = .{ |
| ... | ... | @@ -755,8 +755,8 @@ pub const Directories = struct { |
| 755 | 755 | }; |
| 756 | 756 | const nonempty_path = if (path.len == 0) "." else path; |
| 757 | 757 | const handle_or_err = switch (thing) { |
| 758 | | .@"zig lib" => std.fs.cwd().openDir(nonempty_path, .{}), |
| 759 | | .@"global cache", .@"local cache" => std.fs.cwd().makeOpenPath(nonempty_path, .{}), |
| 758 | .@"zig lib" => fs.cwd().openDir(nonempty_path, .{}), |
| 759 | .@"global cache", .@"local cache" => fs.cwd().makeOpenPath(nonempty_path, .{}), |
| 760 | 760 | }; |
| 761 | 761 | return .{ |
| 762 | 762 | .path = if (path.len == 0) null else path, |
| ... | ... | @@ -993,7 +993,7 @@ pub const CObject = struct { |
| 993 | 993 | const source_line = source_line: { |
| 994 | 994 | if (diag.src_loc.offset == 0 or diag.src_loc.column == 0) break :source_line 0; |
| 995 | 995 | |
| 996 | | const file = std.fs.cwd().openFile(file_name, .{}) catch break :source_line 0; |
| 996 | const file = fs.cwd().openFile(file_name, .{}) catch break :source_line 0; |
| 997 | 997 | defer file.close(); |
| 998 | 998 | file.seekTo(diag.src_loc.offset + 1 - diag.src_loc.column) catch break :source_line 0; |
| 999 | 999 | |
| ... | ... | @@ -1067,7 +1067,7 @@ pub const CObject = struct { |
| 1067 | 1067 | } |
| 1068 | 1068 | }; |
| 1069 | 1069 | |
| 1070 | | const file = try std.fs.cwd().openFile(path, .{}); |
| 1070 | const file = try fs.cwd().openFile(path, .{}); |
| 1071 | 1071 | defer file.close(); |
| 1072 | 1072 | var br = std.io.bufferedReader(file.deprecatedReader()); |
| 1073 | 1073 | const reader = br.reader(); |
| ... | ... | @@ -1875,7 +1875,7 @@ pub fn create(gpa: Allocator, arena: Allocator, options: CreateOptions) !*Compil |
| 1875 | 1875 | if (options.root_mod.resolved_target.llvm_cpu_features) |cf| print: { |
| 1876 | 1876 | std.debug.lockStdErr(); |
| 1877 | 1877 | defer std.debug.unlockStdErr(); |
| 1878 | | const stderr = std.fs.File.stderr().deprecatedWriter(); |
| 1878 | const stderr = fs.File.stderr().deprecatedWriter(); |
| 1879 | 1879 | nosuspend { |
| 1880 | 1880 | stderr.print("compilation: {s}\n", .{options.root_name}) catch break :print; |
| 1881 | 1881 | stderr.print(" target: {s}\n", .{try target.zigTriple(arena)}) catch break :print; |
| ... | ... | @@ -1901,7 +1901,7 @@ pub fn create(gpa: Allocator, arena: Allocator, options: CreateOptions) !*Compil |
| 1901 | 1901 | .manifest_dir = try options.dirs.local_cache.handle.makeOpenPath("h", .{}), |
| 1902 | 1902 | }; |
| 1903 | 1903 | // These correspond to std.zig.Server.Message.PathPrefix. |
| 1904 | | cache.addPrefix(.{ .path = null, .handle = std.fs.cwd() }); |
| 1904 | cache.addPrefix(.{ .path = null, .handle = fs.cwd() }); |
| 1905 | 1905 | cache.addPrefix(options.dirs.zig_lib); |
| 1906 | 1906 | cache.addPrefix(options.dirs.local_cache); |
| 1907 | 1907 | cache.addPrefix(options.dirs.global_cache); |
| ... | ... | @@ -2192,7 +2192,7 @@ pub fn create(gpa: Allocator, arena: Allocator, options: CreateOptions) !*Compil |
| 2192 | 2192 | comp.digest = hash.peekBin(); |
| 2193 | 2193 | const digest = hash.final(); |
| 2194 | 2194 | |
| 2195 | | const artifact_sub_dir = "o" ++ std.fs.path.sep_str ++ digest; |
| 2195 | const artifact_sub_dir = "o" ++ fs.path.sep_str ++ digest; |
| 2196 | 2196 | var artifact_dir = try options.dirs.local_cache.handle.makeOpenPath(artifact_sub_dir, .{}); |
| 2197 | 2197 | errdefer artifact_dir.close(); |
| 2198 | 2198 | const artifact_directory: Cache.Directory = .{ |
| ... | ... | @@ -2604,11 +2604,11 @@ fn cleanupAfterUpdate(comp: *Compilation, tmp_dir_rand_int: u64) void { |
| 2604 | 2604 | // temporary directories; it doesn't have a real cache directory anyway. |
| 2605 | 2605 | return; |
| 2606 | 2606 | } |
| 2607 | | const tmp_dir_sub_path = "tmp" ++ std.fs.path.sep_str ++ std.fmt.hex(tmp_dir_rand_int); |
| 2607 | const tmp_dir_sub_path = "tmp" ++ fs.path.sep_str ++ std.fmt.hex(tmp_dir_rand_int); |
| 2608 | 2608 | comp.dirs.local_cache.handle.deleteTree(tmp_dir_sub_path) catch |err| { |
| 2609 | 2609 | log.warn("failed to delete temporary directory '{s}{c}{s}': {s}", .{ |
| 2610 | 2610 | comp.dirs.local_cache.path orelse ".", |
| 2611 | | std.fs.path.sep, |
| 2611 | fs.path.sep, |
| 2612 | 2612 | tmp_dir_sub_path, |
| 2613 | 2613 | @errorName(err), |
| 2614 | 2614 | }); |
| ... | ... | @@ -2628,11 +2628,11 @@ fn cleanupAfterUpdate(comp: *Compilation, tmp_dir_rand_int: u64) void { |
| 2628 | 2628 | if (whole.tmp_artifact_directory) |*tmp_dir| { |
| 2629 | 2629 | tmp_dir.handle.close(); |
| 2630 | 2630 | whole.tmp_artifact_directory = null; |
| 2631 | | const tmp_dir_sub_path = "tmp" ++ std.fs.path.sep_str ++ std.fmt.hex(tmp_dir_rand_int); |
| 2631 | const tmp_dir_sub_path = "tmp" ++ fs.path.sep_str ++ std.fmt.hex(tmp_dir_rand_int); |
| 2632 | 2632 | comp.dirs.local_cache.handle.deleteTree(tmp_dir_sub_path) catch |err| { |
| 2633 | 2633 | log.warn("failed to delete temporary directory '{s}{c}{s}': {s}", .{ |
| 2634 | 2634 | comp.dirs.local_cache.path orelse ".", |
| 2635 | | std.fs.path.sep, |
| 2635 | fs.path.sep, |
| 2636 | 2636 | tmp_dir_sub_path, |
| 2637 | 2637 | @errorName(err), |
| 2638 | 2638 | }); |
| ... | ... | @@ -2668,7 +2668,7 @@ pub fn update(comp: *Compilation, main_progress_node: std.Progress.Node) !void { |
| 2668 | 2668 | assert(none.tmp_artifact_directory == null); |
| 2669 | 2669 | none.tmp_artifact_directory = d: { |
| 2670 | 2670 | tmp_dir_rand_int = std.crypto.random.int(u64); |
| 2671 | | const tmp_dir_sub_path = "tmp" ++ std.fs.path.sep_str ++ std.fmt.hex(tmp_dir_rand_int); |
| 2671 | const tmp_dir_sub_path = "tmp" ++ fs.path.sep_str ++ std.fmt.hex(tmp_dir_rand_int); |
| 2672 | 2672 | const path = try comp.dirs.local_cache.join(arena, &.{tmp_dir_sub_path}); |
| 2673 | 2673 | break :d .{ |
| 2674 | 2674 | .path = path, |
| ... | ... | @@ -2735,7 +2735,7 @@ pub fn update(comp: *Compilation, main_progress_node: std.Progress.Node) !void { |
| 2735 | 2735 | // Compile the artifacts to a temporary directory. |
| 2736 | 2736 | whole.tmp_artifact_directory = d: { |
| 2737 | 2737 | tmp_dir_rand_int = std.crypto.random.int(u64); |
| 2738 | | const tmp_dir_sub_path = "tmp" ++ std.fs.path.sep_str ++ std.fmt.hex(tmp_dir_rand_int); |
| 2738 | const tmp_dir_sub_path = "tmp" ++ fs.path.sep_str ++ std.fmt.hex(tmp_dir_rand_int); |
| 2739 | 2739 | const path = try comp.dirs.local_cache.join(arena, &.{tmp_dir_sub_path}); |
| 2740 | 2740 | break :d .{ |
| 2741 | 2741 | .path = path, |
| ... | ... | @@ -2910,7 +2910,7 @@ pub fn update(comp: *Compilation, main_progress_node: std.Progress.Node) !void { |
| 2910 | 2910 | // Close tmp dir and link.File to avoid open handle during rename. |
| 2911 | 2911 | whole.tmp_artifact_directory.?.handle.close(); |
| 2912 | 2912 | whole.tmp_artifact_directory = null; |
| 2913 | | const s = std.fs.path.sep_str; |
| 2913 | const s = fs.path.sep_str; |
| 2914 | 2914 | const tmp_dir_sub_path = "tmp" ++ s ++ std.fmt.hex(tmp_dir_rand_int); |
| 2915 | 2915 | const o_sub_path = "o" ++ s ++ hex_digest; |
| 2916 | 2916 | renameTmpIntoCache(comp.dirs.local_cache, tmp_dir_sub_path, o_sub_path) catch |err| { |
| ... | ... | @@ -2932,7 +2932,7 @@ pub fn update(comp: *Compilation, main_progress_node: std.Progress.Node) !void { |
| 2932 | 2932 | if (comp.bin_file) |lf| { |
| 2933 | 2933 | lf.emit = .{ |
| 2934 | 2934 | .root_dir = comp.dirs.local_cache, |
| 2935 | | .sub_path = try std.fs.path.join(arena, &.{ o_sub_path, comp.emit_bin.? }), |
| 2935 | .sub_path = try fs.path.join(arena, &.{ o_sub_path, comp.emit_bin.? }), |
| 2936 | 2936 | }; |
| 2937 | 2937 | |
| 2938 | 2938 | switch (need_writable_dance) { |
| ... | ... | @@ -3105,7 +3105,7 @@ fn renameTmpIntoCache( |
| 3105 | 3105 | ) !void { |
| 3106 | 3106 | var seen_eaccess = false; |
| 3107 | 3107 | while (true) { |
| 3108 | | std.fs.rename( |
| 3108 | fs.rename( |
| 3109 | 3109 | cache_directory.handle, |
| 3110 | 3110 | tmp_dir_sub_path, |
| 3111 | 3111 | cache_directory.handle, |
| ... | ... | @@ -3931,7 +3931,7 @@ pub fn getAllErrorsAlloc(comp: *Compilation) !ErrorBundle { |
| 3931 | 3931 | // This AU is referenced and has a transitive compile error, meaning it referenced something with a compile error. |
| 3932 | 3932 | // However, we haven't reported any such error. |
| 3933 | 3933 | // This is a compiler bug. |
| 3934 | | const stderr = std.fs.File.stderr().deprecatedWriter(); |
| 3934 | const stderr = fs.File.stderr().deprecatedWriter(); |
| 3935 | 3935 | try stderr.writeAll("referenced transitive analysis errors, but none actually emitted\n"); |
| 3936 | 3936 | try stderr.print("{f} [transitive failure]\n", .{zcu.fmtAnalUnit(failed_unit)}); |
| 3937 | 3937 | while (ref) |r| { |
| ... | ... | @@ -4842,7 +4842,7 @@ fn docsCopyFallible(comp: *Compilation) anyerror!void { |
| 4842 | 4842 | defer out_dir.close(); |
| 4843 | 4843 | |
| 4844 | 4844 | for (&[_][]const u8{ "docs/main.js", "docs/index.html" }) |sub_path| { |
| 4845 | | const basename = std.fs.path.basename(sub_path); |
| 4845 | const basename = fs.path.basename(sub_path); |
| 4846 | 4846 | comp.dirs.zig_lib.handle.copyFile(sub_path, out_dir, basename, .{}) catch |err| { |
| 4847 | 4847 | comp.lockAndSetMiscFailure(.docs_copy, "unable to copy {s}: {s}", .{ |
| 4848 | 4848 | sub_path, |
| ... | ... | @@ -4878,7 +4878,7 @@ fn docsCopyFallible(comp: *Compilation) anyerror!void { |
| 4878 | 4878 | } |
| 4879 | 4879 | } |
| 4880 | 4880 | |
| 4881 | | fn docsCopyModule(comp: *Compilation, module: *Package.Module, name: []const u8, tar_file: std.fs.File) !void { |
| 4881 | fn docsCopyModule(comp: *Compilation, module: *Package.Module, name: []const u8, tar_file: fs.File) !void { |
| 4882 | 4882 | const root = module.root; |
| 4883 | 4883 | var mod_dir = d: { |
| 4884 | 4884 | const root_dir, const sub_path = root.openInfo(comp.dirs); |
| ... | ... | @@ -4973,7 +4973,7 @@ fn workerDocsWasmFallible(comp: *Compilation, prog_node: std.Progress.Node) anye |
| 4973 | 4973 | }); |
| 4974 | 4974 | |
| 4975 | 4975 | const src_basename = "main.zig"; |
| 4976 | | const root_name = std.fs.path.stem(src_basename); |
| 4976 | const root_name = fs.path.stem(src_basename); |
| 4977 | 4977 | |
| 4978 | 4978 | const dirs = comp.dirs.withoutLocalCache(); |
| 4979 | 4979 | |
| ... | ... | @@ -5068,13 +5068,13 @@ fn workerUpdateFile( |
| 5068 | 5068 | prog_node: std.Progress.Node, |
| 5069 | 5069 | wg: *WaitGroup, |
| 5070 | 5070 | ) void { |
| 5071 | | const child_prog_node = prog_node.start(std.fs.path.basename(file.path.sub_path), 0); |
| 5071 | const child_prog_node = prog_node.start(fs.path.basename(file.path.sub_path), 0); |
| 5072 | 5072 | defer child_prog_node.end(); |
| 5073 | 5073 | |
| 5074 | 5074 | const pt: Zcu.PerThread = .activate(comp.zcu.?, @enumFromInt(tid)); |
| 5075 | 5075 | defer pt.deactivate(); |
| 5076 | 5076 | pt.updateFile(file_index, file) catch |err| { |
| 5077 | | pt.reportRetryableFileError(file_index, "unable to load '{s}': {s}", .{ std.fs.path.basename(file.path.sub_path), @errorName(err) }) catch |oom| switch (oom) { |
| 5077 | pt.reportRetryableFileError(file_index, "unable to load '{s}': {s}", .{ fs.path.basename(file.path.sub_path), @errorName(err) }) catch |oom| switch (oom) { |
| 5078 | 5078 | error.OutOfMemory => { |
| 5079 | 5079 | comp.mutex.lock(); |
| 5080 | 5080 | defer comp.mutex.unlock(); |
| ... | ... | @@ -5239,7 +5239,7 @@ pub fn cImport(comp: *Compilation, c_src: []const u8, owner_mod: *Package.Module |
| 5239 | 5239 | const arena = arena_allocator.allocator(); |
| 5240 | 5240 | |
| 5241 | 5241 | const tmp_digest = man.hash.peek(); |
| 5242 | | const tmp_dir_sub_path = try std.fs.path.join(arena, &[_][]const u8{ "o", &tmp_digest }); |
| 5242 | const tmp_dir_sub_path = try fs.path.join(arena, &[_][]const u8{ "o", &tmp_digest }); |
| 5243 | 5243 | var zig_cache_tmp_dir = try comp.dirs.local_cache.handle.makeOpenPath(tmp_dir_sub_path, .{}); |
| 5244 | 5244 | defer zig_cache_tmp_dir.close(); |
| 5245 | 5245 | const cimport_basename = "cimport.h"; |
| ... | ... | @@ -5308,7 +5308,7 @@ pub fn cImport(comp: *Compilation, c_src: []const u8, owner_mod: *Package.Module |
| 5308 | 5308 | log.info("C import .d file: {s}", .{out_dep_path}); |
| 5309 | 5309 | } |
| 5310 | 5310 | |
| 5311 | | const dep_basename = std.fs.path.basename(out_dep_path); |
| 5311 | const dep_basename = fs.path.basename(out_dep_path); |
| 5312 | 5312 | try man.addDepFilePost(zig_cache_tmp_dir, dep_basename); |
| 5313 | 5313 | switch (comp.cache_use) { |
| 5314 | 5314 | .whole => |whole| if (whole.cache_manifest) |whole_cache_manifest| { |
| ... | ... | @@ -5321,7 +5321,7 @@ pub fn cImport(comp: *Compilation, c_src: []const u8, owner_mod: *Package.Module |
| 5321 | 5321 | |
| 5322 | 5322 | const bin_digest = man.finalBin(); |
| 5323 | 5323 | const hex_digest = Cache.binToHex(bin_digest); |
| 5324 | | const o_sub_path = "o" ++ std.fs.path.sep_str ++ hex_digest; |
| 5324 | const o_sub_path = "o" ++ fs.path.sep_str ++ hex_digest; |
| 5325 | 5325 | var o_dir = try comp.dirs.local_cache.handle.makeOpenPath(o_sub_path, .{}); |
| 5326 | 5326 | defer o_dir.close(); |
| 5327 | 5327 | |
| ... | ... | @@ -5674,7 +5674,7 @@ fn updateCObject(comp: *Compilation, c_object: *CObject, c_obj_prog_node: std.Pr |
| 5674 | 5674 | defer arena_allocator.deinit(); |
| 5675 | 5675 | const arena = arena_allocator.allocator(); |
| 5676 | 5676 | |
| 5677 | | const c_source_basename = std.fs.path.basename(c_object.src.src_path); |
| 5677 | const c_source_basename = fs.path.basename(c_object.src.src_path); |
| 5678 | 5678 | |
| 5679 | 5679 | const child_progress_node = c_obj_prog_node.start(c_source_basename, 0); |
| 5680 | 5680 | defer child_progress_node.end(); |
| ... | ... | @@ -5687,7 +5687,7 @@ fn updateCObject(comp: *Compilation, c_object: *CObject, c_obj_prog_node: std.Pr |
| 5687 | 5687 | const o_basename_noext = if (direct_o) |
| 5688 | 5688 | comp.root_name |
| 5689 | 5689 | else |
| 5690 | | c_source_basename[0 .. c_source_basename.len - std.fs.path.extension(c_source_basename).len]; |
| 5690 | c_source_basename[0 .. c_source_basename.len - fs.path.extension(c_source_basename).len]; |
| 5691 | 5691 | |
| 5692 | 5692 | const target = comp.getTarget(); |
| 5693 | 5693 | const o_ext = target.ofmt.fileExt(target.cpu.arch); |
| ... | ... | @@ -5814,11 +5814,11 @@ fn updateCObject(comp: *Compilation, c_object: *CObject, c_obj_prog_node: std.Pr |
| 5814 | 5814 | } |
| 5815 | 5815 | |
| 5816 | 5816 | // Just to save disk space, we delete the files that are never needed again. |
| 5817 | | defer if (out_diag_path) |diag_file_path| zig_cache_tmp_dir.deleteFile(std.fs.path.basename(diag_file_path)) catch |err| switch (err) { |
| 5817 | defer if (out_diag_path) |diag_file_path| zig_cache_tmp_dir.deleteFile(fs.path.basename(diag_file_path)) catch |err| switch (err) { |
| 5818 | 5818 | error.FileNotFound => {}, // the file wasn't created due to an error we reported |
| 5819 | 5819 | else => log.warn("failed to delete '{s}': {s}", .{ diag_file_path, @errorName(err) }), |
| 5820 | 5820 | }; |
| 5821 | | defer if (out_dep_path) |dep_file_path| zig_cache_tmp_dir.deleteFile(std.fs.path.basename(dep_file_path)) catch |err| switch (err) { |
| 5821 | defer if (out_dep_path) |dep_file_path| zig_cache_tmp_dir.deleteFile(fs.path.basename(dep_file_path)) catch |err| switch (err) { |
| 5822 | 5822 | error.FileNotFound => {}, // the file wasn't created due to an error we reported |
| 5823 | 5823 | else => log.warn("failed to delete '{s}': {s}", .{ dep_file_path, @errorName(err) }), |
| 5824 | 5824 | }; |
| ... | ... | @@ -5889,7 +5889,7 @@ fn updateCObject(comp: *Compilation, c_object: *CObject, c_obj_prog_node: std.Pr |
| 5889 | 5889 | } |
| 5890 | 5890 | |
| 5891 | 5891 | if (out_dep_path) |dep_file_path| { |
| 5892 | | const dep_basename = std.fs.path.basename(dep_file_path); |
| 5892 | const dep_basename = fs.path.basename(dep_file_path); |
| 5893 | 5893 | // Add the files depended on to the cache system. |
| 5894 | 5894 | try man.addDepFilePost(zig_cache_tmp_dir, dep_basename); |
| 5895 | 5895 | switch (comp.cache_use) { |
| ... | ... | @@ -5909,11 +5909,11 @@ fn updateCObject(comp: *Compilation, c_object: *CObject, c_obj_prog_node: std.Pr |
| 5909 | 5909 | |
| 5910 | 5910 | // Rename into place. |
| 5911 | 5911 | const digest = man.final(); |
| 5912 | | const o_sub_path = try std.fs.path.join(arena, &[_][]const u8{ "o", &digest }); |
| 5912 | const o_sub_path = try fs.path.join(arena, &[_][]const u8{ "o", &digest }); |
| 5913 | 5913 | var o_dir = try comp.dirs.local_cache.handle.makeOpenPath(o_sub_path, .{}); |
| 5914 | 5914 | defer o_dir.close(); |
| 5915 | | const tmp_basename = std.fs.path.basename(out_obj_path); |
| 5916 | | try std.fs.rename(zig_cache_tmp_dir, tmp_basename, o_dir, o_basename); |
| 5915 | const tmp_basename = fs.path.basename(out_obj_path); |
| 5916 | try fs.rename(zig_cache_tmp_dir, tmp_basename, o_dir, o_basename); |
| 5917 | 5917 | break :blk digest; |
| 5918 | 5918 | }; |
| 5919 | 5919 | |
| ... | ... | @@ -5935,7 +5935,7 @@ fn updateCObject(comp: *Compilation, c_object: *CObject, c_obj_prog_node: std.Pr |
| 5935 | 5935 | .success = .{ |
| 5936 | 5936 | .object_path = .{ |
| 5937 | 5937 | .root_dir = comp.dirs.local_cache, |
| 5938 | | .sub_path = try std.fs.path.join(gpa, &.{ "o", &digest, o_basename }), |
| 5938 | .sub_path = try fs.path.join(gpa, &.{ "o", &digest, o_basename }), |
| 5939 | 5939 | }, |
| 5940 | 5940 | .lock = man.toOwnedLock(), |
| 5941 | 5941 | }, |
| ... | ... | @@ -5959,7 +5959,7 @@ fn updateWin32Resource(comp: *Compilation, win32_resource: *Win32Resource, win32 |
| 5959 | 5959 | .rc => |rc_src| rc_src.src_path, |
| 5960 | 5960 | .manifest => |src_path| src_path, |
| 5961 | 5961 | }; |
| 5962 | | const src_basename = std.fs.path.basename(src_path); |
| 5962 | const src_basename = fs.path.basename(src_path); |
| 5963 | 5963 | |
| 5964 | 5964 | log.debug("updating win32 resource: {s}", .{src_path}); |
| 5965 | 5965 | |
| ... | ... | @@ -5996,7 +5996,7 @@ fn updateWin32Resource(comp: *Compilation, win32_resource: *Win32Resource, win32 |
| 5996 | 5996 | // get the digest now and write the .res directly to the cache |
| 5997 | 5997 | const digest = man.final(); |
| 5998 | 5998 | |
| 5999 | | const o_sub_path = try std.fs.path.join(arena, &.{ "o", &digest }); |
| 5999 | const o_sub_path = try fs.path.join(arena, &.{ "o", &digest }); |
| 6000 | 6000 | var o_dir = try comp.dirs.local_cache.handle.makeOpenPath(o_sub_path, .{}); |
| 6001 | 6001 | defer o_dir.close(); |
| 6002 | 6002 | |
| ... | ... | @@ -6082,7 +6082,7 @@ fn updateWin32Resource(comp: *Compilation, win32_resource: *Win32Resource, win32 |
| 6082 | 6082 | _ = try man.addFile(rc_src.src_path, null); |
| 6083 | 6083 | man.hash.addListOfBytes(rc_src.extra_flags); |
| 6084 | 6084 | |
| 6085 | | const rc_basename_noext = src_basename[0 .. src_basename.len - std.fs.path.extension(src_basename).len]; |
| 6085 | const rc_basename_noext = src_basename[0 .. src_basename.len - fs.path.extension(src_basename).len]; |
| 6086 | 6086 | |
| 6087 | 6087 | const digest = if (try man.hit()) man.final() else blk: { |
| 6088 | 6088 | var zig_cache_tmp_dir = try comp.dirs.local_cache.handle.makeOpenPath("tmp", .{}); |
| ... | ... | @@ -6127,7 +6127,7 @@ fn updateWin32Resource(comp: *Compilation, win32_resource: *Win32Resource, win32 |
| 6127 | 6127 | |
| 6128 | 6128 | // Read depfile and update cache manifest |
| 6129 | 6129 | { |
| 6130 | | const dep_basename = std.fs.path.basename(out_dep_path); |
| 6130 | const dep_basename = fs.path.basename(out_dep_path); |
| 6131 | 6131 | const dep_file_contents = try zig_cache_tmp_dir.readFileAlloc(arena, dep_basename, 50 * 1024 * 1024); |
| 6132 | 6132 | defer arena.free(dep_file_contents); |
| 6133 | 6133 | |
| ... | ... | @@ -6155,11 +6155,11 @@ fn updateWin32Resource(comp: *Compilation, win32_resource: *Win32Resource, win32 |
| 6155 | 6155 | |
| 6156 | 6156 | // Rename into place. |
| 6157 | 6157 | const digest = man.final(); |
| 6158 | | const o_sub_path = try std.fs.path.join(arena, &[_][]const u8{ "o", &digest }); |
| 6158 | const o_sub_path = try fs.path.join(arena, &[_][]const u8{ "o", &digest }); |
| 6159 | 6159 | var o_dir = try comp.dirs.local_cache.handle.makeOpenPath(o_sub_path, .{}); |
| 6160 | 6160 | defer o_dir.close(); |
| 6161 | | const tmp_basename = std.fs.path.basename(out_res_path); |
| 6162 | | try std.fs.rename(zig_cache_tmp_dir, tmp_basename, o_dir, res_filename); |
| 6161 | const tmp_basename = fs.path.basename(out_res_path); |
| 6162 | try fs.rename(zig_cache_tmp_dir, tmp_basename, o_dir, res_filename); |
| 6163 | 6163 | break :blk digest; |
| 6164 | 6164 | }; |
| 6165 | 6165 | |
| ... | ... | @@ -6270,7 +6270,7 @@ fn spawnZigRc( |
| 6270 | 6270 | } |
| 6271 | 6271 | |
| 6272 | 6272 | pub fn tmpFilePath(comp: Compilation, ally: Allocator, suffix: []const u8) error{OutOfMemory}![]const u8 { |
| 6273 | | const s = std.fs.path.sep_str; |
| 6273 | const s = fs.path.sep_str; |
| 6274 | 6274 | const rand_int = std.crypto.random.int(u64); |
| 6275 | 6275 | if (comp.dirs.local_cache.path) |p| { |
| 6276 | 6276 | return std.fmt.allocPrint(ally, "{s}" ++ s ++ "tmp" ++ s ++ "{x}-{s}", .{ p, rand_int, suffix }); |
| ... | ... | @@ -6520,12 +6520,12 @@ pub fn addCCArgs( |
| 6520 | 6520 | |
| 6521 | 6521 | if (comp.config.link_libcpp) { |
| 6522 | 6522 | try argv.append("-isystem"); |
| 6523 | | try argv.append(try std.fs.path.join(arena, &[_][]const u8{ |
| 6523 | try argv.append(try fs.path.join(arena, &[_][]const u8{ |
| 6524 | 6524 | comp.dirs.zig_lib.path.?, "libcxx", "include", |
| 6525 | 6525 | })); |
| 6526 | 6526 | |
| 6527 | 6527 | try argv.append("-isystem"); |
| 6528 | | try argv.append(try std.fs.path.join(arena, &[_][]const u8{ |
| 6528 | try argv.append(try fs.path.join(arena, &[_][]const u8{ |
| 6529 | 6529 | comp.dirs.zig_lib.path.?, "libcxxabi", "include", |
| 6530 | 6530 | })); |
| 6531 | 6531 | |
| ... | ... | @@ -6536,7 +6536,7 @@ pub fn addCCArgs( |
| 6536 | 6536 | // However as noted by @dimenus, appending libc headers before compiler headers breaks |
| 6537 | 6537 | // intrinsics and other compiler specific items. |
| 6538 | 6538 | try argv.append("-isystem"); |
| 6539 | | try argv.append(try std.fs.path.join(arena, &.{ comp.dirs.zig_lib.path.?, "include" })); |
| 6539 | try argv.append(try fs.path.join(arena, &.{ comp.dirs.zig_lib.path.?, "include" })); |
| 6540 | 6540 | |
| 6541 | 6541 | try argv.ensureUnusedCapacity(comp.libc_include_dir_list.len * 2); |
| 6542 | 6542 | for (comp.libc_include_dir_list) |include_dir| { |
| ... | ... | @@ -6554,7 +6554,7 @@ pub fn addCCArgs( |
| 6554 | 6554 | |
| 6555 | 6555 | if (comp.config.link_libunwind) { |
| 6556 | 6556 | try argv.append("-isystem"); |
| 6557 | | try argv.append(try std.fs.path.join(arena, &[_][]const u8{ |
| 6557 | try argv.append(try fs.path.join(arena, &[_][]const u8{ |
| 6558 | 6558 | comp.dirs.zig_lib.path.?, "libunwind", "include", |
| 6559 | 6559 | })); |
| 6560 | 6560 | } |
| ... | ... | @@ -7147,7 +7147,7 @@ fn get_libc_crt_file(comp: *Compilation, arena: Allocator, basename: []const u8) |
| 7147 | 7147 | return (try crtFilePath(&comp.crt_files, basename)) orelse { |
| 7148 | 7148 | const lci = comp.libc_installation orelse return error.LibCInstallationNotAvailable; |
| 7149 | 7149 | const crt_dir_path = lci.crt_dir orelse return error.LibCInstallationMissingCrtDir; |
| 7150 | | const full_path = try std.fs.path.join(arena, &[_][]const u8{ crt_dir_path, basename }); |
| 7150 | const full_path = try fs.path.join(arena, &[_][]const u8{ crt_dir_path, basename }); |
| 7151 | 7151 | return Cache.Path.initCwd(full_path); |
| 7152 | 7152 | }; |
| 7153 | 7153 | } |
| ... | ... | @@ -7211,7 +7211,7 @@ pub fn lockAndSetMiscFailure( |
| 7211 | 7211 | pub fn dump_argv(argv: []const []const u8) void { |
| 7212 | 7212 | std.debug.lockStdErr(); |
| 7213 | 7213 | defer std.debug.unlockStdErr(); |
| 7214 | | const stderr = std.fs.File.stderr().deprecatedWriter(); |
| 7214 | const stderr = fs.File.stderr().deprecatedWriter(); |
| 7215 | 7215 | for (argv[0 .. argv.len - 1]) |arg| { |
| 7216 | 7216 | nosuspend stderr.print("{s} ", .{arg}) catch return; |
| 7217 | 7217 | } |
| ... | ... | @@ -7542,7 +7542,7 @@ pub fn toCrtFile(comp: *Compilation) Allocator.Error!CrtFile { |
| 7542 | 7542 | return .{ |
| 7543 | 7543 | .full_object_path = .{ |
| 7544 | 7544 | .root_dir = comp.dirs.local_cache, |
| 7545 | | .sub_path = try std.fs.path.join(comp.gpa, &.{ |
| 7545 | .sub_path = try fs.path.join(comp.gpa, &.{ |
| 7546 | 7546 | "o", |
| 7547 | 7547 | &Cache.binToHex(comp.digest.?), |
| 7548 | 7548 | comp.emit_bin.?, |