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

Ensure that iOS builds get correct library identity for native libraries #43302

Merged
merged 4 commits into from
Oct 12, 2020

Conversation

filipnavara
Copy link
Member

Fixes #34637

I am not 100% sure this is the right place to put it. The otool -L output now looks like this:

otool -L /Users/filipnavara/Projects/runtime/artifacts/bin/native/net6.0-iOS-Debug-x64/./libSystem.IO.Compression.Native.dylib
/Users/filipnavara/Projects/runtime/artifacts/bin/native/net6.0-iOS-Debug-x64/./libSystem.IO.Compression.Native.dylib:
	@rpath/libSystem.IO.Compression.Native.dylib (compatibility version 0.0.0, current version 0.0.0)
	/usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.11)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1292.0.0)

/cc @akoeplinger @rolfbjarne

@ghost
Copy link

ghost commented Oct 12, 2020

Tagging subscribers to this area: @safern, @ViktorHofer
See info in area-owners.md if you want to be subscribed.

Copy link
Member

@akoeplinger akoeplinger left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@filipnavara filipnavara marked this pull request as ready for review October 12, 2020 12:53
@akoeplinger
Copy link
Member

Looks like the iOS arm64 build fails with:

##[error]ld(0,0): error : (NETCORE_ENGINEERING_TELEMETRY=Build) embedded dylibs/frameworks only run on iOS 8 or later

We're indeed targetting iOS 7 for device builds and iOS 8 for simulator. @rolfbjarne do you know what this error means, should we use @executable_path instead?

@filipnavara
Copy link
Member Author

That's quite unfortunate. I think Xamarin itself uses @rpath but it does it through install_name_tool and not the linker. That may simply behave differently and ignore the iOS version. It also seems that @rpath actually worked on iOS 7 but it was not officially supported.

@filipnavara
Copy link
Member Author

Hm, @executable_path fails with the exact same error.

@akoeplinger
Copy link
Member

Looks like this is usually a warning instead of an error but we're using warnings-as-errors so this gets turned into an error.

@akoeplinger
Copy link
Member

We discussed on Discord and iOS 8 is fine as the minimum version these days.

@akoeplinger akoeplinger merged commit 12299e2 into dotnet:master Oct 12, 2020
@rolfbjarne
Copy link
Member

We discussed on Discord and iOS 8 is fine as the minimum version these days.

8.0 as the minimum version is fine for dynamic libraries or frameworks, it's not for static libraries, since we still support iOS 7.

We're indeed targetting iOS 7 for device builds and iOS 8 for simulator.

Apple is dropping support for older simulators quite aggressively, so there's not much purpose in building for a simulator you can never use. On the other hand it's still possible to build for older device versions in Xcode.

@ghost ghost locked as resolved and limited conversation to collaborators Dec 7, 2020
@filipnavara filipnavara deleted the ios-rpath branch April 21, 2021 10:54
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Dynamic libraries in the microsoft.netcore.app.runtime.ios-x64 package has incorrect identity
4 participants