Skip to content
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

[Swift] let the Swift Package Manager choose between static or dynamic linking #3743

Closed
wants to merge 2 commits into from

Conversation

100mango
Copy link
Contributor

@100mango 100mango commented Jun 8, 2022

When building an executable target using Swift Package Manager, We should depend on a static Antlr runtime framework to make a portable executable binary.

Or we will have to deal with the linker problem like:

dyld[36790]: Library not loaded: @rpath/libAntlr4.dylib
  Referenced from: /Users/100mango/Desktop/RossetaDartDemo/Rosseta
  Reason: tried: '/usr/lib/swift/libAntlr4.dylib' (no such file),
 '/Users/100mango/Desktop/RossetaDartDemo/../lib/libAntlr4.dylib' (no such file),
 '/usr/lib/swift/libAntlr4.dylib' (no such file), 
'/Users/100mango/Desktop/RossetaDartDemo/../lib/libAntlr4.dylib' (no such file),
 '/usr/local/lib/libAntlr4.dylib' (no such file), 
'/usr/lib/libAntlr4.dylib' (no such file)

@parrt parrt added this to the 4.10.2 milestone Jun 25, 2022
@parrt
Copy link
Member

parrt commented Jun 25, 2022

hi. How certain are you of this change? Well this affect people that are expecting dynamic?

…ager choose between static or dynamic linking (recommended).
@100mango 100mango changed the title [Swift] runtime as static framework [Swift] let the Swift Package Manager choose between static or dynamic linking Jun 28, 2022
@100mango
Copy link
Contributor Author

@parrt Good Point👍 A better approach is to leave this parameter unspecified (done)。

According to Apple Docs:
" Leave this parameter unspecified to let the Swift Package Manager choose between static or dynamic linking (recommended)."

@KvanTTT
Copy link
Member

KvanTTT commented Jun 28, 2022

Hi. Not sure it should be removed. Have you tried runtime tests with removed option? They don't work for me if the option is removed because Antlr4.lib and Antlr4.dll are absent at least on Windows.

@HellGhost
Copy link
Contributor

#3669

@parrt
Copy link
Member

parrt commented Jul 5, 2022

Hi gang. Can you help me understand the status here? Do we need this and #3669 or does #3669 supersede this one? thanks!

@serhiybobyr-tomtom
Copy link

Hi gang. Can you help me understand the status here? Do we need this and #3669 or does #3669 supersede this one? thanks!

By default the current changes are enough and are recommended. #3669 supersedes this one. Beside the recommended way it also specifies 2 more products. So as a result swift build will produce static and dynamic libraries the default one will only produce object files which then you can choose to what used it for. BTW the other PR bumps swift version from 5.3 straight to 5.6 which is not related to this at all and raises a question why not 5.5 or 5.7.

@parrt
Copy link
Member

parrt commented Aug 4, 2022

Closed in favor of #3669. thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants