Skip to content

Conversation

Steelskin
Copy link
Contributor

@Steelskin Steelskin commented Aug 7, 2025

This is the proper installation scheme for Swift libraries on Windows and prevents having to manually copy them in build.ps1.

@Steelskin
Copy link
Contributor Author

@swift-ci please test

@parkera parkera requested review from compnerd and jmschonfeld August 7, 2025 17:14
@Steelskin Steelskin force-pushed the fabrice/build-install-swift-libraries-arch-folder branch from ef23f75 to ea40b13 Compare August 7, 2025 22:00
@Steelskin Steelskin marked this pull request as ready for review August 7, 2025 22:01
@Steelskin
Copy link
Contributor Author

@swift-ci please test

Copy link
Contributor

@jmschonfeld jmschonfeld left a comment

Choose a reason for hiding this comment

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

I'm still not entirely sure I'm following what this change is intended to do - could you elaborate on the background/context a bit more? My current understanding is that when we ship the toolchain we ship a single swift module with multiple architectures within it. Do I have that right? And if so, is this intending to change how that is done but only on some platforms where SwiftFoundation_INSTALL_ARCH_SUBDIR is set?

This is the proper installation scheme for Swift libraries and
prevents having to manually copy them in `build.ps1`.
* Update the C and C++ libraries to also install the arch
  sub-directory.
* Simplify the logic to gather the arch and triple data.
@Steelskin Steelskin force-pushed the fabrice/build-install-swift-libraries-arch-folder branch from ea40b13 to 81c5202 Compare August 29, 2025 22:26
@Steelskin
Copy link
Contributor Author

@jmschonfeld PTAL, my apologies it took me a while to get back to this.

I'm still not entirely sure I'm following what this change is intended to do - could you elaborate on the background/context a bit more? My current understanding is that when we ship the toolchain we ship a single swift module with multiple architectures within it. Do I have that right? And if so, is this intending to change how that is done but only on some platforms where SwiftFoundation_INSTALL_ARCH_SUBDIR is set?

The Windows toolchain layout expects that the native libraries are installed in an architecture sub-directory. There is a manual step in the build script for Windows to copy the libraries in the right folder that warns about these in this manner:

[2025-08-29T04:48:07.348Z] T:\Program Files\Swift\Platforms\Windows.platform\Developer\SDKs\WindowsExperimental.sdk\usr\lib\swift\windows\BlocksRuntime.lib is not nested in an architecture directory
[...]
[2025-08-29T04:48:07.348Z] T:\Program Files\Swift\Platforms\Windows.platform\Developer\SDKs\WindowsExperimental.sdk\usr\lib\swift_static\windows\_CFURLSessionInterface.lib is not nested in an architecture directory
[2025-08-29T04:48:07.348Z] T:\Program Files\Swift\Platforms\Windows.platform\Developer\SDKs\WindowsExperimental.sdk\usr\lib\swift_static\windows\_CFXMLInterface.lib is not nested in an architecture directory
[2025-08-29T04:48:07.348Z] T:\Program Files\Swift\Platforms\Windows.platform\Developer\SDKs\WindowsExperimental.sdk\usr\lib\swift_static\windows\_FoundationCShims.lib is not nested in an architecture directory
[...]

This PR aims to fix the problem by installing the libraries in the right directory with this new configuration option.

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