containers/podlet

Unable to build on arm64

wolf-yuan-6115 opened this issue · 8 comments

I want to run this on a Raspberry Pi, but I can't get it built

Logs
error[E0463]: can't find crate for `core`
  |
  = note: the `aarch64-unknown-linux-musl` target may not be installed
  = help: consider downloading the target with `rustup target add aarch64-unknown-linux-musl`

error[E0463]: can't find crate for `compiler_builtins`

error[E0463]: can't find crate for `core`
    --> /home/wolf/.cargo/registry/src/index.crates.io-6f17d22bba15001f/pin-project-lite-0.2.13/src/lib.rs:1622:9
     |
1622 |     use core::mem::ManuallyDrop;
     |         ^^^^ can't find crate
     |
     = note: the `aarch64-unknown-linux-musl` target may not be installed
     = help: consider downloading the target with `rustup target add aarch64-unknown-linux-musl`

error[E0463]: can't find crate for `core`
    --> /home/wolf/.cargo/registry/src/index.crates.io-6f17d22bba15001f/pin-project-lite-0.2.13/src/lib.rs:1624:13
     |
1624 |     pub use core::{
     |             ^^^^ can't find crate
     |
     = note: the `aarch64-unknown-linux-musl` target may not be installed
     = help: consider downloading the target with `rustup target add aarch64-unknown-linux-musl`

error[E0405]: cannot find trait `Sized` in this scope
    --> /home/wolf/.cargo/registry/src/index.crates.io-6f17d22bba15001f/pin-project-lite-0.2.13/src/lib.rs:1633:32
     |
1633 |     pub struct AlwaysUnpin<T: ?Sized>(PhantomData<T>);
     |                                ^^^^^ not found in this scope

error[E0405]: cannot find trait `Sized` in this scope
    --> /home/wolf/.cargo/registry/src/index.crates.io-6f17d22bba15001f/pin-project-lite-0.2.13/src/lib.rs:1635:14
     |
1635 |     impl<T: ?Sized> Unpin for AlwaysUnpin<T> {}
     |              ^^^^^ not found in this scope

error[E0405]: cannot find trait `Sized` in this scope
    --> /home/wolf/.cargo/registry/src/index.crates.io-6f17d22bba15001f/pin-project-lite-0.2.13/src/lib.rs:1639:43
     |
1639 |     pub struct UnsafeDropInPlaceGuard<T: ?Sized>(*mut T);
     |                                           ^^^^^ not found in this scope

error[E0405]: cannot find trait `Sized` in this scope
    --> /home/wolf/.cargo/registry/src/index.crates.io-6f17d22bba15001f/pin-project-lite-0.2.13/src/lib.rs:1641:14
     |
1641 |     impl<T: ?Sized> UnsafeDropInPlaceGuard<T> {
     |              ^^^^^ not found in this scope

error[E0405]: cannot find trait `Sized` in this scope
    --> /home/wolf/.cargo/registry/src/index.crates.io-6f17d22bba15001f/pin-project-lite-0.2.13/src/lib.rs:1648:14
     |
1648 |     impl<T: ?Sized> Drop for UnsafeDropInPlaceGuard<T> {
     |              ^^^^^ not found in this scope

Some errors have detailed explanations: E0405, E0463.
For more information about an error, try `rustc --explain E0405`.
error: could not compile `pin-project-lite` (lib) due to 9 previous errors
warning: build failed, waiting for other jobs to finish...
error: failed to compile `podlet v0.2.3`, intermediate artifacts can be found at `/tmp/cargo-installyUy4YD`.
To reuse those artifacts with a future compilation, set the environment variable `CARGO_TARGET_DIR` to that path.
ERROR Cargo errored! ExitStatus(unix_wait_status(25856))
ERROR Fatal error:
binstall::subprocess

  × subprocess /usr/bin/cargo install podlet --version 0.2.3 --target aarch64-unknown-linux-musl errored with exit status: 101

From the beginning of your logs:

= note: the aarch64-unknown-linux-musl target may not be installed
= help: consider downloading the target with rustup target add aarch64-unknown-linux-musl

Did you install Rust with rustup, or another way? Have you added the aarch64-unknown-linux-musl target?

From the beginning of your logs:

= note: the aarch64-unknown-linux-musl target may not be installed
= help: consider downloading the target with rustup target add aarch64-unknown-linux-musl

Did you install Rust with rustup, or another way? Have you added the aarch64-unknown-linux-musl target?

I did it through cargo binstall podlet and wrote my container file myself because it's taking too long to build.

I don't think you read what I asked. Did you install Rust (rustc, cargo, etc.) with rustup or by another method such as your package manager (e.g. apt, dnf)?

wrote my container file myself because it's taking too long to build.

The Containerfile builds podlet in release mode with lto enabled. There also linux/arm64 images available on quay.io and docker hub.

I don't think you read what I asked. Did you install Rust (rustc, cargo, etc.) with rustup or by another method such as your package manager (e.g. apt, dnf)?

wrote my container file myself because it's taking too long to build.

The Containerfile builds podlet in release mode with lto enabled. There also linux/arm64 images available on quay.io and docker hub.

I installed rust via dnf, and I'm not familiar with rust ecosystem.

Well I just tried cargo binstall podlet again, and seems like it successfully got the pre-built binary now.
image

podlet -V also reported latest version

Huh, that's interesting. I didn't know that the QuickInstall people were making aarch64-unknown-linux-musl builds of podlet.

I installed rust via dnf, and I'm not familiar with rust ecosystem.

For future reference, assuming you are using Fedora (or a distro with the same package names), you need to install the rust-std-static package in order to build Rust programs.

Huh, that's interesting. I didn't know that the QuickInstall people were making aarch64-unknown-linux-musl builds of podlet.

I installed rust via dnf, and I'm not familiar with rust ecosystem.

For future reference, assuming you are using Fedora (or a distro with the same package names), you need to install the rust-std-static package in order to build Rust programs.

Yes, I'm using Fedora, thanks for your information.

I'm glad I was able to help 😄 .