diff --git a/ci/aarch64-freebsd-debug.sh b/ci/aarch64-freebsd-debug.sh index f1e53270618c5954a0554934a4dd90e81e8d5e3f..a11481b4a74d998f03003a02c70576f516274b43 100755 --- a/ci/aarch64-freebsd-debug.sh +++ b/ci/aarch64-freebsd-debug.sh @@ -11,33 +11,29 @@ CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.17.0-dev.203+073889523" PREFIX="$HOME/deps/$CACHE_BASENAME" ZIG="$PREFIX/bin/zig" +export PATH="$HOME/local/bin:$PATH" + # Override the cache directories because they won't actually help other CI runs # which will be testing alternate versions of zig, and ultimately would just # fill up space on the hard drive for no reason. export ZIG_GLOBAL_CACHE_DIR="$PWD/zig-global-cache" export ZIG_LOCAL_CACHE_DIR="$PWD/zig-local-cache" -mkdir build-debug +mkdir -p build-debug cd build-debug -export CC="$ZIG cc -target $TARGET -mcpu=$MCPU" -export CXX="$ZIG c++ -target $TARGET -mcpu=$MCPU" - cmake .. \ -DCMAKE_INSTALL_PREFIX="stage3-debug" \ -DCMAKE_PREFIX_PATH="$PREFIX" \ -DCMAKE_BUILD_TYPE=Debug \ + -DCMAKE_C_COMPILER="$ZIG;cc;-target;$TARGET;-mcpu=$MCPU" \ + -DCMAKE_CXX_COMPILER="$ZIG;c++;-target;$TARGET;-mcpu=$MCPU" \ -DZIG_TARGET_TRIPLE="$TARGET" \ -DZIG_TARGET_MCPU="$MCPU" \ -DZIG_STATIC=ON \ -DZIG_NO_LIB=ON \ -GNinja -# Now cmake will use zig as the C/C++ compiler. We reset the environment variables -# so that installation and testing do not get affected by them. -unset CC -unset CXX - ninja install # Must be done after zig cc is finished. @@ -55,6 +51,7 @@ stage3-debug/bin/zig build \ -Denable-llvm \ -Dno-lib \ -Dtarget=$TARGET \ + -Dcpu=$MCPU \ -Duse-zig-libcxx \ -Dversion-string="$(stage3-debug/bin/zig version)" diff --git a/ci/aarch64-freebsd-release.sh b/ci/aarch64-freebsd-release.sh index 0f5a949b7a89c0256f4c9d4d8e85607756b88c00..205900073ec3dee440aaa75a1b5e6edebe2a412c 100755 --- a/ci/aarch64-freebsd-release.sh +++ b/ci/aarch64-freebsd-release.sh @@ -11,33 +11,29 @@ CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.17.0-dev.203+073889523" PREFIX="$HOME/deps/$CACHE_BASENAME" ZIG="$PREFIX/bin/zig" +export PATH="$HOME/local/bin:$PATH" + # Override the cache directories because they won't actually help other CI runs # which will be testing alternate versions of zig, and ultimately would just # fill up space on the hard drive for no reason. export ZIG_GLOBAL_CACHE_DIR="$PWD/zig-global-cache" export ZIG_LOCAL_CACHE_DIR="$PWD/zig-local-cache" -mkdir build-release +mkdir -p build-release cd build-release -export CC="$ZIG cc -target $TARGET -mcpu=$MCPU" -export CXX="$ZIG c++ -target $TARGET -mcpu=$MCPU" - cmake .. \ -DCMAKE_INSTALL_PREFIX="stage3-release" \ -DCMAKE_PREFIX_PATH="$PREFIX" \ -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_C_COMPILER="$ZIG;cc;-target;$TARGET;-mcpu=$MCPU" \ + -DCMAKE_CXX_COMPILER="$ZIG;c++;-target;$TARGET;-mcpu=$MCPU" \ -DZIG_TARGET_TRIPLE="$TARGET" \ -DZIG_TARGET_MCPU="$MCPU" \ -DZIG_STATIC=ON \ -DZIG_NO_LIB=ON \ -GNinja -# Now cmake will use zig as the C/C++ compiler. We reset the environment variables -# so that installation and testing do not get affected by them. -unset CC -unset CXX - ninja install # Must be done after zig cc is finished. @@ -58,6 +54,7 @@ stage3-release/bin/zig build \ -Doptimize=ReleaseFast \ -Dstrip \ -Dtarget=$TARGET \ + -Dcpu=$MCPU \ -Duse-zig-libcxx \ -Dversion-string="$(stage3-release/bin/zig version)" diff --git a/ci/aarch64-linux-debug.sh b/ci/aarch64-linux-debug.sh index c2af0a12108f88fb803c7afeff2b537699458690..185e4c6ce3a50b6b8c898208fe3e813298cae982 100755 --- a/ci/aarch64-linux-debug.sh +++ b/ci/aarch64-linux-debug.sh @@ -19,33 +19,26 @@ export PATH="$HOME/local/bin:$PATH" export ZIG_GLOBAL_CACHE_DIR="$PWD/zig-global-cache" export ZIG_LOCAL_CACHE_DIR="$PWD/zig-local-cache" -mkdir build-debug +mkdir -p build-debug cd build-debug -export CC="$ZIG cc -target $TARGET -mcpu=$MCPU" -export CXX="$ZIG c++ -target $TARGET -mcpu=$MCPU" - cmake .. \ -DCMAKE_INSTALL_PREFIX="stage3-debug" \ -DCMAKE_PREFIX_PATH="$PREFIX" \ -DCMAKE_BUILD_TYPE=Debug \ + -DCMAKE_C_COMPILER="$ZIG;cc;-target;$TARGET;-mcpu=$MCPU" \ + -DCMAKE_CXX_COMPILER="$ZIG;c++;-target;$TARGET;-mcpu=$MCPU" \ -DZIG_TARGET_TRIPLE="$TARGET" \ -DZIG_TARGET_MCPU="$MCPU" \ -DZIG_STATIC=ON \ -DZIG_NO_LIB=ON \ -GNinja -# Now cmake will use zig as the C/C++ compiler. We reset the environment variables -# so that installation and testing do not get affected by them. -unset CC -unset CXX - ninja install # Must be done after zig cc is finished. export ZIG_LIB_DIR="$PWD/../lib" -# No -fqemu and -fwasmtime here as they're covered by the x86_64-linux scripts. stage3-debug/bin/zig build test docs \ --maxrss ${ZSF_MAX_RSS:-0} \ -Dstatic-llvm \ @@ -59,6 +52,7 @@ stage3-debug/bin/zig build \ -Denable-llvm \ -Dno-lib \ -Dtarget=$TARGET \ + -Dcpu=$MCPU \ -Duse-zig-libcxx \ -Dversion-string="$(stage3-debug/bin/zig version)" diff --git a/ci/aarch64-linux-release.sh b/ci/aarch64-linux-release.sh index 261aa083ecbb26f3823564bc7bce88449258123d..40c9b428c0cc4cb612885fcd79238fb6518a61db 100755 --- a/ci/aarch64-linux-release.sh +++ b/ci/aarch64-linux-release.sh @@ -19,33 +19,26 @@ export PATH="$HOME/local/bin:$PATH" export ZIG_GLOBAL_CACHE_DIR="$PWD/zig-global-cache" export ZIG_LOCAL_CACHE_DIR="$PWD/zig-local-cache" -mkdir build-release +mkdir -p build-release cd build-release -export CC="$ZIG cc -target $TARGET -mcpu=$MCPU" -export CXX="$ZIG c++ -target $TARGET -mcpu=$MCPU" - cmake .. \ -DCMAKE_INSTALL_PREFIX="stage3-release" \ -DCMAKE_PREFIX_PATH="$PREFIX" \ -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_C_COMPILER="$ZIG;cc;-target;$TARGET;-mcpu=$MCPU" \ + -DCMAKE_CXX_COMPILER="$ZIG;c++;-target;$TARGET;-mcpu=$MCPU" \ -DZIG_TARGET_TRIPLE="$TARGET" \ -DZIG_TARGET_MCPU="$MCPU" \ -DZIG_STATIC=ON \ -DZIG_NO_LIB=ON \ -GNinja -# Now cmake will use zig as the C/C++ compiler. We reset the environment variables -# so that installation and testing do not get affected by them. -unset CC -unset CXX - ninja install # Must be done after zig cc is finished. export ZIG_LIB_DIR="$PWD/../lib" -# No -fqemu and -fwasmtime here as they're covered by the x86_64-linux scripts. stage3-release/bin/zig build test docs \ --maxrss ${ZSF_MAX_RSS:-0} \ -Dstatic-llvm \ @@ -62,6 +55,7 @@ stage3-release/bin/zig build \ -Doptimize=ReleaseFast \ -Dstrip \ -Dtarget=$TARGET \ + -Dcpu=$MCPU \ -Duse-zig-libcxx \ -Dversion-string="$(stage3-release/bin/zig version)" diff --git a/ci/aarch64-macos-debug.sh b/ci/aarch64-macos-debug.sh index 226b3109eafa9e8de169999b52fcd748ddb7c088..9ea978f50989ee196865c35aa79d003b9b81d6ed 100755 --- a/ci/aarch64-macos-debug.sh +++ b/ci/aarch64-macos-debug.sh @@ -5,28 +5,29 @@ set -x set -e -ZIGDIR="$PWD" TARGET="aarch64-macos-none" MCPU="baseline" CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.17.0-dev.203+073889523" PREFIX="$HOME/$CACHE_BASENAME" ZIG="$PREFIX/bin/zig" +ZIGDIR="$PWD" if [ ! -d "$PREFIX" ]; then cd $HOME curl -L -O "https://ziglang.org/deps/$CACHE_BASENAME.tar.xz" tar xf "$CACHE_BASENAME.tar.xz" fi - cd $ZIGDIR +export PATH="$HOME/local/bin:$PATH" + # Override the cache directories because they won't actually help other CI runs # which will be testing alternate versions of zig, and ultimately would just # fill up space on the hard drive for no reason. export ZIG_GLOBAL_CACHE_DIR="$PWD/zig-global-cache" export ZIG_LOCAL_CACHE_DIR="$PWD/zig-local-cache" -mkdir build-debug +mkdir -p build-debug cd build-debug cmake .. \ @@ -65,6 +66,7 @@ stage3-debug/bin/zig build \ -Denable-llvm \ -Dno-lib \ -Dtarget=$TARGET \ + -Dcpu=$MCPU \ -Duse-zig-libcxx \ -Dversion-string="$(stage3-debug/bin/zig version)" diff --git a/ci/aarch64-macos-release.sh b/ci/aarch64-macos-release.sh index 8bebf1e3bcac0d5c70d9fac7dac8dee6c348363d..99ebf2ddec8e106e99ff1a75a5683693d59caa4e 100755 --- a/ci/aarch64-macos-release.sh +++ b/ci/aarch64-macos-release.sh @@ -5,28 +5,29 @@ set -x set -e -ZIGDIR="$PWD" TARGET="aarch64-macos-none" MCPU="baseline" CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.17.0-dev.203+073889523" PREFIX="$HOME/$CACHE_BASENAME" ZIG="$PREFIX/bin/zig" +ZIGDIR="$PWD" if [ ! -d "$PREFIX" ]; then cd $HOME curl -L -O "https://ziglang.org/deps/$CACHE_BASENAME.tar.xz" tar xf "$CACHE_BASENAME.tar.xz" fi - cd $ZIGDIR +export PATH="$HOME/local/bin:$PATH" + # Override the cache directories because they won't actually help other CI runs # which will be testing alternate versions of zig, and ultimately would just # fill up space on the hard drive for no reason. export ZIG_GLOBAL_CACHE_DIR="$PWD/zig-global-cache" export ZIG_LOCAL_CACHE_DIR="$PWD/zig-local-cache" -mkdir build-release +mkdir -p build-release cd build-release cmake .. \ @@ -72,6 +73,7 @@ stage3-release/bin/zig build \ -Doptimize=ReleaseFast \ -Dstrip \ -Dtarget=$TARGET \ + -Dcpu=$MCPU \ -Duse-zig-libcxx \ -Dversion-string="$(stage3-release/bin/zig version)" diff --git a/ci/aarch64-netbsd-debug.sh b/ci/aarch64-netbsd-debug.sh index a7d7d3e97920a95ff4006792c1bea005bc648583..1791da2caa55e49c02faf72169835834fb3b1c89 100755 --- a/ci/aarch64-netbsd-debug.sh +++ b/ci/aarch64-netbsd-debug.sh @@ -11,33 +11,29 @@ CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.17.0-dev.203+073889523" PREFIX="$HOME/deps/$CACHE_BASENAME" ZIG="$PREFIX/bin/zig" +export PATH="$HOME/local/bin:$PATH" + # Override the cache directories because they won't actually help other CI runs # which will be testing alternate versions of zig, and ultimately would just # fill up space on the hard drive for no reason. export ZIG_GLOBAL_CACHE_DIR="$PWD/zig-global-cache" export ZIG_LOCAL_CACHE_DIR="$PWD/zig-local-cache" -mkdir build-debug +mkdir -p build-debug cd build-debug -export CC="$ZIG cc -target $TARGET -mcpu=$MCPU" -export CXX="$ZIG c++ -target $TARGET -mcpu=$MCPU" - cmake .. \ -DCMAKE_INSTALL_PREFIX="stage3-debug" \ -DCMAKE_PREFIX_PATH="$PREFIX" \ -DCMAKE_BUILD_TYPE=Debug \ + -DCMAKE_C_COMPILER="$ZIG;cc;-target;$TARGET;-mcpu=$MCPU" \ + -DCMAKE_CXX_COMPILER="$ZIG;c++;-target;$TARGET;-mcpu=$MCPU" \ -DZIG_TARGET_TRIPLE="$TARGET" \ -DZIG_TARGET_MCPU="$MCPU" \ -DZIG_STATIC=ON \ -DZIG_NO_LIB=ON \ -GNinja -# Now cmake will use zig as the C/C++ compiler. We reset the environment variables -# so that installation and testing do not get affected by them. -unset CC -unset CXX - ninja install # Must be done after zig cc is finished. @@ -55,6 +51,7 @@ stage3-debug/bin/zig build \ -Denable-llvm \ -Dno-lib \ -Dtarget=$TARGET \ + -Dcpu=$MCPU \ -Duse-zig-libcxx \ -Dversion-string="$(stage3-debug/bin/zig version)" diff --git a/ci/aarch64-netbsd-release.sh b/ci/aarch64-netbsd-release.sh index e0a4c9aaa03f87770b013be6aaf92ffddc6d2bbc..f0dc9d639d5a66c454c3af65ca3d743c774bf8bc 100755 --- a/ci/aarch64-netbsd-release.sh +++ b/ci/aarch64-netbsd-release.sh @@ -11,33 +11,29 @@ CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.17.0-dev.203+073889523" PREFIX="$HOME/deps/$CACHE_BASENAME" ZIG="$PREFIX/bin/zig" +export PATH="$HOME/local/bin:$PATH" + # Override the cache directories because they won't actually help other CI runs # which will be testing alternate versions of zig, and ultimately would just # fill up space on the hard drive for no reason. export ZIG_GLOBAL_CACHE_DIR="$PWD/zig-global-cache" export ZIG_LOCAL_CACHE_DIR="$PWD/zig-local-cache" -mkdir build-release +mkdir -p build-release cd build-release -export CC="$ZIG cc -target $TARGET -mcpu=$MCPU" -export CXX="$ZIG c++ -target $TARGET -mcpu=$MCPU" - cmake .. \ -DCMAKE_INSTALL_PREFIX="stage3-release" \ -DCMAKE_PREFIX_PATH="$PREFIX" \ -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_C_COMPILER="$ZIG;cc;-target;$TARGET;-mcpu=$MCPU" \ + -DCMAKE_CXX_COMPILER="$ZIG;c++;-target;$TARGET;-mcpu=$MCPU" \ -DZIG_TARGET_TRIPLE="$TARGET" \ -DZIG_TARGET_MCPU="$MCPU" \ -DZIG_STATIC=ON \ -DZIG_NO_LIB=ON \ -GNinja -# Now cmake will use zig as the C/C++ compiler. We reset the environment variables -# so that installation and testing do not get affected by them. -unset CC -unset CXX - ninja install # Must be done after zig cc is finished. @@ -58,6 +54,7 @@ stage3-release/bin/zig build \ -Doptimize=ReleaseFast \ -Dstrip \ -Dtarget=$TARGET \ + -Dcpu=$MCPU \ -Duse-zig-libcxx \ -Dversion-string="$(stage3-release/bin/zig version)" diff --git a/ci/aarch64-openbsd-debug.sh b/ci/aarch64-openbsd-debug.sh index 6b38cd7d208a7d7119892acd64bfe5285656fa3b..ccb691a1f1385cafe025440f6e9b6b60d3e475c9 100755 --- a/ci/aarch64-openbsd-debug.sh +++ b/ci/aarch64-openbsd-debug.sh @@ -11,33 +11,29 @@ CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.17.0-dev.2030+f955266cf" PREFIX="$HOME/deps/$CACHE_BASENAME" ZIG="$PREFIX/bin/zig" +export PATH="$HOME/local/bin:$PATH" + # Override the cache directories because they won't actually help other CI runs # which will be testing alternate versions of zig, and ultimately would just # fill up space on the hard drive for no reason. export ZIG_GLOBAL_CACHE_DIR="$PWD/zig-global-cache" export ZIG_LOCAL_CACHE_DIR="$PWD/zig-local-cache" -mkdir build-debug +mkdir -p build-debug cd build-debug -export CC="$ZIG cc -target $TARGET -mcpu=$MCPU" -export CXX="$ZIG c++ -target $TARGET -mcpu=$MCPU" - cmake .. \ -DCMAKE_INSTALL_PREFIX="stage3-debug" \ -DCMAKE_PREFIX_PATH="$PREFIX" \ -DCMAKE_BUILD_TYPE=Debug \ + -DCMAKE_C_COMPILER="$ZIG;cc;-target;$TARGET;-mcpu=$MCPU" \ + -DCMAKE_CXX_COMPILER="$ZIG;c++;-target;$TARGET;-mcpu=$MCPU" \ -DZIG_TARGET_TRIPLE="$TARGET" \ -DZIG_TARGET_MCPU="$MCPU" \ -DZIG_STATIC=ON \ -DZIG_NO_LIB=ON \ -GNinja -# Now cmake will use zig as the C/C++ compiler. We reset the environment variables -# so that installation and testing do not get affected by them. -unset CC -unset CXX - ninja install # Must be done after zig cc is finished. @@ -55,6 +51,7 @@ stage3-debug/bin/zig build \ -Denable-llvm \ -Dno-lib \ -Dtarget=$TARGET \ + -Dcpu=$MCPU \ -Duse-zig-libcxx \ -Dversion-string="$(stage3-debug/bin/zig version)" diff --git a/ci/aarch64-openbsd-release.sh b/ci/aarch64-openbsd-release.sh index 36b8a529e3faa9aae592d2e8aa68501f62f5e9fb..fc48ea7ec563a8ce10797c8a07cfc28fa6df674a 100755 --- a/ci/aarch64-openbsd-release.sh +++ b/ci/aarch64-openbsd-release.sh @@ -11,33 +11,29 @@ CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.17.0-dev.2030+f955266cf" PREFIX="$HOME/deps/$CACHE_BASENAME" ZIG="$PREFIX/bin/zig" +export PATH="$HOME/local/bin:$PATH" + # Override the cache directories because they won't actually help other CI runs # which will be testing alternate versions of zig, and ultimately would just # fill up space on the hard drive for no reason. export ZIG_GLOBAL_CACHE_DIR="$PWD/zig-global-cache" export ZIG_LOCAL_CACHE_DIR="$PWD/zig-local-cache" -mkdir build-release +mkdir -p build-release cd build-release -export CC="$ZIG cc -target $TARGET -mcpu=$MCPU" -export CXX="$ZIG c++ -target $TARGET -mcpu=$MCPU" - cmake .. \ -DCMAKE_INSTALL_PREFIX="stage3-release" \ -DCMAKE_PREFIX_PATH="$PREFIX" \ -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_C_COMPILER="$ZIG;cc;-target;$TARGET;-mcpu=$MCPU" \ + -DCMAKE_CXX_COMPILER="$ZIG;c++;-target;$TARGET;-mcpu=$MCPU" \ -DZIG_TARGET_TRIPLE="$TARGET" \ -DZIG_TARGET_MCPU="$MCPU" \ -DZIG_STATIC=ON \ -DZIG_NO_LIB=ON \ -GNinja -# Now cmake will use zig as the C/C++ compiler. We reset the environment variables -# so that installation and testing do not get affected by them. -unset CC -unset CXX - ninja install # Must be done after zig cc is finished. @@ -63,6 +59,7 @@ stage3-release/bin/zig build \ -Doptimize=ReleaseFast \ -Dstrip \ -Dtarget=$TARGET \ + -Dcpu=$MCPU \ -Duse-zig-libcxx \ -Dversion-string="$(stage3-release/bin/zig version)" diff --git a/ci/aarch64-windows-debug.ps1 b/ci/aarch64-windows-debug.ps1 new file mode 100644 index 0000000000000000000000000000000000000000..c5232c8d06ecfa139bfeadce1f2a8c6b30c56381 --- /dev/null +++ b/ci/aarch64-windows-debug.ps1 @@ -0,0 +1,72 @@ +$TARGET = "aarch64-windows-gnu" +$MCPU = "baseline" +$PREFIX_PATH = "$($Env:USERPROFILE)\deps\zig+llvm+lld+clang-$TARGET-0.17.0-dev.203+073889523" +$ZIG = "$PREFIX_PATH\bin\zig.exe" +$ZSF_MAX_RSS = if ($Env:ZSF_MAX_RSS) { $Env:ZSF_MAX_RSS } else { 0 } + +$Env:PATH = "$($Env:USERPROFILE)\local\bin;$Env:PATH" + +function CheckLastExitCode { + if (!$?) { + exit 1 + } + return 0 +} + +# Override the cache directories because they won't actually help other CI runs +# which will be testing alternate versions of zig, and ultimately would just +# fill up space on the hard drive for no reason. +$Env:ZIG_GLOBAL_CACHE_DIR="$(Get-Location)\zig-global-cache" +$Env:ZIG_LOCAL_CACHE_DIR="$(Get-Location)\zig-local-cache" + +Write-Output "Building from source..." +New-Item -Force -Path 'build-debug' -ItemType Directory +Set-Location -Path 'build-debug' + +# CMake gives a syntax error when file paths with backward slashes are used. +# Here, we use forward slashes only to work around this. +cmake .. ` + -GNinja ` + -DCMAKE_INSTALL_PREFIX="stage3-debug" ` + -DCMAKE_PREFIX_PATH="$($PREFIX_PATH -Replace "\\", "/")" ` + -DCMAKE_BUILD_TYPE=Debug ` + -DCMAKE_C_COMPILER="$($ZIG -Replace "\\", "/");cc;-target;$TARGET;-mcpu=$MCPU" ` + -DCMAKE_CXX_COMPILER="$($ZIG -Replace "\\", "/");c++;-target;$TARGET;-mcpu=$MCPU" ` + -DCMAKE_AR="$($ZIG -Replace "\\", "/")" ` + -DZIG_AR_WORKAROUND=ON ` + -DZIG_TARGET_TRIPLE="$TARGET" ` + -DZIG_TARGET_MCPU="$MCPU" ` + -DZIG_STATIC=ON ` + -DZIG_NO_LIB=ON +CheckLastExitCode + +ninja install +CheckLastExitCode + +# Must be done after zig cc is finished. +$Env:ZIG_LIB_DIR="$(Get-Location)\..\lib" + +Write-Output "Main test suite..." +stage3-debug\bin\zig.exe build test docs ` + --maxrss $ZSF_MAX_RSS ` + --search-prefix "$PREFIX_PATH" ` + -Dstatic-llvm ` + -Dskip-non-native ` + -Denable-symlinks-windows ` + --test-timeout 30m +CheckLastExitCode + +Write-Output "Build and test stage4..." +stage3-debug\bin\zig.exe build ` + --prefix stage4-debug ` + -Denable-llvm ` + -Dno-lib ` + -Doptimize=Debug ` + -Dtarget="$TARGET" ` + -Dcpu="$MCPU" ` + -Duse-zig-libcxx ` + -Dversion-string="$(stage3-debug\bin\zig.exe version)" +CheckLastExitCode + +stage4-debug\bin\zig.exe test ..\test\behavior.zig +CheckLastExitCode diff --git a/ci/aarch64-windows-release.ps1 b/ci/aarch64-windows-release.ps1 new file mode 100644 index 0000000000000000000000000000000000000000..26b95dfc2e60a518431dd9c214594623a1efd3b4 --- /dev/null +++ b/ci/aarch64-windows-release.ps1 @@ -0,0 +1,84 @@ +$TARGET = "aarch64-windows-gnu" +$MCPU = "baseline" +$PREFIX_PATH = "$($Env:USERPROFILE)\deps\zig+llvm+lld+clang-$TARGET-0.17.0-dev.203+073889523" +$ZIG = "$PREFIX_PATH\bin\zig.exe" +$ZSF_MAX_RSS = if ($Env:ZSF_MAX_RSS) { $Env:ZSF_MAX_RSS } else { 0 } + +$Env:PATH = "$($Env:USERPROFILE)\local\bin;$Env:PATH" + +function CheckLastExitCode { + if (!$?) { + exit 1 + } + return 0 +} + +# Override the cache directories because they won't actually help other CI runs +# which will be testing alternate versions of zig, and ultimately would just +# fill up space on the hard drive for no reason. +$Env:ZIG_GLOBAL_CACHE_DIR="$(Get-Location)\zig-global-cache" +$Env:ZIG_LOCAL_CACHE_DIR="$(Get-Location)\zig-local-cache" + +Write-Output "Building from source..." +New-Item -Force -Path 'build-release' -ItemType Directory +Set-Location -Path 'build-release' + +# CMake gives a syntax error when file paths with backward slashes are used. +# Here, we use forward slashes only to work around this. +cmake .. ` + -GNinja ` + -DCMAKE_INSTALL_PREFIX="stage3-release" ` + -DCMAKE_PREFIX_PATH="$($PREFIX_PATH -Replace "\\", "/")" ` + -DCMAKE_BUILD_TYPE=Release ` + -DCMAKE_C_COMPILER="$($ZIG -Replace "\\", "/");cc;-target;$TARGET;-mcpu=$MCPU" ` + -DCMAKE_CXX_COMPILER="$($ZIG -Replace "\\", "/");c++;-target;$TARGET;-mcpu=$MCPU" ` + -DCMAKE_AR="$($ZIG -Replace "\\", "/")" ` + -DZIG_AR_WORKAROUND=ON ` + -DZIG_TARGET_TRIPLE="$TARGET" ` + -DZIG_TARGET_MCPU="$MCPU" ` + -DZIG_STATIC=ON ` + -DZIG_NO_LIB=ON +CheckLastExitCode + +ninja install +CheckLastExitCode + +# Must be done after zig cc is finished. +$Env:ZIG_LIB_DIR="$(Get-Location)\..\lib" + +Write-Output "Main test suite..." +stage3-release\bin\zig.exe build test docs ` + --maxrss $ZSF_MAX_RSS ` + --search-prefix "$PREFIX_PATH" ` + -Dstatic-llvm ` + -Dskip-non-native ` + -Denable-symlinks-windows ` + --test-timeout 30m +CheckLastExitCode + +# Ensure that the fuzzer at least compiles. +# https://codeberg.org/ziglang/zig/issues/31893 +# stage3-release\bin\zig.exe build test-std --fuzz=1K -Dno-lib -Dfuzz-only -Doptimize=ReleaseSafe +# CheckLastExitCode +# stage3-release\bin\zig.exe build test-std --fuzz=1K -Dno-lib -Dfuzz-only -Doptimize=Debug +# CheckLastExitCode + +# Ensure that stage3 and stage4 are byte-for-byte identical. +Write-Output "Build and compare stage4..." +stage3-release\bin\zig.exe build ` + --prefix stage4-release ` + -Denable-llvm ` + -Dno-lib ` + -Doptimize=ReleaseFast ` + -Dstrip ` + -Dtarget="$TARGET" ` + -Dcpu="$MCPU" ` + -Duse-zig-libcxx ` + -Dversion-string="$(stage3-release\bin\zig.exe version)" +CheckLastExitCode + +# Compare-Object returns an error code if the files differ. +Write-Output "If the following command fails, it means nondeterminism has been" +Write-Output "introduced, making stage3 and stage4 no longer byte-for-byte identical." +Compare-Object (Get-Content stage3-release\bin\zig.exe) (Get-Content stage4-release\bin\zig.exe) +CheckLastExitCode diff --git a/ci/aarch64-windows.ps1 b/ci/aarch64-windows.ps1 deleted file mode 100644 index 3268dfd1e4eec456d247780beab3ae2542eb6897..0000000000000000000000000000000000000000 --- a/ci/aarch64-windows.ps1 +++ /dev/null @@ -1,85 +0,0 @@ -$TARGET = "aarch64-windows-gnu" -$ZIG_LLVM_CLANG_LLD_NAME = "zig+llvm+lld+clang-$TARGET-0.17.0-dev.203+073889523" -$MCPU = "baseline" -$ZIG_LLVM_CLANG_LLD_URL = "https://ziglang.org/deps/$ZIG_LLVM_CLANG_LLD_NAME.zip" -$PREFIX_PATH = "$(Get-Location)\..\$ZIG_LLVM_CLANG_LLD_NAME" -$ZIG = "$PREFIX_PATH\bin\zig.exe" -$ZSF_MAX_RSS = if ($Env:ZSF_MAX_RSS) { $Env:ZSF_MAX_RSS } else { 0 } - -if (!(Test-Path "..\$ZIG_LLVM_CLANG_LLD_NAME.zip")) { - Write-Output "Downloading $ZIG_LLVM_CLANG_LLD_URL" - Invoke-WebRequest -Uri "$ZIG_LLVM_CLANG_LLD_URL" -OutFile "..\$ZIG_LLVM_CLANG_LLD_NAME.zip" - - Write-Output "Extracting..." - Add-Type -AssemblyName System.IO.Compression.FileSystem ; - [System.IO.Compression.ZipFile]::ExtractToDirectory("$PWD\..\$ZIG_LLVM_CLANG_LLD_NAME.zip", "$PWD\..") -} - -function CheckLastExitCode { - if (!$?) { - exit 1 - } - return 0 -} - -# Override the cache directories because they won't actually help other CI runs -# which will be testing alternate versions of zig, and ultimately would just -# fill up space on the hard drive for no reason. -$Env:ZIG_GLOBAL_CACHE_DIR="$(Get-Location)\zig-global-cache" -$Env:ZIG_LOCAL_CACHE_DIR="$(Get-Location)\zig-local-cache" - -Write-Output "Building from source..." -New-Item -Path 'build-release' -ItemType Directory -Set-Location -Path 'build-release' - -# CMake gives a syntax error when file paths with backward slashes are used. -# Here, we use forward slashes only to work around this. -& cmake .. ` - -GNinja ` - -DCMAKE_INSTALL_PREFIX="stage3-release" ` - -DCMAKE_PREFIX_PATH="$($PREFIX_PATH -Replace "\\", "/")" ` - -DCMAKE_BUILD_TYPE=Release ` - -DCMAKE_C_COMPILER="$($ZIG -Replace "\\", "/");cc;-target;$TARGET;-mcpu=$MCPU" ` - -DCMAKE_CXX_COMPILER="$($ZIG -Replace "\\", "/");c++;-target;$TARGET;-mcpu=$MCPU" ` - -DCMAKE_AR="$ZIG" ` - -DZIG_AR_WORKAROUND=ON ` - -DZIG_TARGET_TRIPLE="$TARGET" ` - -DZIG_TARGET_MCPU="$MCPU" ` - -DZIG_STATIC=ON ` - -DZIG_NO_LIB=ON -CheckLastExitCode - -ninja install -CheckLastExitCode - -# Must be done after zig cc is finished. -$Env:ZIG_LIB_DIR="$(Get-Location)\..\lib" - -Write-Output "Main test suite..." -& "stage3-release\bin\zig.exe" build test docs ` - --maxrss $ZSF_MAX_RSS ` - --search-prefix "$PREFIX_PATH" ` - -Dstatic-llvm ` - -Dskip-non-native ` - -Denable-symlinks-windows ` - --test-timeout 30m -CheckLastExitCode - -# Ensure that stage3 and stage4 are byte-for-byte identical. -Write-Output "Build and compare stage4..." -& "stage3-release\bin\zig.exe" build ` - --prefix stage4-release ` - -Denable-llvm ` - -Dno-lib ` - -Doptimize=ReleaseFast ` - -Dstrip ` - -Dtarget="$TARGET" ` - -Duse-zig-libcxx ` - -Dversion-string="$(stage3-release\bin\zig version)" -CheckLastExitCode - -# Compare-Object returns an error code if the files differ. -Write-Output "If the following command fails, it means nondeterminism has been" -Write-Output "introduced, making stage3 and stage4 no longer byte-for-byte identical." -Compare-Object (Get-Content stage3-release\bin\zig.exe) (Get-Content stage4-release\bin\zig.exe) -CheckLastExitCode diff --git a/ci/loongarch64-linux-debug.sh b/ci/loongarch64-linux-debug.sh index b3460be8fe4585bda04f9702c6d666dcf47949c5..1975fb7993679910e0b5f16e5064c8c3466546dc 100755 --- a/ci/loongarch64-linux-debug.sh +++ b/ci/loongarch64-linux-debug.sh @@ -11,39 +11,34 @@ CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.17.0-dev.203+073889523" PREFIX="$HOME/deps/$CACHE_BASENAME" ZIG="$PREFIX/bin/zig" +export PATH="$HOME/local/bin:$PATH" + # Override the cache directories because they won't actually help other CI runs # which will be testing alternate versions of zig, and ultimately would just # fill up space on the hard drive for no reason. export ZIG_GLOBAL_CACHE_DIR="$PWD/zig-global-cache" export ZIG_LOCAL_CACHE_DIR="$PWD/zig-local-cache" -mkdir build-debug +mkdir -p build-debug cd build-debug -export CC="$ZIG cc -target $TARGET -mcpu=$MCPU" -export CXX="$ZIG c++ -target $TARGET -mcpu=$MCPU" - cmake .. \ -DCMAKE_INSTALL_PREFIX="stage3-debug" \ -DCMAKE_PREFIX_PATH="$PREFIX" \ -DCMAKE_BUILD_TYPE=Debug \ + -DCMAKE_C_COMPILER="$ZIG;cc;-target;$TARGET;-mcpu=$MCPU" \ + -DCMAKE_CXX_COMPILER="$ZIG;c++;-target;$TARGET;-mcpu=$MCPU" \ -DZIG_TARGET_TRIPLE="$TARGET" \ -DZIG_TARGET_MCPU="$MCPU" \ -DZIG_STATIC=ON \ -DZIG_NO_LIB=ON \ -GNinja -# Now cmake will use zig as the C/C++ compiler. We reset the environment variables -# so that installation and testing do not get affected by them. -unset CC -unset CXX - ninja install # Must be done after zig cc is finished. export ZIG_LIB_DIR="$PWD/../lib" -# No -fqemu and -fwasmtime here as they're covered by the x86_64-linux scripts. stage3-debug/bin/zig build test docs \ --maxrss ${ZSF_MAX_RSS:-0} \ -Dstatic-llvm \ @@ -57,6 +52,7 @@ stage3-debug/bin/zig build \ -Denable-llvm \ -Dno-lib \ -Dtarget=$TARGET \ + -Dcpu=$MCPU \ -Duse-zig-libcxx \ -Dversion-string="$(stage3-debug/bin/zig version)" diff --git a/ci/loongarch64-linux-release.sh b/ci/loongarch64-linux-release.sh index 4c1451a09003a53cde93328d34aad08c7de272f0..8f983b6d3a2add3a8faca73691a1327813175eb0 100755 --- a/ci/loongarch64-linux-release.sh +++ b/ci/loongarch64-linux-release.sh @@ -11,39 +11,34 @@ CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.17.0-dev.203+073889523" PREFIX="$HOME/deps/$CACHE_BASENAME" ZIG="$PREFIX/bin/zig" +export PATH="$HOME/local/bin:$PATH" + # Override the cache directories because they won't actually help other CI runs # which will be testing alternate versions of zig, and ultimately would just # fill up space on the hard drive for no reason. export ZIG_GLOBAL_CACHE_DIR="$PWD/zig-global-cache" export ZIG_LOCAL_CACHE_DIR="$PWD/zig-local-cache" -mkdir build-release +mkdir -p build-release cd build-release -export CC="$ZIG cc -target $TARGET -mcpu=$MCPU" -export CXX="$ZIG c++ -target $TARGET -mcpu=$MCPU" - cmake .. \ -DCMAKE_INSTALL_PREFIX="stage3-release" \ -DCMAKE_PREFIX_PATH="$PREFIX" \ -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_C_COMPILER="$ZIG;cc;-target;$TARGET;-mcpu=$MCPU" \ + -DCMAKE_CXX_COMPILER="$ZIG;c++;-target;$TARGET;-mcpu=$MCPU" \ -DZIG_TARGET_TRIPLE="$TARGET" \ -DZIG_TARGET_MCPU="$MCPU" \ -DZIG_STATIC=ON \ -DZIG_NO_LIB=ON \ -GNinja -# Now cmake will use zig as the C/C++ compiler. We reset the environment variables -# so that installation and testing do not get affected by them. -unset CC -unset CXX - ninja install # Must be done after zig cc is finished. export ZIG_LIB_DIR="$PWD/../lib" -# No -fqemu and -fwasmtime here as they're covered by the x86_64-linux scripts. stage3-release/bin/zig build test docs \ --maxrss ${ZSF_MAX_RSS:-0} \ -Dstatic-llvm \ @@ -60,6 +55,7 @@ stage3-release/bin/zig build \ -Doptimize=ReleaseFast \ -Dstrip \ -Dtarget=$TARGET \ + -Dcpu=$MCPU \ -Duse-zig-libcxx \ -Dversion-string="$(stage3-release/bin/zig version)" diff --git a/ci/powerpc64le-linux-debug.sh b/ci/powerpc64le-linux-debug.sh index 442a7a03c3637b95249b4273469348a418b784ce..ff7143c296c0dd8c722570ccd19aa0c387a96083 100755 --- a/ci/powerpc64le-linux-debug.sh +++ b/ci/powerpc64le-linux-debug.sh @@ -11,39 +11,34 @@ CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.17.0-dev.203+073889523" PREFIX="$HOME/deps/$CACHE_BASENAME" ZIG="$PREFIX/bin/zig" +export PATH="$HOME/local/bin:$PATH" + # Override the cache directories because they won't actually help other CI runs # which will be testing alternate versions of zig, and ultimately would just # fill up space on the hard drive for no reason. export ZIG_GLOBAL_CACHE_DIR="$PWD/zig-global-cache" export ZIG_LOCAL_CACHE_DIR="$PWD/zig-local-cache" -mkdir build-debug +mkdir -p build-debug cd build-debug -export CC="$ZIG cc -target $TARGET -mcpu=$MCPU" -export CXX="$ZIG c++ -target $TARGET -mcpu=$MCPU" - cmake .. \ -DCMAKE_INSTALL_PREFIX="stage3-debug" \ -DCMAKE_PREFIX_PATH="$PREFIX" \ -DCMAKE_BUILD_TYPE=Debug \ + -DCMAKE_C_COMPILER="$ZIG;cc;-target;$TARGET;-mcpu=$MCPU" \ + -DCMAKE_CXX_COMPILER="$ZIG;c++;-target;$TARGET;-mcpu=$MCPU" \ -DZIG_TARGET_TRIPLE="$TARGET" \ -DZIG_TARGET_MCPU="$MCPU" \ -DZIG_STATIC=ON \ -DZIG_NO_LIB=ON \ -GNinja -# Now cmake will use zig as the C/C++ compiler. We reset the environment variables -# so that installation and testing do not get affected by them. -unset CC -unset CXX - ninja install # Must be done after zig cc is finished. export ZIG_LIB_DIR="$PWD/../lib" -# No -fqemu and -fwasmtime here as they're covered by the x86_64-linux scripts. stage3-debug/bin/zig build test docs \ --maxrss ${ZSF_MAX_RSS:-0} \ -Dstatic-llvm \ diff --git a/ci/powerpc64le-linux-release.sh b/ci/powerpc64le-linux-release.sh index c03c1504febc9e8039a74781c091fc999dd5d9e8..527265cc67a6aad1aefc2a3a7828e9c00e7577a5 100755 --- a/ci/powerpc64le-linux-release.sh +++ b/ci/powerpc64le-linux-release.sh @@ -11,39 +11,34 @@ CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.17.0-dev.203+073889523" PREFIX="$HOME/deps/$CACHE_BASENAME" ZIG="$PREFIX/bin/zig" +export PATH="$HOME/local/bin:$PATH" + # Override the cache directories because they won't actually help other CI runs # which will be testing alternate versions of zig, and ultimately would just # fill up space on the hard drive for no reason. export ZIG_GLOBAL_CACHE_DIR="$PWD/zig-global-cache" export ZIG_LOCAL_CACHE_DIR="$PWD/zig-local-cache" -mkdir build-release +mkdir -p build-release cd build-release -export CC="$ZIG cc -target $TARGET -mcpu=$MCPU" -export CXX="$ZIG c++ -target $TARGET -mcpu=$MCPU" - cmake .. \ -DCMAKE_INSTALL_PREFIX="stage3-release" \ -DCMAKE_PREFIX_PATH="$PREFIX" \ -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_C_COMPILER="$ZIG;cc;-target;$TARGET;-mcpu=$MCPU" \ + -DCMAKE_CXX_COMPILER="$ZIG;c++;-target;$TARGET;-mcpu=$MCPU" \ -DZIG_TARGET_TRIPLE="$TARGET" \ -DZIG_TARGET_MCPU="$MCPU" \ -DZIG_STATIC=ON \ -DZIG_NO_LIB=ON \ -GNinja -# Now cmake will use zig as the C/C++ compiler. We reset the environment variables -# so that installation and testing do not get affected by them. -unset CC -unset CXX - ninja install # Must be done after zig cc is finished. export ZIG_LIB_DIR="$PWD/../lib" -# No -fqemu and -fwasmtime here as they're covered by the x86_64-linux scripts. stage3-release/bin/zig build test docs \ --maxrss ${ZSF_MAX_RSS:-0} \ -Dstatic-llvm \ diff --git a/ci/riscv64-linux-debug.sh b/ci/riscv64-linux-debug.sh index 1885782df8f202b2dbe096d178ab447ed5783910..20ce6c572bd0a3e3d42369f3f6d999e06dded3ff 100755 --- a/ci/riscv64-linux-debug.sh +++ b/ci/riscv64-linux-debug.sh @@ -11,39 +11,34 @@ CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.17.0-dev.203+073889523" PREFIX="$HOME/deps/$CACHE_BASENAME" ZIG="$PREFIX/bin/zig" +export PATH="$HOME/local/bin:$PATH" + # Override the cache directories because they won't actually help other CI runs # which will be testing alternate versions of zig, and ultimately would just # fill up space on the hard drive for no reason. export ZIG_GLOBAL_CACHE_DIR="$PWD/zig-global-cache" export ZIG_LOCAL_CACHE_DIR="$PWD/zig-local-cache" -mkdir build-debug +mkdir -p build-debug cd build-debug -export CC="$ZIG cc -target $TARGET -mcpu=$MCPU" -export CXX="$ZIG c++ -target $TARGET -mcpu=$MCPU" - cmake .. \ -DCMAKE_INSTALL_PREFIX="stage3-debug" \ -DCMAKE_PREFIX_PATH="$PREFIX" \ -DCMAKE_BUILD_TYPE=Debug \ + -DCMAKE_C_COMPILER="$ZIG;cc;-target;$TARGET;-mcpu=$MCPU" \ + -DCMAKE_CXX_COMPILER="$ZIG;c++;-target;$TARGET;-mcpu=$MCPU" \ -DZIG_TARGET_TRIPLE="$TARGET" \ -DZIG_TARGET_MCPU="$MCPU" \ -DZIG_STATIC=ON \ -DZIG_NO_LIB=ON \ -GNinja -# Now cmake will use zig as the C/C++ compiler. We reset the environment variables -# so that installation and testing do not get affected by them. -unset CC -unset CXX - ninja install # Must be done after zig cc is finished. export ZIG_LIB_DIR="$PWD/../lib" -# No -fqemu and -fwasmtime here as they're covered by the x86_64-linux scripts. stage3-debug/bin/zig build test docs \ --maxrss ${ZSF_MAX_RSS:-0} \ -Dstatic-llvm \ @@ -57,6 +52,7 @@ stage3-debug/bin/zig build \ -Denable-llvm \ -Dno-lib \ -Dtarget=$TARGET \ + -Dcpu=$MCPU \ -Duse-zig-libcxx \ -Dversion-string="$(stage3-debug/bin/zig version)" diff --git a/ci/riscv64-linux-release.sh b/ci/riscv64-linux-release.sh index 396cfac90ba6d626c41e40f9842462a2e81456c4..b1096e935b674c0eaffb4ebfd461094439a2cd45 100755 --- a/ci/riscv64-linux-release.sh +++ b/ci/riscv64-linux-release.sh @@ -11,39 +11,34 @@ CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.17.0-dev.203+073889523" PREFIX="$HOME/deps/$CACHE_BASENAME" ZIG="$PREFIX/bin/zig" +export PATH="$HOME/local/bin:$PATH" + # Override the cache directories because they won't actually help other CI runs # which will be testing alternate versions of zig, and ultimately would just # fill up space on the hard drive for no reason. export ZIG_GLOBAL_CACHE_DIR="$PWD/zig-global-cache" export ZIG_LOCAL_CACHE_DIR="$PWD/zig-local-cache" -mkdir build-release +mkdir -p build-release cd build-release -export CC="$ZIG cc -target $TARGET -mcpu=$MCPU" -export CXX="$ZIG c++ -target $TARGET -mcpu=$MCPU" - cmake .. \ -DCMAKE_INSTALL_PREFIX="stage3-release" \ -DCMAKE_PREFIX_PATH="$PREFIX" \ -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_C_COMPILER="$ZIG;cc;-target;$TARGET;-mcpu=$MCPU" \ + -DCMAKE_CXX_COMPILER="$ZIG;c++;-target;$TARGET;-mcpu=$MCPU" \ -DZIG_TARGET_TRIPLE="$TARGET" \ -DZIG_TARGET_MCPU="$MCPU" \ -DZIG_STATIC=ON \ -DZIG_NO_LIB=ON \ -GNinja -# Now cmake will use zig as the C/C++ compiler. We reset the environment variables -# so that installation and testing do not get affected by them. -unset CC -unset CXX - ninja install # Must be done after zig cc is finished. export ZIG_LIB_DIR="$PWD/../lib" -# No -fqemu and -fwasmtime here as they're covered by the x86_64-linux scripts. stage3-release/bin/zig build test docs \ --maxrss ${ZSF_MAX_RSS:-0} \ -Dstatic-llvm \ @@ -60,6 +55,7 @@ stage3-release/bin/zig build \ -Doptimize=ReleaseFast \ -Dstrip \ -Dtarget=$TARGET \ + -Dcpu=$MCPU \ -Duse-zig-libcxx \ -Dversion-string="$(stage3-release/bin/zig version)" diff --git a/ci/s390x-linux-debug.sh b/ci/s390x-linux-debug.sh index 3d97f9c1650189ae1f105553257dd692e94f818d..872ae25d161d021e1d5b3f275c7d70f17bfd1eb0 100755 --- a/ci/s390x-linux-debug.sh +++ b/ci/s390x-linux-debug.sh @@ -11,39 +11,34 @@ CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.17.0-dev.203+073889523" PREFIX="$HOME/deps/$CACHE_BASENAME" ZIG="$PREFIX/bin/zig" +export PATH="$HOME/local/bin:$PATH" + # Override the cache directories because they won't actually help other CI runs # which will be testing alternate versions of zig, and ultimately would just # fill up space on the hard drive for no reason. export ZIG_GLOBAL_CACHE_DIR="$PWD/zig-global-cache" export ZIG_LOCAL_CACHE_DIR="$PWD/zig-local-cache" -mkdir build-debug +mkdir -p build-debug cd build-debug -export CC="$ZIG cc -target $TARGET -mcpu=$MCPU" -export CXX="$ZIG c++ -target $TARGET -mcpu=$MCPU" - cmake .. \ -DCMAKE_INSTALL_PREFIX="stage3-debug" \ -DCMAKE_PREFIX_PATH="$PREFIX" \ -DCMAKE_BUILD_TYPE=Debug \ + -DCMAKE_C_COMPILER="$ZIG;cc;-target;$TARGET;-mcpu=$MCPU" \ + -DCMAKE_CXX_COMPILER="$ZIG;c++;-target;$TARGET;-mcpu=$MCPU" \ -DZIG_TARGET_TRIPLE="$TARGET" \ -DZIG_TARGET_MCPU="$MCPU" \ -DZIG_STATIC=ON \ -DZIG_NO_LIB=ON \ -GNinja -# Now cmake will use zig as the C/C++ compiler. We reset the environment variables -# so that installation and testing do not get affected by them. -unset CC -unset CXX - ninja install # Must be done after zig cc is finished. export ZIG_LIB_DIR="$PWD/../lib" -# No -fqemu and -fwasmtime here as they're covered by the x86_64-linux scripts. stage3-debug/bin/zig build test docs \ --maxrss ${ZSF_MAX_RSS:-0} \ -Dstatic-llvm \ diff --git a/ci/s390x-linux-release.sh b/ci/s390x-linux-release.sh index a8c5a9fcb341bb616729c5ab792acff29ca3db02..7f025780506a5a0c5978ecc80133e574ad481ccd 100755 --- a/ci/s390x-linux-release.sh +++ b/ci/s390x-linux-release.sh @@ -11,39 +11,34 @@ CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.17.0-dev.203+073889523" PREFIX="$HOME/deps/$CACHE_BASENAME" ZIG="$PREFIX/bin/zig" +export PATH="$HOME/local/bin:$PATH" + # Override the cache directories because they won't actually help other CI runs # which will be testing alternate versions of zig, and ultimately would just # fill up space on the hard drive for no reason. export ZIG_GLOBAL_CACHE_DIR="$PWD/zig-global-cache" export ZIG_LOCAL_CACHE_DIR="$PWD/zig-local-cache" -mkdir build-release +mkdir -p build-release cd build-release -export CC="$ZIG cc -target $TARGET -mcpu=$MCPU" -export CXX="$ZIG c++ -target $TARGET -mcpu=$MCPU" - cmake .. \ -DCMAKE_INSTALL_PREFIX="stage3-release" \ -DCMAKE_PREFIX_PATH="$PREFIX" \ -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_C_COMPILER="$ZIG;cc;-target;$TARGET;-mcpu=$MCPU" \ + -DCMAKE_CXX_COMPILER="$ZIG;c++;-target;$TARGET;-mcpu=$MCPU" \ -DZIG_TARGET_TRIPLE="$TARGET" \ -DZIG_TARGET_MCPU="$MCPU" \ -DZIG_STATIC=ON \ -DZIG_NO_LIB=ON \ -GNinja -# Now cmake will use zig as the C/C++ compiler. We reset the environment variables -# so that installation and testing do not get affected by them. -unset CC -unset CXX - ninja install # Must be done after zig cc is finished. export ZIG_LIB_DIR="$PWD/../lib" -# No -fqemu and -fwasmtime here as they're covered by the x86_64-linux scripts. stage3-release/bin/zig build test docs \ --maxrss ${ZSF_MAX_RSS:-0} \ -Dstatic-llvm \ diff --git a/ci/x86_64-freebsd-debug.sh b/ci/x86_64-freebsd-debug.sh index 5266970f1c184067753df726fd8921b87fdd76be..ccb9a946c764589e46232610d9658d9b4e64aa00 100755 --- a/ci/x86_64-freebsd-debug.sh +++ b/ci/x86_64-freebsd-debug.sh @@ -11,33 +11,29 @@ CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.17.0-dev.203+073889523" PREFIX="$HOME/deps/$CACHE_BASENAME" ZIG="$PREFIX/bin/zig" +export PATH="$HOME/local/bin:$PATH" + # Override the cache directories because they won't actually help other CI runs # which will be testing alternate versions of zig, and ultimately would just # fill up space on the hard drive for no reason. export ZIG_GLOBAL_CACHE_DIR="$PWD/zig-global-cache" export ZIG_LOCAL_CACHE_DIR="$PWD/zig-local-cache" -mkdir build-debug +mkdir -p build-debug cd build-debug -export CC="$ZIG cc -target $TARGET -mcpu=$MCPU" -export CXX="$ZIG c++ -target $TARGET -mcpu=$MCPU" - cmake .. \ -DCMAKE_INSTALL_PREFIX="stage3-debug" \ -DCMAKE_PREFIX_PATH="$PREFIX" \ -DCMAKE_BUILD_TYPE=Debug \ + -DCMAKE_C_COMPILER="$ZIG;cc;-target;$TARGET;-mcpu=$MCPU" \ + -DCMAKE_CXX_COMPILER="$ZIG;c++;-target;$TARGET;-mcpu=$MCPU" \ -DZIG_TARGET_TRIPLE="$TARGET" \ -DZIG_TARGET_MCPU="$MCPU" \ -DZIG_STATIC=ON \ -DZIG_NO_LIB=ON \ -GNinja -# Now cmake will use zig as the C/C++ compiler. We reset the environment variables -# so that installation and testing do not get affected by them. -unset CC -unset CXX - ninja install # Must be done after zig cc is finished. @@ -55,6 +51,7 @@ stage3-debug/bin/zig build \ -Denable-llvm \ -Dno-lib \ -Dtarget=$TARGET \ + -Dcpu=$MCPU \ -Duse-zig-libcxx \ -Dversion-string="$(stage3-debug/bin/zig version)" diff --git a/ci/x86_64-freebsd-release.sh b/ci/x86_64-freebsd-release.sh index 9425420cc083a13cf9974640d239d2c65bf99b2f..ad6e2ab18583c5f134fcde5c02ee8c2c705ac31a 100755 --- a/ci/x86_64-freebsd-release.sh +++ b/ci/x86_64-freebsd-release.sh @@ -11,33 +11,29 @@ CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.17.0-dev.203+073889523" PREFIX="$HOME/deps/$CACHE_BASENAME" ZIG="$PREFIX/bin/zig" +export PATH="$HOME/local/bin:$PATH" + # Override the cache directories because they won't actually help other CI runs # which will be testing alternate versions of zig, and ultimately would just # fill up space on the hard drive for no reason. export ZIG_GLOBAL_CACHE_DIR="$PWD/zig-global-cache" export ZIG_LOCAL_CACHE_DIR="$PWD/zig-local-cache" -mkdir build-release +mkdir -p build-release cd build-release -export CC="$ZIG cc -target $TARGET -mcpu=$MCPU" -export CXX="$ZIG c++ -target $TARGET -mcpu=$MCPU" - cmake .. \ -DCMAKE_INSTALL_PREFIX="stage3-release" \ -DCMAKE_PREFIX_PATH="$PREFIX" \ -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_C_COMPILER="$ZIG;cc;-target;$TARGET;-mcpu=$MCPU" \ + -DCMAKE_CXX_COMPILER="$ZIG;c++;-target;$TARGET;-mcpu=$MCPU" \ -DZIG_TARGET_TRIPLE="$TARGET" \ -DZIG_TARGET_MCPU="$MCPU" \ -DZIG_STATIC=ON \ -DZIG_NO_LIB=ON \ -GNinja -# Now cmake will use zig as the C/C++ compiler. We reset the environment variables -# so that installation and testing do not get affected by them. -unset CC -unset CXX - ninja install # Must be done after zig cc is finished. @@ -62,6 +58,7 @@ stage3-release/bin/zig build \ -Doptimize=ReleaseFast \ -Dstrip \ -Dtarget=$TARGET \ + -Dcpu=$MCPU \ -Duse-zig-libcxx \ -Dversion-string="$(stage3-release/bin/zig version)" diff --git a/ci/x86_64-linux-debug-llvm.sh b/ci/x86_64-linux-debug-llvm.sh index 12beee8d9baebc901a55076e75fe9d1164f8c193..86709f28b79615d5e752922191d30a7541732455 100755 --- a/ci/x86_64-linux-debug-llvm.sh +++ b/ci/x86_64-linux-debug-llvm.sh @@ -19,16 +19,15 @@ export PATH="$HOME/deps/wasmtime-v46.0.1-x86_64-linux:$HOME/deps/qemu-linux-x86_ export ZIG_GLOBAL_CACHE_DIR="$PWD/zig-global-cache" export ZIG_LOCAL_CACHE_DIR="$PWD/zig-local-cache" -mkdir build-debug-llvm +mkdir -p build-debug-llvm cd build-debug-llvm -export CC="$ZIG cc -target $TARGET -mcpu=$MCPU" -export CXX="$ZIG c++ -target $TARGET -mcpu=$MCPU" - cmake .. \ -DCMAKE_INSTALL_PREFIX="stage3-debug" \ -DCMAKE_PREFIX_PATH="$PREFIX" \ -DCMAKE_BUILD_TYPE=Debug \ + -DCMAKE_C_COMPILER="$ZIG;cc;-target;$TARGET;-mcpu=$MCPU" \ + -DCMAKE_CXX_COMPILER="$ZIG;c++;-target;$TARGET;-mcpu=$MCPU" \ -DZIG_TARGET_TRIPLE="$TARGET" \ -DZIG_TARGET_MCPU="$MCPU" \ -DZIG_STATIC=ON \ @@ -36,11 +35,6 @@ cmake .. \ -DZIG_EXTRA_BUILD_ARGS="-Duse-llvm=true" \ -GNinja -# Now cmake will use zig as the C/C++ compiler. We reset the environment variables -# so that installation and testing do not get affected by them. -unset CC -unset CXX - ninja install # Must be done after zig cc is finished. @@ -75,6 +69,7 @@ stage3-debug/bin/zig build \ -Denable-llvm \ -Dno-lib \ -Dtarget=$TARGET \ + -Dcpu=$MCPU \ -Duse-zig-libcxx \ -Dversion-string="$(stage3-debug/bin/zig version)" diff --git a/ci/x86_64-linux-debug.sh b/ci/x86_64-linux-debug.sh index 79787d9cad274c9e06fd70e4527718bf70b4a7d6..3cdb7d7586693ffc18a4aaa4f6eb79961ccdc303 100755 --- a/ci/x86_64-linux-debug.sh +++ b/ci/x86_64-linux-debug.sh @@ -19,27 +19,21 @@ export PATH="$HOME/deps/wasmtime-v46.0.1-x86_64-linux:$HOME/deps/qemu-linux-x86_ export ZIG_GLOBAL_CACHE_DIR="$PWD/zig-global-cache" export ZIG_LOCAL_CACHE_DIR="$PWD/zig-local-cache" -mkdir build-debug +mkdir -p build-debug cd build-debug -export CC="$ZIG cc -target $TARGET -mcpu=$MCPU" -export CXX="$ZIG c++ -target $TARGET -mcpu=$MCPU" - cmake .. \ -DCMAKE_INSTALL_PREFIX="stage3-debug" \ -DCMAKE_PREFIX_PATH="$PREFIX" \ -DCMAKE_BUILD_TYPE=Debug \ + -DCMAKE_C_COMPILER="$ZIG;cc;-target;$TARGET;-mcpu=$MCPU" \ + -DCMAKE_CXX_COMPILER="$ZIG;c++;-target;$TARGET;-mcpu=$MCPU" \ -DZIG_TARGET_TRIPLE="$TARGET" \ -DZIG_TARGET_MCPU="$MCPU" \ -DZIG_STATIC=ON \ -DZIG_NO_LIB=ON \ -GNinja -# Now cmake will use zig as the C/C++ compiler. We reset the environment variables -# so that installation and testing do not get affected by them. -unset CC -unset CXX - ninja install # Must be done after zig cc is finished. @@ -74,6 +68,7 @@ stage3-debug/bin/zig build \ -Denable-llvm \ -Dno-lib \ -Dtarget=$TARGET \ + -Dcpu=$MCPU \ -Duse-zig-libcxx \ -Dversion-string="$(stage3-debug/bin/zig version)" diff --git a/ci/x86_64-linux-release.sh b/ci/x86_64-linux-release.sh index d8ac56e1af086d1ee298e2352cda71e1504443e9..ceb7ab6f2f0311c9ffbb342c11072d9748cc40fa 100755 --- a/ci/x86_64-linux-release.sh +++ b/ci/x86_64-linux-release.sh @@ -25,27 +25,21 @@ cc -o bootstrap bootstrap.c ./zig2 build -Dno-lib ./zig-out/bin/zig test test/behavior.zig -mkdir build-release +mkdir -p build-release cd build-release -export CC="$ZIG cc -target $TARGET -mcpu=$MCPU" -export CXX="$ZIG c++ -target $TARGET -mcpu=$MCPU" - cmake .. \ -DCMAKE_INSTALL_PREFIX="stage3-release" \ -DCMAKE_PREFIX_PATH="$PREFIX" \ -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_C_COMPILER="$ZIG;cc;-target;$TARGET;-mcpu=$MCPU" \ + -DCMAKE_CXX_COMPILER="$ZIG;c++;-target;$TARGET;-mcpu=$MCPU" \ -DZIG_TARGET_TRIPLE="$TARGET" \ -DZIG_TARGET_MCPU="$MCPU" \ -DZIG_STATIC=ON \ -DZIG_NO_LIB=ON \ -GNinja -# Now cmake will use zig as the C/C++ compiler. We reset the environment variables -# so that installation and testing do not get affected by them. -unset CC -unset CXX - ninja install # Must not be set while using the other `zig cc` which has its own zig lib dir. @@ -84,6 +78,7 @@ stage3-release/bin/zig build \ -Doptimize=ReleaseFast \ -Dstrip \ -Dtarget=$TARGET \ + -Dcpu=$MCPU \ -Duse-zig-libcxx \ -Dversion-string="$(stage3-release/bin/zig version)" @@ -94,27 +89,21 @@ diff stage3-release/bin/zig stage4-release/bin/zig # Ensure that updating the wasm binary from this commit will result in a viable build. stage3-release/bin/zig build update-zig1 -mkdir ../build-new +mkdir -p ../build-new cd ../build-new -export CC="$ZIG cc -target $TARGET -mcpu=$MCPU" -export CXX="$ZIG c++ -target $TARGET -mcpu=$MCPU" unset ZIG_LIB_DIR cmake .. \ -DCMAKE_PREFIX_PATH="$PREFIX" \ -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_C_COMPILER="$ZIG;cc;-target;$TARGET;-mcpu=$MCPU" \ + -DCMAKE_CXX_COMPILER="$ZIG;c++;-target;$TARGET;-mcpu=$MCPU" \ -DZIG_TARGET_TRIPLE="$TARGET" \ -DZIG_TARGET_MCPU="$MCPU" \ -DZIG_STATIC=ON \ -DZIG_NO_LIB=ON \ - -GNinja \ - -DCMAKE_C_LINKER_DEPFILE_SUPPORTED=FALSE \ - -DCMAKE_CXX_LINKER_DEPFILE_SUPPORTED=FALSE -# https://github.com/ziglang/zig/issues/22213 - -unset CC -unset CXX + -GNinja ninja install diff --git a/ci/x86_64-netbsd-debug.sh b/ci/x86_64-netbsd-debug.sh index ef16be259f9a5c692d63e094f974c81ee4e0e62d..1de7b01c6684a0505dbda291dde918235681d89d 100755 --- a/ci/x86_64-netbsd-debug.sh +++ b/ci/x86_64-netbsd-debug.sh @@ -11,33 +11,29 @@ CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.17.0-dev.203+073889523" PREFIX="$HOME/deps/$CACHE_BASENAME" ZIG="$PREFIX/bin/zig" +export PATH="$HOME/local/bin:$PATH" + # Override the cache directories because they won't actually help other CI runs # which will be testing alternate versions of zig, and ultimately would just # fill up space on the hard drive for no reason. export ZIG_GLOBAL_CACHE_DIR="$PWD/zig-global-cache" export ZIG_LOCAL_CACHE_DIR="$PWD/zig-local-cache" -mkdir build-debug +mkdir -p build-debug cd build-debug -export CC="$ZIG cc -target $TARGET -mcpu=$MCPU" -export CXX="$ZIG c++ -target $TARGET -mcpu=$MCPU" - cmake .. \ -DCMAKE_INSTALL_PREFIX="stage3-debug" \ -DCMAKE_PREFIX_PATH="$PREFIX" \ -DCMAKE_BUILD_TYPE=Debug \ + -DCMAKE_C_COMPILER="$ZIG;cc;-target;$TARGET;-mcpu=$MCPU" \ + -DCMAKE_CXX_COMPILER="$ZIG;c++;-target;$TARGET;-mcpu=$MCPU" \ -DZIG_TARGET_TRIPLE="$TARGET" \ -DZIG_TARGET_MCPU="$MCPU" \ -DZIG_STATIC=ON \ -DZIG_NO_LIB=ON \ -GNinja -# Now cmake will use zig as the C/C++ compiler. We reset the environment variables -# so that installation and testing do not get affected by them. -unset CC -unset CXX - ninja install # Must be done after zig cc is finished. @@ -55,6 +51,7 @@ stage3-debug/bin/zig build \ -Denable-llvm \ -Dno-lib \ -Dtarget=$TARGET \ + -Dcpu=$MCPU \ -Duse-zig-libcxx \ -Dversion-string="$(stage3-debug/bin/zig version)" diff --git a/ci/x86_64-netbsd-release.sh b/ci/x86_64-netbsd-release.sh index f9fc7d6aea7fa0ed44223544052dd084a06996fd..c3792943daec12e37b4cd5d4e9c040c919745f13 100755 --- a/ci/x86_64-netbsd-release.sh +++ b/ci/x86_64-netbsd-release.sh @@ -11,33 +11,29 @@ CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.17.0-dev.203+073889523" PREFIX="$HOME/deps/$CACHE_BASENAME" ZIG="$PREFIX/bin/zig" +export PATH="$HOME/local/bin:$PATH" + # Override the cache directories because they won't actually help other CI runs # which will be testing alternate versions of zig, and ultimately would just # fill up space on the hard drive for no reason. export ZIG_GLOBAL_CACHE_DIR="$PWD/zig-global-cache" export ZIG_LOCAL_CACHE_DIR="$PWD/zig-local-cache" -mkdir build-release +mkdir -p build-release cd build-release -export CC="$ZIG cc -target $TARGET -mcpu=$MCPU" -export CXX="$ZIG c++ -target $TARGET -mcpu=$MCPU" - cmake .. \ -DCMAKE_INSTALL_PREFIX="stage3-release" \ -DCMAKE_PREFIX_PATH="$PREFIX" \ -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_C_COMPILER="$ZIG;cc;-target;$TARGET;-mcpu=$MCPU" \ + -DCMAKE_CXX_COMPILER="$ZIG;c++;-target;$TARGET;-mcpu=$MCPU" \ -DZIG_TARGET_TRIPLE="$TARGET" \ -DZIG_TARGET_MCPU="$MCPU" \ -DZIG_STATIC=ON \ -DZIG_NO_LIB=ON \ -GNinja -# Now cmake will use zig as the C/C++ compiler. We reset the environment variables -# so that installation and testing do not get affected by them. -unset CC -unset CXX - ninja install # Must be done after zig cc is finished. @@ -62,6 +58,7 @@ stage3-release/bin/zig build \ -Doptimize=ReleaseFast \ -Dstrip \ -Dtarget=$TARGET \ + -Dcpu=$MCPU \ -Duse-zig-libcxx \ -Dversion-string="$(stage3-release/bin/zig version)" diff --git a/ci/x86_64-openbsd-debug.sh b/ci/x86_64-openbsd-debug.sh index 3aac9c636bc642dca609d562c6f721ce6cce8665..e28bf3a24fb95043b7124e933895bb0976c1a9c5 100755 --- a/ci/x86_64-openbsd-debug.sh +++ b/ci/x86_64-openbsd-debug.sh @@ -11,33 +11,29 @@ CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.17.0-dev.203+073889523" PREFIX="$HOME/deps/$CACHE_BASENAME" ZIG="$PREFIX/bin/zig" +export PATH="$HOME/local/bin:$PATH" + # Override the cache directories because they won't actually help other CI runs # which will be testing alternate versions of zig, and ultimately would just # fill up space on the hard drive for no reason. export ZIG_GLOBAL_CACHE_DIR="$PWD/zig-global-cache" export ZIG_LOCAL_CACHE_DIR="$PWD/zig-local-cache" -mkdir build-debug +mkdir -p build-debug cd build-debug -export CC="$ZIG cc -target $TARGET -mcpu=$MCPU" -export CXX="$ZIG c++ -target $TARGET -mcpu=$MCPU" - cmake .. \ -DCMAKE_INSTALL_PREFIX="stage3-debug" \ -DCMAKE_PREFIX_PATH="$PREFIX" \ -DCMAKE_BUILD_TYPE=Debug \ + -DCMAKE_C_COMPILER="$ZIG;cc;-target;$TARGET;-mcpu=$MCPU" \ + -DCMAKE_CXX_COMPILER="$ZIG;c++;-target;$TARGET;-mcpu=$MCPU" \ -DZIG_TARGET_TRIPLE="$TARGET" \ -DZIG_TARGET_MCPU="$MCPU" \ -DZIG_STATIC=ON \ -DZIG_NO_LIB=ON \ -GNinja -# Now cmake will use zig as the C/C++ compiler. We reset the environment variables -# so that installation and testing do not get affected by them. -unset CC -unset CXX - ninja install # Must be done after zig cc is finished. @@ -55,6 +51,7 @@ stage3-debug/bin/zig build \ -Denable-llvm \ -Dno-lib \ -Dtarget=$TARGET \ + -Dcpu=$MCPU \ -Duse-zig-libcxx \ -Dversion-string="$(stage3-debug/bin/zig version)" diff --git a/ci/x86_64-openbsd-release.sh b/ci/x86_64-openbsd-release.sh index 76dd9a8b9c0a41efe1a89a21a7125f56f6066d44..f5c62306120925ddd26bc3fa367bcd1246369d4b 100755 --- a/ci/x86_64-openbsd-release.sh +++ b/ci/x86_64-openbsd-release.sh @@ -11,33 +11,29 @@ CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.17.0-dev.203+073889523" PREFIX="$HOME/deps/$CACHE_BASENAME" ZIG="$PREFIX/bin/zig" +export PATH="$HOME/local/bin:$PATH" + # Override the cache directories because they won't actually help other CI runs # which will be testing alternate versions of zig, and ultimately would just # fill up space on the hard drive for no reason. export ZIG_GLOBAL_CACHE_DIR="$PWD/zig-global-cache" export ZIG_LOCAL_CACHE_DIR="$PWD/zig-local-cache" -mkdir build-release +mkdir -p build-release cd build-release -export CC="$ZIG cc -target $TARGET -mcpu=$MCPU" -export CXX="$ZIG c++ -target $TARGET -mcpu=$MCPU" - cmake .. \ -DCMAKE_INSTALL_PREFIX="stage3-release" \ -DCMAKE_PREFIX_PATH="$PREFIX" \ -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_C_COMPILER="$ZIG;cc;-target;$TARGET;-mcpu=$MCPU" \ + -DCMAKE_CXX_COMPILER="$ZIG;c++;-target;$TARGET;-mcpu=$MCPU" \ -DZIG_TARGET_TRIPLE="$TARGET" \ -DZIG_TARGET_MCPU="$MCPU" \ -DZIG_STATIC=ON \ -DZIG_NO_LIB=ON \ -GNinja -# Now cmake will use zig as the C/C++ compiler. We reset the environment variables -# so that installation and testing do not get affected by them. -unset CC -unset CXX - ninja install # Must be done after zig cc is finished. @@ -63,6 +59,7 @@ stage3-release/bin/zig build \ -Doptimize=ReleaseFast \ -Dstrip \ -Dtarget=$TARGET \ + -Dcpu=$MCPU \ -Duse-zig-libcxx \ -Dversion-string="$(stage3-release/bin/zig version)" diff --git a/ci/x86_64-windows-debug.ps1 b/ci/x86_64-windows-debug.ps1 index fa416bf3ff1207dc26c6ebf497608940d8fc52e7..5914c3c9e4d6efe6fccfe0cbba58b808206c0d74 100644 --- a/ci/x86_64-windows-debug.ps1 +++ b/ci/x86_64-windows-debug.ps1 @@ -4,6 +4,8 @@ $PREFIX_PATH = "$($Env:USERPROFILE)\deps\zig+llvm+lld+clang-$TARGET-0.17.0-dev.2 $ZIG = "$PREFIX_PATH\bin\zig.exe" $ZSF_MAX_RSS = if ($Env:ZSF_MAX_RSS) { $Env:ZSF_MAX_RSS } else { 0 } +$Env:PATH = "$($Env:USERPROFILE)\local\bin;$Env:PATH" + function CheckLastExitCode { if (!$?) { exit 1 @@ -18,7 +20,7 @@ $Env:ZIG_GLOBAL_CACHE_DIR="$(Get-Location)\zig-global-cache" $Env:ZIG_LOCAL_CACHE_DIR="$(Get-Location)\zig-local-cache" Write-Output "Building from source..." -New-Item -Path 'build-debug' -ItemType Directory +New-Item -Force -Path 'build-debug' -ItemType Directory Set-Location -Path 'build-debug' # CMake gives a syntax error when file paths with backward slashes are used. @@ -45,18 +47,32 @@ CheckLastExitCode $Env:ZIG_LIB_DIR="$(Get-Location)\..\lib" Write-Output "Main test suite..." -stage3-debug\bin\zig build test docs ` +stage3-debug\bin\zig.exe build test docs ` --maxrss $ZSF_MAX_RSS ` --search-prefix "$PREFIX_PATH" ` -Dstatic-llvm ` -Dskip-non-native ` - -Dskip-test-incremental ` -Denable-symlinks-windows ` --test-timeout 30m CheckLastExitCode +Write-Output "Build and test stage4..." +stage3-debug\bin\zig.exe build ` + --prefix stage4-debug ` + -Denable-llvm ` + -Dno-lib ` + -Doptimize=Debug ` + -Dtarget="$TARGET" ` + -Dcpu="$MCPU" ` + -Duse-zig-libcxx ` + -Dversion-string="$(stage3-debug\bin\zig.exe version)" +CheckLastExitCode + +stage4-debug\bin\zig.exe test ..\test\behavior.zig +CheckLastExitCode + Write-Output "Build x86_64-windows-msvc behavior tests using the C backend..." -stage3-debug\bin\zig build-obj ` +stage3-debug\bin\zig.exe build-obj ` -ofmt=c ` -OReleaseSmall ` --name compiler_rt ` @@ -66,7 +82,7 @@ stage3-debug\bin\zig build-obj ` ..\lib\compiler_rt.zig CheckLastExitCode -stage3-debug\bin\zig test ` +stage3-debug\bin\zig.exe test ` -ofmt=c ` -femit-bin="behavior-x86_64-windows-msvc.c" ` --test-no-exec ` diff --git a/ci/x86_64-windows-release.ps1 b/ci/x86_64-windows-release.ps1 index 8364836291d8d57097f7a76cba93b651c88c1e94..07ac431c499c1becce5b10869d9abfb58c763b85 100644 --- a/ci/x86_64-windows-release.ps1 +++ b/ci/x86_64-windows-release.ps1 @@ -4,6 +4,8 @@ $PREFIX_PATH = "$($Env:USERPROFILE)\deps\zig+llvm+lld+clang-$TARGET-0.17.0-dev.2 $ZIG = "$PREFIX_PATH\bin\zig.exe" $ZSF_MAX_RSS = if ($Env:ZSF_MAX_RSS) { $Env:ZSF_MAX_RSS } else { 0 } +$Env:PATH = "$($Env:USERPROFILE)\local\bin;$Env:PATH" + function CheckLastExitCode { if (!$?) { exit 1 @@ -18,7 +20,7 @@ $Env:ZIG_GLOBAL_CACHE_DIR="$(Get-Location)\zig-global-cache" $Env:ZIG_LOCAL_CACHE_DIR="$(Get-Location)\zig-local-cache" Write-Output "Building from source..." -New-Item -Path 'build-release' -ItemType Directory +New-Item -Force -Path 'build-release' -ItemType Directory Set-Location -Path 'build-release' # CMake gives a syntax error when file paths with backward slashes are used. @@ -50,7 +52,6 @@ stage3-release\bin\zig.exe build test docs ` --search-prefix "$PREFIX_PATH" ` -Dstatic-llvm ` -Dskip-non-native ` - -Dskip-test-incremental ` -Denable-symlinks-windows ` --test-timeout 30m CheckLastExitCode @@ -71,8 +72,9 @@ stage3-release\bin\zig.exe build ` -Doptimize=ReleaseFast ` -Dstrip ` -Dtarget="$TARGET" ` + -Dcpu="$MCPU" ` -Duse-zig-libcxx ` - -Dversion-string="$(stage3-release\bin\zig version)" + -Dversion-string="$(stage3-release\bin\zig.exe version)" CheckLastExitCode # Compare-Object returns an error code if the files differ.