containers / podlet

Generate Podman Quadlet files from a Podman command, compose file, or existing object
https://crates.io/crates/podlet
Mozilla Public License 2.0
422 stars 12 forks source link

Unable to build on arm64 #56

Closed wolf-yuan-6115 closed 8 months ago

wolf-yuan-6115 commented 8 months ago

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(PhantomData); | ^^^^^ 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 Unpin for AlwaysUnpin {} | ^^^^^ 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(*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 UnsafeDropInPlaceGuard { | ^^^^^ 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 Drop for UnsafeDropInPlaceGuard { | ^^^^^ 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 ```
k9withabone commented 8 months ago

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?

wolf-yuan-6115 commented 8 months ago

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.

k9withabone commented 8 months ago

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.

wolf-yuan-6115 commented 8 months ago

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.

wolf-yuan-6115 commented 8 months ago

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

k9withabone commented 8 months ago

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.

wolf-yuan-6115 commented 8 months ago

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.

k9withabone commented 8 months ago

I'm glad I was able to help :smile: .