diff --git a/build.zig b/build.zig index 0ff528520180..1c2212c1a4c7 100644 --- a/build.zig +++ b/build.zig @@ -65,7 +65,6 @@ pub fn build(b: *Builder) !void { const only_install_lib_files = b.option(bool, "lib-files-only", "Only install library files") orelse false; const is_stage1 = b.option(bool, "stage1", "Build the stage1 compiler, put stage2 behind a feature flag") orelse false; - const omit_stage2 = b.option(bool, "omit-stage2", "Do not include stage2 behind a feature flag inside stage1") orelse false; const static_llvm = b.option(bool, "static-llvm", "Disable integration with system-installed LLVM, Clang, LLD, and libc++") orelse false; const enable_llvm = b.option(bool, "enable-llvm", "Build self-hosted compiler with LLVM backend enabled") orelse (is_stage1 or static_llvm); const llvm_has_m68k = b.option( @@ -361,7 +360,6 @@ pub fn build(b: *Builder) !void { exe_options.addOption(bool, "enable_tracy_allocation", tracy_allocation); exe_options.addOption(bool, "value_tracing", value_tracing); exe_options.addOption(bool, "is_stage1", is_stage1); - exe_options.addOption(bool, "omit_stage2", omit_stage2); if (tracy) |tracy_path| { const client_cpp = fs.path.join( b.allocator, @@ -397,7 +395,6 @@ pub fn build(b: *Builder) !void { test_cases_options.addOption(bool, "skip_non_native", skip_non_native); test_cases_options.addOption(bool, "skip_stage1", skip_stage1); test_cases_options.addOption(bool, "is_stage1", is_stage1); - test_cases_options.addOption(bool, "omit_stage2", omit_stage2); test_cases_options.addOption(bool, "have_llvm", enable_llvm); test_cases_options.addOption(bool, "llvm_has_m68k", llvm_has_m68k); test_cases_options.addOption(bool, "llvm_has_csky", llvm_has_csky); @@ -457,7 +454,7 @@ pub fn build(b: *Builder) !void { skip_non_native, skip_libc, skip_stage1, - omit_stage2, + false, is_stage1, )); @@ -472,7 +469,7 @@ pub fn build(b: *Builder) !void { skip_non_native, true, // skip_libc skip_stage1, - omit_stage2 or true, // TODO get these all passing + true, // TODO get these all passing is_stage1, )); @@ -487,7 +484,7 @@ pub fn build(b: *Builder) !void { skip_non_native, true, // skip_libc skip_stage1, - omit_stage2 or true, // TODO get these all passing + true, // TODO get these all passing is_stage1, )); @@ -499,14 +496,13 @@ pub fn build(b: *Builder) !void { skip_non_native, enable_macos_sdk, target, - omit_stage2, b.enable_darling, b.enable_qemu, b.enable_rosetta, b.enable_wasmtime, b.enable_wine, )); - toolchain_step.dependOn(tests.addLinkTests(b, test_filter, modes, enable_macos_sdk, omit_stage2)); + toolchain_step.dependOn(tests.addLinkTests(b, test_filter, modes, enable_macos_sdk)); toolchain_step.dependOn(tests.addStackTraceTests(b, test_filter, modes)); toolchain_step.dependOn(tests.addCliTests(b, test_filter, modes)); toolchain_step.dependOn(tests.addAssembleAndLinkTests(b, test_filter, modes)); @@ -528,7 +524,7 @@ pub fn build(b: *Builder) !void { skip_non_native, skip_libc, skip_stage1, - omit_stage2 or true, // TODO get these all passing + true, // TODO get these all passing is_stage1, ); diff --git a/ci/azure/build.zig b/ci/azure/build.zig index 3fec5553215f..053065b6997b 100644 --- a/ci/azure/build.zig +++ b/ci/azure/build.zig @@ -38,7 +38,6 @@ pub fn build(b: *Builder) !void { docs_step.dependOn(&docgen_cmd.step); const is_stage1 = b.option(bool, "stage1", "Build the stage1 compiler, put stage2 behind a feature flag") orelse false; - const omit_stage2 = b.option(bool, "omit-stage2", "Do not include stage2 behind a feature flag inside stage1") orelse false; const static_llvm = b.option(bool, "static-llvm", "Disable integration with system-installed LLVM, Clang, LLD, and libc++") orelse false; const enable_llvm = b.option(bool, "enable-llvm", "Build self-hosted compiler with LLVM backend enabled") orelse (is_stage1 or static_llvm); const llvm_has_m68k = b.option( @@ -300,7 +299,6 @@ pub fn build(b: *Builder) !void { exe_options.addOption(bool, "enable_tracy_allocation", tracy_allocation); exe_options.addOption(bool, "value_tracing", value_tracing); exe_options.addOption(bool, "is_stage1", is_stage1); - exe_options.addOption(bool, "omit_stage2", omit_stage2); if (tracy) |tracy_path| { const client_cpp = fs.path.join( b.allocator, diff --git a/src/Compilation.zig b/src/Compilation.zig index af39154a3f23..40601f71ddb6 100644 --- a/src/Compilation.zig +++ b/src/Compilation.zig @@ -1033,8 +1033,6 @@ pub fn create(gpa: Allocator, options: InitOptions) !*Compilation { // Even though we may have no Zig code to compile (depending on `options.main_pkg`), // we may need to use stage1 for building compiler-rt and other dependencies. - if (build_options.omit_stage2) - break :blk true; if (options.use_llvm) |use_llvm| { if (!use_llvm) { break :blk false; @@ -2180,8 +2178,7 @@ pub fn update(comp: *Compilation) !void { comp.c_object_work_queue.writeItemAssumeCapacity(key); } - const use_stage1 = build_options.omit_stage2 or - (build_options.is_stage1 and comp.bin_file.options.use_stage1); + const use_stage1 = build_options.is_stage1 and comp.bin_file.options.use_stage1; if (comp.bin_file.options.module) |module| { module.compile_log_text.shrinkAndFree(module.gpa, 0); module.generation += 1; @@ -2357,8 +2354,7 @@ fn flush(comp: *Compilation, prog_node: *std.Progress.Node) !void { }; comp.link_error_flags = comp.bin_file.errorFlags(); - const use_stage1 = build_options.omit_stage2 or - (build_options.is_stage1 and comp.bin_file.options.use_stage1); + const use_stage1 = build_options.is_stage1 and comp.bin_file.options.use_stage1; if (!use_stage1) { if (comp.bin_file.options.module) |module| { try link.File.C.flushEmitH(module); @@ -2919,9 +2915,6 @@ pub fn performAllTheWork( fn processOneJob(comp: *Compilation, job: Job) !void { switch (job) { .codegen_decl => |decl_index| { - if (build_options.omit_stage2) - @panic("sadly stage2 is omitted from this build to save memory on the CI server"); - const module = comp.bin_file.options.module.?; const decl = module.declPtr(decl_index); @@ -2956,9 +2949,6 @@ fn processOneJob(comp: *Compilation, job: Job) !void { } }, .codegen_func => |func| { - if (build_options.omit_stage2) - @panic("sadly stage2 is omitted from this build to save memory on the CI server"); - const named_frame = tracy.namedFrame("codegen_func"); defer named_frame.end(); @@ -2969,9 +2959,6 @@ fn processOneJob(comp: *Compilation, job: Job) !void { }; }, .emit_h_decl => |decl_index| { - if (build_options.omit_stage2) - @panic("sadly stage2 is omitted from this build to save memory on the CI server"); - const module = comp.bin_file.options.module.?; const decl = module.declPtr(decl_index); @@ -3030,9 +3017,6 @@ fn processOneJob(comp: *Compilation, job: Job) !void { } }, .analyze_decl => |decl_index| { - if (build_options.omit_stage2) - @panic("sadly stage2 is omitted from this build to save memory on the CI server"); - const module = comp.bin_file.options.module.?; module.ensureDeclAnalyzed(decl_index) catch |err| switch (err) { error.OutOfMemory => return error.OutOfMemory, @@ -3040,9 +3024,6 @@ fn processOneJob(comp: *Compilation, job: Job) !void { }; }, .update_embed_file => |embed_file| { - if (build_options.omit_stage2) - @panic("sadly stage2 is omitted from this build to save memory on the CI server"); - const named_frame = tracy.namedFrame("update_embed_file"); defer named_frame.end(); @@ -3053,9 +3034,6 @@ fn processOneJob(comp: *Compilation, job: Job) !void { }; }, .update_line_number => |decl_index| { - if (build_options.omit_stage2) - @panic("sadly stage2 is omitted from this build to save memory on the CI server"); - const named_frame = tracy.namedFrame("update_line_number"); defer named_frame.end(); @@ -3074,9 +3052,6 @@ fn processOneJob(comp: *Compilation, job: Job) !void { }; }, .analyze_pkg => |pkg| { - if (build_options.omit_stage2) - @panic("sadly stage2 is omitted from this build to save memory on the CI server"); - const named_frame = tracy.namedFrame("analyze_pkg"); defer named_frame.end(); diff --git a/src/Sema.zig b/src/Sema.zig index f9b37f5b495e..fc41c322a9da 100644 --- a/src/Sema.zig +++ b/src/Sema.zig @@ -27173,9 +27173,6 @@ pub fn resolveTypeLayout( src: LazySrcLoc, ty: Type, ) CompileError!void { - if (build_options.omit_stage2) - @panic("sadly stage2 is omitted from this build to save memory on the CI server"); - switch (ty.zigTypeTag()) { .Struct => return sema.resolveStructLayout(block, src, ty), .Union => return sema.resolveUnionLayout(block, src, ty), @@ -27514,8 +27511,6 @@ fn resolveUnionFully( } pub fn resolveTypeFields(sema: *Sema, block: *Block, src: LazySrcLoc, ty: Type) CompileError!Type { - if (build_options.omit_stage2) - @panic("sadly stage2 is omitted from this build to save memory on the CI server"); switch (ty.tag()) { .@"struct" => { const struct_obj = ty.castTag(.@"struct").?.data; @@ -29114,8 +29109,6 @@ fn typePtrOrOptionalPtrTy( /// TODO merge these implementations together with the "advanced"/sema_kit pattern seen /// elsewhere in value.zig pub fn typeRequiresComptime(sema: *Sema, block: *Block, src: LazySrcLoc, ty: Type) CompileError!bool { - if (build_options.omit_stage2) - @panic("sadly stage2 is omitted from this build to save memory on the CI server"); return switch (ty.tag()) { .u1, .u8, diff --git a/src/config.zig.in b/src/config.zig.in index a886b2d28efa..336a6c45edae 100644 --- a/src/config.zig.in +++ b/src/config.zig.in @@ -10,4 +10,3 @@ pub const enable_tracy = false; pub const value_tracing = false; pub const is_stage1 = true; pub const skip_non_native = false; -pub const omit_stage2: bool = @ZIG_OMIT_STAGE2_BOOL@; diff --git a/test/tests.zig b/test/tests.zig index dcc891f8786b..0fabdd33caa4 100644 --- a/test/tests.zig +++ b/test/tests.zig @@ -462,7 +462,6 @@ pub fn addStandaloneTests( skip_non_native: bool, enable_macos_sdk: bool, target: std.zig.CrossTarget, - omit_stage2: bool, enable_darling: bool, enable_qemu: bool, enable_rosetta: bool, @@ -479,7 +478,6 @@ pub fn addStandaloneTests( .skip_non_native = skip_non_native, .enable_macos_sdk = enable_macos_sdk, .target = target, - .omit_stage2 = omit_stage2, .enable_darling = enable_darling, .enable_qemu = enable_qemu, .enable_rosetta = enable_rosetta, @@ -497,7 +495,6 @@ pub fn addLinkTests( test_filter: ?[]const u8, modes: []const Mode, enable_macos_sdk: bool, - omit_stage2: bool, ) *build.Step { const cases = b.allocator.create(StandaloneContext) catch unreachable; cases.* = StandaloneContext{ @@ -509,7 +506,6 @@ pub fn addLinkTests( .skip_non_native = true, .enable_macos_sdk = enable_macos_sdk, .target = .{}, - .omit_stage2 = omit_stage2, }; link.addCases(cases); return cases.step; @@ -971,7 +967,6 @@ pub const StandaloneContext = struct { skip_non_native: bool, enable_macos_sdk: bool, target: std.zig.CrossTarget, - omit_stage2: bool, enable_darling: bool = false, enable_qemu: bool = false, enable_rosetta: bool = false, @@ -996,7 +991,6 @@ pub const StandaloneContext = struct { const b = self.b; if (features.requires_macos_sdk and !self.enable_macos_sdk) return; - if (features.requires_stage2 and self.omit_stage2) return; const annotated_case_name = b.fmt("build {s}", .{build_file}); if (self.test_filter) |filter| {