-
Notifications
You must be signed in to change notification settings - Fork 39
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
Enable Windows for Android emulator and JVM #240
Comments
Hello @thunderbiscuit., I am willing to contribute to this feature. However, I only have a little knowledge regarding this. Can you help me get started with understanding the issue? |
I think the first step for this is to use the workflow in the Gradle plugins we developed. Take time to review the code in there and see what it does. If you have access to a macOS or Linux operating system that will help you because you'll be able to see the files in your directories and see them move. You can basically call the commands one at a time to reproduce what the plugins are doing. When calling the This is probably a bit vague but I don't know the exact names of the files and directories you'll get when you build on Windows. You'll probably need to fiddle around with it a bit. Note that you'll need to add the triple above as a compilation target for your cargo tool (something like):
And from there your build command might look something like
And you'll have to see what comes out in your Feel free to use this thread as a place to ask questions. |
@thunderbiscuit is the generated bdk.kt file a sign of a successful build?? |
Yes that's a great start. The bindings really come down to two things:
The bdk.kt file references that binary library file. Building and connecting the two is the crux of the problem here, and I think you're going in the right direction for sure. |
@thunderbiscuit Yeah I was able to generate both. A small change here, though, is the format. I think the binary file format is .dll in windows, not .so . I made the changes in the UniFfiJvmPlugin file accordingly. What should be the next step I should follow?? |
Oh sweet ok yes that makes sense. Ok well step 1: you don't need to tag me in every message 🤣 (I am a maintainer of this repo so I get all messages/replies/PRs/issues). Step 2: You'll need the plugin to understand when it's being used on a Windows machine, and to have an enum variant for that in the Enums.kt file. From there you'll need custom logic to trigger the build command for the Windows target(s) (not sure which one you need of the two options above) and to move the binary files in their correct directories (I don't know what those would be for Windows I think you'll need to trial/error a bit for that or Stack Overflow). |
Sowwy for the first step 🤣 |
Mmmm ok. The ring crate giving you an error is super common, there are a few different places where this has come up. Are you attempting to build the bdk-jvm library first or the bdk-android? (start with bdk-jvm if you can). You're right I don't know how we should go about deciding which one of those two to build if the user has Windows. Assume it is whatever it is on your machine and you can make work, and from there we can iterate and add extra logic maybe to decide or choose between different builds (for example if the gradle task had an optional flag where you could ask which version of the Windows build you want to trigger). For now let's just keep it simple; if you can make it work on your machine, any of the two above is already a big win. We can work on enabling the other after that. Just putting this here for future reference: https://rust-lang.github.io/rustup/installation/windows.html |
Yeah I am building bdk-jvm first.
I will try to raise a PR soon. Hope I am in the right direction |
So I was able to build the bdk ffi lib, and after locally using the repo, I was finally able to run the tatooine server (in windows). |
Thanks for all the hard work on this, the bdk-jvm version compatible with Windows is now out! After looking into the two targets for Windows, I now think that supporting Here is what ChatGPT had to say about the difference between the two targets: Quoting ChatGPTIn Rust, when you target Windows, you have two major options for the ABI (Application Binary Interface) and the toolchain you can use. These two options are represented by the targets
Which one to choose depends on your specific needs. If you are interfacing with libraries that are compiled with MSVC or if performance is critical, you might choose the MSVC target. If, however, you are porting software from a Unix-like environment, or dealing with libraries that are compiled with GCC, then the GNU target might be more appropriate. In practice, the MSVC target is more commonly used for Windows development unless there are specific reasons to prefer the MinGW toolchain. |
Let's get these two working for the Android emulator and JVM:
The text was updated successfully, but these errors were encountered: