authorgravatar for kris.tate+github@gmail.comkristopher tate <kris.tate+github@gmail.com> 2018-11-30 01:51:31+09:00
committergravatar for kris.tate+github@gmail.comkristopher tate <kris.tate+github@gmail.com> 2018-11-30 03:52:28+09:00
log1e60ca4b752a61e26067b4893be623442836ec6f
tree039a5cbd5080653975d9dd1d25d2faf928b47a6d
parent2b78a90424ee47ee1a9ef590dcf517026d0f13d1
signature Commit is signed but in an unrecognized format.

stage2: update std.os.path.join method signature;

stage2: take 2;

6 files changed, 13 insertions(+), 13 deletions(-)

src-self-hosted/compilation.zig+3-3
......@@ -485,7 +485,7 @@ pub const Compilation = struct {
485485 comp.name = try Buffer.init(comp.arena(), name);
486486 comp.llvm_triple = try target.getTriple(comp.arena());
487487 comp.llvm_target = try Target.llvmTargetFromTriple(comp.llvm_triple);
488 comp.zig_std_dir = try std.os.path.join(comp.arena(), zig_lib_dir, "std");
488 comp.zig_std_dir = try std.os.path.join(comp.arena(), [][]const u8{ zig_lib_dir, "std" });
489489
490490 const opt_level = switch (build_mode) {
491491 builtin.Mode.Debug => llvm.CodeGenLevelNone,
......@@ -1183,7 +1183,7 @@ pub const Compilation = struct {
11831183 const file_name = try std.fmt.allocPrint(self.gpa(), "{}{}", file_prefix[0..], suffix);
11841184 defer self.gpa().free(file_name);
11851185
1186 const full_path = try os.path.join(self.gpa(), tmp_dir, file_name[0..]);
1186 const full_path = try os.path.join(self.gpa(), [][]const u8{ tmp_dir, file_name[0..] });
11871187 errdefer self.gpa().free(full_path);
11881188
11891189 return Buffer.fromOwnedSlice(self.gpa(), full_path);
......@@ -1204,7 +1204,7 @@ pub const Compilation = struct {
12041204 const zig_dir_path = try getZigDir(self.gpa());
12051205 defer self.gpa().free(zig_dir_path);
12061206
1207 const tmp_dir = try os.path.join(self.arena(), zig_dir_path, comp_dir_name[0..]);
1207 const tmp_dir = try os.path.join(self.arena(), [][]const u8{ zig_dir_path, comp_dir_name[0..] });
12081208 try os.makePath(self.gpa(), tmp_dir);
12091209 return tmp_dir;
12101210 }
src-self-hosted/introspect.zig+2-2
......@@ -8,10 +8,10 @@ const warn = std.debug.warn;
88
99/// Caller must free result
1010pub fn testZigInstallPrefix(allocator: *mem.Allocator, test_path: []const u8) ![]u8 {
11 const test_zig_dir = try os.path.join(allocator, test_path, "lib", "zig");
11 const test_zig_dir = try os.path.join(allocator, [][]const u8{ test_path, "lib", "zig" });
1212 errdefer allocator.free(test_zig_dir);
1313
14 const test_index_file = try os.path.join(allocator, test_zig_dir, "std", "index.zig");
14 const test_index_file = try os.path.join(allocator, [][]const u8{ test_zig_dir, "std", "index.zig" });
1515 defer allocator.free(test_index_file);
1616
1717 var file = try os.File.openRead(test_index_file);
src-self-hosted/libc_installation.zig+4-4
......@@ -230,7 +230,7 @@ pub const LibCInstallation = struct {
230230 while (path_i < search_paths.len) : (path_i += 1) {
231231 const search_path_untrimmed = search_paths.at(search_paths.len - path_i - 1);
232232 const search_path = std.mem.trimLeft(u8, search_path_untrimmed, " ");
233 const stdlib_path = try std.os.path.join(loop.allocator, search_path, "stdlib.h");
233 const stdlib_path = try std.os.path.join(loop.allocator, [][]const u8{ search_path, "stdlib.h" });
234234 defer loop.allocator.free(stdlib_path);
235235
236236 if (try fileExists(stdlib_path)) {
......@@ -254,7 +254,7 @@ pub const LibCInstallation = struct {
254254 const stream = &std.io.BufferOutStream.init(&result_buf).stream;
255255 try stream.print("{}\\Include\\{}\\ucrt", search.path, search.version);
256256
257 const stdlib_path = try std.os.path.join(loop.allocator, result_buf.toSliceConst(), "stdlib.h");
257 const stdlib_path = try std.os.path.join(loop.allocator, [][]const u8{ result_buf.toSliceConst(), "stdlib.h" });
258258 defer loop.allocator.free(stdlib_path);
259259
260260 if (try fileExists(stdlib_path)) {
......@@ -283,7 +283,7 @@ pub const LibCInstallation = struct {
283283 builtin.Arch.aarch64v8 => try stream.write("arm"),
284284 else => return error.UnsupportedArchitecture,
285285 }
286 const ucrt_lib_path = try std.os.path.join(loop.allocator, result_buf.toSliceConst(), "ucrt.lib");
286 const ucrt_lib_path = try std.os.path.join(loop.allocator, [][]const u8{ result_buf.toSliceConst(), "ucrt.lib" });
287287 defer loop.allocator.free(ucrt_lib_path);
288288 if (try fileExists(ucrt_lib_path)) {
289289 self.lib_dir = result_buf.toOwnedSlice();
......@@ -358,7 +358,7 @@ pub const LibCInstallation = struct {
358358 builtin.Arch.aarch64v8 => try stream.write("arm\\"),
359359 else => return error.UnsupportedArchitecture,
360360 }
361 const kernel32_path = try std.os.path.join(loop.allocator, result_buf.toSliceConst(), "kernel32.lib");
361 const kernel32_path = try std.os.path.join(loop.allocator, [][]const u8{ result_buf.toSliceConst(), "kernel32.lib" });
362362 defer loop.allocator.free(kernel32_path);
363363 if (try fileExists(kernel32_path)) {
364364 self.kernel32_lib_dir = result_buf.toOwnedSlice();
src-self-hosted/link.zig+1-1
......@@ -315,7 +315,7 @@ fn constructLinkerArgsElf(ctx: *Context) !void {
315315}
316316
317317fn addPathJoin(ctx: *Context, dirname: []const u8, basename: []const u8) !void {
318 const full_path = try std.os.path.join(&ctx.arena.allocator, dirname, basename);
318 const full_path = try std.os.path.join(&ctx.arena.allocator, [][]const u8{ dirname, basename });
319319 const full_path_with_null = try std.cstr.addNullByte(&ctx.arena.allocator, full_path);
320320 try ctx.args.append(full_path_with_null.ptr);
321321}
src-self-hosted/main.zig+1-1
......@@ -757,7 +757,7 @@ async fn fmtPath(fmt: *Fmt, file_path_ref: []const u8, check_mode: bool) FmtErro
757757 var group = event.Group(FmtError!void).init(fmt.loop);
758758 while (try dir.next()) |entry| {
759759 if (entry.kind == std.os.Dir.Entry.Kind.Directory or mem.endsWith(u8, entry.name, ".zig")) {
760 const full_path = try os.path.join(fmt.loop.allocator, file_path, entry.name);
760 const full_path = try os.path.join(fmt.loop.allocator, [][]const u8{ file_path, entry.name });
761761 try group.call(fmtPath, fmt, full_path, check_mode);
762762 }
763763 }
src-self-hosted/test.zig+2-2
......@@ -87,7 +87,7 @@ pub const TestContext = struct {
8787 ) !void {
8888 var file_index_buf: [20]u8 = undefined;
8989 const file_index = try std.fmt.bufPrint(file_index_buf[0..], "{}", self.file_index.incr());
90 const file1_path = try std.os.path.join(allocator, tmp_dir_name, file_index, file1);
90 const file1_path = try std.os.path.join(allocator, [][]const u8{ tmp_dir_name, file_index, file1 });
9191
9292 if (std.os.path.dirname(file1_path)) |dirname| {
9393 try std.os.makePath(allocator, dirname);
......@@ -120,7 +120,7 @@ pub const TestContext = struct {
120120 ) !void {
121121 var file_index_buf: [20]u8 = undefined;
122122 const file_index = try std.fmt.bufPrint(file_index_buf[0..], "{}", self.file_index.incr());
123 const file1_path = try std.os.path.join(allocator, tmp_dir_name, file_index, file1);
123 const file1_path = try std.os.path.join(allocator, [][]const u8{ tmp_dir_name, file_index, file1 });
124124
125125 const output_file = try std.fmt.allocPrint(allocator, "{}-out{}", file1_path, Target(Target.Native).exeFileExt());
126126 if (std.os.path.dirname(file1_path)) |dirname| {