From 31d632b72e4792c533603db140ca65a45ebdbefe Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Thu, 4 Jan 2018 18:34:42 -0500 Subject: [PATCH 01/10] appveyor ci: look for newer windows sdk version --- ci/appveyor/build_script.bat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/appveyor/build_script.bat b/ci/appveyor/build_script.bat index 839c5a7ff8e44b2633aaddabcd68d174314ea803..ce6844c8a0725bd68efd339561b8b11e23cb41a7 100644 --- a/ci/appveyor/build_script.bat +++ b/ci/appveyor/build_script.bat @@ -17,7 +17,7 @@ SET "ZIGPREFIXPATH=%APPVEYOR_BUILD_FOLDER%\llvm+clang-5.0.0-win64-msvc-release" mkdir %ZIGBUILDDIR% 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 +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.26624.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.26624.0\ucrt\x64" || exit /b msbuild /p:Configuration=Release INSTALL.vcxproj || exit /b bin\zig.exe build --build-file ..\build.zig test || exit /b -- 2.54.0 From 35dc987dc88712d6e70f3b8c9cd076fe43fcd874 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Thu, 4 Jan 2018 18:54:46 -0500 Subject: [PATCH 02/10] try using appveyor's llvm copy --- ci/appveyor/build_script.bat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/appveyor/build_script.bat b/ci/appveyor/build_script.bat index ce6844c8a0725bd68efd339561b8b11e23cb41a7..ab4239e92ae38a3ceea9a4838e5caf90d4107451 100644 --- a/ci/appveyor/build_script.bat +++ b/ci/appveyor/build_script.bat @@ -13,7 +13,7 @@ bash -lc "cd ${APPVEYOR_BUILD_FOLDER} && if [ -s ""llvm+clang-5.0.0-win64-msvc-r SET "PATH=%PREVPATH%" SET "MSYSTEM=%PREVMSYSTEM%" SET "ZIGBUILDDIR=%APPVEYOR_BUILD_FOLDER%\build-msvc-release" -SET "ZIGPREFIXPATH=%APPVEYOR_BUILD_FOLDER%\llvm+clang-5.0.0-win64-msvc-release" +SET "ZIGPREFIXPATH=C:\Libraries\LLVM-5.0.0" mkdir %ZIGBUILDDIR% cd %ZIGBUILDDIR% -- 2.54.0 From 21a552682ef51b03648c5b5a47de2f623bd71cfd Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Thu, 4 Jan 2018 19:06:48 -0500 Subject: [PATCH 03/10] Revert "try using appveyor's llvm copy" This reverts commit 35dc987dc88712d6e70f3b8c9cd076fe43fcd874. --- ci/appveyor/build_script.bat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/appveyor/build_script.bat b/ci/appveyor/build_script.bat index ab4239e92ae38a3ceea9a4838e5caf90d4107451..ce6844c8a0725bd68efd339561b8b11e23cb41a7 100644 --- a/ci/appveyor/build_script.bat +++ b/ci/appveyor/build_script.bat @@ -13,7 +13,7 @@ bash -lc "cd ${APPVEYOR_BUILD_FOLDER} && if [ -s ""llvm+clang-5.0.0-win64-msvc-r SET "PATH=%PREVPATH%" SET "MSYSTEM=%PREVMSYSTEM%" SET "ZIGBUILDDIR=%APPVEYOR_BUILD_FOLDER%\build-msvc-release" -SET "ZIGPREFIXPATH=C:\Libraries\LLVM-5.0.0" +SET "ZIGPREFIXPATH=%APPVEYOR_BUILD_FOLDER%\llvm+clang-5.0.0-win64-msvc-release" mkdir %ZIGBUILDDIR% cd %ZIGBUILDDIR% -- 2.54.0 From 1b120d1e49106d0683cc3e6ed766fd8534f798f2 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Thu, 4 Jan 2018 22:46:26 -0500 Subject: [PATCH 04/10] update windows build to llvm 5.0.1 llvm-config.exe does not handle diaguids.lib for us so we have to duplicate the work. --- CMakeLists.txt | 12 ++++++++++++ build.zig | 5 +++++ ci/appveyor/build_script.bat | 4 ++-- src/config.h.in | 1 + src/main.cpp | 5 +++-- 5 files changed, 23 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 08c2cf47612e91d27a6ca5354fd51735e16a4bab..1c9f374d290f3932d4728e570854df29a779a688 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -570,6 +570,14 @@ set(ZIG_C_HEADER_FILES "xtestintrin.h" ) +if(MSVC) + set(MSVC_DIA_SDK_DIR "$ENV{VSINSTALLDIR}DIA SDK") + if (IS_DIRECTORY ${MSVC_DIA_SDK_DIR}) + set(ZIG_DIA_GUIDS_LIB "${MSVC_DIA_SDK_DIR}/lib/amd64/diaguids.lib") + string(REGEX REPLACE "\\\\" "\\\\\\\\" ZIG_DIA_GUIDS_LIB_ESCAPED "${ZIG_DIA_GUIDS_LIB}") + endif() +endif() + set(ZIG_LIB_DIR "lib/zig") set(C_HEADERS_DEST "${ZIG_LIB_DIR}/include") set(ZIG_STD_DEST "${ZIG_LIB_DIR}/std") @@ -631,6 +639,10 @@ target_link_libraries(zig LINK_PUBLIC ${LLVM_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} ) +if(ZIG_DIA_GUIDS_LIB) + target_link_libraries(zig LINK_PUBLIC ${ZIG_DIA_GUIDS_LIB}) +endif() + if(MSVC OR MINGW) target_link_libraries(zig LINK_PUBLIC version) endif() diff --git a/build.zig b/build.zig index b8b47cda2eaadd5643c7e6c0dfcbf329971fa70b..57af7eaecad5be73667b81aa49169586174cfd03 100644 --- a/build.zig +++ b/build.zig @@ -45,6 +45,7 @@ pub fn build(b: &Builder) { const lld_libraries = nextValue(&index, build_info); const std_files = nextValue(&index, build_info); const c_header_files = nextValue(&index, build_info); + const dia_guids_lib = nextValue(&index, build_info); const llvm = findLLVM(b, llvm_config_exe); @@ -76,6 +77,10 @@ pub fn build(b: &Builder) { exe.linkSystemLibrary("c++"); } + if (dia_guids_lib.len != 0) { + exe.addObjectFile(dia_guids_lib); + } + exe.linkSystemLibrary("c"); b.default_step.dependOn(&exe.step); diff --git a/ci/appveyor/build_script.bat b/ci/appveyor/build_script.bat index ce6844c8a0725bd68efd339561b8b11e23cb41a7..98786d9866b111c4e3d023b64a84c3838503c01a 100644 --- a/ci/appveyor/build_script.bat +++ b/ci/appveyor/build_script.bat @@ -7,13 +7,13 @@ SET "PATH=C:\msys64\mingw64\bin;C:\msys64\usr\bin;%PATH%" SET "MSYSTEM=MINGW64" SET "APPVEYOR_CACHE_ENTRY_ZIP_ARGS=-m0=Copy" -bash -lc "cd ${APPVEYOR_BUILD_FOLDER} && if [ -s ""llvm+clang-5.0.0-win64-msvc-release.tar.xz"" ]; then echo 'skipping LLVM download'; else wget 'https://s3.amazonaws.com/superjoe/temp/llvm%%2bclang-5.0.0-win64-msvc-release.tar.xz'; fi && tar xf llvm+clang-5.0.0-win64-msvc-release.tar.xz" || exit /b +bash -lc "cd ${APPVEYOR_BUILD_FOLDER} && if [ -s ""llvm+clang-5.0.1-win64-msvc-release.tar.xz"" ]; then echo 'skipping LLVM download'; else wget 'https://s3.amazonaws.com/ziglang.org/deps/llvm%%2bclang-5.0.1-win64-msvc-release.tar.xz'; fi && tar xf llvm+clang-5.0.1-win64-msvc-release.tar.xz" || exit /b SET "PATH=%PREVPATH%" SET "MSYSTEM=%PREVMSYSTEM%" SET "ZIGBUILDDIR=%APPVEYOR_BUILD_FOLDER%\build-msvc-release" -SET "ZIGPREFIXPATH=%APPVEYOR_BUILD_FOLDER%\llvm+clang-5.0.0-win64-msvc-release" +SET "ZIGPREFIXPATH=%APPVEYOR_BUILD_FOLDER%\llvm+clang-5.0.1-win64-msvc-release" mkdir %ZIGBUILDDIR% cd %ZIGBUILDDIR% diff --git a/src/config.h.in b/src/config.h.in index 038d42d218fd0de838e551ce4cb2683ea2ddc420..1fcc3fe12c853cadab6ee50ac9809226dc48e453 100644 --- a/src/config.h.in +++ b/src/config.h.in @@ -32,5 +32,6 @@ #define ZIG_LLVM_CONFIG_EXE "@LLVM_CONFIG_EXE@" #define ZIG_STD_FILES "@ZIG_STD_FILES@" #define ZIG_C_HEADER_FILES "@ZIG_C_HEADER_FILES@" +#define ZIG_DIA_GUIDS_LIB "@ZIG_DIA_GUIDS_LIB_ESCAPED@" #endif diff --git a/src/main.cpp b/src/main.cpp index 6f70317f985173e8d1f71bcf85b3d6517df441b9..4acf4014ba4621023b2bda40078b6dffc85d1965 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -267,14 +267,15 @@ static void add_package(CodeGen *g, CliPkg *cli_pkg, PackageTableEntry *pkg) { int main(int argc, char **argv) { if (argc == 2 && strcmp(argv[1], "BUILD_INFO") == 0) { - printf("%s\n%s\n%s\n%s\n%s\n%s\n%s\n", + printf("%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n", ZIG_CMAKE_BINARY_DIR, ZIG_CXX_COMPILER, ZIG_LLVM_CONFIG_EXE, ZIG_LLD_INCLUDE_PATH, ZIG_LLD_LIBRARIES, ZIG_STD_FILES, - ZIG_C_HEADER_FILES); + ZIG_C_HEADER_FILES, + ZIG_DIA_GUIDS_LIB); return 0; } -- 2.54.0 From d1ef17e3cd02a2e2f2597a75eb77b5173ce45f62 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Thu, 4 Jan 2018 22:59:39 -0500 Subject: [PATCH 05/10] appveyor: set VCINSTALLDIR --- ci/appveyor/appveyor.yml | 1 + ci/appveyor/build_script.bat | 1 + 2 files changed, 2 insertions(+) diff --git a/ci/appveyor/appveyor.yml b/ci/appveyor/appveyor.yml index 2009f92e4323caf9a6ad584878bde20f34ec6b47..de8b621bacda634df71c5a489c565fbe7c8bc635 100644 --- a/ci/appveyor/appveyor.yml +++ b/ci/appveyor/appveyor.yml @@ -7,3 +7,4 @@ after_build: - '%APPVEYOR_BUILD_FOLDER%\ci\appveyor\after_build.bat' cache: - 'llvm+clang-5.0.0-win64-msvc-release.tar.xz' + - 'llvm+clang-5.0.1-win64-msvc-release.tar.xz' diff --git a/ci/appveyor/build_script.bat b/ci/appveyor/build_script.bat index 98786d9866b111c4e3d023b64a84c3838503c01a..3c419bca559a4937bd36614ad53fc0935851d09b 100644 --- a/ci/appveyor/build_script.bat +++ b/ci/appveyor/build_script.bat @@ -10,6 +10,7 @@ SET "APPVEYOR_CACHE_ENTRY_ZIP_ARGS=-m0=Copy" bash -lc "cd ${APPVEYOR_BUILD_FOLDER} && if [ -s ""llvm+clang-5.0.1-win64-msvc-release.tar.xz"" ]; then echo 'skipping LLVM download'; else wget 'https://s3.amazonaws.com/ziglang.org/deps/llvm%%2bclang-5.0.1-win64-msvc-release.tar.xz'; fi && tar xf llvm+clang-5.0.1-win64-msvc-release.tar.xz" || exit /b +SET "VCINSTALLDIR=C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\" SET "PATH=%PREVPATH%" SET "MSYSTEM=%PREVMSYSTEM%" SET "ZIGBUILDDIR=%APPVEYOR_BUILD_FOLDER%\build-msvc-release" -- 2.54.0 From 25ad0b47e2e9478f50ca06b14f9a6558f571ee3b Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Thu, 4 Jan 2018 23:11:27 -0500 Subject: [PATCH 06/10] appveyor: try using vcvarsall --- ci/appveyor/build_script.bat | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ci/appveyor/build_script.bat b/ci/appveyor/build_script.bat index 3c419bca559a4937bd36614ad53fc0935851d09b..356560d63a3c401a6a9b01ae76befb6b6b24b399 100644 --- a/ci/appveyor/build_script.bat +++ b/ci/appveyor/build_script.bat @@ -10,12 +10,14 @@ SET "APPVEYOR_CACHE_ENTRY_ZIP_ARGS=-m0=Copy" bash -lc "cd ${APPVEYOR_BUILD_FOLDER} && if [ -s ""llvm+clang-5.0.1-win64-msvc-release.tar.xz"" ]; then echo 'skipping LLVM download'; else wget 'https://s3.amazonaws.com/ziglang.org/deps/llvm%%2bclang-5.0.1-win64-msvc-release.tar.xz'; fi && tar xf llvm+clang-5.0.1-win64-msvc-release.tar.xz" || exit /b -SET "VCINSTALLDIR=C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\" SET "PATH=%PREVPATH%" SET "MSYSTEM=%PREVMSYSTEM%" SET "ZIGBUILDDIR=%APPVEYOR_BUILD_FOLDER%\build-msvc-release" SET "ZIGPREFIXPATH=%APPVEYOR_BUILD_FOLDER%\llvm+clang-5.0.1-win64-msvc-release" +call "C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd" /x64 +call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x86_amd64 + mkdir %ZIGBUILDDIR% 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.26624.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.26624.0\ucrt\x64" || exit /b -- 2.54.0 From 7f0b12a481110c5f8c5bafa42bf21306f3798366 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Thu, 4 Jan 2018 23:30:03 -0500 Subject: [PATCH 07/10] appveyor: skip building self hosted compiler for now --- build.zig | 6 +++++- ci/appveyor/appveyor.yml | 1 - ci/appveyor/build_script.bat | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/build.zig b/build.zig index 57af7eaecad5be73667b81aa49169586174cfd03..19324968ef22bae859180b9d74d02a39a28084c4 100644 --- a/build.zig +++ b/build.zig @@ -85,7 +85,11 @@ pub fn build(b: &Builder) { b.default_step.dependOn(&exe.step); b.default_step.dependOn(docs_step); - test_step.dependOn(&exe.step); + + const skip_self_hosted = b.option(bool, "skip-self-hosted", "Main test suite skips building self hosted compiler") ?? false; + if (!skip_self_hosted) { + test_step.dependOn(&exe.step); + } b.installArtifact(exe); installStdLib(b, std_files); diff --git a/ci/appveyor/appveyor.yml b/ci/appveyor/appveyor.yml index de8b621bacda634df71c5a489c565fbe7c8bc635..0cae78027b6c7d409f4114d1d99efb75aeae0507 100644 --- a/ci/appveyor/appveyor.yml +++ b/ci/appveyor/appveyor.yml @@ -6,5 +6,4 @@ build_script: after_build: - '%APPVEYOR_BUILD_FOLDER%\ci\appveyor\after_build.bat' cache: - - 'llvm+clang-5.0.0-win64-msvc-release.tar.xz' - 'llvm+clang-5.0.1-win64-msvc-release.tar.xz' diff --git a/ci/appveyor/build_script.bat b/ci/appveyor/build_script.bat index 356560d63a3c401a6a9b01ae76befb6b6b24b399..63302d1c67618f84c4b19274cdef2a6b6c5af6b9 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.26624.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.26624.0\ucrt\x64" || exit /b msbuild /p:Configuration=Release INSTALL.vcxproj || exit /b -bin\zig.exe build --build-file ..\build.zig test || exit /b +bin\zig.exe build --build-file ..\build.zig test -Dskip-self-hosted || exit /b @echo "MSVC build succeeded, proceeding with MinGW build" cd %APPVEYOR_BUILD_FOLDER% -- 2.54.0 From f377b1e88609ff461bd5ad84b3fd915039b1ede8 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Thu, 4 Jan 2018 23:37:21 -0500 Subject: [PATCH 08/10] Revert "appveyor ci: look for newer windows sdk version" This reverts commit 31d632b72e4792c533603db140ca65a45ebdbefe. according to https://developer.microsoft.com/en-us/windows/downloads/sdk-archive 10240 is actually 26624 and there was some kind of versioning issue. --- ci/appveyor/build_script.bat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/appveyor/build_script.bat b/ci/appveyor/build_script.bat index 63302d1c67618f84c4b19274cdef2a6b6c5af6b9..d2302167cf46a817122a2ab0d6d1023ac43183c8 100644 --- a/ci/appveyor/build_script.bat +++ b/ci/appveyor/build_script.bat @@ -20,7 +20,7 @@ call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x86_ mkdir %ZIGBUILDDIR% 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.26624.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.26624.0\ucrt\x64" || exit /b +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 -- 2.54.0 From 79d50d993361322720a96f9b06f6f77733cea822 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Thu, 4 Jan 2018 23:43:46 -0500 Subject: [PATCH 09/10] 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 19324968ef22bae859180b9d74d02a39a28084c4..9f66cf8728e7b0470e13a2b651a5456e40982aaf 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 d2302167cf46a817122a2ab0d6d1023ac43183c8..b06c24b20a71115db6963679ac3b2b4a93242a23 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 bb5280837f9695eb547313ec3c88467908841ba5..71ce56def350783abd8ca1ad896d54490efcb5c9 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 0ae76a560b4d11413c59120cbbc142d10d100c51..18007538abc6eed044438a79cb5ecc26ddf9d024 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; -- 2.54.0 From 2c35e24bd95fa8ad9af1c6a712293163232a8b3c Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Fri, 5 Jan 2018 11:35:46 -0500 Subject: [PATCH 10/10] workaround for microsoft releasing windows SDK with wrong version --- src/os.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/os.cpp b/src/os.cpp index a59fa126579f74259077054b15e7e1e3dc8f06ab..ef12464c8cba6e21a502c239f7bddbb1ea8f0544 100644 --- a/src/os.cpp +++ b/src/os.cpp @@ -1055,6 +1055,11 @@ int os_find_windows_sdk(ZigWindowsSDK **out_sdk) { if (ffd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) { int c0 = 0, c1 = 0, c2 = 0, c3 = 0; sscanf(ffd.cFileName, "%d.%d.%d.%d", &c0, &c1, &c2, &c3); + if (c0 == 10 && c1 == 0 && c2 == 10240 && c3 == 0) { + // Microsoft released 26624 as 10240 accidentally. + // https://developer.microsoft.com/en-us/windows/downloads/sdk-archive + c2 = 26624; + } if ((c0 > v0) || (c1 > v1) || (c2 > v2) || (c3 > v3)) { v0 = c0, v1 = c1, v2 = c2, v3 = c3; buf_init_from_str(&result_sdk->version10, ffd.cFileName); -- 2.54.0