You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Can somebody please point me in the right direction here.. we're intending to make use of SwiftRs in one of our projects to avoid duplicating implementation for a specific shared functionality between apps where we have a pre-existing implementation in Swift. We currently need to distribute our apps as a universal binary.
Unfortunately, when attempting to build a universal binary I've discovered that something has gone wrong at the linker stage and I get an error related to not being able to load @rpath/libswiftCore.dylib
To make sure I hadn't done anything wrong, I've grabbed the example from this repo and I am seeing the same behaviour. Compiling and running the example natively on my Apple Silicon Mac works as expected, but when I compile for x86_64 architecture things don't work. Compile command in this case is cargo build --target x86_64-apple-darwin
$ target/x86_64-apple-darwin/debug/example
dyld[31266]: Library not loaded: @rpath/libswiftCore.dylib
Referenced from: <7923220E-4AA3-3374-AAC3-53D979383A00> /<snipped>/swift-rs-main/example/target/x86_64-apple-darwin/debug/example
Reason: no LC_RPATH's found
zsh: abort target/x86_64-apple-darwin/debug/example
I can modify the resulting binary by adding an rpath for /usr/lib/swift by doing install_name_tool -add_rpath /usr/lib/swift target/x86_64-apple-darwin/debug/example, then then results in the binary running as expected
$ target/x86_64-apple-darwin/debug/example
length of base64 encoded thumbnail: 1054264
First Volume Name: Macintosh HD
function returned nil: true
function returned data: true
But this doesn't feel like the "correct" solution to me.
Any help/advise greatly appreciated.
The text was updated successfully, but these errors were encountered:
I should note that I have seen the mention of Tauri .... but we're not using that, and I'm unaware of how the tauri build system sets the build environment to correct this when the documented option is set appropriately.
Hey all,
Can somebody please point me in the right direction here.. we're intending to make use of SwiftRs in one of our projects to avoid duplicating implementation for a specific shared functionality between apps where we have a pre-existing implementation in Swift. We currently need to distribute our apps as a universal binary.
Unfortunately, when attempting to build a universal binary I've discovered that something has gone wrong at the linker stage and I get an error related to not being able to load
@rpath/libswiftCore.dylib
To make sure I hadn't done anything wrong, I've grabbed the example from this repo and I am seeing the same behaviour. Compiling and running the example natively on my Apple Silicon Mac works as expected, but when I compile for x86_64 architecture things don't work. Compile command in this case is
cargo build --target x86_64-apple-darwin
I can modify the resulting binary by adding an rpath for
/usr/lib/swift
by doinginstall_name_tool -add_rpath /usr/lib/swift target/x86_64-apple-darwin/debug/example
, then then results in the binary running as expectedBut this doesn't feel like the "correct" solution to me.
Any help/advise greatly appreciated.
The text was updated successfully, but these errors were encountered: