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

Conversation

jmschonfeld
Copy link
Contributor

Now that we've gotten the SwiftPM build of swift-corelibs-foundation up and running on Windows, we can run its tests as part of the toolchain test suite. We need to pass some environment variables indicating where libxml2/zlib/curl have been built since those can't be declared as SwiftPM dependencies (similar to the dispatch path, except we also need to provide paths to the static libraries themselves since these are in build folders and not the install folder)

@jmschonfeld
Copy link
Contributor Author

@jmschonfeld jmschonfeld marked this pull request as ready for review August 20, 2024 15:24
Comment on lines +1677 to +1682
$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"
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

@jmschonfeld jmschonfeld merged commit 96c3357 into swiftlang:main Aug 21, 2024
3 checks passed
@jmschonfeld jmschonfeld deleted the windows/enable-foundation-tests branch August 21, 2024 17:11
andrurogerz pushed a commit to andrurogerz/swift that referenced this pull request Sep 3, 2024
andrurogerz pushed a commit to andrurogerz/swift that referenced this pull request Sep 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants