| ... | ... | @@ -82,7 +82,7 @@ has_side_effects: bool = false, |
| 82 | 82 | pub const StdIn = union(enum) { |
| 83 | 83 | none, |
| 84 | 84 | bytes: []const u8, |
| 85 | | file_source: std.Build.LazyPath, |
| 85 | lazy_path: std.Build.LazyPath, |
| 86 | 86 | }; |
| 87 | 87 | |
| 88 | 88 | pub const StdIo = union(enum) { |
| ... | ... | @@ -120,7 +120,7 @@ pub const StdIo = union(enum) { |
| 120 | 120 | |
| 121 | 121 | pub const Arg = union(enum) { |
| 122 | 122 | artifact: *Step.Compile, |
| 123 | | file_source: PrefixedLazyPath, |
| 123 | lazy_path: PrefixedLazyPath, |
| 124 | 124 | directory_source: PrefixedLazyPath, |
| 125 | 125 | bytes: []u8, |
| 126 | 126 | output: *Output, |
| ... | ... | @@ -128,7 +128,7 @@ pub const Arg = union(enum) { |
| 128 | 128 | |
| 129 | 129 | pub const PrefixedLazyPath = struct { |
| 130 | 130 | prefix: []const u8, |
| 131 | | file_source: std.Build.LazyPath, |
| 131 | lazy_path: std.Build.LazyPath, |
| 132 | 132 | }; |
| 133 | 133 | |
| 134 | 134 | pub const Output = struct { |
| ... | ... | @@ -213,9 +213,9 @@ pub fn addPrefixedFileArg(self: *Run, prefix: []const u8, lp: std.Build.LazyPath |
| 213 | 213 | |
| 214 | 214 | const prefixed_file_source: PrefixedLazyPath = .{ |
| 215 | 215 | .prefix = b.dupe(prefix), |
| 216 | | .file_source = lp.dupe(b), |
| 216 | .lazy_path = lp.dupe(b), |
| 217 | 217 | }; |
| 218 | | self.argv.append(.{ .file_source = prefixed_file_source }) catch @panic("OOM"); |
| 218 | self.argv.append(.{ .lazy_path = prefixed_file_source }) catch @panic("OOM"); |
| 219 | 219 | lp.addStepDependencies(&self.step); |
| 220 | 220 | } |
| 221 | 221 | |
| ... | ... | @@ -234,7 +234,7 @@ pub fn addPrefixedDirectoryArg(self: *Run, prefix: []const u8, directory_source: |
| 234 | 234 | |
| 235 | 235 | const prefixed_directory_source: PrefixedLazyPath = .{ |
| 236 | 236 | .prefix = b.dupe(prefix), |
| 237 | | .file_source = directory_source.dupe(b), |
| 237 | .lazy_path = directory_source.dupe(b), |
| 238 | 238 | }; |
| 239 | 239 | self.argv.append(.{ .directory_source = prefixed_directory_source }) catch @panic("OOM"); |
| 240 | 240 | directory_source.addStepDependencies(&self.step); |
| ... | ... | @@ -252,7 +252,7 @@ pub fn addArgs(self: *Run, args: []const []const u8) void { |
| 252 | 252 | |
| 253 | 253 | pub fn setStdIn(self: *Run, stdin: StdIn) void { |
| 254 | 254 | switch (stdin) { |
| 255 | | .file_source => |file_source| file_source.addStepDependencies(&self.step), |
| 255 | .lazy_path => |lazy_path| lazy_path.addStepDependencies(&self.step), |
| 256 | 256 | .bytes, .none => {}, |
| 257 | 257 | } |
| 258 | 258 | self.stdin = stdin; |
| ... | ... | @@ -444,14 +444,14 @@ fn make(step: *Step, prog_node: *std.Progress.Node) !void { |
| 444 | 444 | try argv_list.append(bytes); |
| 445 | 445 | man.hash.addBytes(bytes); |
| 446 | 446 | }, |
| 447 | | .file_source => |file| { |
| 448 | | const file_path = file.file_source.getPath(b); |
| 447 | .lazy_path => |file| { |
| 448 | const file_path = file.lazy_path.getPath(b); |
| 449 | 449 | try argv_list.append(b.fmt("{s}{s}", .{ file.prefix, file_path })); |
| 450 | 450 | man.hash.addBytes(file.prefix); |
| 451 | 451 | _ = try man.addFile(file_path, null); |
| 452 | 452 | }, |
| 453 | 453 | .directory_source => |file| { |
| 454 | | const file_path = file.file_source.getPath(b); |
| 454 | const file_path = file.lazy_path.getPath(b); |
| 455 | 455 | try argv_list.append(b.fmt("{s}{s}", .{ file.prefix, file_path })); |
| 456 | 456 | man.hash.addBytes(file.prefix); |
| 457 | 457 | man.hash.addBytes(file_path); |
| ... | ... | @@ -486,8 +486,8 @@ fn make(step: *Step, prog_node: *std.Progress.Node) !void { |
| 486 | 486 | .bytes => |bytes| { |
| 487 | 487 | man.hash.addBytes(bytes); |
| 488 | 488 | }, |
| 489 | | .file_source => |file_source| { |
| 490 | | const file_path = file_source.getPath(b); |
| 489 | .lazy_path => |lazy_path| { |
| 490 | const file_path = lazy_path.getPath(b); |
| 491 | 491 | _ = try man.addFile(file_path, null); |
| 492 | 492 | }, |
| 493 | 493 | .none => {}, |
| ... | ... | @@ -1186,8 +1186,8 @@ fn evalGeneric(self: *Run, child: *std.process.Child) !StdIoResult { |
| 1186 | 1186 | child.stdin.?.close(); |
| 1187 | 1187 | child.stdin = null; |
| 1188 | 1188 | }, |
| 1189 | | .file_source => |file_source| { |
| 1190 | | const path = file_source.getPath(self.step.owner); |
| 1189 | .lazy_path => |lazy_path| { |
| 1190 | const path = lazy_path.getPath(self.step.owner); |
| 1191 | 1191 | const file = self.step.owner.build_root.handle.openFile(path, .{}) catch |err| { |
| 1192 | 1192 | return self.step.fail("unable to open stdin file: {s}", .{@errorName(err)}); |
| 1193 | 1193 | }; |