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

Standalone build for WASM runtime for developers #532

Closed
Tracked by #530
mattgeddes opened this issue Oct 3, 2023 · 5 comments
Closed
Tracked by #530

Standalone build for WASM runtime for developers #532

mattgeddes opened this issue Oct 3, 2023 · 5 comments
Assignees
Labels
documentation Improvements or additions to documentation enhancement New feature or request must-have Considered required for a particular milestone
Milestone

Comments

@mattgeddes
Copy link
Contributor

mattgeddes commented Oct 3, 2023

We need to package up the WASM runtime to not only be able to be executed as part of the protocol/consensus, but also for developers to be able to execute it locally and without the network as a way to test/debug their smart contract code. This means building binaries for x86_64 and aarch64, as well as Linux, Darwin, etc. It will also no-doubt include adding better diagnostics for contracts and some documentation for its use.

@mattgeddes mattgeddes mentioned this issue Oct 3, 2023
7 tasks
@mattgeddes mattgeddes self-assigned this Nov 2, 2023
@mattgeddes mattgeddes added documentation Improvements or additions to documentation enhancement New feature or request must-have Considered required for a particular milestone labels Nov 2, 2023
@mattgeddes mattgeddes added this to the betanet milestone Nov 2, 2023
@mattgeddes
Copy link
Contributor Author

I think the Rust targets we want to add for this are:

  1. x86_64-unknown-linux-musl
  2. aarch64-unknown-linux-musl
  3. x86_64-apple-darwin
  4. aarch64-apple-darwin
  5. x86_64-pc-windows-msvc
  6. aarch64-pc-windows-msvc

It'd kinda cool to also include x86_64-unknown-freebsd too unless there's a reason why it won't build (it currently builds).

For the Linux builds, we're going with MUSL libc so that we end up with a single, statically linked binary. There is currently still an open issue preventing this (#533 ).

For the Windows binaries, we may be able to use the GNU target instead of the MSVC ones if there's an issue, but let's try for MSVC first.

@mikehostetler suggested that github tags and actions might be able to handle this all for us. We should probably also formalise how we tag versions on the repo and keep it in sync with Cargo.toml so that we don't have to remember to set both.

@mattgeddes
Copy link
Contributor Author

The build issues for this are done. We still have a couple of changes we want to make (#716 if possible, and a small change to publish a contract), but it ought to be possible to do a build from the automation and show it working, and we can do a final build once we get the final changes in.

@mikehostetler
Copy link
Collaborator

@mattgeddes I was able to get a successful build for x86_64-unknown-linux-musl, but all other architectures aren't easily supported by Github Runners.

We can look at hosting our own runners - but I'd recommend we split that out of this ticket.

I was also able to get tagging sorted for the entire repository as well. I'm going to limit the scope of this ticket to building for the one architecture we can support for now, tagging and that's it. Welcome other input on steps to investigate or take if needed.

@mattgeddes
Copy link
Contributor Author

OK. We can't ship without other architectures. "You can use any language and tools you like.... except only on Linux" isn't as shiny :) . At this late point, it's probably going to end up in my lap to manually build all of the binaries. I've checked my lab and I think I can do:

  • linux + x86_64
  • linux + aarch64
  • linux + arm
  • darwin + x86_64
  • darwin + aarch64
  • freebsd + x86_64

Given a cheap mini-PC off Amazon, I can probably add windows + x86_64 and windows + aarch64 to that list too.

I'll likely spend a little time partially orchestrating it, rather than doing it by hand each time. I suspect we'll be rebuilding quite a bit in the early days.

@mattgeddes
Copy link
Contributor Author

I'm doing this by hand for each architecture on a bunch of my own hardware. Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request must-have Considered required for a particular milestone
Projects
None yet
Development

No branches or pull requests

2 participants