Skip to content

Enable swift-corelibs-foundation tests on Windows #75932

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 17 additions & 12 deletions utils/build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -1669,18 +1669,23 @@ function Build-Foundation([Platform]$Platform, $Arch, [switch]$Test = $false) {
-Arch $HostArch
}

# swift-corelibs-foundation tests are disabled since the package does not build for Windows yet
# $OutDir = Join-Path -Path $HostArch.BinaryCache -ChildPath foundation-tests

# Isolate-EnvVars {
# $env:SWIFTCI_USE_LOCAL_DEPS=1
# $env:DISPATCH_INCLUDE_PATH="$($Arch.SDKInstallRoot)/usr/lib/swift"
# Build-SPMProject `
# -Test `
# -Src $SourceCache\swift-corelibs-foundation `
# -Bin $OutDir `
# -Arch $HostArch
# }
$OutDir = Join-Path -Path $HostArch.BinaryCache -ChildPath foundation-tests
$ShortArch = $Arch.LLVMName

Isolate-EnvVars {
$env:SWIFTCI_USE_LOCAL_DEPS=1
$env:DISPATCH_INCLUDE_PATH="$($Arch.SDKInstallRoot)/usr/lib/swift"
$env:LIBXML_LIBRARY_PATH="$LibraryRoot/libxml2-2.11.5/usr/lib/$Platform/$ShortArch"
$env:LIBXML_INCLUDE_PATH="$LibraryRoot/libxml2-2.11.5/usr/include/libxml2"
$env:ZLIB_LIBRARY_PATH="$LibraryRoot/zlib-1.3.1/usr/lib/$Platform/$ShortArch"
$env:CURL_LIBRARY_PATH="$LibraryRoot/curl-8.9.1/usr/lib/$Platform/$ShortArch"
$env:CURL_INCLUDE_PATH="$LibraryRoot/curl-8.9.1/usr/include"
Comment on lines +1677 to +1682
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason to prefer the environment variables over -Xcc -I... -Xlinker -L.. flags?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just found that was easier to manage when building locally, that way I could set up my environment and then just keep running swift test as I iterate rather than having to spell out the full invocation each time / remember what the right flags are. This also allows us to make sure that the right targets link the right things

Build-SPMProject `
-Test `
-Src $SourceCache\swift-corelibs-foundation `
-Bin $OutDir `
-Arch $HostArch
}
} else {
$DispatchBinaryCache = Get-TargetProjectBinaryCache $Arch Dispatch
$FoundationBinaryCache = Get-TargetProjectBinaryCache $Arch Foundation
Expand Down