|
12 | 12 | ##
|
13 | 13 | ##===----------------------------------------------------------------------===##
|
14 | 14 |
|
15 |
| -$env:CI = "1" |
16 |
| -$env:FAST_TEST_RUN = "1" |
| 15 | +# In newer Visual C++ Tools they've added compiler intrinsics headers in wchar.h |
| 16 | +# that end up creating a cyclic dependency between the `ucrt` and compiler intrinsics modules. |
| 17 | +# Newer versions of swift (6.2) have a fixed modulemap that resolves the issue: https://github.com/swiftlang/swift/pull/79751 |
| 18 | +$windowsSdkVersion = "10.0.22000.0" |
| 19 | +$vcToolsVersion = "14.43.34808" |
| 20 | + |
| 21 | +# As a workaround we can pin the tools/SDK versions to older versions that are present in the GH Actions Windows image. |
| 22 | +# In the future we may only want to apply this workaround to older versions of Swift that don't have the fixed module map. |
| 23 | +$jsonFilePath = "./assets/test/.vscode/settings.json" |
| 24 | +try { |
| 25 | + $jsonContent = Get-Content -Raw -Path $jsonFilePath | ConvertFrom-Json |
| 26 | +} catch { |
| 27 | + Write-Host "Invalid JSON content in $jsonFilePath" |
| 28 | + exit 1 |
| 29 | +} |
| 30 | +if ($jsonContent.PSObject.Properties['swift.buildArguments']) { |
| 31 | + $jsonContent.PSObject.Properties.Remove('swift.buildArguments') |
| 32 | +} |
| 33 | + |
| 34 | +$windowsSdkRoot = "C:\Program Files (x86)\Windows Kits\10\" |
| 35 | + |
| 36 | +$jsonContent | Add-Member -MemberType NoteProperty -Name "swift.buildArguments" -Value @( |
| 37 | + "-Xbuild-tools-swiftc", "-windows-sdk-root", "-Xbuild-tools-swiftc", $windowsSdkRoot, |
| 38 | + "-Xbuild-tools-swiftc", "-windows-sdk-version", "-Xbuild-tools-swiftc", $windowsSdkVersion, |
| 39 | + "-Xbuild-tools-swiftc", "-visualc-tools-version", "-Xbuild-tools-swiftc", $vcToolsVersion, |
| 40 | + "-Xswiftc", "-windows-sdk-root", "-Xswiftc", $windowsSdkRoot, |
| 41 | + "-Xswiftc", "-windows-sdk-version", "-Xswiftc", $windowsSdkVersion, |
| 42 | + "-Xswiftc", "-visualc-tools-version", "-Xswiftc", $vcToolsVersion |
| 43 | +) |
| 44 | + |
| 45 | +if ($jsonContent.PSObject.Properties['swift.packageArguments']) { |
| 46 | + $jsonContent.PSObject.Properties.Remove('swift.packageArguments') |
| 47 | +} |
| 48 | + |
| 49 | +$jsonContent | Add-Member -MemberType NoteProperty -Name "swift.packageArguments" -Value @( |
| 50 | + "-Xbuild-tools-swiftc", "-windows-sdk-root", "-Xbuild-tools-swiftc", $windowsSdkRoot, |
| 51 | + "-Xbuild-tools-swiftc", "-windows-sdk-version", "-Xbuild-tools-swiftc", $windowsSdkVersion, |
| 52 | + "-Xbuild-tools-swiftc", "-visualc-tools-version", "-Xbuild-tools-swiftc", $vcToolsVersion, |
| 53 | + "-Xswiftc", "-windows-sdk-root", "-Xswiftc", $windowsSdkRoot, |
| 54 | + "-Xswiftc", "-windows-sdk-version", "-Xswiftc", $windowsSdkVersion, |
| 55 | + "-Xswiftc", "-visualc-tools-version", "-Xswiftc", $vcToolsVersion |
| 56 | +) |
| 57 | + |
| 58 | +$jsonContent | ConvertTo-Json -Depth 32 | Set-Content -Path $jsonFilePath |
| 59 | + |
| 60 | +Write-Host "Contents of ${jsonFilePath}:" |
| 61 | +Get-Content -Path $jsonFilePath |
| 62 | + |
17 | 63 | npm ci -ignore-script node-pty
|
18 | 64 | npm run lint
|
19 | 65 | npm run format
|
|
0 commit comments