taiki-e / setup-cross-toolchain-action

GitHub Action for setup toolchains for cross compilation and cross testing for Rust.
Apache License 2.0
32 stars 3 forks source link

feat: add `package` input to install packages #23

Open tjallingt opened 1 month ago

tjallingt commented 1 month ago

fixes https://github.com/taiki-e/setup-cross-toolchain-action/issues/21

Tried to reuse the existing install_apt_packages function to install the packages. I'd like to also support newlines in the packages input but i'm not sure what would be the best way to handle those.

This will need to be added to the changelog and the readme.

tjallingt commented 1 month ago

Unfortunately when using this to attempt to build my code I get another error:

thread 'main' panicked at /home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libudev-sys-0.1.4/build.rs:38:41:
  called `Result::unwrap()` on an `Err` value: "pkg-config has not been configured to support cross-compilation.\n\nInstall a sysroot for the target platform and configure it via\nPKG_CONFIG_SYSROOT_DIR and PKG_CONFIG_PATH, or install a\ncross-compiling wrapper for pkg-config and set it via\nPKG_CONFIG environment variable."

When building for aarch64-unknown-linux-gnu

I'm not quite sure how to fix this. Other than that this change does appear to work as the extra packages are being installed.

EDIT: looking into this and the PKG_CONFIG_PATH should be set, if i understand correctly. Maybe a problem with this PR after all?

tjallingt commented 1 month ago

After trying to add the dpkg arch im seeing errors like

Reading package lists...
Building dependency tree...
Reading state information...
E: Unable to locate package libgbm-dev:arm64
E: Unable to locate package libxkbcommon-dev:arm64
E: Unable to locate package libinput-dev:arm64
E: Unable to locate package libudev-dev:arm64
E: Unable to locate package libseat-dev:arm64

despite adding _sudo dpkg --add-architecture arm64