Skip to content

Conversation

@alithethird
Copy link
Owner

Use https://github.com/cross-rs/cross to cross compile

Copilot AI review requested due to automatic review settings November 28, 2025 08:52
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the release workflow to use the cross tool for cross-compilation instead of the standard cargo build command. This change enables more reliable cross-platform builds by using containerized build environments.

Key Changes:

  • Replaces cargo build with cross build in the release workflow
  • Adds installation of the cross tool from its GitHub repository

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

- name: Build release binary
run: cargo build --release --target ${{ matrix.target }}
run: |
cargo install cross --git https://github.com/cross-rs/cross && \
Copy link

Copilot AI Nov 28, 2025

Choose a reason for hiding this comment

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

Installing cross from source on every workflow run is inefficient and slow. Consider using a pre-built binary via cargo-binstall or caching the installation with actions/cache to speed up builds.

Suggested change
cargo install cross --git https://github.com/cross-rs/cross && \
curl -sSL https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash
cargo binstall cross --no-confirm

Copilot uses AI. Check for mistakes.
- name: Build release binary
run: cargo build --release --target ${{ matrix.target }}
run: |
cargo install cross --git https://github.com/cross-rs/cross && \
Copy link

Copilot AI Nov 28, 2025

Choose a reason for hiding this comment

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

Consider pinning to a specific commit or tag when installing from git (e.g., --git https://github.com/cross-rs/cross --tag v0.2.5) to ensure reproducible builds and avoid breaking changes from the main branch.

Suggested change
cargo install cross --git https://github.com/cross-rs/cross && \
cargo install cross --git https://github.com/cross-rs/cross --tag v0.2.5 && \

Copilot uses AI. Check for mistakes.
Copilot AI review requested due to automatic review settings November 28, 2025 09:38
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

- name: Build release binary (ARM Linux native)
if: matrix.target == 'aarch64-unknown-linux-gnu'
run: |
cargo install cross --git https://github.com/cross-rs/cross
Copy link

Copilot AI Nov 28, 2025

Choose a reason for hiding this comment

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

Installing cross from git on every build will be slow and inefficient. Consider caching the installation or using a pre-built release version with cargo install cross (without --git flag) for faster builds.

Suggested change
cargo install cross --git https://github.com/cross-rs/cross
cargo install cross

Copilot uses AI. Check for mistakes.
Copilot AI review requested due to automatic review settings November 28, 2025 09:51
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +47 to +53
- name: Build release binary (ARM Linux native)
if: matrix.target == 'aarch64-unknown-linux-gnu'
run: |
cargo install cross --git https://github.com/cross-rs/cross
cross build --release --target ${{ matrix.target }}
- name: Build release binary (cross-compile)
Copy link

Copilot AI Nov 28, 2025

Choose a reason for hiding this comment

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

The step names are misleading. Step '(ARM Linux native)' uses cross-compilation via the cross tool, while '(cross-compile)' uses native cargo. Consider renaming to '(ARM Linux with cross)' and '(native cargo)' respectively to accurately reflect their functionality.

Suggested change
- name: Build release binary (ARM Linux native)
if: matrix.target == 'aarch64-unknown-linux-gnu'
run: |
cargo install cross --git https://github.com/cross-rs/cross
cross build --release --target ${{ matrix.target }}
- name: Build release binary (cross-compile)
- name: Build release binary (ARM Linux with cross)
if: matrix.target == 'aarch64-unknown-linux-gnu'
run: |
cargo install cross --git https://github.com/cross-rs/cross
cross build --release --target ${{ matrix.target }}
- name: Build release binary (native cargo)

Copilot uses AI. Check for mistakes.
Copilot AI review requested due to automatic review settings November 28, 2025 10:48
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

- name: Build release binary (ARM Linux native)
if: matrix.target == 'aarch64-unknown-linux-gnu'
run: |
cargo install cross --git https://github.com/cross-rs/cross
Copy link

Copilot AI Nov 28, 2025

Choose a reason for hiding this comment

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

Installing cross from git source on every workflow run is inefficient and slow. Consider either: (1) installing from crates.io with cargo install cross for faster installation, (2) using cargo binstall cross for binary installation, or (3) caching the installation between runs to improve build performance.

Suggested change
cargo install cross --git https://github.com/cross-rs/cross
cargo install cross

Copilot uses AI. Check for mistakes.
Copilot AI review requested due to automatic review settings November 28, 2025 11:17
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

cargo install cross --git https://github.com/cross-rs/cross
cross build --release --target ${{ matrix.target }}
- name: Build release binary (cross-compile)
Copy link

Copilot AI Nov 28, 2025

Choose a reason for hiding this comment

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

The step name 'cross-compile' is confusing because this step uses native cargo build, not cross-compilation. The aarch64 target is actually the one being cross-compiled. Consider renaming to 'Build release binary (native)' for clarity.

Suggested change
- name: Build release binary (cross-compile)
- name: Build release binary (native)

Copilot uses AI. Check for mistakes.
@alithethird alithethird merged commit f89bfee into master Nov 28, 2025
9 of 10 checks passed
@alithethird alithethird deleted the fix/cross-compile branch November 28, 2025 11:22
alithethird added a commit that referenced this pull request Dec 3, 2025
Fix: Use cross for cross compilation
alithethird added a commit that referenced this pull request Dec 19, 2025
Fix: Use cross for cross compilation
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.

2 participants