Skip to content

Add arm64-osx-dynamic triplet#17363

Merged
BillyONeal merged 1 commit intomasterfrom
unknown repository
Apr 29, 2021
Merged

Add arm64-osx-dynamic triplet#17363
BillyONeal merged 1 commit intomasterfrom
unknown repository

Conversation

@ghost
Copy link
Copy Markdown

@ghost ghost commented Apr 19, 2021

Describe the pull request

  • What does your PR fix?

Adds a new triplet for dynamic libraries for arm64 on osx. I copied the existing arm64-osx triplet and simply changed VCPKG_LIBRARY_LINKAGE to dynamic. I tested with ./vcpkg install sdl2:arm64-osx-dynamic and it successfully built a .dylib instead of a .a.

  • Which triplets are supported/not supported? Have you updated the CI baseline?

N/A, this is just adding a new community triplet.

Yes

  • If you have added/updated a port: Have you run ./vcpkg x-add-version --all and committed the result?

N/A, not a change to any ports

@JackBoosY JackBoosY added the category:community-triplet A PR or issue related to community triplets not officially validated by the vcpkg team. label Apr 20, 2021
@JackBoosY JackBoosY added the info:needs-maintainer-attention Lets the current 'on rotation' vcpkg maintainer know they need to look at this. label Apr 20, 2021
@BillyONeal
Copy link
Copy Markdown
Member

I'm marking this requires: discussion because to my understanding this could be bad for the same reason we don't provide dynamic linux triplets, even under community; because we have no means of arranging for the loader to ever find the right libs. (getting into community means we have to not know it won't work)

I do observe there already is an x64-osx-dynamic. Either:

  1. osx is different than linux enough in how it finds dynamic libs that both triplets are fine, or
  2. osx is exactly like linux and both this port should be rejected and x64-osx-dynamic should be deleted.

Related: #15006 #16332

@BillyONeal BillyONeal added requires:discussion and removed info:needs-maintainer-attention Lets the current 'on rotation' vcpkg maintainer know they need to look at this. labels Apr 28, 2021
@ghost
Copy link
Copy Markdown
Author

ghost commented Apr 29, 2021

Can't say I have deep knowledge in dynamic loading nor am I heavily invested either way for vcpkg; I only submitted this PR while testing vcpkg for a project and noticing there was no dynamic arm64 triplet.

For my purposes, the games I build on macOS use dylibs for things like SDL2 which use @rpath for their ID. When I build my app against those libs, I use Xcode's feature to embed and sign the dylibs so that my app bundle includes the dynamic libraries in the correct location in the bundle, with my executable configuring the rpath such that the dylibs load correctly.

I personally don't ever build and distribute non-bundled apps on macOS so that distribution channel might have more issues here, but I believe rpath can still be used there.

@BillyONeal
Copy link
Copy Markdown
Member

I see, so the bundling process fixes up rpath to be all relative within the bundle correctly? That is something meaningfully different than linux which argues to merge this.

@BillyONeal
Copy link
Copy Markdown
Member

After a conversation with @strega-nil we're going to merge this.

Thanks for your contribution!

@BillyONeal BillyONeal merged commit e93ea4e into microsoft:master Apr 29, 2021
@ghost ghost deleted the add-arm64-osx-dynamic-triplet branch April 30, 2021 00:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

category:community-triplet A PR or issue related to community triplets not officially validated by the vcpkg team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants