From 7ab260268a3b3b3a0e36b43179924a7c6b3acb21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20R=C3=B8nne=20Petersen?= Date: Sat, 23 Nov 2024 15:21:46 +0100 Subject: [PATCH] ci: Test building from bootstrap.c without LLVM on Windows. --- ci/x86_64-windows-debug.ps1 | 28 ++++++++++++++++++++-------- ci/x86_64-windows-release.ps1 | 28 ++++++++++++++++++++-------- 2 files changed, 40 insertions(+), 16 deletions(-) diff --git a/ci/x86_64-windows-debug.ps1 b/ci/x86_64-windows-debug.ps1 index 8fd4db222c52..e5ea962425e2 100644 --- a/ci/x86_64-windows-debug.ps1 +++ b/ci/x86_64-windows-debug.ps1 @@ -30,6 +30,26 @@ if ((git rev-parse --is-shallow-repository) -eq "true") { git fetch --unshallow # `git describe` won't work on a shallow repo } +Import-Module "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\Common7\Tools\Microsoft.VisualStudio.DevShell.dll" +CheckLastExitCode + +Enter-VsDevShell -VsInstallPath "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools" ` + -DevCmdArguments '-arch=x64 -no_logo' ` + -StartInPath $(Get-Location) +CheckLastExitCode + +# Test building from source without LLVM. +git clean -fd +Remove-Item -Path 'zig-out' -Recurse -Force -ErrorAction Ignore +cl -nologo bootstrap.c /link /OUT:bootstrap.exe +CheckLastExitCode +.\bootstrap +CheckLastExitCode +.\zig2 build -Dno-lib +CheckLastExitCode +.\zig-out\bin\zig test test\behavior.zig +CheckLastExitCode + Write-Output "Building from source..." Remove-Item -Path 'build-debug' -Recurse -Force -ErrorAction Ignore New-Item -Path 'build-debug' -ItemType Directory @@ -94,14 +114,6 @@ CheckLastExitCode -Mbuild_options="config.zig" CheckLastExitCode -Import-Module "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\Common7\Tools\Microsoft.VisualStudio.DevShell.dll" -CheckLastExitCode - -Enter-VsDevShell -VsInstallPath "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools" ` - -DevCmdArguments '-arch=x64 -no_logo' ` - -StartInPath $(Get-Location) -CheckLastExitCode - Write-Output "Build and run behavior tests with msvc..." & cl.exe -I..\lib test-x86_64-windows-msvc.c compiler_rt-x86_64-windows-msvc.c /W3 /Z7 -link -nologo -debug -subsystem:console kernel32.lib ntdll.lib libcmt.lib CheckLastExitCode diff --git a/ci/x86_64-windows-release.ps1 b/ci/x86_64-windows-release.ps1 index 432d0649beb1..820c3bcb3105 100644 --- a/ci/x86_64-windows-release.ps1 +++ b/ci/x86_64-windows-release.ps1 @@ -30,6 +30,26 @@ if ((git rev-parse --is-shallow-repository) -eq "true") { git fetch --unshallow # `git describe` won't work on a shallow repo } +Import-Module "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\Common7\Tools\Microsoft.VisualStudio.DevShell.dll" +CheckLastExitCode + +Enter-VsDevShell -VsInstallPath "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools" ` + -DevCmdArguments '-arch=x64 -no_logo' ` + -StartInPath $(Get-Location) +CheckLastExitCode + +# Test building from source without LLVM. +git clean -fd +Remove-Item -Path 'zig-out' -Recurse -Force -ErrorAction Ignore +cl -nologo bootstrap.c /link /OUT:bootstrap.exe +CheckLastExitCode +.\bootstrap +CheckLastExitCode +.\zig2 build -Dno-lib +CheckLastExitCode +.\zig-out\bin\zig test test\behavior.zig +CheckLastExitCode + Write-Output "Building from source..." Remove-Item -Path 'build-release' -Recurse -Force -ErrorAction Ignore New-Item -Path 'build-release' -ItemType Directory @@ -112,14 +132,6 @@ CheckLastExitCode -Mbuild_options="config.zig" CheckLastExitCode -Import-Module "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\Common7\Tools\Microsoft.VisualStudio.DevShell.dll" -CheckLastExitCode - -Enter-VsDevShell -VsInstallPath "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools" ` - -DevCmdArguments '-arch=x64 -no_logo' ` - -StartInPath $(Get-Location) -CheckLastExitCode - Write-Output "Build and run behavior tests with msvc..." & cl.exe -I..\lib test-x86_64-windows-msvc.c compiler_rt-x86_64-windows-msvc.c /W3 /Z7 -link -nologo -debug -subsystem:console kernel32.lib ntdll.lib libcmt.lib CheckLastExitCode