athenavm / athena

Athena monorepo
https://www.athenavm.org/
Apache License 2.0
21 stars 2 forks source link

release the lib on windows #234

Closed poszu closed 1 day ago

poszu commented 2 days ago

Enable testing the Go bindings on all supported targets and release the library for windows.

A successful pre-release with windows artifacts: https://github.com/athenavm/athena/releases/tag/nightly-70faee4e6d3c2dbf3b6325732ae767b2c9e744e3

The library on windows exhibited linker issues similar to #215. I found that this happens because the code, which is meant for running in the VM (the contents of athena-vm-sdk and athena-vm crates, specifically the athena-vm::heap package which contains the heap allocator for the guest programs) is a dependency of the athena-vmlib crate. This dependency was added to add export the encoding functions for the wallet.

I temporarily (?) resolved this problem by making the athena-vm an optional dependency of the athena-vm-sdk (enabled by default) to allow the athena-vmlib opting out from importing the VM-side code.

Long term, I think we should rethink whether the athena-vm-sdk is the right place for the wallet example structures definitions (like SpendArguments etc.). I believe this is not the right place and it should be defined in the wallet crate but I didn't want to refactor it in this PR.

poszu commented 1 day ago

For me it looks like this change, especially in vm/sdk/src/lib.rs is covering also #235. Right?

Yes, it fixes this problem, but I don't think it's the final solution.