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

Docker build failed on arm64 #164

Closed
Kwaskoff opened this issue Jan 14, 2021 · 7 comments
Closed

Docker build failed on arm64 #164

Kwaskoff opened this issue Jan 14, 2021 · 7 comments

Comments

@Kwaskoff
Copy link

Kwaskoff commented Jan 14, 2021

I can't build it and try docker buiding
https://github.com/CosmWasm/wasmvm/tree/master/builders#usage
but..
image
Docker was made for what?!🙃
OS: Ubuntu 18.04 L4T arm64
rustc 1.49.0 (e1884a8e3 2020-12-29)
go version go1.15.6 linux/arm64

@ethanfrey
Copy link
Member

There is no arm support #53

The only request we had before was to run on Rasberry Pi, which seemed like a nice toy server, and definitely not a dev machine. I think you are the first person trying to run on an arm64 based dev machine. Maybe you want to look into #53 first?

You should be able to simple make release-build-linux in root, if the docker images are already on docker hub.

@webmaster128
Copy link
Member

I just tried to re-build the Docker image on an Intel Mac. This works:

$ (cd builders && make docker-image-centos7)

…

 11950K .......... .......... .......... .......... .......... 95% 12.9M 0s
 12000K .......... .......... .......... .......... .......... 96% 64.5M 0s
 12050K .......... .......... .......... .......... .......... 96% 27.6M 0s
 12100K .......... .......... .......... .......... .......... 97% 16.3M 0s
 12150K .......... .......... .......... .......... .......... 97% 28.5M 0s
 12200K .......... .......... .......... .......... .......... 97% 13.4M 0s
 12250K .......... .......... .......... .......... .......... 98% 25.4M 0s
 12300K .......... .......... .......... .......... .......... 98% 63.4M 0s
 12350K .......... .......... .......... .......... .......... 99% 9.70M 0s
 12400K .......... .......... .......... .......... .......... 99% 29.5M 0s
 12450K .......... .......... .......... .......... .......... 99% 12.3M 0s
 12500K .......... ......                                     100% 44.7M=1.0s

2021-01-14 13:32:31 (12.0 MB/s) - 'rustup-init' saved [12817272/12817272]

info: profile set to 'default'
info: default host triple is x86_64-unknown-linux-gnu
info: syncing channel updates for '1.49.0-x86_64-unknown-linux-gnu'
info: latest update on 2020-12-31, rust version 1.49.0 (e1884a8e3 2020-12-29)
info: downloading component 'cargo'
info: downloading component 'clippy'
info: downloading component 'rust-docs'
info: downloading component 'rust-std'
info: downloading component 'rustc'
info: downloading component 'rustfmt'
info: installing component 'cargo'
info: using up to 500.0 MiB of RAM to unpack components
info: installing component 'clippy'
info: installing component 'rust-docs'
info: installing component 'rust-std'
info: installing component 'rustc'
info: installing component 'rustfmt'
info: default toolchain set to '1.49.0-x86_64-unknown-linux-gnu'

  1.49.0-x86_64-unknown-linux-gnu installed - rustc 1.49.0 (e1884a8e3 2020-12-29)


Rust is installed now. Great!

To get started you need Cargo's bin directory (/usr/local/cargo/bin) in your 
PATH
environment variable.

To configure your current shell, run:
source /usr/local/cargo/env
rustup 1.23.1 (3df2264a9 2020-11-30)
info: This is the version for the rustup toolchain manager, not the rustc compiler.
info: The currently active `rustc` version is `rustc 1.49.0 (e1884a8e3 2020-12-29)`
cargo 1.49.0 (d00d64df9 2020-12-05)
rustc 1.49.0 (e1884a8e3 2020-12-29)
Removing intermediate container f23a78eea584
 ---> b83c70eb3f27

I don't know what the expected behaviour is. Can you execute Linux x86_64 guests on Linux arm64 hosts?

@ethanfrey
Copy link
Member

Looking at the actual builder docker images, I see two points.

  1. If you only need this for linux, you can make docker-image-centos7 which makes a linux docker using a very old version of glibc (use make docker-image-alpine if you want muslc).
  2. Our images assume x86-64 architecture: RUN url="https://static.rust-lang.org/rustup/dist/x86_64-unknown-linux-gnu/rustup-init"; ...

As mentioned in #53 there are currently no resources to add arm support. If you just want to use this project with minimal hassle, I would suggest you develop on an x86 server (you can rent a cloud one to compile this there). Contract development should be fine on arm64.

If you have time/energy and really want this on arm64, I suggest you start working to compile these versions in a PR. I would suggest starting with local compilation on linux only, rather than all the build scripts (meant for releases). The first step would be that make build-rust && make test pass in your local dev environment.

@ethanfrey
Copy link
Member

Can you execute Linux x86_64 guests on Linux arm64 hosts?

Docker doesn't emulate, but rather hooks into all syscalls. The same is true of eg. virtualbox.
You would need something like qemu. There are plenty of docs on how to run arm64 guests on x86 hosts, and it seems possible to do the reverse as well

@ethanfrey ethanfrey changed the title Docker build failed Docker build failed on arm64 Jan 19, 2021
@faddat
Copy link
Contributor

faddat commented Mar 16, 2021

I'll be playing with this, and will chime in if I can get something working.

@ethanfrey
Copy link
Member

@faddat I'd love to accept any PRs on this.

First, I'd suggest trying to run the full test suite on the cosmwasm repo on an arm64 system with singlepass enabled to ensure this works in general. Then, figuring out how to build wasmvm on an arm64 system would be awesome. https://github.com/wasmerio/wasmer may be a useful place to raise issues (or search for them) with arm64 compatibility for the underlying engine.

@webmaster128
Copy link
Member

ARM support is tracked at #53. Looks like this is not moving due to the lack of ARM support in singlepass.

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

4 participants