tschneidereit opened Issue #1720:
We're creating aarch64 builds in CI, but for people wanting to do so themselves using cross-compilation, it's hard to figure out how.
We should have documentation for how to do this for at least x64 Linux, but ideally also macOS and, if feasible, Windows.
CC @alexcrichton
tschneidereit labeled Issue #1720:
We're creating aarch64 builds in CI, but for people wanting to do so themselves using cross-compilation, it's hard to figure out how.
We should have documentation for how to do this for at least x64 Linux, but ideally also macOS and, if feasible, Windows.
CC @alexcrichton
tschneidereit labeled Issue #1720:
We're creating aarch64 builds in CI, but for people wanting to do so themselves using cross-compilation, it's hard to figure out how.
We should have documentation for how to do this for at least x64 Linux, but ideally also macOS and, if feasible, Windows.
CC @alexcrichton
tschneidereit commented on Issue #1720:
Oh, and ideally we'd have this for both Wasmtime and Cranelift, but those are probably separate tasks.
alexcrichton commented on Issue #1720:
Hm so in theory this is the same as cross-compilation of any other Rust code, where you'd first install a native toolchain for the linker and then you'd execute
cargo build --target aarch64-unknown-linux-gnu
.Beyond that I feel that documentation for Wasmtime would cover all the standard "this applies to all cross compilation in Rust" bullet points:
- A native toolchain which compiles to AArch64 is required.
- This is typically extremely difficult to obtain on macOS and Windows.
- If you're not using a package manager with an AArch64 toolchain on Linux, it's also likely extremely hard to obtain.
- The name of the toolchain in Linux package managers likely varies widely across distributions.
- You'll need to install the rustup target via
rustup target add
- The final binary shows up in
target/aarch64-unknown-linux-gnu/*
instead oftarget/*
@tschneidereit do you have an idea on what folks were getting tripped up on more specifically?
alexcrichton edited a comment on Issue #1720:
Hm so in theory this is the same as cross-compilation of any other Rust code, where you'd first install a native toolchain for the linker and then you'd execute
cargo build --target aarch64-unknown-linux-gnu
.Beyond that I feel that documentation for Wasmtime would cover all the standard "this applies to all cross compilation in Rust" bullet points:
- A native toolchain which compiles to AArch64 is required.
- This is typically extremely difficult to obtain on macOS and Windows.
- If you're not using a package manager with an AArch64 toolchain on Linux, it's also likely extremely hard to obtain.
- The name of the toolchain in Linux package managers likely varies widely across distributions.
- You'll need to install the rustup target via
rustup target add
- The final binary shows up in
target/aarch64-unknown-linux-gnu/*
instead oftarget/*
- You'll have to configure Cargo to pass the right linker to rustc since it otherwise won't find it.
@tschneidereit do you have an idea on what folks were getting tripped up on more specifically?
alexcrichton commented on Issue #1720:
To be clear it seems fine to document all this, it's just worth knowing that it's not really anything novel or specific to Wasmtime itself. I'm mostly just curious if there's something else that I'm missing about what we would need to document.
tschneidereit commented on Issue #1720:
@alexcrichton thank you for the explanation, that makes a lot of sense. Based on this Twitter thread, I tried building for Aarch64 myself, and honestly simply didn't know where to even begin. If there is good general documentation, perhaps we could link to that in our docs? Something like "follow this general guide, then take these exact steps for Wasmtime, specifically".
Also, I just realized that it'd be good to have this both for building the shared library and CLI, and for embedding in other Rust projects. I think the ladder is what @autodidaddict, @dlmanning, and @squillace are talking about in that Twitter thread.
tschneidereit commented on Issue #1720:
* This is typically extremely difficult to obtain on macOS and Windows.
Oh, and this is where the "if feasible" comes in :)
alexcrichton commented on Issue #1720:
I don't personally know of standard docs now that I think about it (so documenting this regardless definitely makes sense), although if others know some it'd be great to link!
That twitter looks a bit like the wrong version of the source is being used, especially if unsupported platform errors show up for AArch64. In any case I've opened https://github.com/bytecodealliance/wasmtime/pull/1721 to help improve the state of things.
alexcrichton closed Issue #1720:
We're creating aarch64 builds in CI, but for people wanting to do so themselves using cross-compilation, it's hard to figure out how.
We should have documentation for how to do this for at least x64 Linux, but ideally also macOS and, if feasible, Windows.
CC @alexcrichton
Last updated: Dec 23 2024 at 12:05 UTC