╭ changed ──────────────────╮ │lib/std/Build/Serialize.zig│ ╰───────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │ 82 .steps = .{ .slice = dep_steps }, │ │ 83 }); │ │ 84 │ │ 85 - try wc.steps.ensureTotalCapacity(gpa, s.step_map.entries.capacity); │ │ 86 - wc.steps.appendAssumeCapacity(.{ │ │ 87 - .name = try wc.addString(step.name), │ │ 88 - .owner = try s.builderToPackage(step.owner), │ │ 89 - .deps = deps, │ │ 90 - .max_rss = .fromBytes(step.max_rss), │ │ 91 - .extended = @fromBackingInt(@intCast(switch (step.tag) { │ │ 92 - .top_level => e: { │ │ 93 - const top_level: *Step.TopLevel = @fieldParentPtr("step", step); │ │ 94 - break :e try wc.addExtraErased(Configuration.Step.TopLevel, .{ │ │ 95 - .description = try wc.addString(top_level.description), │ │ 96 - }); │ │ 97 - }, │ │ 98 - .compile => e: { │ │ 99 - const c: *Step.Compile = @fieldParentPtr("step", step); │ │100 - const installed_headers: []u32 = try arena.alloc(u32, c.installed_headers.items.len); │ │101 - for (installed_headers, c.installed_headers.items) |*dst, src| switch (src) { │ │102 - .file => |file| { │ │103 - dst.* = try wc.addExtraErased(Configuration.Step.Compile.InstalledHeader.File, .{ │ │104 - .source = try s.addLazyPath(file.source), │ │105 - .dest_sub_path = try wc.addString(file.dest_rel_path), │ │106 - }); │ │107 - }, │ │108 - .directory => |directory| { │ │109 - const include_extensions = directory.options.include_extensions orelse &.{}; │ │110 - dst.* = try wc.addExtraErased(Configuration.Step.Compile.InstalledHeader.Directory, .{ │ │111 - .flags = .{ │ │112 - .include_extensions = include_extensions.len != 0, │ │113 - .exclude_extensions = directory.options.exclude_extensions.len != 0, │ │114 - }, │ │115 - .source = try s.addLazyPath(directory.source), │ │116 - .dest_sub_path = try wc.addString(directory.dest_rel_path), │ │117 - .exclude_extensions = .{ .slice = try s.initStringList(directory.options.exclude_extensions) }, │ │118 - .include_extensions = .{ .slice = try s.initStringList(include_extensions) }, │ │119 - }); │ │120 - }, │ │121 - }; │ │ 85 + const extended: u32 = switch (step.tag) { │ │ 86 + .top_level => e: { │ │ 87 + const top_level: *Step.TopLevel = @fieldParentPtr("step", step); │ │ 88 + break :e try wc.addExtraErased(Configuration.Step.TopLevel, .{ │ │ 89 + .description = try wc.addString(top_level.description), │ │ 90 + }); │ │ 91 + }, │ │ 92 + .compile => e: { │ │ 93 + const c: *Step.Compile = @fieldParentPtr("step", step); │ │ 94 + const installed_headers: []u32 = try arena.alloc(u32, c.installed_headers.items.len); │ │ 95 + for (installed_headers, c.installed_headers.items) |*dst, src| switch (src) { │ │ 96 + .file => |file| { │ │ 97 + dst.* = try wc.addExtraErased(Configuration.Step.Compile.InstalledHeader.File, .{ │ │ 98 + .source = try s.addLazyPath(file.source), │ │ 99 + .dest_sub_path = try wc.addString(file.dest_rel_path), │ │100 + }); │ │101 + }, │ │102 + .directory => |directory| { │ │103 + const include_extensions = directory.options.include_extensions orelse &.{}; │ │104 + dst.* = try wc.addExtraErased(Configuration.Step.Compile.InstalledHeader.Directory, .{ │ │105 + .flags = .{ │ │106 + .include_extensions = include_extensions.len != 0, │ │107 + .exclude_extensions = directory.options.exclude_extensions.len != 0, │ │108 + }, │ │109 + .source = try s.addLazyPath(directory.source), │ │110 + .dest_sub_path = try wc.addString(directory.dest_rel_path), │ │111 + .exclude_extensions = .{ .slice = try s.initStringList(directory.options.exclude_extensions) }, │ │112 + .include_extensions = .{ .slice = try s.initStringList(include_extensions) }, │ │113 + }); │ │114 + }, │ │115 + }; │ │116 │ │123 - break :e try wc.addExtraErased(Configuration.Step.Compile, .{ │ │124 - .flags = .{ │ │125 - .filters_len = c.filters.len != 0, │ │126 - .installed_headers_len = installed_headers.len != 0, │ │127 - .force_undefined_symbols_len = c.force_undefined_symbols.entries.len != 0, │ │117 + break :e try wc.addExtraErased(Configuration.Step.Compile, .{ │ │118 + .flags = .{ │ │119 + .filters_len = c.filters.len != 0, │ │120 + .installed_headers_len = installed_headers.len != 0, │ │121 + .force_undefined_symbols_len = c.force_undefined_symbols.entries.len != 0, │ │122 │ │129 - .verbose_link = c.verbose_link, │ │130 - .verbose_cc = c.verbose_cc, │ │131 - .rdynamic = c.rdynamic, │ │132 - .import_memory = c.import_memory, │ │133 - .export_memory = c.export_memory, │ │134 - .import_symbols = c.import_symbols, │ │135 - .import_table = c.import_table, │ │136 - .export_table = c.export_table, │ │137 - .growable_table = c.growable_table, │ │138 - .shared_memory = c.shared_memory, │ │139 - .link_eh_frame_hdr = c.link_eh_frame_hdr, │ │140 - .link_emit_relocs = c.link_emit_relocs, │ │141 - .link_function_sections = c.link_function_sections, │ │142 - .link_data_sections = c.link_data_sections, │ │143 - .linker_dynamicbase = c.linker_dynamicbase, │ │144 - .link_z_notext = c.link_z_notext, │ │145 - .link_z_relro = c.link_z_relro, │ │146 - .link_z_lazy = c.link_z_lazy, │ │147 - .link_z_defs = c.link_z_defs, │ │148 - .headerpad_max_install_names = c.headerpad_max_install_names, │ │149 - .dead_strip_dylibs = c.dead_strip_dylibs, │ │150 - .force_load_objc = c.force_load_objc, │ │151 - .discard_local_symbols = c.discard_local_symbols, │ │152 - .mingw_unicode_entry_point = c.mingw_unicode_entry_point, │ │153 - }, │ │154 - .flags2 = .{ │ │155 - .pie = .init(c.pie), │ │156 - .formatted_panics = .init(c.formatted_panics), │ │157 - .bundle_compiler_rt = .init(c.bundle_compiler_rt), │ │158 - .bundle_ubsan_rt = .init(c.bundle_ubsan_rt), │ │159 - .each_lib_rpath = .init(c.each_lib_rpath), │ │160 - .link_gc_sections = .init(c.link_gc_sections), │ │161 - .linker_allow_shlib_undefined = .init(c.linker_allow_shlib_undefined), │ │162 - .linker_allow_undefined_version = .init(c.linker_allow_undefined_version), │ │163 - .linker_enable_new_dtags = .init(c.linker_enable_new_dtags), │ │164 - .dll_export_fns = .init(c.dll_export_fns), │ │165 - .use_llvm = .init(c.use_llvm), │ │166 - .use_lld = .init(c.use_lld), │ │167 - .use_new_linker = .init(c.use_new_linker), │ │168 - .allow_so_scripts = .init(c.allow_so_scripts), │ │169 - .sanitize_coverage_trace_pc_guard = .init(c.sanitize_coverage_trace_pc_guard), │ │170 - .linkage = .init(c.linkage), │ │171 - }, │ │172 - .flags3 = .{ │ │173 - .version = c.version != null, │ │174 - .compress_debug_sections = c.compress_debug_sections, │ │175 - .initial_memory = c.initial_memory != null, │ │176 - .max_memory = c.max_memory != null, │ │177 - .kind = c.kind, │ │178 - .global_base = c.global_base != null, │ │179 - .test_runner = if (c.test_runner) |tr| switch (tr.mode) { │ │180 - .simple => .simple, │ │181 - .server => .server, │ │182 - } else .default, │ │183 - .wasi_exec_model = .init(c.wasi_exec_model), │ │184 - .win32_manifest = c.win32_manifest != null, │ │185 - .win32_module_definition = c.win32_module_definition != null, │ │186 - .zig_lib_dir = c.zig_lib_dir != null, │ │187 - .rc_includes = c.rc_includes, │ │188 - .image_base = c.image_base != null, │ │189 - .build_id = .init(c.build_id), │ │190 - .entry = switch (c.entry) { │ │191 - .default => .default, │ │192 - .disabled => .disabled, │ │193 - .enabled => .enabled, │ │194 - .symbol_name => .symbol_name, │ │195 - }, │ │196 - .lto = .init(c.lto), │ │197 - .subsystem = .init(c.subsystem), │ │123 + .verbose_link = c.verbose_link, │ │124 + .verbose_cc = c.verbose_cc, │ │125 + .rdynamic = c.rdynamic, │ │126 + .import_memory = c.import_memory, │ │127 + .export_memory = c.export_memory, │ │128 + .import_symbols = c.import_symbols, │ │129 + .import_table = c.import_table, │ │130 + .export_table = c.export_table, │ │131 + .growable_table = c.growable_table, │ │132 + .shared_memory = c.shared_memory, │ │133 + .link_eh_frame_hdr = c.link_eh_frame_hdr, │ │134 + .link_emit_relocs = c.link_emit_relocs, │ │135 + .link_function_sections = c.link_function_sections, │ │136 + .link_data_sections = c.link_data_sections, │ │137 + .linker_dynamicbase = c.linker_dynamicbase, │ │138 + .link_z_notext = c.link_z_notext, │ │139 + .link_z_relro = c.link_z_relro, │ │140 + .link_z_lazy = c.link_z_lazy, │ │141 + .link_z_defs = c.link_z_defs, │ │142 + .headerpad_max_install_names = c.headerpad_max_install_names, │ │143 + .dead_strip_dylibs = c.dead_strip_dylibs, │ │144 + .force_load_objc = c.force_load_objc, │ │145 + .discard_local_symbols = c.discard_local_symbols, │ │146 + .mingw_unicode_entry_point = c.mingw_unicode_entry_point, │ │147 + }, │ │148 + .flags2 = .{ │ │149 + .pie = .init(c.pie), │ │150 + .formatted_panics = .init(c.formatted_panics), │ │151 + .bundle_compiler_rt = .init(c.bundle_compiler_rt), │ │152 + .bundle_ubsan_rt = .init(c.bundle_ubsan_rt), │ │153 + .each_lib_rpath = .init(c.each_lib_rpath), │ │154 + .link_gc_sections = .init(c.link_gc_sections), │ │155 + .linker_allow_shlib_undefined = .init(c.linker_allow_shlib_undefined), │ │156 + .linker_allow_undefined_version = .init(c.linker_allow_undefined_version), │ │157 + .linker_enable_new_dtags = .init(c.linker_enable_new_dtags), │ │158 + .dll_export_fns = .init(c.dll_export_fns), │ │159 + .use_llvm = .init(c.use_llvm), │ │160 + .use_lld = .init(c.use_lld), │ │161 + .use_new_linker = .init(c.use_new_linker), │ │162 + .allow_so_scripts = .init(c.allow_so_scripts), │ │163 + .sanitize_coverage_trace_pc_guard = .init(c.sanitize_coverage_trace_pc_guard), │ │164 + .linkage = .init(c.linkage), │ │165 + }, │ │166 + .flags3 = .{ │ │167 + .version = c.version != null, │ │168 + .compress_debug_sections = c.compress_debug_sections, │ │169 + .initial_memory = c.initial_memory != null, │ │170 + .max_memory = c.max_memory != null, │ │171 + .kind = c.kind, │ │172 + .global_base = c.global_base != null, │ │173 + .test_runner = if (c.test_runner) |tr| switch (tr.mode) { │ │174 + .simple => .simple, │ │175 + .server => .server, │ │176 + } else .default, │ │177 + .wasi_exec_model = .init(c.wasi_exec_model), │ │178 + .win32_manifest = c.win32_manifest != null, │ │179 + .win32_module_definition = c.win32_module_definition != null, │ │180 + .zig_lib_dir = c.zig_lib_dir != null, │ │181 + .rc_includes = c.rc_includes, │ │182 + .image_base = c.image_base != null, │ │183 + .build_id = .init(c.build_id), │ │184 + .entry = switch (c.entry) { │ │185 + .default => .default, │ │186 + .disabled => .disabled, │ │187 + .enabled => .enabled, │ │188 + .symbol_name => .symbol_name, │ │189 }, │ │199 - .flags4 = .{ │ │200 - .libc_file = c.libc_file != null, │ │201 - .link_z_common_page_size = c.link_z_common_page_size != null, │ │202 - .link_z_max_page_size = c.link_z_max_page_size != null, │ │203 - .pagezero_size = c.pagezero_size != null, │ │204 - .stack_size = c.stack_size != null, │ │205 - .headerpad_size = c.headerpad_size != null, │ │206 - .error_limit = c.error_limit != null, │ │207 - .install_name = c.install_name != null, │ │208 - .entitlements = c.entitlements != null, │ │209 - .expect_errors = if (c.expect_errors) |x| switch (x) { │ │210 - .contains => .contains, │ │211 - .exact => .exact, │ │212 - .starts_with => .starts_with, │ │213 - .stderr_contains => .stderr_contains, │ │214 - } else .none, │ │215 - .linker_script = c.linker_script != null, │ │216 - .version_script = c.version_script != null, │ │217 - .emit_directory = c.emit_directory != .none, │ │218 - .generated_docs = c.generated_docs != .none, │ │219 - .generated_asm = c.generated_asm != .none, │ │220 - .generated_bin = c.generated_bin != .none, │ │221 - .generated_pdb = c.generated_pdb != .none, │ │222 - .generated_implib = c.generated_implib != .none, │ │223 - .generated_llvm_bc = c.generated_llvm_bc != .none, │ │224 - .generated_llvm_ir = c.generated_llvm_ir != .none, │ │225 - .generated_h = c.generated_h != .none, │ │226 - .incremental = .init(c.incremental), │ │227 - }, │ │228 - .root_module = try s.addModule(c.root_module), │ │229 - .root_name = try wc.addString(c.name), │ │230 - .linker_script = .{ .value = try s.addOptionalLazyPath(c.linker_script) }, │ │231 - .version_script = .{ .value = try s.addOptionalLazyPath(c.version_script) }, │ │232 - .zig_lib_dir = .{ .value = try s.addOptionalLazyPath(c.zig_lib_dir) }, │ │233 - .libc_file = .{ .value = try s.addOptionalLazyPath(c.libc_file) }, │ │234 - .win32_manifest = .{ .value = try s.addOptionalLazyPath(c.win32_manifest) }, │ │235 - .win32_module_definition = .{ .value = try s.addOptionalLazyPath(c.win32_module_definition) }, │ │236 - .entitlements = .{ .value = try s.addOptionalLazyPath(c.entitlements) }, │ │237 - .version = .{ .value = try s.addOptionalSemVer(c.version) }, │ │238 - .install_name = .{ .value = try s.addOptionalString(c.install_name) }, │ │239 - .initial_memory = .{ .value = c.initial_memory }, │ │240 - .max_memory = .{ .value = c.max_memory }, │ │241 - .global_base = .{ .value = c.global_base }, │ │242 - .image_base = .{ .value = c.image_base }, │ │243 - .link_z_common_page_size = .{ .value = c.link_z_common_page_size }, │ │244 - .link_z_max_page_size = .{ .value = c.link_z_max_page_size }, │ │245 - .pagezero_size = .{ .value = c.pagezero_size }, │ │246 - .stack_size = .{ .value = c.stack_size }, │ │247 - .headerpad_size = .{ .value = c.headerpad_size }, │ │248 - .error_limit = .{ .value = c.error_limit }, │ │249 - .entry = .{ .value = switch (c.entry) { │ │250 - .symbol_name => |name| try wc.addString(name), │ │251 - .default, .disabled, .enabled => null, │ │252 - } }, │ │253 - .build_id = .{ .value = if (c.build_id) |id| switch (id) { │ │254 - .hexstring => |*hexstring| try wc.addString(hexstring.toSlice()), │ │255 - .none, .fast, .uuid, .sha1, .md5 => null, │ │256 - } else null }, │ │257 - .filters = .{ .slice = try s.initStringList(c.filters) }, │ │258 - .installed_headers = .initErased(installed_headers), │ │259 - .force_undefined_symbols = .{ .slice = try s.initStringList(c.force_undefined_symbols.keys()) }, │ │260 - .expect_errors = .{ .u = if (c.expect_errors) |x| switch (x) { │ │261 - .contains => |slice| .{ .contains = try wc.addString(slice) }, │ │262 - .exact => |exact| .{ .exact = .{ .slice = try s.initStringList(exact) } }, │ │263 - .starts_with => |slice| .{ .starts_with = try wc.addString(slice) }, │ │264 - .stderr_contains => |slice| .{ .stderr_contains = try wc.addString(slice) }, │ │265 - } else .none }, │ │266 - .test_runner = .{ .u = if (c.test_runner) |tr| switch (tr.mode) { │ │267 - .simple => .{ .simple = try s.addLazyPath(tr.path) }, │ │268 - .server => .{ .server = try s.addLazyPath(tr.path) }, │ │269 - } else .default }, │ │190 + .lto = .init(c.lto), │ │191 + .subsystem = .init(c.subsystem), │ │192 + }, │ │193 + .flags4 = .{ │ │194 + .libc_file = c.libc_file != null, │ │195 + .link_z_common_page_size = c.link_z_common_page_size != null, │ │196 + .link_z_max_page_size = c.link_z_max_page_size != null, │ │197 + .pagezero_size = c.pagezero_size != null, │ │198 + .stack_size = c.stack_size != null, │ │199 + .headerpad_size = c.headerpad_size != null, │ │200 + .error_limit = c.error_limit != null, │ │201 + .install_name = c.install_name != null, │ │202 + .entitlements = c.entitlements != null, │ │203 + .expect_errors = if (c.expect_errors) |x| switch (x) { │ │204 + .contains => .contains, │ │205 + .exact => .exact, │ │206 + .starts_with => .starts_with, │ │207 + .stderr_contains => .stderr_contains, │ │208 + } else .none, │ │209 + .linker_script = c.linker_script != null, │ │210 + .version_script = c.version_script != null, │ │211 + .emit_directory = c.emit_directory != .none, │ │212 + .generated_docs = c.generated_docs != .none, │ │213 + .generated_asm = c.generated_asm != .none, │ │214 + .generated_bin = c.generated_bin != .none, │ │215 + .generated_pdb = c.generated_pdb != .none, │ │216 + .generated_implib = c.generated_implib != .none, │ │217 + .generated_llvm_bc = c.generated_llvm_bc != .none, │ │218 + .generated_llvm_ir = c.generated_llvm_ir != .none, │ │219 + .generated_h = c.generated_h != .none, │ │220 + .incremental = .init(c.incremental), │ │221 + }, │ │222 + .root_module = try s.addModule(c.root_module), │ │223 + .root_name = try wc.addString(c.name), │ │224 + .linker_script = .{ .value = try s.addOptionalLazyPath(c.linker_script) }, │ │225 + .version_script = .{ .value = try s.addOptionalLazyPath(c.version_script) }, │ │226 + .zig_lib_dir = .{ .value = try s.addOptionalLazyPath(c.zig_lib_dir) }, │ │227 + .libc_file = .{ .value = try s.addOptionalLazyPath(c.libc_file) }, │ │228 + .win32_manifest = .{ .value = try s.addOptionalLazyPath(c.win32_manifest) }, │ │229 + .win32_module_definition = .{ .value = try s.addOptionalLazyPath(c.win32_module_definition) }, │ │230 + .entitlements = .{ .value = try s.addOptionalLazyPath(c.entitlements) }, │ │231 + .version = .{ .value = try s.addOptionalSemVer(c.version) }, │ │232 + .install_name = .{ .value = try s.addOptionalString(c.install_name) }, │ │233 + .initial_memory = .{ .value = c.initial_memory }, │ │234 + .max_memory = .{ .value = c.max_memory }, │ │235 + .global_base = .{ .value = c.global_base }, │ │236 + .image_base = .{ .value = c.image_base }, │ │237 + .link_z_common_page_size = .{ .value = c.link_z_common_page_size }, │ │238 + .link_z_max_page_size = .{ .value = c.link_z_max_page_size }, │ │239 + .pagezero_size = .{ .value = c.pagezero_size }, │ │240 + .stack_size = .{ .value = c.stack_size }, │ │241 + .headerpad_size = .{ .value = c.headerpad_size }, │ │242 + .error_limit = .{ .value = c.error_limit }, │ │243 + .entry = .{ .value = switch (c.entry) { │ │244 + .symbol_name => |name| try wc.addString(name), │ │245 + .default, .disabled, .enabled => null, │ │246 + } }, │ │247 + .build_id = .{ .value = if (c.build_id) |id| switch (id) { │ │248 + .hexstring => |*hexstring| try wc.addString(hexstring.toSlice()), │ │249 + .none, .fast, .uuid, .sha1, .md5 => null, │ │250 + } else null }, │ │251 + .filters = .{ .slice = try s.initStringList(c.filters) }, │ │252 + .installed_headers = .initErased(installed_headers), │ │253 + .force_undefined_symbols = .{ .slice = try s.initStringList(c.force_undefined_symbols.keys()) }, │ │254 + .expect_errors = .{ .u = if (c.expect_errors) |x| switch (x) { │ │255 + .contains => |slice| .{ .contains = try wc.addString(slice) }, │ │256 + .exact => |exact| .{ .exact = .{ .slice = try s.initStringList(exact) } }, │ │257 + .starts_with => |slice| .{ .starts_with = try wc.addString(slice) }, │ │258 + .stderr_contains => |slice| .{ .stderr_contains = try wc.addString(slice) }, │ │259 + } else .none }, │ │260 + .test_runner = .{ .u = if (c.test_runner) |tr| switch (tr.mode) { │ │261 + .simple => .{ .simple = try s.addLazyPath(tr.path) }, │ │262 + .server => .{ .server = try s.addLazyPath(tr.path) }, │ │263 + } else .default }, │ │264 │ │271 - .emit_directory = .{ .value = c.emit_directory.unwrap() }, │ │272 - .generated_docs = .{ .value = c.generated_docs.unwrap() }, │ │273 - .generated_asm = .{ .value = c.generated_asm.unwrap() }, │ │274 - .generated_bin = .{ .value = c.generated_bin.unwrap() }, │ │275 - .generated_pdb = .{ .value = c.generated_pdb.unwrap() }, │ │276 - .generated_implib = .{ .value = c.generated_implib.unwrap() }, │ │277 - .generated_llvm_bc = .{ .value = c.generated_llvm_bc.unwrap() }, │ │278 - .generated_llvm_ir = .{ .value = c.generated_llvm_ir.unwrap() }, │ │279 - .generated_h = .{ .value = c.generated_h.unwrap() }, │ │280 - }); │ │281 - }, │ │282 - .install_artifact => e: { │ │283 - const ia: *Step.InstallArtifact = @fieldParentPtr("step", step); │ │284 - break :e try wc.addExtraErased(Configuration.Step.InstallArtifact, .{ │ │285 - .flags = .{ │ │286 - .dylib_symlinks = ia.dylib_symlinks, │ │287 - .bin_dir = ia.dest_dir != null, │ │288 - .implib_dir = ia.implib_dir != null, │ │289 - .pdb_dir = ia.pdb_dir != null, │ │290 - .h_dir = ia.h_dir != null, │ │291 - .bin_sub_path = ia.dest_sub_path != null, │ │292 - }, │ │293 - .bin_dir = .{ .value = try addInstallDirDefaultNull(wc, ia.dest_dir) }, │ │294 - .implib_dir = .{ .value = try addInstallDirDefaultNull(wc, ia.implib_dir) }, │ │295 - .pdb_dir = .{ .value = try addInstallDirDefaultNull(wc, ia.pdb_dir) }, │ │296 - .h_dir = .{ .value = try addInstallDirDefaultNull(wc, ia.h_dir) }, │ │297 - .bin_sub_path = .{ .value = try s.addOptionalString(ia.dest_sub_path) }, │ │298 - }); │ │299 - }, │ │300 - .install_file => e: { │ │301 - const sif: *Step.InstallFile = @fieldParentPtr("step", step); │ │302 - break :e try wc.addExtraErased(Configuration.Step.InstallFile, .{ │ │303 - .source = try s.addLazyPath(sif.source), │ │304 - .dest_dir = try addInstallDir(wc, sif.dir), │ │305 - .dest_sub_path = try wc.addString(sif.dest_rel_path), │ │306 - }); │ │307 - }, │ │308 - .install_dir => e: { │ │309 - const sid: *Step.InstallDir = @fieldParentPtr("step", step); │ │310 - const dest_sub_path: ?[]const u8 = if (sid.options.install_subdir.len != 0) │ │311 - sid.options.install_subdir │ │312 - else │ │313 - null; │ │314 - const include_extensions = sid.options.include_extensions orelse &.{}; │ │315 - break :e try wc.addExtraErased(Configuration.Step.InstallDir, .{ │ │316 - .flags = .{ │ │317 - .dest_sub_path = dest_sub_path != null, │ │318 - .exclude_extensions = sid.options.exclude_extensions.len != 0, │ │319 - .include_extensions = include_extensions.len != 0, │ │320 - .include_extensions_active = sid.options.include_extensions != null, │ │321 - .blank_extensions = sid.options.blank_extensions.len != 0, │ │322 - }, │ │323 - .source_dir = try s.addLazyPath(sid.options.source_dir), │ │324 - .dest_dir = try addInstallDir(wc, sid.options.install_dir), │ │325 - .dest_sub_path = .{ .value = try s.addOptionalString(dest_sub_path) }, │ │326 - .exclude_extensions = .{ .slice = try s.initStringList(sid.options.exclude_extensions) }, │ │327 - .include_extensions = .{ .slice = try s.initStringList(include_extensions) }, │ │328 - .blank_extensions = .{ .slice = try s.initStringList(sid.options.blank_extensions) }, │ │329 - }); │ │330 - }, │ │331 - .fail => e: { │ │332 - const sf: *Step.Fail = @fieldParentPtr("step", step); │ │333 - break :e try wc.addExtraErased(Configuration.Step.Fail, .{ │ │334 - .msg = sf.error_msg, │ │335 - }); │ │336 - }, │ │337 - .find_program => e: { │ │338 - const fp: *Step.FindProgram = @fieldParentPtr("step", step); │ │339 - break :e try wc.addExtraErased(Configuration.Step.FindProgram, .{ │ │340 - .names = fp.names, │ │341 - .found_path = fp.found_path, │ │342 - }); │ │343 - }, │ │344 - .fmt => e: { │ │345 - const sf: *Step.Fmt = @fieldParentPtr("step", step); │ │346 - break :e try wc.addExtraErased(Configuration.Step.Fmt, .{ │ │347 - .flags = .{ │ │348 - .paths = sf.paths.len != 0, │ │349 - .exclude_paths = sf.exclude_paths.len != 0, │ │350 - .check = sf.check, │ │351 - }, │ │352 - .paths = .{ .slice = try s.initLazyPathList(sf.paths) }, │ │353 - .exclude_paths = .{ .slice = try s.initLazyPathList(sf.exclude_paths) }, │ │354 - }); │ │355 - }, │ │356 - .translate_c => e: { │ │357 - const tc: *Step.TranslateC = @fieldParentPtr("step", step); │ │265 + .emit_directory = .{ .value = c.emit_directory.unwrap() }, │ │266 + .generated_docs = .{ .value = c.generated_docs.unwrap() }, │ │267 + .generated_asm = .{ .value = c.generated_asm.unwrap() }, │ │268 + .generated_bin = .{ .value = c.generated_bin.unwrap() }, │ │269 + .generated_pdb = .{ .value = c.generated_pdb.unwrap() }, │ │270 + .generated_implib = .{ .value = c.generated_implib.unwrap() }, │ │271 + .generated_llvm_bc = .{ .value = c.generated_llvm_bc.unwrap() }, │ │272 + .generated_llvm_ir = .{ .value = c.generated_llvm_ir.unwrap() }, │ │273 + .generated_h = .{ .value = c.generated_h.unwrap() }, │ │274 + }); │ │275 + }, │ │276 + .install_artifact => e: { │ │277 + const ia: *Step.InstallArtifact = @fieldParentPtr("step", step); │ │278 + break :e try wc.addExtraErased(Configuration.Step.InstallArtifact, .{ │ │279 + .flags = .{ │ │280 + .dylib_symlinks = ia.dylib_symlinks, │ │281 + .bin_dir = ia.dest_dir != null, │ │282 + .implib_dir = ia.implib_dir != null, │ │283 + .pdb_dir = ia.pdb_dir != null, │ │284 + .h_dir = ia.h_dir != null, │ │285 + .bin_sub_path = ia.dest_sub_path != null, │ │286 + }, │ │287 + .bin_dir = .{ .value = try addInstallDirDefaultNull(wc, ia.dest_dir) }, │ │288 + .implib_dir = .{ .value = try addInstallDirDefaultNull(wc, ia.implib_dir) }, │ │289 + .pdb_dir = .{ .value = try addInstallDirDefaultNull(wc, ia.pdb_dir) }, │ │290 + .h_dir = .{ .value = try addInstallDirDefaultNull(wc, ia.h_dir) }, │ │291 + .bin_sub_path = .{ .value = try s.addOptionalString(ia.dest_sub_path) }, │ │292 + }); │ │293 + }, │ │294 + .install_file => e: { │ │295 + const sif: *Step.InstallFile = @fieldParentPtr("step", step); │ │296 + break :e try wc.addExtraErased(Configuration.Step.InstallFile, .{ │ │297 + .source = try s.addLazyPath(sif.source), │ │298 + .dest_dir = try addInstallDir(wc, sif.dir), │ │299 + .dest_sub_path = try wc.addString(sif.dest_rel_path), │ │300 + }); │ │301 + }, │ │302 + .install_dir => e: { │ │303 + const sid: *Step.InstallDir = @fieldParentPtr("step", step); │ │304 + const dest_sub_path: ?[]const u8 = if (sid.options.install_subdir.len != 0) │ │305 + sid.options.install_subdir │ │306 + else │ │307 + null; │ │308 + const include_extensions = sid.options.include_extensions orelse &.{}; │ │309 + break :e try wc.addExtraErased(Configuration.Step.InstallDir, .{ │ │310 + .flags = .{ │ │311 + .dest_sub_path = dest_sub_path != null, │ │312 + .exclude_extensions = sid.options.exclude_extensions.len != 0, │ │313 + .include_extensions = include_extensions.len != 0, │ │314 + .include_extensions_active = sid.options.include_extensions != null, │ │315 + .blank_extensions = sid.options.blank_extensions.len != 0, │ │316 + }, │ │317 + .source_dir = try s.addLazyPath(sid.options.source_dir), │ │318 + .dest_dir = try addInstallDir(wc, sid.options.install_dir), │ │319 + .dest_sub_path = .{ .value = try s.addOptionalString(dest_sub_path) }, │ │320 + .exclude_extensions = .{ .slice = try s.initStringList(sid.options.exclude_extensions) }, │ │321 + .include_extensions = .{ .slice = try s.initStringList(include_extensions) }, │ │322 + .blank_extensions = .{ .slice = try s.initStringList(sid.options.blank_extensions) }, │ │323 + }); │ │324 + }, │ │325 + .fail => e: { │ │326 + const sf: *Step.Fail = @fieldParentPtr("step", step); │ │327 + break :e try wc.addExtraErased(Configuration.Step.Fail, .{ │ │328 + .msg = sf.error_msg, │ │329 + }); │ │330 + }, │ │331 + .find_program => e: { │ │332 + const fp: *Step.FindProgram = @fieldParentPtr("step", step); │ │333 + break :e try wc.addExtraErased(Configuration.Step.FindProgram, .{ │ │334 + .names = fp.names, │ │335 + .found_path = fp.found_path, │ │336 + }); │ │337 + }, │ │338 + .fmt => e: { │ │339 + const sf: *Step.Fmt = @fieldParentPtr("step", step); │ │340 + break :e try wc.addExtraErased(Configuration.Step.Fmt, .{ │ │341 + .flags = .{ │ │342 + .paths = sf.paths.len != 0, │ │343 + .exclude_paths = sf.exclude_paths.len != 0, │ │344 + .check = sf.check, │ │345 + }, │ │346 + .paths = .{ .slice = try s.initLazyPathList(sf.paths) }, │ │347 + .exclude_paths = .{ .slice = try s.initLazyPathList(sf.exclude_paths) }, │ │348 + }); │ │349 + }, │ │350 + .translate_c => e: { │ │351 + const tc: *Step.TranslateC = @fieldParentPtr("step", step); │ │352 │ │359 - const system_libs = try arena.alloc(Configuration.SystemLib.Index, tc.system_libs.items.len); │ │360 - for (system_libs, tc.system_libs.items) |*dest, *src| dest.* = try s.addSystemLib(src); │ │353 + const system_libs = try arena.alloc(Configuration.SystemLib.Index, tc.system_libs.items.len); │ │354 + for (system_libs, tc.system_libs.items) |*dest, *src| dest.* = try s.addSystemLib(src); │ │355 │ │362 - break :e try wc.addExtraErased(Configuration.Step.TranslateC, .{ │ │363 - .flags = .{ │ │364 - .include_dirs = tc.include_dirs.items.len != 0, │ │365 - .system_libs = system_libs.len != 0, │ │366 - .c_macros = tc.c_macros.items.len != 0, │ │367 - .link_libc = tc.link_libc, │ │368 - .optimize = .init(tc.optimize), │ │369 - }, │ │370 - .src_path = try s.addLazyPath(tc.source), │ │371 - .output_file = tc.output_file, │ │372 - .include_dirs = .init(try s.initIncludeDirList(tc.include_dirs.items)), │ │373 - .system_libs = .{ .slice = system_libs }, │ │374 - .c_macros = .{ .slice = tc.c_macros.items }, │ │375 - .target = try addOptionalResolvedTarget(wc, tc.target), │ │376 - }); │ │377 - }, │ │378 - .write_file => e: { │ │379 - const wf: *Step.WriteFile = @fieldParentPtr("step", step); │ │356 + break :e try wc.addExtraErased(Configuration.Step.TranslateC, .{ │ │357 + .flags = .{ │ │358 + .include_dirs = tc.include_dirs.items.len != 0, │ │359 + .system_libs = system_libs.len != 0, │ │360 + .c_macros = tc.c_macros.items.len != 0, │ │361 + .link_libc = tc.link_libc, │ │362 + .optimize = .init(tc.optimize), │ │363 + }, │ │364 + .src_path = try s.addLazyPath(tc.source), │ │365 + .output_file = tc.output_file, │ │366 + .include_dirs = .init(try s.initIncludeDirList(tc.include_dirs.items)), │ │367 + .system_libs = .{ .slice = system_libs }, │ │368 + .c_macros = .{ .slice = tc.c_macros.items }, │ │369 + .target = try addOptionalResolvedTarget(wc, tc.target), │ │370 + }); │ │371 + }, │ │372 + .write_file => e: { │ │373 + const wf: *Step.WriteFile = @fieldParentPtr("step", step); │ │374 │ │381 - const directories = try arena.alloc( │ │382 - Configuration.Step.WriteFile.Directory, │ │383 - wf.directories.items.len, │ │384 - ); │ │385 - for (directories, wf.directories.items) |*dest, src| dest.* = .{ │ │386 - .sub_path = src.sub_path, │ │387 - .src_path = try s.addLazyPath(src.src_path), │ │388 - .exclude_extensions = src.exclude_extensions, │ │389 - .include_extensions = src.include_extensions, │ │390 - }; │ │375 + const directories = try arena.alloc( │ │376 + Configuration.Step.WriteFile.Directory, │ │377 + wf.directories.items.len, │ │378 + ); │ │379 + for (directories, wf.directories.items) |*dest, src| dest.* = .{ │ │380 + .sub_path = src.sub_path, │ │381 + .src_path = try s.addLazyPath(src.src_path), │ │382 + .exclude_extensions = src.exclude_extensions, │ │383 + .include_extensions = src.include_extensions, │ │384 + }; │ │385 │ │392 - break :e try wc.addExtraErased(Configuration.Step.WriteFile, .{ │ │393 - .flags = .{ │ │394 - .embeds = wf.embeds.items.len != 0, │ │395 - .copies = wf.copies.items.len != 0, │ │396 - .directories = directories.len != 0, │ │397 - .mode = switch (wf.mode) { │ │398 - .whole_cached => .whole_cached, │ │399 - .tmp => .tmp, │ │400 - .mutate => .mutate, │ │401 - }, │ │386 + break :e try wc.addExtraErased(Configuration.Step.WriteFile, .{ │ │387 + .flags = .{ │ │388 + .embeds = wf.embeds.items.len != 0, │ │389 + .copies = wf.copies.items.len != 0, │ │390 + .directories = directories.len != 0, │ │391 + .mode = switch (wf.mode) { │ │392 + .whole_cached => .whole_cached, │ │393 + .tmp => .tmp, │ │394 + .mutate => .mutate, │ │395 }, │ │403 - .generated_directory = wf.generated_directory, │ │404 - .embeds = .{ .slice = wf.embeds.items }, │ │405 - .copies = .{ .slice = try s.initCopyList(wf.copies.items) }, │ │406 - .directories = .{ .slice = directories }, │ │407 - .mutate_path = .{ .value = switch (wf.mode) { │ │408 - .mutate => |lp| try s.addLazyPath(lp), │ │409 - .whole_cached, .tmp => null, │ │410 - } }, │ │411 - }); │ │412 - }, │ │413 - .update_source_files => e: { │ │414 - const usf: *Step.UpdateSourceFiles = @fieldParentPtr("step", step); │ │415 - break :e try wc.addExtraErased(Configuration.Step.UpdateSourceFiles, .{ │ │416 - .flags = .{ │ │417 - .embeds = usf.embeds.items.len != 0, │ │418 - .copies = usf.copies.items.len != 0, │ │396 + }, │ │397 + .generated_directory = wf.generated_directory, │ │398 + .embeds = .{ .slice = wf.embeds.items }, │ │399 + .copies = .{ .slice = try s.initCopyList(wf.copies.items) }, │ │400 + .directories = .{ .slice = directories }, │ │401 + .mutate_path = .{ .value = switch (wf.mode) { │ │402 + .mutate => |lp| try s.addLazyPath(lp), │ │403 + .whole_cached, .tmp => null, │ │404 + } }, │ │405 + }); │ │406 + }, │ │407 + .update_source_files => e: { │ │408 + const usf: *Step.UpdateSourceFiles = @fieldParentPtr("step", step); │ │409 + break :e try wc.addExtraErased(Configuration.Step.UpdateSourceFiles, .{ │ │410 + .flags = .{ │ │411 + .embeds = usf.embeds.items.len != 0, │ │412 + .copies = usf.copies.items.len != 0, │ │413 + }, │ │414 + .embeds = .{ .slice = usf.embeds.items }, │ │415 + .copies = .{ .slice = try s.initCopyList(usf.copies.items) }, │ │416 + }); │ │417 + }, │ │418 + .run => e: { │ │419 + const run: *Step.Run = @fieldParentPtr("step", step); │ │420 + var expect_stderr_exact: ?Configuration.Bytes = null; │ │421 + var expect_stdout_exact: ?Configuration.Bytes = null; │ │422 + var expect_stderr_match: std.ArrayList(Configuration.Bytes) = .empty; │ │423 + var expect_stdout_match: std.ArrayList(Configuration.Bytes) = .empty; │ │424 + var expect_term: ?struct { │ │425 + status: Configuration.Step.Run.ExpectTermStatus, │ │426 + value: u32, │ │427 + } = null; │ │428 + var expect_stderr_snapshot: ?Configuration.LazyPath.Index = null; │ │429 + var expect_stdout_snapshot: ?Configuration.LazyPath.Index = null; │ │430 + switch (run.stdio) { │ │431 + .check => |checks| for (checks.items) |check| switch (check) { │ │432 + .expect_stderr_exact => |bytes| expect_stderr_exact = try wc.addBytes(bytes), │ │433 + .expect_stdout_exact => |bytes| expect_stdout_exact = try wc.addBytes(bytes), │ │434 + .expect_stderr_match => |bytes| { │ │435 + try expect_stderr_match.append(arena, try wc.addBytes(bytes)); │ │436 }, │ │420 - .embeds = .{ .slice = usf.embeds.items }, │ │421 - .copies = .{ .slice = try s.initCopyList(usf.copies.items) }, │ │422 - }); │ │423 - }, │ │424 - .run => e: { │ │425 - const run: *Step.Run = @fieldParentPtr("step", step); │ │426 - var expect_stderr_exact: ?Configuration.Bytes = null; │ │427 - var expect_stdout_exact: ?Configuration.Bytes = null; │ │428 - var expect_stderr_match: std.ArrayList(Configuration.Bytes) = .empty; │ │429 - var expect_stdout_match: std.ArrayList(Configuration.Bytes) = .empty; │ │430 - var expect_term: ?struct { │ │431 - status: Configuration.Step.Run.ExpectTermStatus, │ │432 - value: u32, │ │433 - } = null; │ │434 - var expect_stderr_snapshot: ?Configuration.LazyPath.Index = null; │ │435 - var expect_stdout_snapshot: ?Configuration.LazyPath.Index = null; │ │436 - switch (run.stdio) { │ │437 - .check => |checks| for (checks.items) |check| switch (check) { │ │438 - .expect_stderr_exact => |bytes| expect_stderr_exact = try wc.addBytes(bytes), │ │439 - .expect_stdout_exact => |bytes| expect_stdout_exact = try wc.addBytes(bytes), │ │440 - .expect_stderr_match => |bytes| { │ │441 - try expect_stderr_match.append(arena, try wc.addBytes(bytes)); │ │442 - }, │ │443 - .expect_stdout_match => |bytes| { │ │444 - try expect_stdout_match.append(arena, try wc.addBytes(bytes)); │ │445 - }, │ │446 - .expect_term => |t| expect_term = switch (t) { │ │447 - .exited => |x| .{ .status = .exited, .value = x }, │ │448 - .signal => |x| .{ .status = .signal, .value = @backingInt(x) }, │ │449 - .stopped => |x| .{ .status = .stopped, .value = @backingInt(x) }, │ │450 - .unknown => |x| .{ .status = .unknown, .value = x }, │ │451 - }, │ │452 - .expect_stderr_snapshot => |path| expect_stderr_snapshot = try s.addLazyPath(path), │ │453 - .expect_stdout_snapshot => |path| expect_stdout_snapshot = try s.addLazyPath(path), │ │437 + .expect_stdout_match => |bytes| { │ │438 + try expect_stdout_match.append(arena, try wc.addBytes(bytes)); │ │439 + }, │ │440 + .expect_term => |t| expect_term = switch (t) { │ │441 + .exited => |x| .{ .status = .exited, .value = x }, │ │442 + .signal => |x| .{ .status = .signal, .value = @backingInt(x) }, │ │443 + .stopped => |x| .{ .status = .stopped, .value = @backingInt(x) }, │ │444 + .unknown => |x| .{ .status = .unknown, .value = x }, │ │445 }, │ │455 - else => {}, │ │456 - } │ │457 - const preopens = try arena.alloc( │ │458 - Configuration.Step.Run.Preopen, │ │459 - run.preopens.count(), │ │460 - ); │ │461 - for (preopens, run.preopens.keys(), run.preopens.values()) |*dest, name, path| { │ │462 - dest.* = .{ .name = name, .path = try s.addLazyPath(path) }; │ │463 - } │ │446 + .expect_stderr_snapshot => |path| expect_stderr_snapshot = try s.addLazyPath(path), │ │447 + .expect_stdout_snapshot => |path| expect_stdout_snapshot = try s.addLazyPath(path), │ │448 + }, │ │449 + else => {}, │ │450 + } │ │451 + const preopens = try arena.alloc( │ │452 + Configuration.Step.Run.Preopen, │ │453 + run.preopens.count(), │ │454 + ); │ │455 + for (preopens, run.preopens.keys(), run.preopens.values()) |*dest, name, path| { │ │456 + dest.* = .{ .name = name, .path = try s.addLazyPath(path) }; │ │457 + } │ │458 │ │465 - break :e try wc.addExtraErased(Configuration.Step.Run, .{ │ │466 - .flags = .{ │ │467 - .disable_zig_progress = run.disable_zig_progress, │ │468 - .skip_foreign_checks = run.skip_foreign_checks, │ │469 - .failing_to_execute_foreign_is_an_error = run.failing_to_execute_foreign_is_an_error, │ │470 - .has_side_effects = run.has_side_effects, │ │471 - .test_runner_mode = run.test_runner_mode, │ │472 - .color = run.color, │ │473 - .stdio = switch (run.stdio) { │ │474 - .infer_from_args => .infer_from_args, │ │475 - .inherit => .inherit, │ │476 - .check => .check, │ │477 - .zig_test => .zig_test, │ │478 - }, │ │479 - .stdin = switch (run.stdin) { │ │480 - .none => .none, │ │481 - .bytes => .bytes, │ │482 - .lazy_path => .lazy_path, │ │483 - }, │ │484 - .stdout_trim_whitespace = if (run.captured_stdout) |cs| cs.trim_whitespace else .none, │ │485 - .stderr_trim_whitespace = if (run.captured_stderr) |cs| cs.trim_whitespace else .none, │ │486 - .stdio_limit = run.stdio_limit != .unlimited, │ │487 - .producer = run.producer != null, │ │488 - .cwd = run.cwd != null, │ │489 - .captured_stdout = run.captured_stdout != null, │ │490 - .captured_stderr = run.captured_stderr != null, │ │491 - .environ_map = run.environ_map != null, │ │492 - .preopens = run.preopens.count() > 0, │ │493 - }, │ │494 - .flags2 = .{ │ │495 - .expect_stderr_exact = expect_stderr_exact != null, │ │496 - .expect_stdout_exact = expect_stdout_exact != null, │ │497 - .expect_stderr_match = expect_stderr_match.items.len != 0, │ │498 - .expect_stdout_match = expect_stdout_match.items.len != 0, │ │499 - .expect_term = expect_term != null, │ │500 - .expect_term_status = if (expect_term) |t| t.status else .exited, │ │501 - .expect_stderr_snapshot = expect_stderr_snapshot != null, │ │502 - .expect_stdout_snapshot = expect_stdout_snapshot != null, │ │459 + break :e try wc.addExtraErased(Configuration.Step.Run, .{ │ │460 + .flags = .{ │ │461 + .disable_zig_progress = run.disable_zig_progress, │ │462 + .skip_foreign_checks = run.skip_foreign_checks, │ │463 + .failing_to_execute_foreign_is_an_error = run.failing_to_execute_foreign_is_an_error, │ │464 + .has_side_effects = run.has_side_effects, │ │465 + .test_runner_mode = run.test_runner_mode, │ │466 + .color = run.color, │ │467 + .stdio = switch (run.stdio) { │ │468 + .infer_from_args => .infer_from_args, │ │469 + .inherit => .inherit, │ │470 + .check => .check, │ │471 + .zig_test => .zig_test, │ │472 }, │ │504 - .file_inputs = .{ .slice = try s.initLazyPathList(run.file_inputs.items) }, │ │505 - .args = .{ .slice = try s.initArgsList(run.argv.items) }, │ │506 - .cwd = .{ .value = try s.addOptionalLazyPath(run.cwd) }, │ │507 - .preopens = .{ .slice = preopens }, │ │508 - .captured_stdout = .{ .value = if (run.captured_stdout) |cs| .{ │ │509 - .basename = try wc.addString(cs.basename), │ │510 - .generated_file = cs.generated_file, │ │511 - } else null }, │ │512 - .captured_stderr = .{ .value = if (run.captured_stderr) |cs| .{ │ │513 - .basename = try wc.addString(cs.basename), │ │514 - .generated_file = cs.generated_file, │ │515 - } else null }, │ │516 - .environ_map = .{ .value = try s.addEnvironMap(run.environ_map) }, │ │517 - .expect_term_value = .{ .value = if (expect_term) |t| t.value else null }, │ │518 - .stdio_limit = .{ .value = run.stdio_limit.toInt64() }, │ │519 - .producer = .{ .value = if (run.producer) |cs| s.stepIndex(&cs.step) else null }, │ │520 - .expect_stderr_exact = .{ .value = if (expect_stderr_exact) |bytes| bytes else null }, │ │521 - .expect_stdout_exact = .{ .value = if (expect_stdout_exact) |bytes| bytes else null }, │ │522 - .expect_stderr_match = .{ .slice = expect_stderr_match.items }, │ │523 - .expect_stdout_match = .{ .slice = expect_stdout_match.items }, │ │524 - .expect_stderr_snapshot = .{ .value = expect_stderr_snapshot orelse null }, │ │525 - .expect_stdout_snapshot = .{ .value = expect_stdout_snapshot orelse null }, │ │526 - .stdin = .{ .u = switch (run.stdin) { │ │473 + .stdin = switch (run.stdin) { │ │474 .none => .none, │ │528 - .bytes => |bytes| .{ .bytes = try wc.addBytes(bytes) }, │ │529 - .lazy_path => |lp| .{ .lazy_path = try s.addLazyPath(lp) }, │ │530 - } }, │ │531 - }); │ │532 - }, │ │533 - .check_file => e: { │ │534 - const cf: *Step.CheckFile = @fieldParentPtr("step", step); │ │535 - break :e try wc.addExtraErased(Configuration.Step.CheckFile, .{ │ │536 - .flags = .{ │ │537 - .expected_exact = cf.expected_exact != null, │ │538 - .expected_matches = cf.expected_matches.len != 0, │ │539 - .max_bytes = cf.max_bytes != null, │ │475 + .bytes => .bytes, │ │476 + .lazy_path => .lazy_path, │ │477 }, │ │541 - .file = try s.addLazyPath(cf.file), │ │542 - .expected_exact = .{ .value = cf.expected_exact }, │ │543 - .expected_matches = .{ .slice = cf.expected_matches }, │ │544 - .max_bytes = .{ .value = cf.max_bytes }, │ │545 - }); │ │546 - }, │ │547 - .config_header => e: { │ │548 - const ch: *Step.ConfigHeader = @fieldParentPtr("step", step); │ │549 - const lazy_path: ?std.Build.LazyPath = ch.style.getPath(); │ │550 - const pairs = try arena.alloc(Configuration.Step.ConfigHeader.Value.Pair, ch.values.count()); │ │551 - for (pairs, ch.values.keys(), ch.values.values()) |*pair, key, value| pair.* = .{ │ │552 - .key = try wc.addString(key), │ │553 - .index = switch (value) { │ │554 - .undef => .undef, │ │555 - .defined => .defined, │ │556 - .boolean => |x| switch (x) { │ │557 - false => .bool_false, │ │558 - true => .bool_true, │ │559 - }, │ │560 - .int => |x| switch (x) { │ │561 - 0 => .int_0, │ │562 - 1 => .int_1, │ │563 - else => try wc.addExtra(Configuration.Step.ConfigHeader.Value, .initSigned(x)), │ │564 - }, │ │565 - .ident => |x| try wc.addExtra(Configuration.Step.ConfigHeader.Value, .{ │ │566 - .flags = .{ │ │567 - .tag = .ident, │ │568 - .small = 0, │ │569 - }, │ │570 - .i64 = .{ .value = null }, │ │571 - .u64 = .{ .value = null }, │ │572 - .ident = .{ .value = try wc.addString(x) }, │ │573 - .string = .{ .value = null }, │ │574 - }), │ │575 - .string => |x| try wc.addExtra(Configuration.Step.ConfigHeader.Value, .{ │ │576 - .flags = .{ │ │577 - .tag = .string, │ │578 - .small = 0, │ │579 - }, │ │580 - .i64 = .{ .value = null }, │ │581 - .u64 = .{ .value = null }, │ │582 - .ident = .{ .value = null }, │ │583 - .string = .{ .value = try wc.addString(x) }, │ │584 - }), │ │478 + .stdout_trim_whitespace = if (run.captured_stdout) |cs| cs.trim_whitespace else .none, │ │479 + .stderr_trim_whitespace = if (run.captured_stderr) |cs| cs.trim_whitespace else .none, │ │480 + .stdio_limit = run.stdio_limit != .unlimited, │ │481 + .producer = run.producer != null, │ │482 + .cwd = run.cwd != null, │ │483 + .captured_stdout = run.captured_stdout != null, │ │484 + .captured_stderr = run.captured_stderr != null, │ │485 + .environ_map = run.environ_map != null, │ │486 + .preopens = run.preopens.count() > 0, │ │487 + }, │ │488 + .flags2 = .{ │ │489 + .expect_stderr_exact = expect_stderr_exact != null, │ │490 + .expect_stdout_exact = expect_stdout_exact != null, │ │491 + .expect_stderr_match = expect_stderr_match.items.len != 0, │ │492 + .expect_stdout_match = expect_stdout_match.items.len != 0, │ │493 + .expect_term = expect_term != null, │ │494 + .expect_term_status = if (expect_term) |t| t.status else .exited, │ │495 + .expect_stderr_snapshot = expect_stderr_snapshot != null, │ │496 + .expect_stdout_snapshot = expect_stdout_snapshot != null, │ │497 + }, │ │498 + .file_inputs = .{ .slice = try s.initLazyPathList(run.file_inputs.items) }, │ │499 + .args = .{ .slice = try s.initArgsList(run.argv.items) }, │ │500 + .cwd = .{ .value = try s.addOptionalLazyPath(run.cwd) }, │ │501 + .preopens = .{ .slice = preopens }, │ │502 + .captured_stdout = .{ .value = if (run.captured_stdout) |cs| .{ │ │503 + .basename = try wc.addString(cs.basename), │ │504 + .generated_file = cs.generated_file, │ │505 + } else null }, │ │506 + .captured_stderr = .{ .value = if (run.captured_stderr) |cs| .{ │ │507 + .basename = try wc.addString(cs.basename), │ │508 + .generated_file = cs.generated_file, │ │509 + } else null }, │ │510 + .environ_map = .{ .value = try s.addEnvironMap(run.environ_map) }, │ │511 + .expect_term_value = .{ .value = if (expect_term) |t| t.value else null }, │ │512 + .stdio_limit = .{ .value = run.stdio_limit.toInt64() }, │ │513 + .producer = .{ .value = if (run.producer) |cs| s.stepIndex(&cs.step) else null }, │ │514 + .expect_stderr_exact = .{ .value = if (expect_stderr_exact) |bytes| bytes else null }, │ │515 + .expect_stdout_exact = .{ .value = if (expect_stdout_exact) |bytes| bytes else null }, │ │516 + .expect_stderr_match = .{ .slice = expect_stderr_match.items }, │ │517 + .expect_stdout_match = .{ .slice = expect_stdout_match.items }, │ │518 + .expect_stderr_snapshot = .{ .value = expect_stderr_snapshot orelse null }, │ │519 + .expect_stdout_snapshot = .{ .value = expect_stdout_snapshot orelse null }, │ │520 + .stdin = .{ .u = switch (run.stdin) { │ │521 + .none => .none, │ │522 + .bytes => |bytes| .{ .bytes = try wc.addBytes(bytes) }, │ │523 + .lazy_path => |lp| .{ .lazy_path = try s.addLazyPath(lp) }, │ │524 + } }, │ │525 + }); │ │526 + }, │ │527 + .check_file => e: { │ │528 + const cf: *Step.CheckFile = @fieldParentPtr("step", step); │ │529 + break :e try wc.addExtraErased(Configuration.Step.CheckFile, .{ │ │530 + .flags = .{ │ │531 + .expected_exact = cf.expected_exact != null, │ │532 + .expected_matches = cf.expected_matches.len != 0, │ │533 + .max_bytes = cf.max_bytes != null, │ │534 + }, │ │535 + .file = try s.addLazyPath(cf.file), │ │536 + .expected_exact = .{ .value = cf.expected_exact }, │ │537 + .expected_matches = .{ .slice = cf.expected_matches }, │ │538 + .max_bytes = .{ .value = cf.max_bytes }, │ │539 + }); │ │540 + }, │ │541 + .config_header => e: { │ │542 + const ch: *Step.ConfigHeader = @fieldParentPtr("step", step); │ │543 + const lazy_path: ?std.Build.LazyPath = ch.style.getPath(); │ │544 + const pairs = try arena.alloc(Configuration.Step.ConfigHeader.Value.Pair, ch.values.count()); │ │545 + for (pairs, ch.values.keys(), ch.values.values()) |*pair, key, value| pair.* = .{ │ │546 + .key = try wc.addString(key), │ │547 + .index = switch (value) { │ │548 + .undef => .undef, │ │549 + .defined => .defined, │ │550 + .boolean => |x| switch (x) { │ │551 + false => .bool_false, │ │552 + true => .bool_true, │ │553 }, │ │586 - }; │ │587 - break :e try wc.addExtraErased(Configuration.Step.ConfigHeader, .{ │ │588 - .flags = .{ │ │589 - .template_file = lazy_path != null, │ │590 - .style = .init(ch.style), │ │591 - .input_size_limit = ch.input_size_limit != null, │ │592 - .include_guard = ch.include_guard != .none, │ │554 + .int => |x| switch (x) { │ │555 + 0 => .int_0, │ │556 + 1 => .int_1, │ │557 + else => try wc.addExtra(Configuration.Step.ConfigHeader.Value, .initSigned(x)), │ │558 }, │ │594 - .template_file = .{ .value = try s.addOptionalLazyPath(lazy_path) }, │ │595 - .generated_dir = ch.generated_dir, │ │596 - .input_size_limit = .{ .value = ch.input_size_limit }, │ │597 - .include_path = try wc.addString(ch.include_path), │ │598 - .include_guard = .{ .value = ch.include_guard.unwrap() }, │ │599 - .values = .{ .slice = pairs }, │ │600 - }); │ │601 - }, │ │602 - .obj_copy => e: { │ │603 - const oc: *Step.ObjCopy = @fieldParentPtr("step", step); │ │559 + .ident => |x| try wc.addExtra(Configuration.Step.ConfigHeader.Value, .{ │ │560 + .flags = .{ │ │561 + .tag = .ident, │ │562 + .small = 0, │ │563 + }, │ │564 + .i64 = .{ .value = null }, │ │565 + .u64 = .{ .value = null }, │ │566 + .ident = .{ .value = try wc.addString(x) }, │ │567 + .string = .{ .value = null }, │ │568 + }), │ │569 + .string => |x| try wc.addExtra(Configuration.Step.ConfigHeader.Value, .{ │ │570 + .flags = .{ │ │571 + .tag = .string, │ │572 + .small = 0, │ │573 + }, │ │574 + .i64 = .{ .value = null }, │ │575 + .u64 = .{ .value = null }, │ │576 + .ident = .{ .value = null }, │ │577 + .string = .{ .value = try wc.addString(x) }, │ │578 + }), │ │579 + }, │ │580 + }; │ │581 + break :e try wc.addExtraErased(Configuration.Step.ConfigHeader, .{ │ │582 + .flags = .{ │ │583 + .template_file = lazy_path != null, │ │584 + .style = .init(ch.style), │ │585 + .input_size_limit = ch.input_size_limit != null, │ │586 + .include_guard = ch.include_guard != .none, │ │587 + }, │ │588 + .template_file = .{ .value = try s.addOptionalLazyPath(lazy_path) }, │ │589 + .generated_dir = ch.generated_dir, │ │590 + .input_size_limit = .{ .value = ch.input_size_limit }, │ │591 + .include_path = try wc.addString(ch.include_path), │ │592 + .include_guard = .{ .value = ch.include_guard.unwrap() }, │ │593 + .values = .{ .slice = pairs }, │ │594 + }); │ │595 + }, │ │596 + .obj_copy => e: { │ │597 + const oc: *Step.ObjCopy = @fieldParentPtr("step", step); │ │598 │ │605 - const debug_basename: ?Configuration.String = if (oc.debug_file) |df| │ │606 - df.basename.unwrap() │ │607 - else │ │608 - null; │ │599 + const debug_basename: ?Configuration.String = if (oc.debug_file) |df| │ │600 + df.basename.unwrap() │ │601 + else │ │602 + null; │ │603 + │ │604 + const debug_file: ?Configuration.GeneratedFileIndex = if (oc.debug_file) |df| │ │605 + df.output_file │ │606 + else │ │607 + null; │ │608 │ │610 - const debug_file: ?Configuration.GeneratedFileIndex = if (oc.debug_file) |df| │ │611 - df.output_file │ │612 - else │ │613 - null; │ │609 + const add_sections = try arena.alloc( │ │610 + Configuration.Step.ObjCopy.AddSection, │ │611 + oc.add_sections.items.len, │ │612 + ); │ │613 + for (add_sections, oc.add_sections.items) |*dest, src| dest.* = .{ │ │614 + .section_name = src.section_name, │ │615 + .file_path = try s.addLazyPath(src.file_path), │ │616 + }; │ │617 │ │615 - const add_sections = try arena.alloc( │ │616 - Configuration.Step.ObjCopy.AddSection, │ │617 - oc.add_sections.items.len, │ │618 - ); │ │619 - for (add_sections, oc.add_sections.items) |*dest, src| dest.* = .{ │ │620 - .section_name = src.section_name, │ │621 - .file_path = try s.addLazyPath(src.file_path), │ │622 - }; │ │618 + break :e try wc.addExtraErased(Configuration.Step.ObjCopy, .{ │ │619 + .flags = .{ │ │620 + .basename = oc.basename != .none, │ │621 + .debug_file = debug_file != null, │ │622 + .debug_basename = debug_basename != null, │ │623 + .format = .init(oc.format), │ │624 + .strip = oc.strip, │ │625 + .compress_debug = oc.compress_debug, │ │626 + .only_section = oc.only_section != .none, │ │627 + .pad_to = oc.pad_to != null, │ │628 + .add_section = add_sections.len != 0, │ │629 + .update_section = oc.update_sections.items.len != 0, │ │630 + }, │ │631 + .input_file = try s.addLazyPath(oc.input_file), │ │632 + .output_file = oc.output_file, │ │633 + .basename = .{ .value = oc.basename.unwrap() }, │ │634 + .debug_file = .{ .value = debug_file }, │ │635 + .debug_basename = .{ .value = debug_basename }, │ │636 + .only_section = .{ .value = oc.only_section.unwrap() }, │ │637 + .pad_to = .{ .value = oc.pad_to }, │ │638 + .add_section = .{ .slice = add_sections }, │ │639 + .update_section = .{ .slice = oc.update_sections.items }, │ │640 + }); │ │641 + }, │ │642 + .options => e: { │ │643 + const so: *Step.Options = @fieldParentPtr("step", step); │ │644 │ │624 - break :e try wc.addExtraErased(Configuration.Step.ObjCopy, .{ │ │625 - .flags = .{ │ │626 - .basename = oc.basename != .none, │ │627 - .debug_file = debug_file != null, │ │628 - .debug_basename = debug_basename != null, │ │629 - .format = .init(oc.format), │ │630 - .strip = oc.strip, │ │631 - .compress_debug = oc.compress_debug, │ │632 - .only_section = oc.only_section != .none, │ │633 - .pad_to = oc.pad_to != null, │ │634 - .add_section = add_sections.len != 0, │ │635 - .update_section = oc.update_sections.items.len != 0, │ │636 - }, │ │637 - .input_file = try s.addLazyPath(oc.input_file), │ │638 - .output_file = oc.output_file, │ │639 - .basename = .{ .value = oc.basename.unwrap() }, │ │640 - .debug_file = .{ .value = debug_file }, │ │641 - .debug_basename = .{ .value = debug_basename }, │ │642 - .only_section = .{ .value = oc.only_section.unwrap() }, │ │643 - .pad_to = .{ .value = oc.pad_to }, │ │644 - .add_section = .{ .slice = add_sections }, │ │645 - .update_section = .{ .slice = oc.update_sections.items }, │ │646 - }); │ │647 - }, │ │648 - .options => e: { │ │649 - const so: *Step.Options = @fieldParentPtr("step", step); │ │645 + const files = try arena.alloc(Configuration.Step.Options.NamedPath, so.files.items.len); │ │646 + for (files, so.files.items) |*dest, src| dest.* = .{ │ │647 + .name = src.name, │ │648 + .path = try s.addLazyPath(src.path), │ │649 + }; │ │650 │ │651 - const files = try arena.alloc(Configuration.Step.Options.NamedPath, so.files.items.len); │ │652 - for (files, so.files.items) |*dest, src| dest.* = .{ │ │653 - .name = src.name, │ │654 - .path = try s.addLazyPath(src.path), │ │655 - }; │ │651 + const directories = try arena.alloc(Configuration.Step.Options.NamedPath, so.directories.items.len); │ │652 + for (directories, so.directories.items) |*dest, src| dest.* = .{ │ │653 + .name = src.name, │ │654 + .path = try s.addLazyPath(src.path), │ │655 + }; │ │656 │ │657 - const directories = try arena.alloc(Configuration.Step.Options.NamedPath, so.directories.items.len); │ │658 - for (directories, so.directories.items) |*dest, src| dest.* = .{ │ │659 - .name = src.name, │ │660 - .path = try s.addLazyPath(src.path), │ │661 - }; │ │657 + const untracked_paths = try arena.alloc(Configuration.Step.Options.NamedPath, so.untracked_paths.items.len); │ │658 + for (untracked_paths, so.untracked_paths.items) |*dest, src| dest.* = .{ │ │659 + .name = src.name, │ │660 + .path = try s.addLazyPath(src.path), │ │661 + }; │ │662 │ │663 - const untracked_paths = try arena.alloc(Configuration.Step.Options.NamedPath, so.untracked_paths.items.len);│ │664 - for (untracked_paths, so.untracked_paths.items) |*dest, src| dest.* = .{ │ │665 - .name = src.name, │ │666 - .path = try s.addLazyPath(src.path), │ │667 - }; │ │663 + break :e try wc.addExtraErased(Configuration.Step.Options, .{ │ │664 + .flags = .{ │ │665 + .files = so.files.items.len != 0, │ │666 + .directories = so.directories.items.len != 0, │ │667 + .untracked_paths = so.untracked_paths.items.len != 0, │ │668 + }, │ │669 + .generated_file = so.generated_file, │ │670 + .contents = try wc.addBytes(so.contents.items), │ │671 + .files = .{ .slice = files }, │ │672 + .directories = .{ .slice = directories }, │ │673 + .untracked_paths = .{ .slice = untracked_paths }, │ │674 + }); │ │675 + }, │ │676 + }; │ │677 │ │669 - break :e try wc.addExtraErased(Configuration.Step.Options, .{ │ │670 - .flags = .{ │ │671 - .files = so.files.items.len != 0, │ │672 - .directories = so.directories.items.len != 0, │ │673 - .untracked_paths = so.untracked_paths.items.len != 0, │ │674 - }, │ │675 - .generated_file = so.generated_file, │ │676 - .contents = try wc.addBytes(so.contents.items), │ │677 - .files = .{ .slice = files }, │ │678 - .directories = .{ .slice = directories }, │ │679 - .untracked_paths = .{ .slice = untracked_paths }, │ │680 - }); │ │681 - }, │ │682 - })), │ │678 + try wc.steps.ensureTotalCapacity(gpa, s.step_map.entries.capacity); │ │679 + wc.steps.appendAssumeCapacity(.{ │ │680 + .name = try wc.addString(step.name), │ │681 + .owner = try s.builderToPackage(step.owner), │ │682 + .deps = deps, │ │683 + .max_rss = .fromBytes(step.max_rss), │ │684 + .extended = @fromBackingInt(extended), │ │685 }); │ │686 } │ │687 } │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯