Skip to content

Commit

Permalink
Fix CI again (#28)
Browse files Browse the repository at this point in the history
  • Loading branch information
paperclover authored Nov 1, 2023
1 parent dda5443 commit 75e438d
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 9 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ jobs:
name: ${{matrix.label}}
path: ${{runner.temp}}/bun-webkit.tar.gz

jobs:
windows:
strategy:
matrix:
Expand All @@ -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
Expand Down
54 changes: 48 additions & 6 deletions windows-release.ps1
Original file line number Diff line number Diff line change
@@ -1,5 +1,44 @@
$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."
}

# 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*" })
$PathWithPerl = $SplitPath -join ";"
$env:PATH = ($SplitPath | Where-Object { $_ -notlike "*strawberry*" }) -join ';'

Write-Host $env:PATH

(Get-Command link).Path
(Get-Command bash).Path
clang-cl.exe --version

$env:CC = "clang-cl"
$env:CXX = "clang-cl"

$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" }
Expand Down Expand Up @@ -58,10 +97,13 @@ 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 "config.log"
throw "runConfigureICU failed with exit code $LASTEXITCODE"
}

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 }
Expand All @@ -88,13 +130,13 @@ if (!(Test-Path -Path $ICU_SHARED_ROOT)) {

}

$env:CC = "clang-cl"
$env:CXX = "clang-cl"
Write-Host ":: Configuring WebKit"

$env:PATH = $PathWithPerl

$env:CFLAGS = "/Zi /Z7"
$env:CXXFLAGS = "/Zi /Z7"

Write-Host ":: Configuring WebKit"

cmake -S . -B $WebKitBuild `
-DPORT="JSCOnly" `
-DENABLE_STATIC_JSC=ON `
Expand Down

0 comments on commit 75e438d

Please sign in to comment.