From 79d50d993361322720a96f9b06f6f77733cea822 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Thu, 4 Jan 2018 23:43:46 -0500 Subject: [PATCH] appveyor: enable verbose link for self hosted compiler --- build.zig | 2 ++ ci/appveyor/build_script.bat | 2 +- std/build.zig | 15 ++++++--------- std/special/build_runner.zig | 2 +- 4 files changed, 10 insertions(+), 11 deletions(-) diff --git a/build.zig b/build.zig index 19324968ef..9f66cf8728 100644 --- a/build.zig +++ b/build.zig @@ -90,6 +90,8 @@ pub fn build(b: &Builder) { if (!skip_self_hosted) { test_step.dependOn(&exe.step); } + const verbose_link_exe = b.option(bool, "verbose-link", "Print link command for self hosted compiler") ?? false; + exe.setVerboseLink(verbose_link_exe); b.installArtifact(exe); installStdLib(b, std_files); diff --git a/ci/appveyor/build_script.bat b/ci/appveyor/build_script.bat index d2302167cf..b06c24b20a 100644 --- a/ci/appveyor/build_script.bat +++ b/ci/appveyor/build_script.bat @@ -23,7 +23,7 @@ cd %ZIGBUILDDIR% cmake.exe .. -Thost=x64 -G"Visual Studio 14 2015 Win64" "-DCMAKE_INSTALL_PREFIX=%ZIGBUILDDIR%" "-DCMAKE_PREFIX_PATH=%ZIGPREFIXPATH%" -DCMAKE_BUILD_TYPE=Release "-DZIG_LIBC_INCLUDE_DIR=C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt" "-DZIG_LIBC_LIB_DIR=C:\Program Files (x86)\Windows Kits\10\bin\x64\ucrt" "-DZIG_LIBC_STATIC_LIB_DIR=C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10240.0\ucrt\x64" || exit /b msbuild /p:Configuration=Release INSTALL.vcxproj || exit /b -bin\zig.exe build --build-file ..\build.zig test -Dskip-self-hosted || exit /b +bin\zig.exe build --build-file ..\build.zig test -Dverbose-link || exit /b @echo "MSVC build succeeded, proceeding with MinGW build" cd %APPVEYOR_BUILD_FOLDER% diff --git a/std/build.zig b/std/build.zig index bb5280837f..71ce56def3 100644 --- a/std/build.zig +++ b/std/build.zig @@ -842,10 +842,10 @@ pub const LibExeObjStep = struct { lib_paths: ArrayList([]const u8), disable_libc: bool, frameworks: BufSet, + verbose_link: bool, // zig only stuff root_src: ?[]const u8, - verbose: bool, output_h_path: ?[]const u8, out_h_filename: []const u8, assembly_files: ArrayList([]const u8), @@ -923,7 +923,7 @@ pub const LibExeObjStep = struct { var self = LibExeObjStep { .strip = false, .builder = builder, - .verbose = false, + .verbose_link = false, .build_mode = builtin.Mode.Debug, .static = static, .kind = kind, @@ -988,7 +988,7 @@ pub const LibExeObjStep = struct { .linker_script = null, .root_src = undefined, - .verbose = undefined, + .verbose_link = false, .output_h_path = undefined, .out_h_filename = undefined, .assembly_files = undefined, @@ -1087,8 +1087,8 @@ pub const LibExeObjStep = struct { %%self.source_files.append(file); } - pub fn setVerbose(self: &LibExeObjStep, value: bool) { - self.verbose = value; + pub fn setVerboseLink(self: &LibExeObjStep, value: bool) { + self.verbose_link = value; } pub fn setBuildMode(self: &LibExeObjStep, mode: builtin.Mode) { @@ -1223,15 +1223,12 @@ pub const LibExeObjStep = struct { %%zig_args.append(builder.pathFromRoot(asm_file)); } - if (self.verbose) { - %%zig_args.append("--verbose"); - } if (builder.verbose_tokenize) %%zig_args.append("--verbose-tokenize"); if (builder.verbose_ast) %%zig_args.append("--verbose-ast"); if (builder.verbose_cimport) %%zig_args.append("--verbose-cimport"); if (builder.verbose_ir) %%zig_args.append("--verbose-ir"); if (builder.verbose_llvm_ir) %%zig_args.append("--verbose-llvm-ir"); - if (builder.verbose_link) %%zig_args.append("--verbose-link"); + if (builder.verbose_link or self.verbose_link) %%zig_args.append("--verbose-link"); if (self.strip) { %%zig_args.append("--strip"); diff --git a/std/special/build_runner.zig b/std/special/build_runner.zig index 0ae76a560b..18007538ab 100644 --- a/std/special/build_runner.zig +++ b/std/special/build_runner.zig @@ -14,7 +14,7 @@ pub fn main() -> %void { var arg_it = os.args(); // TODO use a more general purpose allocator here - var inc_allocator = %%std.heap.IncrementingAllocator.init(30 * 1024 * 1024); + var inc_allocator = %%std.heap.IncrementingAllocator.init(40 * 1024 * 1024); defer inc_allocator.deinit(); const allocator = &inc_allocator.allocator;