containerd-wasm-shims icon indicating copy to clipboard operation
containerd-wasm-shims copied to clipboard

Errors while building spin shim on Apple Silicon M1

Open bindsi opened this issue 1 year ago • 1 comments

When I want to build the ../containerd-shim-spin-v1 project by running cargo build --manifest=./Cargo.toml on Apple Silicon M1 Macbook I get the following error:

error[E0425]: cannot find function prctlin cratelibc --> /Users/marcelbindseil/.cargo/registry/src/index.crates.io-6f17d22bba15001f/caps-0.5.5/src/ambient.rs:39:15

xCode and rust target 'aarch64-apple-darwin' are installed.

Any idea how to solve it?

bindsi avatar Jun 24 '23 09:06 bindsi

I don't think that's currently feasible due to this issue: https://github.com/containerd/runwasi/issues/42

However, you can use cross to build statically linked ARM binary. Here is a command that helps to do

cross test --release --manifest-path=containerd-shim-spin-v1/Cargo.toml --target aarch64-unknown-linux-musl

Mossaka avatar Jun 26 '23 23:06 Mossaka