Skip to content

Add cross-compilation to Aarch64 logic and investigate CI testing #55

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

Closed
hug-dev opened this issue Oct 22, 2019 · 6 comments
Closed

Add cross-compilation to Aarch64 logic and investigate CI testing #55

hug-dev opened this issue Oct 22, 2019 · 6 comments
Labels
enhancement New feature or request

Comments

@hug-dev
Copy link
Member

hug-dev commented Oct 22, 2019

Currently all tests in our CI execute on x86.
We need to make sure that compiling the service is as easy as cargo build --target aarch64-unknown-linux-gnu. It will be currently except for the compilation of Mbed Crypto which needs extra logic in build.rs scripts.
We also need to investigate CI testing on this target and what are our options.
We can look at cross and at native testing using Travis.

@hug-dev hug-dev added the enhancement New feature or request label Oct 22, 2019
@hug-dev
Copy link
Member Author

hug-dev commented Oct 24, 2019

To cross-compile before, it used to be as easy as changing the Mbed Crypto library compiler in the build-conf.toml file and do the command: cargo build --target aarch64-unknown-linux-gnu
But with that now the compilation fails with the following issue:

          /usr/bin/ld: /home/hugdev01/dev/parsec/parsec/target/aarch64-unknown-linux-gnu/debug/deps/parsec-b832778a0064e80a.103gqkamrymphzyu.rcgu.o: Relocations in generic ELF (EM: 183)
          /usr/bin/ld: /home/hugdev01/dev/parsec/parsec/target/aarch64-unknown-linux-gnu/debug/deps/parsec-b832778a0064e80a.103gqkamrymphzyu.rcgu.o: Relocations in generic ELF (EM: 183)
          /usr/bin/ld: /home/hugdev01/dev/parsec/parsec/target/aarch64-unknown-linux-gnu/debug/deps/parsec-b832778a0064e80a.103gqkamrymphzyu.rcgu.o: Relocations in generic ELF (EM: 183)
          /usr/bin/ld: /home/hugdev01/dev/parsec/parsec/target/aarch64-unknown-linux-gnu/debug/deps/parsec-b832778a0064e80a.103gqkamrymphzyu.rcgu.o: Relocations in generic ELF (EM: 183)
          /usr/bin/ld: /home/hugdev01/dev/parsec/parsec/target/aarch64-unknown-linux-gnu/debug/deps/parsec-b832778a0064e80a.103gqkamrymphzyu.rcgu.o: Relocations in generic ELF (EM: 183)
          /usr/bin/ld: /home/hugdev01/dev/parsec/parsec/target/aarch64-unknown-linux-gnu/debug/deps/parsec-b832778a0064e80a.103gqkamrymphzyu.rcgu.o: Relocations in generic ELF (EM: 183)
          /usr/bin/ld: /home/hugdev01/dev/parsec/parsec/target/aarch64-unknown-linux-gnu/debug/deps/parsec-b832778a0064e80a.103gqkamrymphzyu.rcgu.o: Relocations in generic ELF (EM: 183)
          /usr/bin/ld: /home/hugdev01/dev/parsec/parsec/target/aarch64-unknown-linux-gnu/debug/deps/parsec-b832778a0064e80a.103gqkamrymphzyu.rcgu.o: error adding symbols: file in wrong format
          collect2: error: ld returned 1 exit status

It might be because the linker used is the system linker and not an Aarch64-toolchain linker?

@adamparco
Copy link
Contributor

You could also leverage buildx to do emulated builds, or to point to a remote armv8 builder instance (AWS A1).

@hug-dev
Copy link
Member Author

hug-dev commented Oct 30, 2019

Part of this issue is being addressed in #61: cargo build --target aarch64-unknown-linux-gnu will now cross-compile everything to this target.
To fix the issue above, the linker is precised in .cargo/config. I thought that the linker shipped with Rust installation could be used as well for cross-compiling but I think it does not support this target (or is not included?).

The remaining parts of this issue are related with testing:

  • adding a CI job that cross-compile PARSEC for the Arm64 target (maybe buildx or cross could be used here)
  • adding CI system where some of the tests are compiled and executed natively on Arm64 (Travis CI, AWS A1, Codefresh can be looked at)

@hug-dev
Copy link
Member Author

hug-dev commented Nov 1, 2019

#64 completed the first point above

@hug-dev
Copy link
Member Author

hug-dev commented Jan 15, 2020

We are going to set up a GitHub Actions self-hosted runner on an Arm Machine! That way we will only need little modification to our GH Actions workflows to make them run on Arm as well.

cf WorksOnArm/cluster#190

@hug-dev
Copy link
Member Author

hug-dev commented Jan 30, 2020

Due to security problems about using GitHub Actions self-hosted runners, we decided to switch to Travis CI which has been enabled in #90

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants