| author | |
| committer | |
| log | 73bbd1069a993a0e663033ea3b8cd4ed1a123566 |
| tree | 1e2b148425da2359d720d6d5048ad94151788bb9 |
| parent | 39f43fea8d0f6aa1c69cb7c3209f57f5ce00b273 |
6 files changed, 7 insertions(+), 52 deletions(-)
build.zig+5-9| ... | ... | @@ -65,7 +65,6 @@ pub fn build(b: *Builder) !void { |
| 65 | 65 | const only_install_lib_files = b.option(bool, "lib-files-only", "Only install library files") orelse false; |
| 66 | 66 | |
| 67 | 67 | const is_stage1 = b.option(bool, "stage1", "Build the stage1 compiler, put stage2 behind a feature flag") orelse false; |
| 68 | const omit_stage2 = b.option(bool, "omit-stage2", "Do not include stage2 behind a feature flag inside stage1") orelse false; | |
| 69 | 68 | const static_llvm = b.option(bool, "static-llvm", "Disable integration with system-installed LLVM, Clang, LLD, and libc++") orelse false; |
| 70 | 69 | const enable_llvm = b.option(bool, "enable-llvm", "Build self-hosted compiler with LLVM backend enabled") orelse (is_stage1 or static_llvm); |
| 71 | 70 | const llvm_has_m68k = b.option( |
| ... | ... | @@ -361,7 +360,6 @@ pub fn build(b: *Builder) !void { |
| 361 | 360 | exe_options.addOption(bool, "enable_tracy_allocation", tracy_allocation); |
| 362 | 361 | exe_options.addOption(bool, "value_tracing", value_tracing); |
| 363 | 362 | exe_options.addOption(bool, "is_stage1", is_stage1); |
| 364 | exe_options.addOption(bool, "omit_stage2", omit_stage2); | |
| 365 | 363 | if (tracy) |tracy_path| { |
| 366 | 364 | const client_cpp = fs.path.join( |
| 367 | 365 | b.allocator, |
| ... | ... | @@ -397,7 +395,6 @@ pub fn build(b: *Builder) !void { |
| 397 | 395 | test_cases_options.addOption(bool, "skip_non_native", skip_non_native); |
| 398 | 396 | test_cases_options.addOption(bool, "skip_stage1", skip_stage1); |
| 399 | 397 | test_cases_options.addOption(bool, "is_stage1", is_stage1); |
| 400 | test_cases_options.addOption(bool, "omit_stage2", omit_stage2); | |
| 401 | 398 | test_cases_options.addOption(bool, "have_llvm", enable_llvm); |
| 402 | 399 | test_cases_options.addOption(bool, "llvm_has_m68k", llvm_has_m68k); |
| 403 | 400 | test_cases_options.addOption(bool, "llvm_has_csky", llvm_has_csky); |
| ... | ... | @@ -457,7 +454,7 @@ pub fn build(b: *Builder) !void { |
| 457 | 454 | skip_non_native, |
| 458 | 455 | skip_libc, |
| 459 | 456 | skip_stage1, |
| 460 | omit_stage2, | |
| 457 | false, | |
| 461 | 458 | is_stage1, |
| 462 | 459 | )); |
| 463 | 460 | |
| ... | ... | @@ -472,7 +469,7 @@ pub fn build(b: *Builder) !void { |
| 472 | 469 | skip_non_native, |
| 473 | 470 | true, // skip_libc |
| 474 | 471 | skip_stage1, |
| 475 | omit_stage2 or true, // TODO get these all passing | |
| 472 | true, // TODO get these all passing | |
| 476 | 473 | is_stage1, |
| 477 | 474 | )); |
| 478 | 475 | |
| ... | ... | @@ -487,7 +484,7 @@ pub fn build(b: *Builder) !void { |
| 487 | 484 | skip_non_native, |
| 488 | 485 | true, // skip_libc |
| 489 | 486 | skip_stage1, |
| 490 | omit_stage2 or true, // TODO get these all passing | |
| 487 | true, // TODO get these all passing | |
| 491 | 488 | is_stage1, |
| 492 | 489 | )); |
| 493 | 490 | |
| ... | ... | @@ -499,14 +496,13 @@ pub fn build(b: *Builder) !void { |
| 499 | 496 | skip_non_native, |
| 500 | 497 | enable_macos_sdk, |
| 501 | 498 | target, |
| 502 | omit_stage2, | |
| 503 | 499 | b.enable_darling, |
| 504 | 500 | b.enable_qemu, |
| 505 | 501 | b.enable_rosetta, |
| 506 | 502 | b.enable_wasmtime, |
| 507 | 503 | b.enable_wine, |
| 508 | 504 | )); |
| 509 | toolchain_step.dependOn(tests.addLinkTests(b, test_filter, modes, enable_macos_sdk, omit_stage2)); | |
| 505 | toolchain_step.dependOn(tests.addLinkTests(b, test_filter, modes, enable_macos_sdk)); | |
| 510 | 506 | toolchain_step.dependOn(tests.addStackTraceTests(b, test_filter, modes)); |
| 511 | 507 | toolchain_step.dependOn(tests.addCliTests(b, test_filter, modes)); |
| 512 | 508 | toolchain_step.dependOn(tests.addAssembleAndLinkTests(b, test_filter, modes)); |
| ... | ... | @@ -528,7 +524,7 @@ pub fn build(b: *Builder) !void { |
| 528 | 524 | skip_non_native, |
| 529 | 525 | skip_libc, |
| 530 | 526 | skip_stage1, |
| 531 | omit_stage2 or true, // TODO get these all passing | |
| 527 | true, // TODO get these all passing | |
| 532 | 528 | is_stage1, |
| 533 | 529 | ); |
| 534 | 530 |
ci/azure/build.zig-2| ... | ... | @@ -38,7 +38,6 @@ pub fn build(b: *Builder) !void { |
| 38 | 38 | docs_step.dependOn(&docgen_cmd.step); |
| 39 | 39 | |
| 40 | 40 | const is_stage1 = b.option(bool, "stage1", "Build the stage1 compiler, put stage2 behind a feature flag") orelse false; |
| 41 | const omit_stage2 = b.option(bool, "omit-stage2", "Do not include stage2 behind a feature flag inside stage1") orelse false; | |
| 42 | 41 | const static_llvm = b.option(bool, "static-llvm", "Disable integration with system-installed LLVM, Clang, LLD, and libc++") orelse false; |
| 43 | 42 | const enable_llvm = b.option(bool, "enable-llvm", "Build self-hosted compiler with LLVM backend enabled") orelse (is_stage1 or static_llvm); |
| 44 | 43 | const llvm_has_m68k = b.option( |
| ... | ... | @@ -300,7 +299,6 @@ pub fn build(b: *Builder) !void { |
| 300 | 299 | exe_options.addOption(bool, "enable_tracy_allocation", tracy_allocation); |
| 301 | 300 | exe_options.addOption(bool, "value_tracing", value_tracing); |
| 302 | 301 | exe_options.addOption(bool, "is_stage1", is_stage1); |
| 303 | exe_options.addOption(bool, "omit_stage2", omit_stage2); | |
| 304 | 302 | if (tracy) |tracy_path| { |
| 305 | 303 | const client_cpp = fs.path.join( |
| 306 | 304 | b.allocator, |
src/Compilation.zig+2-27| ... | ... | @@ -1044,8 +1044,6 @@ pub fn create(gpa: Allocator, options: InitOptions) !*Compilation { |
| 1044 | 1044 | // Even though we may have no Zig code to compile (depending on `options.main_pkg`), |
| 1045 | 1045 | // we may need to use stage1 for building compiler-rt and other dependencies. |
| 1046 | 1046 | |
| 1047 | if (build_options.omit_stage2) | |
| 1048 | break :blk true; | |
| 1049 | 1047 | if (options.use_llvm) |use_llvm| { |
| 1050 | 1048 | if (!use_llvm) { |
| 1051 | 1049 | break :blk false; |
| ... | ... | @@ -2213,8 +2211,7 @@ pub fn update(comp: *Compilation) !void { |
| 2213 | 2211 | comp.c_object_work_queue.writeItemAssumeCapacity(key); |
| 2214 | 2212 | } |
| 2215 | 2213 | |
| 2216 | const use_stage1 = build_options.omit_stage2 or | |
| 2217 | (build_options.is_stage1 and comp.bin_file.options.use_stage1); | |
| 2214 | const use_stage1 = build_options.is_stage1 and comp.bin_file.options.use_stage1; | |
| 2218 | 2215 | if (comp.bin_file.options.module) |module| { |
| 2219 | 2216 | module.compile_log_text.shrinkAndFree(module.gpa, 0); |
| 2220 | 2217 | module.generation += 1; |
| ... | ... | @@ -2390,8 +2387,7 @@ fn flush(comp: *Compilation, prog_node: *std.Progress.Node) !void { |
| 2390 | 2387 | }; |
| 2391 | 2388 | comp.link_error_flags = comp.bin_file.errorFlags(); |
| 2392 | 2389 | |
| 2393 | const use_stage1 = build_options.omit_stage2 or | |
| 2394 | (build_options.is_stage1 and comp.bin_file.options.use_stage1); | |
| 2390 | const use_stage1 = build_options.is_stage1 and comp.bin_file.options.use_stage1; | |
| 2395 | 2391 | if (!use_stage1) { |
| 2396 | 2392 | if (comp.bin_file.options.module) |module| { |
| 2397 | 2393 | try link.File.C.flushEmitH(module); |
| ... | ... | @@ -2952,9 +2948,6 @@ pub fn performAllTheWork( |
| 2952 | 2948 | fn processOneJob(comp: *Compilation, job: Job) !void { |
| 2953 | 2949 | switch (job) { |
| 2954 | 2950 | .codegen_decl => |decl_index| { |
| 2955 | if (build_options.omit_stage2) | |
| 2956 | @panic("sadly stage2 is omitted from this build to save memory on the CI server"); | |
| 2957 | ||
| 2958 | 2951 | const module = comp.bin_file.options.module.?; |
| 2959 | 2952 | const decl = module.declPtr(decl_index); |
| 2960 | 2953 | |
| ... | ... | @@ -2989,9 +2982,6 @@ fn processOneJob(comp: *Compilation, job: Job) !void { |
| 2989 | 2982 | } |
| 2990 | 2983 | }, |
| 2991 | 2984 | .codegen_func => |func| { |
| 2992 | if (build_options.omit_stage2) | |
| 2993 | @panic("sadly stage2 is omitted from this build to save memory on the CI server"); | |
| 2994 | ||
| 2995 | 2985 | const named_frame = tracy.namedFrame("codegen_func"); |
| 2996 | 2986 | defer named_frame.end(); |
| 2997 | 2987 | |
| ... | ... | @@ -3002,9 +2992,6 @@ fn processOneJob(comp: *Compilation, job: Job) !void { |
| 3002 | 2992 | }; |
| 3003 | 2993 | }, |
| 3004 | 2994 | .emit_h_decl => |decl_index| { |
| 3005 | if (build_options.omit_stage2) | |
| 3006 | @panic("sadly stage2 is omitted from this build to save memory on the CI server"); | |
| 3007 | ||
| 3008 | 2995 | const module = comp.bin_file.options.module.?; |
| 3009 | 2996 | const decl = module.declPtr(decl_index); |
| 3010 | 2997 | |
| ... | ... | @@ -3063,9 +3050,6 @@ fn processOneJob(comp: *Compilation, job: Job) !void { |
| 3063 | 3050 | } |
| 3064 | 3051 | }, |
| 3065 | 3052 | .analyze_decl => |decl_index| { |
| 3066 | if (build_options.omit_stage2) | |
| 3067 | @panic("sadly stage2 is omitted from this build to save memory on the CI server"); | |
| 3068 | ||
| 3069 | 3053 | const module = comp.bin_file.options.module.?; |
| 3070 | 3054 | module.ensureDeclAnalyzed(decl_index) catch |err| switch (err) { |
| 3071 | 3055 | error.OutOfMemory => return error.OutOfMemory, |
| ... | ... | @@ -3073,9 +3057,6 @@ fn processOneJob(comp: *Compilation, job: Job) !void { |
| 3073 | 3057 | }; |
| 3074 | 3058 | }, |
| 3075 | 3059 | .update_embed_file => |embed_file| { |
| 3076 | if (build_options.omit_stage2) | |
| 3077 | @panic("sadly stage2 is omitted from this build to save memory on the CI server"); | |
| 3078 | ||
| 3079 | 3060 | const named_frame = tracy.namedFrame("update_embed_file"); |
| 3080 | 3061 | defer named_frame.end(); |
| 3081 | 3062 | |
| ... | ... | @@ -3086,9 +3067,6 @@ fn processOneJob(comp: *Compilation, job: Job) !void { |
| 3086 | 3067 | }; |
| 3087 | 3068 | }, |
| 3088 | 3069 | .update_line_number => |decl_index| { |
| 3089 | if (build_options.omit_stage2) | |
| 3090 | @panic("sadly stage2 is omitted from this build to save memory on the CI server"); | |
| 3091 | ||
| 3092 | 3070 | const named_frame = tracy.namedFrame("update_line_number"); |
| 3093 | 3071 | defer named_frame.end(); |
| 3094 | 3072 | |
| ... | ... | @@ -3107,9 +3085,6 @@ fn processOneJob(comp: *Compilation, job: Job) !void { |
| 3107 | 3085 | }; |
| 3108 | 3086 | }, |
| 3109 | 3087 | .analyze_pkg => |pkg| { |
| 3110 | if (build_options.omit_stage2) | |
| 3111 | @panic("sadly stage2 is omitted from this build to save memory on the CI server"); | |
| 3112 | ||
| 3113 | 3088 | const named_frame = tracy.namedFrame("analyze_pkg"); |
| 3114 | 3089 | defer named_frame.end(); |
| 3115 | 3090 |
src/Sema.zig-7| ... | ... | @@ -27358,9 +27358,6 @@ pub fn resolveTypeLayout( |
| 27358 | 27358 | src: LazySrcLoc, |
| 27359 | 27359 | ty: Type, |
| 27360 | 27360 | ) CompileError!void { |
| 27361 | if (build_options.omit_stage2) | |
| 27362 | @panic("sadly stage2 is omitted from this build to save memory on the CI server"); | |
| 27363 | ||
| 27364 | 27361 | switch (ty.zigTypeTag()) { |
| 27365 | 27362 | .Struct => return sema.resolveStructLayout(block, src, ty), |
| 27366 | 27363 | .Union => return sema.resolveUnionLayout(block, src, ty), |
| ... | ... | @@ -27699,8 +27696,6 @@ fn resolveUnionFully( |
| 27699 | 27696 | } |
| 27700 | 27697 | |
| 27701 | 27698 | pub fn resolveTypeFields(sema: *Sema, block: *Block, src: LazySrcLoc, ty: Type) CompileError!Type { |
| 27702 | if (build_options.omit_stage2) | |
| 27703 | @panic("sadly stage2 is omitted from this build to save memory on the CI server"); | |
| 27704 | 27699 | switch (ty.tag()) { |
| 27705 | 27700 | .@"struct" => { |
| 27706 | 27701 | const struct_obj = ty.castTag(.@"struct").?.data; |
| ... | ... | @@ -29323,8 +29318,6 @@ fn typePtrOrOptionalPtrTy( |
| 29323 | 29318 | /// TODO merge these implementations together with the "advanced"/sema_kit pattern seen |
| 29324 | 29319 | /// elsewhere in value.zig |
| 29325 | 29320 | pub fn typeRequiresComptime(sema: *Sema, block: *Block, src: LazySrcLoc, ty: Type) CompileError!bool { |
| 29326 | if (build_options.omit_stage2) | |
| 29327 | @panic("sadly stage2 is omitted from this build to save memory on the CI server"); | |
| 29328 | 29321 | return switch (ty.tag()) { |
| 29329 | 29322 | .u1, |
| 29330 | 29323 | .u8, |
src/config.zig.in-1| ... | ... | @@ -10,4 +10,3 @@ pub const enable_tracy = false; |
| 10 | 10 | pub const value_tracing = false; |
| 11 | 11 | pub const is_stage1 = true; |
| 12 | 12 | pub const skip_non_native = false; |
| 13 | pub const omit_stage2: bool = @ZIG_OMIT_STAGE2_BOOL@; |
test/tests.zig-6| ... | ... | @@ -462,7 +462,6 @@ pub fn addStandaloneTests( |
| 462 | 462 | skip_non_native: bool, |
| 463 | 463 | enable_macos_sdk: bool, |
| 464 | 464 | target: std.zig.CrossTarget, |
| 465 | omit_stage2: bool, | |
| 466 | 465 | enable_darling: bool, |
| 467 | 466 | enable_qemu: bool, |
| 468 | 467 | enable_rosetta: bool, |
| ... | ... | @@ -479,7 +478,6 @@ pub fn addStandaloneTests( |
| 479 | 478 | .skip_non_native = skip_non_native, |
| 480 | 479 | .enable_macos_sdk = enable_macos_sdk, |
| 481 | 480 | .target = target, |
| 482 | .omit_stage2 = omit_stage2, | |
| 483 | 481 | .enable_darling = enable_darling, |
| 484 | 482 | .enable_qemu = enable_qemu, |
| 485 | 483 | .enable_rosetta = enable_rosetta, |
| ... | ... | @@ -497,7 +495,6 @@ pub fn addLinkTests( |
| 497 | 495 | test_filter: ?[]const u8, |
| 498 | 496 | modes: []const Mode, |
| 499 | 497 | enable_macos_sdk: bool, |
| 500 | omit_stage2: bool, | |
| 501 | 498 | ) *build.Step { |
| 502 | 499 | const cases = b.allocator.create(StandaloneContext) catch unreachable; |
| 503 | 500 | cases.* = StandaloneContext{ |
| ... | ... | @@ -509,7 +506,6 @@ pub fn addLinkTests( |
| 509 | 506 | .skip_non_native = true, |
| 510 | 507 | .enable_macos_sdk = enable_macos_sdk, |
| 511 | 508 | .target = .{}, |
| 512 | .omit_stage2 = omit_stage2, | |
| 513 | 509 | }; |
| 514 | 510 | link.addCases(cases); |
| 515 | 511 | return cases.step; |
| ... | ... | @@ -978,7 +974,6 @@ pub const StandaloneContext = struct { |
| 978 | 974 | skip_non_native: bool, |
| 979 | 975 | enable_macos_sdk: bool, |
| 980 | 976 | target: std.zig.CrossTarget, |
| 981 | omit_stage2: bool, | |
| 982 | 977 | enable_darling: bool = false, |
| 983 | 978 | enable_qemu: bool = false, |
| 984 | 979 | enable_rosetta: bool = false, |
| ... | ... | @@ -1003,7 +998,6 @@ pub const StandaloneContext = struct { |
| 1003 | 998 | const b = self.b; |
| 1004 | 999 | |
| 1005 | 1000 | if (features.requires_macos_sdk and !self.enable_macos_sdk) return; |
| 1006 | if (features.requires_stage2 and self.omit_stage2) return; | |
| 1007 | 1001 | |
| 1008 | 1002 | const annotated_case_name = b.fmt("build {s}", .{build_file}); |
| 1009 | 1003 | if (self.test_filter) |filter| { |