From 823b333aee532a55f4115fff5f1d9df20b95f73c Mon Sep 17 00:00:00 2001 From: dave caruso Date: Tue, 31 Oct 2023 22:16:58 -0700 Subject: [PATCH 01/12] test 1 --- .github/workflows/windows.yml | 38 +++++++++++++++++++++++++++++++++++ windows-release.ps1 | 18 +++++++++++++++++ 2 files changed, 56 insertions(+) create mode 100644 .github/workflows/windows.yml diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml new file mode 100644 index 0000000000000..a070d572502f4 --- /dev/null +++ b/.github/workflows/windows.yml @@ -0,0 +1,38 @@ +name: CI + +# Controls when the workflow will run +on: + # Triggers the workflow on push or pull request events but only for the "master" branch + push: + branches: ["icu-build-test"] + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +jobs: + windows: + strategy: + matrix: + include: + - runner: windows-latest + build-type: Release + arch: amd64 + runs-on: windows-latest + timeout-minutes: 90 + steps: + - uses: KyleMayes/install-llvm-action@1a3da29f56261a1e1f937ec88f0856a9b8321d7e + with: + version: 16.0.6 + - run: choco install -y ninja + - uses: actions/checkout@v4 + - name: Build WebKit + run: | + $env:Path = "C:\Program Files (x86)\Windows Kits\10\bin\10.0.22621.0\x64\;" + $env:Path + $env:WEBKIT_OUTPUT_DIR = "bun-webkit" + $env:BUN_WEBKIT_VERSION = "${{ github.sha }}" + $env:CMAKE_BUILD_TYPE = "${{matrix.build-type}}" + ./windows-release.ps1 + - uses: actions/upload-artifact@v3 + with: + name: bun-webkit-windows-${{ matrix.arch }} + path: bun-webkit.tar.gz diff --git a/windows-release.ps1 b/windows-release.ps1 index 06e59e808b7d3..91b40b632ec89 100644 --- a/windows-release.ps1 +++ b/windows-release.ps1 @@ -1,5 +1,23 @@ $ErrorActionPreference = "Stop" +# Set up MSVC environment variables. This is taken from Bun's 'scripts\env.ps1' +if ($env:VSINSTALLDIR -eq $null) { + Write-Host "Loading Visual Studio environment, this may take a second..." + $vsDir = Get-ChildItem -Path "C:\Program Files\Microsoft Visual Studio\2022" -Directory + if ($vsDir -eq $null) { + throw "Visual Studio directory not found." + } + Push-Location $vsDir + try { + . (Join-Path -Path $vsDir.FullName -ChildPath "Common7\Tools\Launch-VsDevShell.ps1") -Arch amd64 -HostArch amd64 + } finally { Pop-Location } +} + +if($Env:VSCMD_ARG_TGT_ARCH -eq "x86") { + # Please do not try to compile Bun for 32 bit. It will not work. I promise. + throw "Visual Studio environment is targetting 32 bit. This configuration is definetly a mistake." +} + $output = if ($env:WEBKIT_OUTPUT_DIR) { $env:WEBKIT_OUTPUT_DIR } else { "bun-webkit" } $WebKitBuild = if ($env:WEBKIT_BUILD_DIR) { $env:WEBKIT_BUILD_DIR } else { "WebKitBuild" } $CMAKE_BUILD_TYPE = if ($env:CMAKE_BUILD_TYPE) { $env:CMAKE_BUILD_TYPE } else { "Release" } From 27ae44cfcfbe1bf933ce82595c4f5fe75f1ae340 Mon Sep 17 00:00:00 2001 From: dave caruso Date: Tue, 31 Oct 2023 22:33:37 -0700 Subject: [PATCH 02/12] test 2 --- windows-release.ps1 | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/windows-release.ps1 b/windows-release.ps1 index 91b40b632ec89..226a0ad471981 100644 --- a/windows-release.ps1 +++ b/windows-release.ps1 @@ -2,22 +2,27 @@ $ErrorActionPreference = "Stop" # Set up MSVC environment variables. This is taken from Bun's 'scripts\env.ps1' if ($env:VSINSTALLDIR -eq $null) { - Write-Host "Loading Visual Studio environment, this may take a second..." - $vsDir = Get-ChildItem -Path "C:\Program Files\Microsoft Visual Studio\2022" -Directory - if ($vsDir -eq $null) { - throw "Visual Studio directory not found." - } - Push-Location $vsDir - try { - . (Join-Path -Path $vsDir.FullName -ChildPath "Common7\Tools\Launch-VsDevShell.ps1") -Arch amd64 -HostArch amd64 - } finally { Pop-Location } + Write-Host "Loading Visual Studio environment, this may take a second..." + $vsDir = Get-ChildItem -Path "C:\Program Files\Microsoft Visual Studio\2022" -Directory + if ($vsDir -eq $null) { + throw "Visual Studio directory not found." + } + Push-Location $vsDir + try { + . (Join-Path -Path $vsDir.FullName -ChildPath "Common7\Tools\Launch-VsDevShell.ps1") -Arch amd64 -HostArch amd64 + } + finally { Pop-Location } } -if($Env:VSCMD_ARG_TGT_ARCH -eq "x86") { - # Please do not try to compile Bun for 32 bit. It will not work. I promise. - throw "Visual Studio environment is targetting 32 bit. This configuration is definetly a mistake." +if ($Env:VSCMD_ARG_TGT_ARCH -eq "x86") { + # Please do not try to compile Bun for 32 bit. It will not work. I promise. + throw "Visual Studio environment is targetting 32 bit. This configuration is definetly a mistake." } +# Remove strawberry from the path while compiling ICU +# They define `link.exe` and many other things which will cause the build to fail. +$env:PATH = $env:PATH -replace "C:\\Strawberry\\c\\bin;", "" + $output = if ($env:WEBKIT_OUTPUT_DIR) { $env:WEBKIT_OUTPUT_DIR } else { "bun-webkit" } $WebKitBuild = if ($env:WEBKIT_BUILD_DIR) { $env:WEBKIT_BUILD_DIR } else { "WebKitBuild" } $CMAKE_BUILD_TYPE = if ($env:CMAKE_BUILD_TYPE) { $env:CMAKE_BUILD_TYPE } else { "Release" } From 45872980c1c87b0ff8be509bc34b172db0e4dad9 Mon Sep 17 00:00:00 2001 From: dave caruso Date: Tue, 31 Oct 2023 22:48:47 -0700 Subject: [PATCH 03/12] test 3 --- windows-release.ps1 | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/windows-release.ps1 b/windows-release.ps1 index 226a0ad471981..2e1b8d62a795a 100644 --- a/windows-release.ps1 +++ b/windows-release.ps1 @@ -21,7 +21,8 @@ if ($Env:VSCMD_ARG_TGT_ARCH -eq "x86") { # Remove strawberry from the path while compiling ICU # They define `link.exe` and many other things which will cause the build to fail. -$env:PATH = $env:PATH -replace "C:\\Strawberry\\c\\bin;", "" +$OriginalPath = $env:PATH +$env:PATH = ($env:PATH -split ";" | Where-Object { $_ -notlike "*strawberry*" }) -join ';' $output = if ($env:WEBKIT_OUTPUT_DIR) { $env:WEBKIT_OUTPUT_DIR } else { "bun-webkit" } $WebKitBuild = if ($env:WEBKIT_BUILD_DIR) { $env:WEBKIT_BUILD_DIR } else { "WebKitBuild" } @@ -118,6 +119,8 @@ $env:CXXFLAGS = "/Zi /Z7" Write-Host ":: Configuring WebKit" +$env:PATH = $OriginalPath + cmake -S . -B $WebKitBuild ` -DPORT="JSCOnly" ` -DENABLE_STATIC_JSC=ON ` From 26a93869652cc4951ba7c400a6dfab364f8f1fe4 Mon Sep 17 00:00:00 2001 From: dave caruso Date: Tue, 31 Oct 2023 23:04:39 -0700 Subject: [PATCH 04/12] test 4 --- windows-release.ps1 | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/windows-release.ps1 b/windows-release.ps1 index 2e1b8d62a795a..a29624cfdea09 100644 --- a/windows-release.ps1 +++ b/windows-release.ps1 @@ -19,10 +19,17 @@ if ($Env:VSCMD_ARG_TGT_ARCH -eq "x86") { throw "Visual Studio environment is targetting 32 bit. This configuration is definetly a mistake." } -# Remove strawberry from the path while compiling ICU -# They define `link.exe` and many other things which will cause the build to fail. -$OriginalPath = $env:PATH -$env:PATH = ($env:PATH -split ";" | Where-Object { $_ -notlike "*strawberry*" }) -join ';' +# Fix up $PATH +$SplitPath = $env:PATH -split ";"; +$MSVCToolsPath = $SplitPath | Where-Object { $_ -like "*HostX64/x64" } | Select-Object -First 1 +$SplitPath = $MSVCToolsPath + ($SplitPath | Where-Object { $_ -notlike "*HostX64/x64" }) +$PathWithPerl = $SplitPath -join ";" +$env:PATH = ($SplitPath | Where-Object { $_ -notlike "*strawberry*" }) -join ';' + +$env:CC = "clang-cl" +$env:CXX = "clang-cl" +$env:CFLAGS = "/Zi /Z7" +$env:CXXFLAGS = "/Zi /Z7" $output = if ($env:WEBKIT_OUTPUT_DIR) { $env:WEBKIT_OUTPUT_DIR } else { "bun-webkit" } $WebKitBuild = if ($env:WEBKIT_BUILD_DIR) { $env:WEBKIT_BUILD_DIR } else { "WebKitBuild" } @@ -112,14 +119,9 @@ if (!(Test-Path -Path $ICU_SHARED_ROOT)) { } -$env:CC = "clang-cl" -$env:CXX = "clang-cl" -$env:CFLAGS = "/Zi /Z7" -$env:CXXFLAGS = "/Zi /Z7" - Write-Host ":: Configuring WebKit" -$env:PATH = $OriginalPath +$env:PATH = $PathWithPerl cmake -S . -B $WebKitBuild ` -DPORT="JSCOnly" ` From 774f89cfc4f10dd3c961520a7aba7a18dacea3f5 Mon Sep 17 00:00:00 2001 From: dave caruso Date: Tue, 31 Oct 2023 23:22:36 -0700 Subject: [PATCH 05/12] test 5 --- windows-release.ps1 | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/windows-release.ps1 b/windows-release.ps1 index a29624cfdea09..120e4787851c7 100644 --- a/windows-release.ps1 +++ b/windows-release.ps1 @@ -20,9 +20,11 @@ if ($Env:VSCMD_ARG_TGT_ARCH -eq "x86") { } # Fix up $PATH +Write-Host $Env:PATH + $SplitPath = $env:PATH -split ";"; $MSVCToolsPath = $SplitPath | Where-Object { $_ -like "*HostX64/x64" } | Select-Object -First 1 -$SplitPath = $MSVCToolsPath + ($SplitPath | Where-Object { $_ -notlike "*HostX64/x64" }) +$SplitPath = @($MSVCToolsPath) + ($SplitPath | Where-Object { $_ -notlike "*HostX64/x64" }) $PathWithPerl = $SplitPath -join ";" $env:PATH = ($SplitPath | Where-Object { $_ -notlike "*strawberry*" }) -join ';' @@ -89,7 +91,10 @@ if (!(Test-Path -Path $ICU_STATIC_ROOT)) { --disable-tests ` --disable-debug ` --enable-release - if ($LASTEXITCODE -ne 0) { throw "runConfigureICU failed with exit code $LASTEXITCODE" } + if ($LASTEXITCODE -ne 0) { + Get-Content "$ICU_STATIC_ROOT/source/config.log" + throw "runConfigureICU failed with exit code $LASTEXITCODE" + } Write-Host ":: Building ICU" make "-j$((Get-CimInstance Win32_ComputerSystem).NumberOfLogicalProcessors)" From b060d69d4646df2e7008356dc2e2df07f0b7495a Mon Sep 17 00:00:00 2001 From: dave caruso Date: Tue, 31 Oct 2023 23:38:02 -0700 Subject: [PATCH 06/12] test 6 --- windows-release.ps1 | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/windows-release.ps1 b/windows-release.ps1 index 120e4787851c7..badf8fdf24e92 100644 --- a/windows-release.ps1 +++ b/windows-release.ps1 @@ -20,14 +20,19 @@ if ($Env:VSCMD_ARG_TGT_ARCH -eq "x86") { } # Fix up $PATH -Write-Host $Env:PATH +Write-Host $env:PATH $SplitPath = $env:PATH -split ";"; -$MSVCToolsPath = $SplitPath | Where-Object { $_ -like "*HostX64/x64" } | Select-Object -First 1 -$SplitPath = @($MSVCToolsPath) + ($SplitPath | Where-Object { $_ -notlike "*HostX64/x64" }) +$MSVCPaths = $SplitPath | Where-Object { $_ -like "Microsoft Visual Studio" } +$SplitPath = $MSVCPaths + ($SplitPath | Where-Object { $_ -notlike "Microsoft Visual Studio" }) $PathWithPerl = $SplitPath -join ";" $env:PATH = ($SplitPath | Where-Object { $_ -notlike "*strawberry*" }) -join ';' +Write-Host $env:PATH + +link.exe /version +clang-cl.exe --version + $env:CC = "clang-cl" $env:CXX = "clang-cl" $env:CFLAGS = "/Zi /Z7" @@ -92,7 +97,7 @@ if (!(Test-Path -Path $ICU_STATIC_ROOT)) { --disable-debug ` --enable-release if ($LASTEXITCODE -ne 0) { - Get-Content "$ICU_STATIC_ROOT/source/config.log" + Get-Content "config.log" throw "runConfigureICU failed with exit code $LASTEXITCODE" } From 7849d500ca4ec4b8f8b85988b5fd1944cbdd02e4 Mon Sep 17 00:00:00 2001 From: dave caruso Date: Tue, 31 Oct 2023 23:48:27 -0700 Subject: [PATCH 07/12] test 7 --- windows-release.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/windows-release.ps1 b/windows-release.ps1 index badf8fdf24e92..03786b09e4a13 100644 --- a/windows-release.ps1 +++ b/windows-release.ps1 @@ -24,7 +24,7 @@ Write-Host $env:PATH $SplitPath = $env:PATH -split ";"; $MSVCPaths = $SplitPath | Where-Object { $_ -like "Microsoft Visual Studio" } -$SplitPath = $MSVCPaths + ($SplitPath | Where-Object { $_ -notlike "Microsoft Visual Studio" }) +$SplitPath = $MSVCPaths + ($SplitPath | Where-Object { $_ -notlike "Microsoft Visual Studio" } | Where-Object { $_ -notlike "*mingw64\bin" }) $PathWithPerl = $SplitPath -join ";" $env:PATH = ($SplitPath | Where-Object { $_ -notlike "*strawberry*" }) -join ';' From 419dfa31745f8fab91e9b41e9683f63e7072086b Mon Sep 17 00:00:00 2001 From: dave caruso Date: Tue, 31 Oct 2023 23:56:25 -0700 Subject: [PATCH 08/12] test 8 --- windows-release.ps1 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/windows-release.ps1 b/windows-release.ps1 index 03786b09e4a13..61db3bbc0204e 100644 --- a/windows-release.ps1 +++ b/windows-release.ps1 @@ -35,8 +35,6 @@ clang-cl.exe --version $env:CC = "clang-cl" $env:CXX = "clang-cl" -$env:CFLAGS = "/Zi /Z7" -$env:CXXFLAGS = "/Zi /Z7" $output = if ($env:WEBKIT_OUTPUT_DIR) { $env:WEBKIT_OUTPUT_DIR } else { "bun-webkit" } $WebKitBuild = if ($env:WEBKIT_BUILD_DIR) { $env:WEBKIT_BUILD_DIR } else { "WebKitBuild" } @@ -133,6 +131,9 @@ Write-Host ":: Configuring WebKit" $env:PATH = $PathWithPerl +$env:CFLAGS = "/Zi /Z7" +$env:CXXFLAGS = "/Zi /Z7" + cmake -S . -B $WebKitBuild ` -DPORT="JSCOnly" ` -DENABLE_STATIC_JSC=ON ` From 44f4e7685e84a6cf6eaffb02b1b50d86ed655915 Mon Sep 17 00:00:00 2001 From: dave caruso Date: Wed, 1 Nov 2023 00:11:12 -0700 Subject: [PATCH 09/12] test 8 --- windows-release.ps1 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/windows-release.ps1 b/windows-release.ps1 index 61db3bbc0204e..3b2e80d4d5705 100644 --- a/windows-release.ps1 +++ b/windows-release.ps1 @@ -24,13 +24,14 @@ Write-Host $env:PATH $SplitPath = $env:PATH -split ";"; $MSVCPaths = $SplitPath | Where-Object { $_ -like "Microsoft Visual Studio" } -$SplitPath = $MSVCPaths + ($SplitPath | Where-Object { $_ -notlike "Microsoft Visual Studio" } | Where-Object { $_ -notlike "*mingw64\bin" }) +$SplitPath = $MSVCPaths + ($SplitPath | Where-Object { $_ -notlike "Microsoft Visual Studio" } | Where-Object { $_ -notlike "*mingw" }) $PathWithPerl = $SplitPath -join ";" $env:PATH = ($SplitPath | Where-Object { $_ -notlike "*strawberry*" }) -join ';' Write-Host $env:PATH -link.exe /version +(Get-Command link).Path +(Get-Command bash).Path clang-cl.exe --version $env:CC = "clang-cl" From c93796d460e94a601127fc964c5a69f86f4ee869 Mon Sep 17 00:00:00 2001 From: dave caruso Date: Wed, 1 Nov 2023 00:22:23 -0700 Subject: [PATCH 10/12] test 10 --- .github/workflows/windows.yml | 1 + windows-release.ps1 | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index a070d572502f4..7ca4db70f3e4f 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -23,6 +23,7 @@ jobs: - uses: KyleMayes/install-llvm-action@1a3da29f56261a1e1f937ec88f0856a9b8321d7e with: version: 16.0.6 + - uses: cygwin/cygwin-install-action@006ad0b0946ca6d0a3ea2d4437677fa767392401 - run: choco install -y ninja - uses: actions/checkout@v4 - name: Build WebKit diff --git a/windows-release.ps1 b/windows-release.ps1 index 3b2e80d4d5705..3ed18d123882d 100644 --- a/windows-release.ps1 +++ b/windows-release.ps1 @@ -24,7 +24,7 @@ Write-Host $env:PATH $SplitPath = $env:PATH -split ";"; $MSVCPaths = $SplitPath | Where-Object { $_ -like "Microsoft Visual Studio" } -$SplitPath = $MSVCPaths + ($SplitPath | Where-Object { $_ -notlike "Microsoft Visual Studio" } | Where-Object { $_ -notlike "*mingw" }) +$SplitPath = $MSVCPaths + ($SplitPath | Where-Object { $_ -notlike "Microsoft Visual Studio" } | Where-Object { $_ -notlike "*mingw*" }) $PathWithPerl = $SplitPath -join ";" $env:PATH = ($SplitPath | Where-Object { $_ -notlike "*strawberry*" }) -join ';' From 008117cbaa7db61e8ac6cb5dd1344d3134b03c05 Mon Sep 17 00:00:00 2001 From: dave caruso Date: Wed, 1 Nov 2023 00:34:18 -0700 Subject: [PATCH 11/12] test 11 --- windows-release.ps1 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/windows-release.ps1 b/windows-release.ps1 index 3ed18d123882d..9d24bdce34897 100644 --- a/windows-release.ps1 +++ b/windows-release.ps1 @@ -22,6 +22,8 @@ if ($Env:VSCMD_ARG_TGT_ARCH -eq "x86") { # Fix up $PATH Write-Host $env:PATH +$MakeExe = (Get-Command make).Path + $SplitPath = $env:PATH -split ";"; $MSVCPaths = $SplitPath | Where-Object { $_ -like "Microsoft Visual Studio" } $SplitPath = $MSVCPaths + ($SplitPath | Where-Object { $_ -notlike "Microsoft Visual Studio" } | Where-Object { $_ -notlike "*mingw*" }) @@ -101,7 +103,7 @@ if (!(Test-Path -Path $ICU_STATIC_ROOT)) { } Write-Host ":: Building ICU" - make "-j$((Get-CimInstance Win32_ComputerSystem).NumberOfLogicalProcessors)" + & $MakeExe "-j$((Get-CimInstance Win32_ComputerSystem).NumberOfLogicalProcessors)" if ($LASTEXITCODE -ne 0) { throw "make failed with exit code $LASTEXITCODE" } } finally { Pop-Location } From 2695e0ad1f2afe3104b0f632eda9c8503535463d Mon Sep 17 00:00:00 2001 From: dave caruso Date: Wed, 1 Nov 2023 01:26:16 -0700 Subject: [PATCH 12/12] confirmed works now --- .github/workflows/build.yml | 5 ++--- .github/workflows/windows.yml | 39 ----------------------------------- 2 files changed, 2 insertions(+), 42 deletions(-) delete mode 100644 .github/workflows/windows.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 398f8d9b9ac01..a2e110879f598 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -151,6 +151,7 @@ jobs: name: ${{matrix.label}} path: ${{runner.temp}}/bun-webkit.tar.gz +jobs: windows: strategy: matrix: @@ -161,12 +162,10 @@ jobs: runs-on: windows-latest timeout-minutes: 90 steps: - - uses: ilammy/msvc-dev-cmd@7315a94840631165970262a99c72cfb48a65d25d - with: - arch: ${{ matrix.arch }} - uses: KyleMayes/install-llvm-action@1a3da29f56261a1e1f937ec88f0856a9b8321d7e with: version: 16.0.6 + - uses: cygwin/cygwin-install-action@006ad0b0946ca6d0a3ea2d4437677fa767392401 - run: choco install -y ninja - uses: actions/checkout@v4 - name: Build WebKit diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml deleted file mode 100644 index 7ca4db70f3e4f..0000000000000 --- a/.github/workflows/windows.yml +++ /dev/null @@ -1,39 +0,0 @@ -name: CI - -# Controls when the workflow will run -on: - # Triggers the workflow on push or pull request events but only for the "master" branch - push: - branches: ["icu-build-test"] - - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: - -jobs: - windows: - strategy: - matrix: - include: - - runner: windows-latest - build-type: Release - arch: amd64 - runs-on: windows-latest - timeout-minutes: 90 - steps: - - uses: KyleMayes/install-llvm-action@1a3da29f56261a1e1f937ec88f0856a9b8321d7e - with: - version: 16.0.6 - - uses: cygwin/cygwin-install-action@006ad0b0946ca6d0a3ea2d4437677fa767392401 - - run: choco install -y ninja - - uses: actions/checkout@v4 - - name: Build WebKit - run: | - $env:Path = "C:\Program Files (x86)\Windows Kits\10\bin\10.0.22621.0\x64\;" + $env:Path - $env:WEBKIT_OUTPUT_DIR = "bun-webkit" - $env:BUN_WEBKIT_VERSION = "${{ github.sha }}" - $env:CMAKE_BUILD_TYPE = "${{matrix.build-type}}" - ./windows-release.ps1 - - uses: actions/upload-artifact@v3 - with: - name: bun-webkit-windows-${{ matrix.arch }} - path: bun-webkit.tar.gz