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

Deploying with a rustler_precompiled library #55

Closed
adiibanez opened this issue Feb 23, 2025 · 2 comments
Closed

Deploying with a rustler_precompiled library #55

adiibanez opened this issue Feb 23, 2025 · 2 comments

Comments

@adiibanez
Copy link

Is there any information available about integrating rustler libs? Specifically precompiled ones.
I also tried explorer project but mix desktop.installer fails too.

Looking at the logmessage I found /Users/runner/work/ and was wondering where that path is configured?

I would like to manually unpack the precompiled libs at the correct location. but /Users/runner/work seems like a problem. Haven't found any references to that path in the source code yet.

error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/otool-classic: can't open file: /Users/runner/work/rustler_btleplug/rustler_btleplug/native/btleplug_client/target/aarch64-apple-darwin/release/deps/libbtleplug_client.dylib (No such file or directory)
** (MatchError) no match of right hand side value: {"", 1}
(desktop_deployment 1.0.0) lib/tooling.ex:124: Desktop.Deployment.Tooling.cmd!/2
(desktop_deployment 1.0.0) lib/package/macos.ex:272: Desktop.Deployment.Package.MacOS.do_find_deps/1
(desktop_deployment 1.0.0) lib/tooling.ex:169: Desktop.Deployment.Tooling.find_deps/2
(elixir 1.18.2) lib/enum.ex:1722: anonymous fn/3 in Enum.map/2
(elixir 1.18.2) lib/enum.ex:4511: anonymous fn/3 in Enum.map/2
(elixir 1.18.2) lib/enum.ex:4964: Enumerable.List.reduce/3
(elixir 1.18.2) lib/enum.ex:4511: Enum.map/2

@dominicletz
Copy link
Collaborator

@adiibanez I think it would be an interesting idea to provide a fallback DESKTOP_LIBS=... or something to search for additional libraries.

That said the path /Users/runner/work/ is not hardcoded anywhere but it is extraced in lib/package/macos.ex from the libraries itself. So something in your app (probably a new nif) depends on /Users/runner/work/rustler_btleplug/rustler_btleplug/native/btleplug_client/target/aarch64-apple-darwin/release/deps/libbtleplug_client.dylib and that path is for some reason compiled into that binary. -- Strange that it's encoded there but not existing... Maybe some cleanup step has (re)moved it?

@adiibanez
Copy link
Author

I see. the lib is built that way, for the moment I just ignore any files that do not exist on the filesystem.
need to investigate rust compilation options

libbtleplug_client.dylib (compatibility version 0.0.0, current version 0.0.0)

adrianibanez@MacBookPro btleplug_client % otool -L /Users/adrianibanez/Library/Developer/CoreSimulator/Devices/B4FDFA07-FD5F-49DE-8643-4C6DD0E0553B/data/Containers/Data/Application/EBFA55A4-C305-4A01-A5EC-A796523C20FD/Library/com.sensocto.iOSErlang/app/lib/rustler_btleplug-0.0.11-alpha/priv/native/libbtleplug_client-v0.0.11-alpha-nif-2.15-aarch64-apple-darwin.so
/Users/adrianibanez/Library/Developer/CoreSimulator/Devices/B4FDFA07-FD5F-49DE-8643-4C6DD0E0553B/data/Containers/Data/Application/EBFA55A4-C305-4A01-A5EC-A796523C20FD/Library/com.sensocto.iOSErlang/app/lib/rustler_btleplug-0.0.11-alpha/priv/native/libbtleplug_client-v0.0.11-alpha-nif-2.15-aarch64-apple-darwin.so:
/Users/runner/work/rustler_btleplug/rustler_btleplug/native/btleplug_client/target/aarch64-apple-darwin/release/deps/libbtleplug_client.dylib (compatibility version 0.0.0, current version 0.0.0)
/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 2503.1.0)
/System/Library/Frameworks/AppKit.framework/Versions/C/AppKit (compatibility version 45.0.0, current version 2487.60.105)
/System/Library/Frameworks/CoreBluetooth.framework/Versions/A/CoreBluetooth (compatibility version 1.0.0, current version 1.0.0)
/System/Library/Frameworks/Foundation.framework/Versions/C/Foundation (compatibility version 300.0.0, current version 2503.1.0)
/usr/lib/libobjc.A.dylib (compatibility version 1.0.0, current version 228.0.0)
/usr/lib/libiconv.2.dylib (compatibility version 7.0.0, current version 7.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1345.120.2)

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

No branches or pull requests

2 participants