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: make sure the target toolchain is available #321

Merged
merged 2 commits into from Jul 6, 2022

Conversation

mjpieters
Copy link
Contributor

@mjpieters mjpieters commented Jul 6, 2022

For cross-compilation builds, the target toolchain needs to be installed (you
can't count on it being present in a GH build environment).

Making this change (adding the target: ${{ matrix.target }} line to the
actions-rs/toolchain@v1 action), make my PR #320 build properly for the iOS
cross-compilation target
*). Without it, you may get errors like:

error[E0463]: can't find crate for `core`
Error:   |
  = note: the `aarch64-apple-ios` target may not be installed
  = help: consider downloading the target with `rustup target add aarch64-apple-ios`

With the target line rustup makes sure to add any missing toolchains; e.g. the iOS Setup Rust toolchain step now includes:

/Users/runner/.cargo/bin/rustup target add --toolchain stable aarch64-apple-ios
info: downloading component 'rust-std' for 'aarch64-apple-ios'
info: installing component 'rust-std' for 'aarch64-apple-ios'

If you were lucky and got a build machine that already had the toolchain installed, the build would pass, I think.

Note: I omitted a changelog entry as this is purely a CI fix.

Checklist

  • I picked the correct source and target branch.
  • I included a new entry to the CHANGELOG.md.
  • I checked cargo clippy and cargo fmt. The CI will fail otherwise anyway.
  • (If applicable) I added tests for this feature or adjusted existing tests.
  • (If applicable) I checked if anything in the wiki needs to be changed.

*) The aarch64-apple-ios build was cancelled because of an unrelated issue with a pre-existing clippy warning, but the build got well past the point where otherwise it'd have failed.

For cross-compilation builds, the target toolchain needs to be installed (you
can't count on it being present in a GH build environment).
@mjpieters
Copy link
Contributor Author

mjpieters commented Jul 6, 2022

Can I suggest that the .github folder is also excluded from codecov? ;-)

codecov/patch — 0.00% of diff hit (target 53.38%)

@Nukesor
Copy link
Owner

Nukesor commented Jul 6, 2022

Nice. This looks good to me :) Thanks for taking the time and fixing this!

@Nukesor Nukesor merged commit de8080f into Nukesor:main Jul 6, 2022
@mjpieters mjpieters deleted the ensure_toolchain branch July 6, 2022 17:25
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

2 participants