| author | |
| committer | |
| log | 83a34758874dbe98d3566e297b56cd3be0e66900 |
| tree | d67da5d8e8d2695f7a87329dfef9ad954cfb272d |
| parent | 0b3ca115206c0332284c80f7f7d42358d96379c1 |
6 files changed, 219 insertions(+), 47 deletions(-)
lib/compiler/configure_runner.zig+79-28| ... | ... | @@ -140,16 +140,13 @@ pub fn main(init: process.Init.Minimal) !void { |
| 140 | 140 | if (try builder.addUserInputFlag(option_contents)) |
| 141 | 141 | fatal(" access the help menu with 'zig build -h'", .{}); |
| 142 | 142 | } |
| 143 | } else if (mem.startsWith(u8, arg, "-fsys=")) { | |
| 144 | const name = arg["-fsys=".len..]; | |
| 143 | } else if (mem.cutPrefix(u8, arg, "-fsys=")) |name| { | |
| 145 | 144 | graph.system_library_options.put(arena, name, .user_enabled) catch @panic("OOM"); |
| 146 | } else if (mem.startsWith(u8, arg, "-fno-sys=")) { | |
| 147 | const name = arg["-fno-sys=".len..]; | |
| 145 | } else if (mem.cutPrefix(u8, arg, "-fno-sys=")) |name| { | |
| 148 | 146 | graph.system_library_options.put(arena, name, .user_disabled) catch @panic("OOM"); |
| 149 | 147 | } else if (mem.eql(u8, arg, "--release")) { |
| 150 | 148 | graph.release_mode = .any; |
| 151 | } else if (mem.startsWith(u8, arg, "--release=")) { | |
| 152 | const text = arg["--release=".len..]; | |
| 149 | } else if (mem.cutPrefix(u8, arg, "--release=")) |text| { | |
| 153 | 150 | graph.release_mode = std.meta.stringToEnum(std.Build.ReleaseMode, text) orelse { |
| 154 | 151 | fatalWithHint("expected [off|any|fast|safe|small] in '{s}', found '{s}'", .{ |
| 155 | 152 | arg, text, |
| ... | ... | @@ -175,23 +172,11 @@ pub fn main(init: process.Init.Minimal) !void { |
| 175 | 172 | multiline_errors = std.meta.stringToEnum(MultilineErrors, next_arg) orelse { |
| 176 | 173 | fatalWithHint("expected style after '{s}', found '{s}'", .{ arg, next_arg }); |
| 177 | 174 | }; |
| 178 | } else if (mem.eql(u8, arg, "--seed")) { | |
| 179 | const next_arg = nextArg(args, &arg_idx) orelse | |
| 180 | fatalWithHint("expected u32 after '{s}'", .{arg}); | |
| 181 | graph.random_seed = std.fmt.parseUnsigned(u32, next_arg, 0) catch |err| { | |
| 182 | fatal("unable to parse seed '{s}' as unsigned 32-bit integer: {s}\n", .{ | |
| 183 | next_arg, @errorName(err), | |
| 184 | }); | |
| 185 | }; | |
| 186 | 175 | } else if (mem.eql(u8, arg, "--build-id")) { |
| 187 | 176 | builder.build_id = .fast; |
| 188 | } else if (mem.startsWith(u8, arg, "--build-id=")) { | |
| 189 | const style = arg["--build-id=".len..]; | |
| 190 | builder.build_id = std.zig.BuildId.parse(style) catch |err| { | |
| 191 | fatal("unable to parse --build-id style '{s}': {s}", .{ | |
| 192 | style, @errorName(err), | |
| 193 | }); | |
| 194 | }; | |
| 177 | } else if (mem.cutPrefix(u8, arg, "--build-id=")) |style| { | |
| 178 | builder.build_id = std.zig.BuildId.parse(style) catch |err| | |
| 179 | fatal("unable to parse --build-id style '{s}': {t}", .{ style, err }); | |
| 195 | 180 | } else if (mem.eql(u8, arg, "--debug-rt")) { |
| 196 | 181 | graph.debug_compiler_runtime_libs = true; |
| 197 | 182 | } else if (mem.eql(u8, arg, "--debug-compile-errors")) { |
| ... | ... | @@ -203,11 +188,6 @@ pub fn main(init: process.Init.Minimal) !void { |
| 203 | 188 | // but it is handled by the parent process. The build runner |
| 204 | 189 | // only sees this flag. |
| 205 | 190 | graph.system_package_mode = true; |
| 206 | } else if (mem.cutPrefix(u8, arg, "-j")) |text| { | |
| 207 | const n = std.fmt.parseUnsigned(u32, text, 10) catch |err| | |
| 208 | fatal("unable to parse jobs count '{s}': {t}", .{ text, err }); | |
| 209 | if (n < 1) fatal("number of jobs must be at least 1", .{}); | |
| 210 | threaded.setAsyncLimit(.limited(n)); | |
| 211 | 191 | } else { |
| 212 | 192 | fatalWithHint("unrecognized argument: '{s}'", .{arg}); |
| 213 | 193 | } |
| ... | ... | @@ -281,6 +261,7 @@ fn serialize(b: *std.Build, wc: *Configuration.Wip, writer: *Io.Writer) !void { |
| 281 | 261 | .name = try wc.addString(step.name), |
| 282 | 262 | .flags = .{ .tag = step.tag }, |
| 283 | 263 | .deps = deps, |
| 264 | .max_rss = .fromBytes(step.max_rss), | |
| 284 | 265 | .extra_index = switch (step.tag) { |
| 285 | 266 | .top_level => e: { |
| 286 | 267 | const top_level: *Step.TopLevel = @fieldParentPtr("step", step); |
| ... | ... | @@ -289,7 +270,21 @@ fn serialize(b: *std.Build, wc: *Configuration.Wip, writer: *Io.Writer) !void { |
| 289 | 270 | })); |
| 290 | 271 | }, |
| 291 | 272 | .compile => @panic("TODO"), |
| 292 | .install_artifact => @panic("TODO"), | |
| 273 | .install_artifact => e: { | |
| 274 | const ia: *Step.InstallArtifact = @fieldParentPtr("step", step); | |
| 275 | break :e try wc.addExtra(@as(Configuration.Step.InstallArtifact, .{ | |
| 276 | .dest_dir = try addInstallDir(wc, ia.dest_dir), | |
| 277 | .dest_sub_path = try wc.addString(ia.dest_sub_path), | |
| 278 | .emitted_bin = try addOptionalLazyPath(wc, ia.emitted_bin), | |
| 279 | .implib_dir = try addInstallDir(wc, ia.implib_dir), | |
| 280 | .emitted_implib = try addOptionalLazyPath(wc, ia.emitted_implib), | |
| 281 | .pdb_dir = try addInstallDir(wc, ia.pdb_dir), | |
| 282 | .emitted_pdb = try addOptionalLazyPath(wc, ia.emitted_pdb), | |
| 283 | .h_dir = try addInstallDir(wc, ia.h_dir), | |
| 284 | .emitted_h = try addOptionalLazyPath(wc, ia.emitted_h), | |
| 285 | .artifact = stepIndex(&step_map, &ia.artifact.step), | |
| 286 | })); | |
| 287 | }, | |
| 293 | 288 | .install_file => @panic("TODO"), |
| 294 | 289 | .install_dir => @panic("TODO"), |
| 295 | 290 | .remove_dir => @panic("TODO"), |
| ... | ... | @@ -315,10 +310,66 @@ fn serialize(b: *std.Build, wc: *Configuration.Wip, writer: *Io.Writer) !void { |
| 315 | 310 | } |
| 316 | 311 | |
| 317 | 312 | try wc.write(writer, .{ |
| 318 | .default_step = @intCast(step_map.getIndex(b.default_step).?), | |
| 313 | .default_step = stepIndex(&step_map, b.default_step), | |
| 319 | 314 | }); |
| 320 | 315 | } |
| 321 | 316 | |
| 317 | fn addOptionalLazyPath(wc: *Configuration.Wip, lp: ?std.Build.LazyPath) !Configuration.OptionalLazyPath { | |
| 318 | return @enumFromInt(switch (lp orelse return .none) { | |
| 319 | .src_path => |src_path| i: { | |
| 320 | const owner = builderToPackage(src_path.owner); | |
| 321 | const sub_path = try wc.addString(src_path.sub_path); | |
| 322 | break :i try wc.addExtra(@as(Configuration.OptionalLazyPath.SourcePath, .{ | |
| 323 | .flags = .{}, | |
| 324 | .owner = owner, | |
| 325 | .sub_path = sub_path, | |
| 326 | })); | |
| 327 | }, | |
| 328 | .generated => |generated| i: { | |
| 329 | const sub_path = try wc.addString(generated.sub_path); | |
| 330 | break :i try wc.addExtra(@as(Configuration.OptionalLazyPath.Generated, .{ | |
| 331 | .flags = .{ .up = @intCast(generated.up) }, | |
| 332 | .sub_path = sub_path, | |
| 333 | })); | |
| 334 | }, | |
| 335 | .cwd_relative => |cwd_relative_sub_path| i: { | |
| 336 | const sub_path = try wc.addString(cwd_relative_sub_path); | |
| 337 | break :i try wc.addExtra(@as(Configuration.OptionalLazyPath.Relative, .{ | |
| 338 | .flags = .{ .base = .cwd }, | |
| 339 | .sub_path = sub_path, | |
| 340 | })); | |
| 341 | }, | |
| 342 | .dependency => |dependency| i: { | |
| 343 | const owner = builderToPackage(dependency.dependency.builder); | |
| 344 | const sub_path = try wc.addString(dependency.sub_path); | |
| 345 | break :i try wc.addExtra(@as(Configuration.OptionalLazyPath.SourcePath, .{ | |
| 346 | .flags = .{}, | |
| 347 | .owner = owner, | |
| 348 | .sub_path = sub_path, | |
| 349 | })); | |
| 350 | }, | |
| 351 | }); | |
| 352 | } | |
| 353 | ||
| 354 | fn builderToPackage(b: *std.Build) Configuration.Package { | |
| 355 | _ = b; | |
| 356 | @panic("TODO"); | |
| 357 | } | |
| 358 | ||
| 359 | fn addInstallDir(wc: *Configuration.Wip, install_dir: ?std.Build.InstallDir) !Configuration.InstallDir { | |
| 360 | switch (install_dir orelse return .none) { | |
| 361 | .prefix => return .prefix, | |
| 362 | .lib => return .lib, | |
| 363 | .bin => return .bin, | |
| 364 | .header => return .header, | |
| 365 | .custom => |sub_path| return .initCustom(try wc.addString(sub_path)), | |
| 366 | } | |
| 367 | } | |
| 368 | ||
| 369 | fn stepIndex(step_map: *const std.AutoArrayHashMapUnmanaged(*Step, void), step: *Step) Configuration.Step.Index { | |
| 370 | return @enumFromInt(step_map.getIndex(step).?); | |
| 371 | } | |
| 372 | ||
| 322 | 373 | /// If the given `Step` is a `Step.Compile`, adds any dependencies for that step which |
| 323 | 374 | /// are implied by the module graph rooted at `step.cast(Step.Compile).?.root_module`. |
| 324 | 375 | fn createModuleDependenciesForStep(step: *Step) Allocator.Error!void { |
lib/std/Build.zig-1| ... | ... | @@ -103,7 +103,6 @@ pub const Graph = struct { |
| 103 | 103 | needed_lazy_dependencies: std.StringArrayHashMapUnmanaged(void) = .empty, |
| 104 | 104 | /// Information about the native target. Computed before build() is invoked. |
| 105 | 105 | host: ResolvedTarget, |
| 106 | random_seed: u32 = 0, | |
| 107 | 106 | dependency_cache: InitializedDepMap = .empty, |
| 108 | 107 | allow_so_scripts: ?bool = null, |
| 109 | 108 | /// Steps should use `io` to limit the number of jobs, however in the case of |
lib/std/Build/Step/InstallArtifact.zig+2-2| ... | ... | @@ -1,8 +1,8 @@ |
| 1 | const InstallArtifact = @This(); | |
| 2 | ||
| 1 | 3 | const std = @import("std"); |
| 2 | 4 | const Step = std.Build.Step; |
| 3 | 5 | const InstallDir = std.Build.InstallDir; |
| 4 | const InstallArtifact = @This(); | |
| 5 | const fs = std.fs; | |
| 6 | 6 | const LazyPath = std.Build.LazyPath; |
| 7 | 7 | |
| 8 | 8 | step: Step, |
lib/std/Build/Step/Run.zig+3-4| ... | ... | @@ -87,6 +87,7 @@ captured_stderr: ?*CapturedStdIo, |
| 87 | 87 | dep_output_file: ?*Output, |
| 88 | 88 | |
| 89 | 89 | has_side_effects: bool, |
| 90 | test_runner_mode: bool = false, | |
| 90 | 91 | |
| 91 | 92 | /// Populated during the fuzz phase if this run step corresponds to a unit test |
| 92 | 93 | /// executable that contains fuzz tests. |
| ... | ... | @@ -234,13 +235,11 @@ pub fn setName(run: *Run, name: []const u8) void { |
| 234 | 235 | } |
| 235 | 236 | |
| 236 | 237 | pub fn enableTestRunnerMode(run: *Run) void { |
| 238 | if (run.test_runner_mode) return; | |
| 237 | 239 | const b = run.step.owner; |
| 238 | 240 | run.stdio = .zig_test; |
| 239 | 241 | run.addPrefixedDirectoryArg("--cache-dir=", .{ .cwd_relative = b.cache_root.path orelse "." }); |
| 240 | run.addArgs(&.{ | |
| 241 | b.fmt("--seed=0x{x}", .{b.graph.random_seed}), | |
| 242 | "--listen=-", | |
| 243 | }); | |
| 242 | run.test_runner_mode = true; | |
| 244 | 243 | } |
| 245 | 244 | |
| 246 | 245 | pub fn addArtifactArg(run: *Run, artifact: *Step.Compile) void { |
lib/std/zig/Configuration.zig+117-7| ... | ... | @@ -4,6 +4,7 @@ const std = @import("../std.zig"); |
| 4 | 4 | const Io = std.Io; |
| 5 | 5 | const Allocator = std.mem.Allocator; |
| 6 | 6 | const assert = std.debug.assert; |
| 7 | const maxInt = std.math.maxInt; | |
| 7 | 8 | |
| 8 | 9 | string_bytes: []u8, |
| 9 | 10 | steps: []Step, |
| ... | ... | @@ -21,8 +22,7 @@ pub const Header = extern struct { |
| 21 | 22 | unlazy_deps_len: u32, |
| 22 | 23 | extra_len: u32, |
| 23 | 24 | |
| 24 | /// Index into `steps`. | |
| 25 | default_step: u32, | |
| 25 | default_step: Step.Index, | |
| 26 | 26 | }; |
| 27 | 27 | |
| 28 | 28 | pub const Wip = struct { |
| ... | ... | @@ -97,7 +97,7 @@ pub const Wip = struct { |
| 97 | 97 | } |
| 98 | 98 | |
| 99 | 99 | pub const Static = struct { |
| 100 | default_step: u32, | |
| 100 | default_step: Step.Index, | |
| 101 | 101 | }; |
| 102 | 102 | |
| 103 | 103 | pub fn write(wip: *Wip, w: *Io.Writer, static: Static) Io.Writer.Error!void { |
| ... | ... | @@ -182,10 +182,12 @@ pub const Wip = struct { |
| 182 | 182 | const fields = @typeInfo(@TypeOf(extra)).@"struct".fields; |
| 183 | 183 | var i = index; |
| 184 | 184 | inline for (fields) |field| { |
| 185 | wip.extra.items[i] = switch (field.type) { | |
| 186 | u32 => @field(extra, field.name), | |
| 187 | String, Deps => @intFromEnum(@field(extra, field.name)), | |
| 188 | else => @compileError("bad field type"), | |
| 185 | comptime assert(@sizeOf(field.type) == @sizeOf(u32)); | |
| 186 | wip.extra.items[i] = switch (@typeInfo(field.type)) { | |
| 187 | .int => @field(extra, field.name), | |
| 188 | .@"enum" => @intFromEnum(@field(extra, field.name)), | |
| 189 | .@"struct" => @bitCast(@field(extra, field.name)), | |
| 190 | else => @compileError("bad field type: " ++ @typeName(field.type)), | |
| 189 | 191 | }; |
| 190 | 192 | i += 1; |
| 191 | 193 | } |
| ... | ... | @@ -196,6 +198,7 @@ pub const Step = extern struct { |
| 196 | 198 | name: String, |
| 197 | 199 | flags: Flags, |
| 198 | 200 | deps: Deps, |
| 201 | max_rss: MaxRss, | |
| 199 | 202 | /// Points into `extra` for step-specific data. |
| 200 | 203 | extra_index: u32, |
| 201 | 204 | |
| ... | ... | @@ -231,6 +234,98 @@ pub const Step = extern struct { |
| 231 | 234 | pub const TopLevel = struct { |
| 232 | 235 | description: String, |
| 233 | 236 | }; |
| 237 | ||
| 238 | pub const InstallArtifact = struct { | |
| 239 | dest_dir: InstallDir, | |
| 240 | dest_sub_path: String, | |
| 241 | emitted_bin: OptionalLazyPath, | |
| 242 | ||
| 243 | implib_dir: InstallDir, | |
| 244 | emitted_implib: OptionalLazyPath, | |
| 245 | ||
| 246 | pdb_dir: InstallDir, | |
| 247 | emitted_pdb: OptionalLazyPath, | |
| 248 | ||
| 249 | h_dir: InstallDir, | |
| 250 | emitted_h: OptionalLazyPath, | |
| 251 | ||
| 252 | /// Always a compile step. | |
| 253 | artifact: Step.Index, | |
| 254 | ||
| 255 | const Flags = packed struct(u32) { | |
| 256 | tag: Tag = .install_artifact, | |
| 257 | dylib_symlinks: bool, | |
| 258 | _: u23 = 0, | |
| 259 | }; | |
| 260 | }; | |
| 261 | }; | |
| 262 | ||
| 263 | pub const MaxRss = enum(u32) { | |
| 264 | none = 0, | |
| 265 | _, | |
| 266 | ||
| 267 | pub fn toBytes(mr: MaxRss) usize { | |
| 268 | const x: usize = @intFromEnum(mr); | |
| 269 | return x << 8; | |
| 270 | } | |
| 271 | ||
| 272 | pub fn fromBytes(bytes: usize) MaxRss { | |
| 273 | return @enumFromInt(bytes >> 8); | |
| 274 | } | |
| 275 | }; | |
| 276 | ||
| 277 | /// An index into `extra`. | |
| 278 | pub const OptionalLazyPath = enum(u32) { | |
| 279 | none = maxInt(u32), | |
| 280 | _, | |
| 281 | ||
| 282 | pub const Tag = enum(u8) { | |
| 283 | /// A source file path relative to build root. | |
| 284 | source_path, | |
| 285 | generated, | |
| 286 | relative, | |
| 287 | }; | |
| 288 | ||
| 289 | pub const SourcePath = struct { | |
| 290 | flags: Flags, | |
| 291 | owner: Package, | |
| 292 | sub_path: String, | |
| 293 | ||
| 294 | pub const Flags = packed struct(u32) { | |
| 295 | tag: Tag = .source_path, | |
| 296 | _: u24 = 0, | |
| 297 | }; | |
| 298 | }; | |
| 299 | ||
| 300 | pub const Generated = struct { | |
| 301 | flags: Flags, | |
| 302 | /// Applied after `up`. | |
| 303 | sub_path: String, | |
| 304 | ||
| 305 | pub const Flags = packed struct(u32) { | |
| 306 | tag: Tag = .generated, | |
| 307 | /// The number of parent directories to go up. | |
| 308 | /// 0 means the generated file itself. | |
| 309 | /// 1 means the directory of the generated file. | |
| 310 | /// 2 means the parent of that directory, and so on. | |
| 311 | up: u24, | |
| 312 | }; | |
| 313 | }; | |
| 314 | ||
| 315 | pub const Relative = struct { | |
| 316 | flags: Flags, | |
| 317 | sub_path: String, | |
| 318 | ||
| 319 | pub const Flags = packed struct(u32) { | |
| 320 | tag: Tag = .relative, | |
| 321 | base: Path.Base, | |
| 322 | _: u16 = 0, | |
| 323 | }; | |
| 324 | }; | |
| 325 | }; | |
| 326 | ||
| 327 | pub const Package = enum(u32) { | |
| 328 | _, | |
| 234 | 329 | }; |
| 235 | 330 | |
| 236 | 331 | /// Points into `extra`, where the first element is number of deps, |
| ... | ... | @@ -258,6 +353,21 @@ pub const Path = extern struct { |
| 258 | 353 | } |
| 259 | 354 | }; |
| 260 | 355 | |
| 356 | pub const InstallDir = enum(u32) { | |
| 357 | none = maxInt(u32) - 4, | |
| 358 | prefix = maxInt(u32) - 3, | |
| 359 | lib = maxInt(u32) - 2, | |
| 360 | bin = maxInt(u32) - 1, | |
| 361 | header = maxInt(u32), | |
| 362 | /// A `String` path relative to the prefix. | |
| 363 | _, | |
| 364 | ||
| 365 | pub fn initCustom(sub_path: String) InstallDir { | |
| 366 | assert(@intFromEnum(sub_path) < @intFromEnum(InstallDir.none)); | |
| 367 | return @enumFromInt(@intFromEnum(sub_path)); | |
| 368 | } | |
| 369 | }; | |
| 370 | ||
| 261 | 371 | /// Points into `string_bytes`, null-terminated. |
| 262 | 372 | pub const String = enum(u32) { |
| 263 | 373 | _, |
src/main.zig+18-5| ... | ... | @@ -4982,34 +4982,47 @@ fn cmdBuild( |
| 4982 | 4982 | const default_seed = try std.fmt.allocPrint(arena, "0x{x}", .{randInt(io, u32)}); |
| 4983 | 4983 | |
| 4984 | 4984 | try configure_argv.ensureUnusedCapacity(arena, 16); |
| 4985 | try make_argv.ensureUnusedCapacity(arena, 16); | |
| 4985 | 4986 | |
| 4986 | 4987 | const argv_index_exe = configure_argv.items.len; |
| 4987 | 4988 | _ = configure_argv.addOneAssumeCapacity(); |
| 4989 | _ = make_argv.addOneAssumeCapacity(); | |
| 4988 | 4990 | |
| 4989 | 4991 | configure_argv.appendAssumeCapacity("--zig"); |
| 4990 | 4992 | configure_argv.appendAssumeCapacity(self_exe_path); |
| 4991 | 4993 | |
| 4994 | make_argv.appendAssumeCapacity("--zig"); | |
| 4995 | make_argv.appendAssumeCapacity(self_exe_path); | |
| 4996 | ||
| 4992 | 4997 | configure_argv.appendAssumeCapacity("--zig-lib-dir"); |
| 4998 | make_argv.appendAssumeCapacity("--zig-lib-dir"); | |
| 4993 | 4999 | const argv_index_zig_lib_dir = configure_argv.items.len; |
| 4994 | 5000 | _ = configure_argv.addOneAssumeCapacity(); |
| 5001 | _ = make_argv.addOneAssumeCapacity(); | |
| 4995 | 5002 | |
| 4996 | 5003 | configure_argv.appendAssumeCapacity("--build-root"); |
| 5004 | make_argv.appendAssumeCapacity("--build-root"); | |
| 4997 | 5005 | const argv_index_build_file = configure_argv.items.len; |
| 4998 | 5006 | _ = configure_argv.addOneAssumeCapacity(); |
| 5007 | _ = make_argv.addOneAssumeCapacity(); | |
| 4999 | 5008 | |
| 5000 | 5009 | configure_argv.appendAssumeCapacity("--local-cache"); |
| 5010 | make_argv.appendAssumeCapacity("--local-cache"); | |
| 5001 | 5011 | const argv_index_cache_dir = configure_argv.items.len; |
| 5002 | 5012 | _ = configure_argv.addOneAssumeCapacity(); |
| 5013 | _ = make_argv.addOneAssumeCapacity(); | |
| 5003 | 5014 | |
| 5004 | 5015 | configure_argv.appendAssumeCapacity("--global-cache"); |
| 5016 | make_argv.appendAssumeCapacity("--global-cache"); | |
| 5005 | 5017 | const argv_index_global_cache_dir = configure_argv.items.len; |
| 5006 | 5018 | _ = configure_argv.addOneAssumeCapacity(); |
| 5019 | _ = make_argv.addOneAssumeCapacity(); | |
| 5007 | 5020 | |
| 5008 | configure_argv.appendSliceAssumeCapacity(&.{ "--seed", default_seed }); | |
| 5009 | const argv_index_seed = configure_argv.items.len - 1; | |
| 5021 | make_argv.appendSliceAssumeCapacity(&.{ "--configuration", undefined }); | |
| 5022 | const argv_index_configuration_file = make_argv.items.len - 1; | |
| 5010 | 5023 | |
| 5011 | const argv_index_configuration_file = make_argv.items.len; | |
| 5012 | _ = try make_argv.addOne(arena); | |
| 5024 | make_argv.appendSliceAssumeCapacity(&.{ "--seed", default_seed }); | |
| 5025 | const argv_index_seed = make_argv.items.len - 1; | |
| 5013 | 5026 | |
| 5014 | 5027 | var color: Color = .auto; |
| 5015 | 5028 | var n_jobs: ?u32 = null; |
| ... | ... | @@ -5151,7 +5164,7 @@ fn cmdBuild( |
| 5151 | 5164 | } else if (mem.eql(u8, arg, "--seed")) { |
| 5152 | 5165 | if (i + 1 >= args.len) fatal("expected argument after '{s}'", .{arg}); |
| 5153 | 5166 | i += 1; |
| 5154 | configure_argv.items[argv_index_seed] = args[i]; | |
| 5167 | make_argv.items[argv_index_seed] = args[i]; | |
| 5155 | 5168 | continue; |
| 5156 | 5169 | } else if (mem.eql(u8, arg, "--")) { |
| 5157 | 5170 | // The rest of the args are supposed to get passed onto |