-
Notifications
You must be signed in to change notification settings - Fork 3
Add builds & dynamic loading for four targets #67
Conversation
I'm moving this to a Draft, I want to reconsider a few things |
@nitro-neal heads up on this PR because I went a slightly different direction then when we last spoke. I decided to use the GitHub Workflow specifically for testing the loading of the shared library across the four targets, and building has been moved to Another thing, I couldn't quite get the |
COPY crates/tbdex ./crates/tbdex | ||
|
||
# Build the static lib (override the lib type) | ||
RUN sed -i 's/crate-type = \["cdylib"\]/crate-type = \["staticlib"\]/' bindings/tbdex_uniffi/Cargo.toml |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe in the future this can be an env variable instead of sed
ing
import tbdex.sdk.web5.BearerDid | ||
import tbdex.sdk.rust.getBalances as rustCoreGetBalances | ||
|
||
fun getBalances(pfiDidUri: String, bearerDid: BearerDid): List<Balance> { | ||
SystemArchitecture.set() // ensure the sys arch is set for first-time loading |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There must be a way to call this when someone does an import on tbdex-kt..
like maybe a wrapper around the entire sdk thats like this:
class TbdexWrapper {
companion object {
init {
SystemArchitecture.set()
}
}
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably other ways too, we can experiment with it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Its pretty ugly with the SystemArchitecture.set()
I think first priority would be to figure out how to do it in just one place on init somewhere
* Add latest web5, make RfqPrivateData optional * Add SubmitOrderRequestBody, add dev print statements to httpclient * Add latest bindings for 2 macOS targets * Add serde skip for null * Add latest bindings * Fix Rfq binding * Add fat jar build support * Build linux shared libs * Undo temporary integration changes * Add latest bindings * Rename directories to use underscores to be consistent
bindings/tbdex_uniffi/libtargets
for building the 4 targets we supportSystemArchitecture.set()
inbound/kt
and add calls in all relevant places (this ensures the proper system architecture is detected prior to UniFFI's codegen'dNative.load()
aarch64-apple-darwin
🚧 we'll make this dynamic later, but right now all major developers are running Apple silicon