mirror of
https://github.com/ziglang/zig.git
synced 2024-11-14 16:13:24 +00:00
ci: omit stage2 backend from stage1 on Windows
to avoid out-of-memory on the CI runs.
This commit is contained in:
parent
462c1d8c74
commit
2fe8a48215
@ -89,6 +89,7 @@ set(ZIG_TARGET_MCPU "baseline" CACHE STRING "-mcpu parameter to output binaries
|
||||
set(ZIG_EXECUTABLE "" CACHE STRING "(when cross compiling) path to already-built zig binary")
|
||||
set(ZIG_PREFER_LLVM_CONFIG off CACHE BOOL "(when cross compiling) use llvm-config to find target llvm dependencies if needed")
|
||||
set(ZIG_SINGLE_THREADED off CACHE BOOL "limit the zig compiler to use only 1 thread")
|
||||
set(ZIG_OMIT_STAGE2 off CACHE BOOL "omit the stage2 backend from stage1")
|
||||
|
||||
find_package(llvm)
|
||||
find_package(clang)
|
||||
@ -587,6 +588,12 @@ if(MSVC)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(ZIG_OMIT_STAGE2)
|
||||
set(ZIG_OMIT_STAGE2_BOOL "true")
|
||||
else()
|
||||
set(ZIG_OMIT_STAGE2_BOOL "false")
|
||||
endif()
|
||||
|
||||
configure_file (
|
||||
"${CMAKE_SOURCE_DIR}/src/stage1/config.h.in"
|
||||
"${ZIG_CONFIG_H_OUT}"
|
||||
|
@ -125,7 +125,6 @@ pub fn build(b: *Builder) !void {
|
||||
try addCmakeCfgOptionsToExe(b, cfg, tracy, test_stage2);
|
||||
} else {
|
||||
// Here we are -Denable-llvm but no cmake integration.
|
||||
|
||||
try addStaticLlvmOptionsToExe(exe);
|
||||
try addStaticLlvmOptionsToExe(test_stage2);
|
||||
}
|
||||
@ -194,6 +193,7 @@ pub fn build(b: *Builder) !void {
|
||||
exe.addBuildOption([]const []const u8, "log_scopes", log_scopes);
|
||||
exe.addBuildOption(bool, "enable_tracy", tracy != null);
|
||||
exe.addBuildOption(bool, "is_stage1", is_stage1);
|
||||
exe.addBuildOption(bool, "omit_stage2", false);
|
||||
if (tracy) |tracy_path| {
|
||||
const client_cpp = fs.path.join(
|
||||
b.allocator,
|
||||
@ -216,6 +216,7 @@ pub fn build(b: *Builder) !void {
|
||||
|
||||
test_stage2.addBuildOption(bool, "skip_non_native", skip_non_native);
|
||||
test_stage2.addBuildOption(bool, "is_stage1", is_stage1);
|
||||
test_stage2.addBuildOption(bool, "omit_stage2", false);
|
||||
test_stage2.addBuildOption(bool, "have_llvm", enable_llvm);
|
||||
test_stage2.addBuildOption(bool, "enable_qemu", is_qemu_enabled);
|
||||
test_stage2.addBuildOption(bool, "enable_wine", is_wine_enabled);
|
||||
|
@ -23,11 +23,12 @@ git.exe fetch --tags
|
||||
|
||||
mkdir %ZIGBUILDDIR%
|
||||
cd %ZIGBUILDDIR%
|
||||
cmake.exe .. -Thost=x64 -G"Visual Studio 16 2019" -A x64 "-DCMAKE_INSTALL_PREFIX=%ZIGINSTALLDIR%" "-DCMAKE_PREFIX_PATH=%ZIGPREFIXPATH%" -DCMAKE_BUILD_TYPE=Release || exit /b
|
||||
cmake.exe .. -Thost=x64 -G"Visual Studio 16 2019" -A x64 "-DCMAKE_INSTALL_PREFIX=%ZIGINSTALLDIR%" "-DCMAKE_PREFIX_PATH=%ZIGPREFIXPATH%" -DCMAKE_BUILD_TYPE=Release -DZIG_OMIT_STAGE2=ON || exit /b
|
||||
msbuild /maxcpucount /p:Configuration=Release INSTALL.vcxproj || exit /b
|
||||
|
||||
"%ZIGINSTALLDIR%\bin\zig.exe" build test-behavior -Dskip-non-native || exit /b
|
||||
"%ZIGINSTALLDIR%\bin\zig.exe" build test-stage2 -Dskip-non-native || exit /b
|
||||
REM Disabled to prevent OOM
|
||||
REM "%ZIGINSTALLDIR%\bin\zig.exe" build test-stage2 -Dskip-non-native || exit /b
|
||||
"%ZIGINSTALLDIR%\bin\zig.exe" build test-fmt -Dskip-non-native || exit /b
|
||||
"%ZIGINSTALLDIR%\bin\zig.exe" build test-std -Dskip-non-native || exit /b
|
||||
"%ZIGINSTALLDIR%\bin\zig.exe" build test-compiler-rt -Dskip-non-native || exit /b
|
||||
|
@ -1461,6 +1461,8 @@ pub fn performAllTheWork(self: *Compilation) error{ TimerUnsupported, OutOfMemor
|
||||
=> continue,
|
||||
|
||||
.complete, .codegen_failure_retryable => {
|
||||
if (build_options.omit_stage2)
|
||||
@panic("sadly stage2 is omitted from this build to save memory on the CI server");
|
||||
const module = self.bin_file.options.module.?;
|
||||
if (decl.typed_value.most_recent.typed_value.val.castTag(.function)) |payload| {
|
||||
const func = payload.data;
|
||||
@ -1532,6 +1534,8 @@ pub fn performAllTheWork(self: *Compilation) error{ TimerUnsupported, OutOfMemor
|
||||
},
|
||||
},
|
||||
.analyze_decl => |decl| {
|
||||
if (build_options.omit_stage2)
|
||||
@panic("sadly stage2 is omitted from this build to save memory on the CI server");
|
||||
const module = self.bin_file.options.module.?;
|
||||
module.ensureDeclAnalyzed(decl) catch |err| switch (err) {
|
||||
error.OutOfMemory => return error.OutOfMemory,
|
||||
@ -1539,6 +1543,8 @@ pub fn performAllTheWork(self: *Compilation) error{ TimerUnsupported, OutOfMemor
|
||||
};
|
||||
},
|
||||
.update_line_number => |decl| {
|
||||
if (build_options.omit_stage2)
|
||||
@panic("sadly stage2 is omitted from this build to save memory on the CI server");
|
||||
const module = self.bin_file.options.module.?;
|
||||
self.bin_file.updateDeclLineNumber(module, decl) catch |err| {
|
||||
try module.failed_decls.ensureCapacity(module.gpa, module.failed_decls.items().len + 1);
|
||||
|
@ -5,3 +5,4 @@ pub const log_scopes: []const []const u8 = &[_][]const u8{};
|
||||
pub const enable_tracy = false;
|
||||
pub const is_stage1 = true;
|
||||
pub const skip_non_native = false;
|
||||
pub const omit_stage2: bool = @ZIG_OMIT_STAGE2_BOOL@;
|
||||
|
Loading…
Reference in New Issue
Block a user