Skip to content

[Windows] Add default dispatch header search path to standalone builds #5033

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

When building this package via SwiftPM on Windows, we need to include dispatch headers from the appropriate directory in the SDK. We cannot rely on an absolute path such as /usr/lib/swift on linux, so instead we use a reasonable default based on the SDKROOT environment variable. I believe this environment variable should be set automatically in a VS developer shell with Swift installed to point to the Windows.sdk directory within the currently active swift installation. This allows us to find dispatch in many cases and get closer to a working package build on Windows (while still allowing manual overriding via the DISPATCH_INCLUDE_PATH environment variable)

@jmschonfeld
Copy link
Contributor Author

@swift-ci please test

@jmschonfeld jmschonfeld changed the title [Windows] Add default dispatch header search path [Windows] Add default dispatch header search path to SwiftPM build Jul 26, 2024
@jmschonfeld
Copy link
Contributor Author

The SwiftPM build still fails because we don't (yet) have a way to find headers for libxml and curl, but this at least gets us a step closer

Copy link
Member

@compnerd compnerd left a comment

Choose a reason for hiding this comment

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

Minor correction on the commit message: SDKROOT is setup by Swift and should be available irrespective of the VSDevCmd setup.

@jmschonfeld
Copy link
Contributor Author

@swift-ci please test Linux platform

@jmschonfeld jmschonfeld force-pushed the windows/package-dispatch-path branch from 1bbb017 to efdbd18 Compare July 29, 2024 17:19
@jmschonfeld jmschonfeld changed the title [Windows] Add default dispatch header search path to SwiftPM build [Windows] Add default dispatch header search path to standalone builds Jul 29, 2024
@jmschonfeld
Copy link
Contributor Author

Updated to make the same change to the CMake file for standalone CMake builds

@jmschonfeld
Copy link
Contributor Author

@swift-ci please test

@jmschonfeld
Copy link
Contributor Author

@swift-ci please test Windows platform

@jmschonfeld jmschonfeld merged commit 9e7732b into swiftlang:main Jul 29, 2024
2 of 3 checks passed
@jmschonfeld jmschonfeld deleted the windows/package-dispatch-path branch July 29, 2024 22:16
jmschonfeld added a commit to jmschonfeld/swift-corelibs-foundation that referenced this pull request Jul 29, 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.

3 participants