royalapplications / beyondnet

A toolset that makes it possible to call .NET code from other programming languages, including C, Swift and Kotlin.
https://royalapps.com
MIT License
111 stars 5 forks source link

Builder fails with Xcode 15 (worked around for now) #61

Open lemonmojo opened 1 year ago

lemonmojo commented 1 year ago

Xcode 15 seems to have issues with symlinks when creating XCFrameworks.

The fix likely involves passing it absolute/resolved paths.

lemonmojo commented 1 year ago

Workaround is now in place until an Xcode update which fixes the issue is out.

lemonmojo commented 1 year ago

We could further improve the code by resolving symlinks on macOS using [NSString stringByResolvingSymlinksInPath].

For reference, here's a quick POC showing how to call ObjC from C#: https://github.com/lemonmojo/SimpleDotNETObjCInterop

There's now a string extension in the repo called ResolveSymlinks_AppleOnly which resolves symlinks using NSString APIs. It's not in use yet though.

lemonmojo commented 1 year ago

Another problem here is that .NET 8 RC1's NativeAOT doesn't play nice with Xcode 15's new linker. See https://github.com/dotnet/runtime/issues/92491.

As mentioned here, we worked around this by adding -ld_classic as an additional linker flag in the generated csproj for now.

We hope to be able to remove this once .NET 8 RC2 is out.

lemonmojo commented 1 year ago

-ld_classic is not required with RC2 anymore so the workaround has been removed in https://github.com/royalapplications/beyondnet/commit/e1336106d4a7ba6df72473f79cfc9d5347bc1cdb.

lemonmojo commented 1 year ago

I haven't yet tested if Xcode 15.1 Beta fixes the symlink issue with xcodebuild. I'll check when 15.1 is released.

lemonmojo commented 10 months ago

Still not fixed in Xcode 15.1

lemonmojo commented 4 months ago

Note to self: Test again with Xcode 16 Beta