Skip to content

Add swiftRegexBuilder dependency on Windows #1264

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

Conversation

Steelskin
Copy link

Following #1198 and #1262, this is needed to build on Windows.

Following swiftlang#1198 and swiftlang#1262, this is needed to build on Windows.
@@ -37,6 +37,7 @@ target_compile_options(FoundationInternationalization PRIVATE ${_SwiftFoundation
target_compile_options(FoundationInternationalization PRIVATE -package-name "SwiftFoundation")

target_link_libraries(FoundationInternationalization PUBLIC
$<$<PLATFORM_ID:Windows>:swiftRegexBuilder>
Copy link
Member

Choose a reason for hiding this comment

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

I wonder if this should be universal.

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure if I fully understand why this is required. We don't actually have any direct dependencies on any other swift targets so this one shouldn't be any different - we just get them all from the toolchain, we don't actually depend on cmake targets for any of the stdlib modules. If this is related to the current CI failure where plutil fails to link, I have a different fix in-flight that I'm about to push that doesn't require adding this dependency

Copy link
Author

Choose a reason for hiding this comment

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

I was not certain and I am assuming this was tested on macOS. Since I don't know how this was tested on macOS, I decided to limit it to Windows out of an abundance of caution.

Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a build failure somewhere that you saw that prompted the need to add this?

Copy link
Contributor

Choose a reason for hiding this comment

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

The plutil linking failure related to an implicitly imported symbol from RegexBuilder is being resolved at swiftlang/swift-corelibs-foundation#5204 if that's the failure that prompted this

Copy link
Author

Choose a reason for hiding this comment

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

Following #1265, there is still one missing symbol:

ICUDateFormatter.swift.obj : error LNK2019: unresolved external symbol __imp_$sSS17_StringProcessing14RegexComponent0C7BuilderMc referenced in function $sS2S17_StringProcessing14RegexComponent0C7BuilderWl
Duration+UnitsFormatStyle.swift.obj : error LNK2001: unresolved external symbol __imp_$sSS17_StringProcessing14RegexComponent0C7BuilderMc
TimeZone_ICU.swift.obj : error LNK2001: unresolved external symbol __imp_$sSS17_StringProcessing14RegexComponent0C7BuilderMc
bin\FoundationInternationalization.dll : fatal error LNK1120: 1 unresolved externals

Copy link
Contributor

Choose a reason for hiding this comment

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

Are there any other linking errors / do you have a full build log I can help look at? It looks like those are just type metadata symbols and I'm not certain why the binary would still be referencing the conformance symbols when it no longer calls the function that requires the conformance (unless there's still another call somewhere in there)

Copy link
Contributor

Choose a reason for hiding this comment

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

Just merged #1268 as well, which should resolve this problem for now. We'll continue to investigate how to land the original change without requiring client modules to link the RegexBuilder library

Copy link
Author

Choose a reason for hiding this comment

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

Copy link
Author

Choose a reason for hiding this comment

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

Just merged #1268 as well, which should resolve this problem for now. We'll continue to investigate how to land the original change without requiring client modules to link the RegexBuilder library

Thank you, there are other issues on swift-ci that prevent checking for the fix but I can confirm that the issue is fixed with our CI with these changes.

@compnerd compnerd requested a review from jmschonfeld April 22, 2025 15:40
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 also just merged #1265 which avoids the link to regex builder on all platforms since the usage isn't Windows specific. So I think any issues should be resolved here now, but let me know if you continue to see any fallout of the change. We shouldn't need to link regex builder from this module since it shouldn't be using it (currently) and if we do I don't think depending on the cmake target will work to make that happen.

@Steelskin
Copy link
Author

I also just merged #1265 which avoids the link to regex builder on all platforms since the usage isn't Windows specific. So I think any issues should be resolved here now, but let me know if you continue to see any fallout of the change. We shouldn't need to link regex builder from this module since it shouldn't be using it (currently) and if we do I don't think depending on the cmake target will work to make that happen.

Just saw your comment. I am going to start a new build with your changes and update you.

@Steelskin Steelskin closed this Apr 23, 2025
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