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

CI: Add cross-compile tests for some Linux targets #40

Merged
merged 3 commits into from
Sep 11, 2021
Merged

Conversation

tatsuya6502
Copy link
Member

Add a CI (GitHub Actions) using rust-embedded/cross. It does the followings:

  1. Cross-compile Moka to a specified Linux target.
  2. Run cross test(similar to cargo test but without integration tests) using QEMU user space emulation.

Currently, the following targets are tested:

  • aarch64-unknown-linux-musl
  • i686-unknown-linux-musl
  • armv7-unknown-linux-musleabihf
  • armv5te-unknown-linux-musleabi
  • mips-unknown-linux-musl
  • mipsel-unknown-linux-musl

There is one concern though. The README of cross says:

cross test runs units tests sequentially because QEMU gets upset when you spawn multiple threads. This means that, if one of your unit tests spawns threads, then it's more likely to fail or, worst, never terminate.

Moka does spawn threads but it seems QEMU is working fine. So it is OK for now. If such a problem happens in the future, we will have to disable the cross test step.

@tatsuya6502 tatsuya6502 self-assigned this Sep 11, 2021
Copy link
Member Author

@tatsuya6502 tatsuya6502 left a comment

Choose a reason for hiding this comment

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

Merging.

@tatsuya6502 tatsuya6502 merged commit 988e5a8 into maint-0.5 Sep 11, 2021
@tatsuya6502 tatsuya6502 deleted the cross branch September 11, 2021 01:32
@tatsuya6502
Copy link
Member Author

There is one concern though. The README of cross says:

cross test runs units tests sequentially because QEMU gets upset when you spawn multiple threads. This means that, if one of your unit tests spawns threads, then it's more likely to fail or, worst, never terminate.

Moka does spawn threads but it seems QEMU is working fine. So it is OK for now. If such a problem happens in the future, we will have to disable the cross test step.

I realized the README was written in December 2016. So the QEMU's user-space emulatiton may have been improved since then. This could explain why cross test is working for me.

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

1 participant