Skip to content

Cross-compile binaries for aarch64-unknown-linux-gnu #172

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
wants to merge 1 commit into from
Closed

Conversation

malor
Copy link
Member

@malor malor commented Nov 24, 2024

GitHub does not provide a aarch64-unknown-linux-gnu runner that we would need to compile binaries for Raspberry Pi, but we can use cross to build those on the amd64 Ubuntu runner.

@malor malor requested a review from ikalnytskyi November 24, 2024 19:44
cross_compile_os: linux
cross_compile_target: aarch64-unknown-linux-gnu
- name: ubuntu-latest
cross_compile_os:
Copy link
Member Author

Choose a reason for hiding this comment

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

Not sure if we need to specify those... If we don't, surely ${{ }} expressions referencing those fields will fail?

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, I don't think we need to specify this. Can't say for sure though.

source rustc.vars
if [ -z "${CROSS_COMPILE_TARGET}" ]; then
# normal build targetting the CPU architecture and the OS of the host
rustc --print cfg | grep = > rustc.vars
Copy link
Member Author

Choose a reason for hiding this comment

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

Alternatively, we can get rid of calling rustc to set target_os and target_arch, and specify the values for both statically in the config.

GitHub does not provide a aarch64-unknown-linux-gnu runner that
we would need to compile binaries for Raspberry Pi, but we can
use `cross` to build those on the amd64 Ubuntu runner.
cross_compile_os: linux
cross_compile_target: aarch64-unknown-linux-gnu
- name: ubuntu-latest
cross_compile_os:
Copy link
Member

Choose a reason for hiding this comment

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

Yeah, I don't think we need to specify this. Can't say for sure though.


runs-on: ${{ matrix.os }}
- name: ubuntu-latest
cross_compile_os: linux
Copy link
Member

Choose a reason for hiding this comment

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

can we somehow infer this from matrix.os? maybe using uname or something?

@malor malor closed this Nov 24, 2024
@malor malor deleted the cross branch November 24, 2024 22:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants