eclipse-uprotocol / up-rust

uProtocol Language Specific Library for Rust
Apache License 2.0
7 stars 6 forks source link

Adding necessary bits for cross-compiling to `aarch64-unknown-linux-gnu` to CI/CD #73

Open PLeVasseur opened 3 months ago

PLeVasseur commented 3 months ago

I got this working locally by:

$ rustup target add aarch64-unknown-linux-gnu
$ sudo apt-get install gcc-aarch64-linux-gnu g++-aarch64-linux-gnu

then adding to .cargo/config.toml:

[target.aarch64-unknown-linux-gnu]
linker = "aarch64-linux-gnu-gcc"

then I could

$ cargo build --target=aarch64-unknown-linux-gnu

Could we add this to the CI/CD pipeline?

Any thoughts from folks? Tagging in @AnotherDaniel, @sophokles73

AnotherDaniel commented 3 months ago

Is this now solved by #72? Or do you have any additional ideas?

I think this x-compilation is purely for academical purposes at the moment - there is nothing in this crate where the target arch should make a difference.

PLeVasseur commented 3 months ago

@AnotherDaniel and me had a quick sync-up. He'd like to review the issue more and address this in a follow-up PR when #72 is merged to add cross-compilation.

AnotherDaniel commented 3 months ago

... and while we're on it: Is x-compiling from x86_64 (I assume?) to aarch64 the only relevant scenario? Are there more?

PLeVasseur commented 3 months ago

... and while we're on it: Is x-compiling from x86_64 (I assume?)

You assume correctly!

only relevant scenario? Are there more?

If you wanted bonus points, I know in Automotive using QNX is pretty common (and on the roadmap for Ferrocene), so we could also try to get *-nto-qnx-* working

Have to build the compiler from source and need a QNX fork of gcc called qcc to link tho... so maybe not in the open source, unless there's a way to get a QNX license for open source work. :slightly_smiling_face:

Tagging @stevenhartley for above point :point_up_2:

AnotherDaniel commented 3 months ago

Uh... you know, that is something I'll leave up to the BB QNX guys to look into ;-)

For now - waiting to get these required-workflow-blockers out of the way, then I'll set up the x64-arm64 x-compile on ubuntu, to meet your needs there. The rest can follow later...