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
signaturelock-open 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 {...@@ -485,7 +485,7 @@ pub const Compilation = struct {
485 comp.name = try Buffer.init(comp.arena(), name);485 comp.name = try Buffer.init(comp.arena(), name);
486 comp.llvm_triple = try target.getTriple(comp.arena());486 comp.llvm_triple = try target.getTriple(comp.arena());
487 comp.llvm_target = try Target.llvmTargetFromTriple(comp.llvm_triple);487 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
490 const opt_level = switch (build_mode) {490 const opt_level = switch (build_mode) {
491 builtin.Mode.Debug => llvm.CodeGenLevelNone,491 builtin.Mode.Debug => llvm.CodeGenLevelNone,
...@@ -1183,7 +1183,7 @@ pub const Compilation = struct {...@@ -1183,7 +1183,7 @@ pub const Compilation = struct {
1183 const file_name = try std.fmt.allocPrint(self.gpa(), "{}{}", file_prefix[0..], suffix);1183 const file_name = try std.fmt.allocPrint(self.gpa(), "{}{}", file_prefix[0..], suffix);
1184 defer self.gpa().free(file_name);1184 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..] });
1187 errdefer self.gpa().free(full_path);1187 errdefer self.gpa().free(full_path);
11881188
1189 return Buffer.fromOwnedSlice(self.gpa(), full_path);1189 return Buffer.fromOwnedSlice(self.gpa(), full_path);
...@@ -1204,7 +1204,7 @@ pub const Compilation = struct {...@@ -1204,7 +1204,7 @@ pub const Compilation = struct {
1204 const zig_dir_path = try getZigDir(self.gpa());1204 const zig_dir_path = try getZigDir(self.gpa());
1205 defer self.gpa().free(zig_dir_path);1205 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..] });
1208 try os.makePath(self.gpa(), tmp_dir);1208 try os.makePath(self.gpa(), tmp_dir);
1209 return tmp_dir;1209 return tmp_dir;
1210 }1210 }
src-self-hosted/introspect.zig+2-2
...@@ -8,10 +8,10 @@ const warn = std.debug.warn;...@@ -8,10 +8,10 @@ const warn = std.debug.warn;
88
9/// Caller must free result9/// Caller must free result
10pub fn testZigInstallPrefix(allocator: *mem.Allocator, test_path: []const u8) ![]u8 {10pub 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" });
12 errdefer allocator.free(test_zig_dir);12 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" });
15 defer allocator.free(test_index_file);15 defer allocator.free(test_index_file);
1616
17 var file = try os.File.openRead(test_index_file);17 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 {...@@ -230,7 +230,7 @@ pub const LibCInstallation = struct {
230 while (path_i < search_paths.len) : (path_i += 1) {230 while (path_i < search_paths.len) : (path_i += 1) {
231 const search_path_untrimmed = search_paths.at(search_paths.len - path_i - 1);231 const search_path_untrimmed = search_paths.at(search_paths.len - path_i - 1);
232 const search_path = std.mem.trimLeft(u8, search_path_untrimmed, " ");232 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" });
234 defer loop.allocator.free(stdlib_path);234 defer loop.allocator.free(stdlib_path);
235235
236 if (try fileExists(stdlib_path)) {236 if (try fileExists(stdlib_path)) {
...@@ -254,7 +254,7 @@ pub const LibCInstallation = struct {...@@ -254,7 +254,7 @@ pub const LibCInstallation = struct {
254 const stream = &std.io.BufferOutStream.init(&result_buf).stream;254 const stream = &std.io.BufferOutStream.init(&result_buf).stream;
255 try stream.print("{}\\Include\\{}\\ucrt", search.path, search.version);255 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" });
258 defer loop.allocator.free(stdlib_path);258 defer loop.allocator.free(stdlib_path);
259259
260 if (try fileExists(stdlib_path)) {260 if (try fileExists(stdlib_path)) {
...@@ -283,7 +283,7 @@ pub const LibCInstallation = struct {...@@ -283,7 +283,7 @@ pub const LibCInstallation = struct {
283 builtin.Arch.aarch64v8 => try stream.write("arm"),283 builtin.Arch.aarch64v8 => try stream.write("arm"),
284 else => return error.UnsupportedArchitecture,284 else => return error.UnsupportedArchitecture,
285 }285 }
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" });
287 defer loop.allocator.free(ucrt_lib_path);287 defer loop.allocator.free(ucrt_lib_path);
288 if (try fileExists(ucrt_lib_path)) {288 if (try fileExists(ucrt_lib_path)) {
289 self.lib_dir = result_buf.toOwnedSlice();289 self.lib_dir = result_buf.toOwnedSlice();
...@@ -358,7 +358,7 @@ pub const LibCInstallation = struct {...@@ -358,7 +358,7 @@ pub const LibCInstallation = struct {
358 builtin.Arch.aarch64v8 => try stream.write("arm\\"),358 builtin.Arch.aarch64v8 => try stream.write("arm\\"),
359 else => return error.UnsupportedArchitecture,359 else => return error.UnsupportedArchitecture,
360 }360 }
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" });
362 defer loop.allocator.free(kernel32_path);362 defer loop.allocator.free(kernel32_path);
363 if (try fileExists(kernel32_path)) {363 if (try fileExists(kernel32_path)) {
364 self.kernel32_lib_dir = result_buf.toOwnedSlice();364 self.kernel32_lib_dir = result_buf.toOwnedSlice();
src-self-hosted/link.zig+1-1
...@@ -315,7 +315,7 @@ fn constructLinkerArgsElf(ctx: *Context) !void {...@@ -315,7 +315,7 @@ fn constructLinkerArgsElf(ctx: *Context) !void {
315}315}
316316
317fn addPathJoin(ctx: *Context, dirname: []const u8, basename: []const u8) !void {317fn 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 });
319 const full_path_with_null = try std.cstr.addNullByte(&ctx.arena.allocator, full_path);319 const full_path_with_null = try std.cstr.addNullByte(&ctx.arena.allocator, full_path);
320 try ctx.args.append(full_path_with_null.ptr);320 try ctx.args.append(full_path_with_null.ptr);
321}321}
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...@@ -757,7 +757,7 @@ async fn fmtPath(fmt: *Fmt, file_path_ref: []const u8, check_mode: bool) FmtErro
757 var group = event.Group(FmtError!void).init(fmt.loop);757 var group = event.Group(FmtError!void).init(fmt.loop);
758 while (try dir.next()) |entry| {758 while (try dir.next()) |entry| {
759 if (entry.kind == std.os.Dir.Entry.Kind.Directory or mem.endsWith(u8, entry.name, ".zig")) {759 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 });
761 try group.call(fmtPath, fmt, full_path, check_mode);761 try group.call(fmtPath, fmt, full_path, check_mode);
762 }762 }
763 }763 }
src-self-hosted/test.zig+2-2
...@@ -87,7 +87,7 @@ pub const TestContext = struct {...@@ -87,7 +87,7 @@ pub const TestContext = struct {
87 ) !void {87 ) !void {
88 var file_index_buf: [20]u8 = undefined;88 var file_index_buf: [20]u8 = undefined;
89 const file_index = try std.fmt.bufPrint(file_index_buf[0..], "{}", self.file_index.incr());89 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
92 if (std.os.path.dirname(file1_path)) |dirname| {92 if (std.os.path.dirname(file1_path)) |dirname| {
93 try std.os.makePath(allocator, dirname);93 try std.os.makePath(allocator, dirname);
...@@ -120,7 +120,7 @@ pub const TestContext = struct {...@@ -120,7 +120,7 @@ pub const TestContext = struct {
120 ) !void {120 ) !void {
121 var file_index_buf: [20]u8 = undefined;121 var file_index_buf: [20]u8 = undefined;
122 const file_index = try std.fmt.bufPrint(file_index_buf[0..], "{}", self.file_index.incr());122 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
125 const output_file = try std.fmt.allocPrint(allocator, "{}-out{}", file1_path, Target(Target.Native).exeFileExt());125 const output_file = try std.fmt.allocPrint(allocator, "{}-out{}", file1_path, Target(Target.Native).exeFileExt());
126 if (std.os.path.dirname(file1_path)) |dirname| {126 if (std.os.path.dirname(file1_path)) |dirname| {