Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extend Github action to cross-compile to aarch64/arm/i686 for Linux #98

Merged
merged 1 commit into from
Nov 8, 2022

Conversation

StephanvanSchaik
Copy link
Contributor

@StephanvanSchaik StephanvanSchaik commented Aug 24, 2022

Extend the Github workflow to set up QEMU and the Rust toolchain, and then build/test evdev for various targets (aarch64, arm and i686).

This way we can also easily catch issues like #95 and #96 and also #82.

@StephanvanSchaik StephanvanSchaik changed the title Extend Github action to ross-compile to aarch64/arm/i686 for Linux Extend Github action to cross-compile to aarch64/arm/i686 for Linux Aug 24, 2022
- name: Run tests
run: cargo test --target ${{ matrix.target.rust }}
- name: Doc
run: cargo doc --target ${{ matrix.target.rust }}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another option, if you want, is to use actions-rs/cargo with the use-cross option enabled. That makes the whole thing easier, and you don't have to install the dependencies or anything, and you only have to use the rust target triple in the matrix.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Honestly, I don't know. I have looked at cross in the past and while it does look more convenient, I don't like its dependency on Docker/Podman at all.

This instead reflects my actual workflow which is to use rustup to install a Rust toolchain for the specific target, run the cargo commands with the specified target, and then run it in using QEMU userspace emulation for that target, which I agree is more involved, but at the same time I know what is going on exactly.

Also, I simply have more experience with QEMU userspace emulation, because I have used that for things outside of Rust like preparing a Linux image for AArch64 using chroot.

Maybe it offers better performance for Github CI? I am not sure, as at the end of the day I am not too familiar with cross, but that could be a good reason to use it for Github CI.

@CryZe
Copy link

CryZe commented Oct 11, 2022

Can we have a 0.12.1 in the meantime that can properly compile again? Not sure if there's a better issue to post this in.

@jeff-hiner
Copy link
Collaborator

I see no reason to hold this back. If it causes problems we can revert it.

@jeff-hiner jeff-hiner merged commit b0e62db into emberian:master Nov 8, 2022
@StephanvanSchaik StephanvanSchaik deleted the cross-compile branch November 11, 2022 23:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants