Repository navigation
feat(tool-images): add a Rust tool image with cross-compilation tools - #274
Merged
Merged
Conversation
A tool-cache image for linux/amd64 and linux/arm64 holding a pinned stable Rust toolchain with rustfmt, clippy and the standard libraries of the macOS, Linux musl and Windows gnullvm targets, and Zig, cargo-zigbuild and cargo-deny, each checked against its published checksum. It holds no Apple SDK and nothing of Microsoft's. Its zig adds -lunwind to a link that asks for LLVM's libunwind, which zig cc ignores and cargo-zigbuild does not translate, so the gnullvm targets link. The published tag is the Rust release followed by an image revision, since the other pins can change while the release does not. A workflow builds the image on both architectures, cross-compiles a crate with a C source for every target, checks each executable's headers (an Apple one loads nothing outside /usr/lib) and fails a change to the image that keeps its tag. Closes #273
|
🎉 This PR is included in version 3.7.0 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
tool-images/rust, a tool-cache capability image for linux/amd64 and linux/arm64, so jobs that build Rust get a pinned toolchain with no per-job install: Rust 1.100.0 (rustfmt, clippy, and the standard libraries of both macOS, both Linux musl and both Windows gnullvm targets), Zig 0.17.1, cargo-zigbuild 0.24.1 and cargo-deny 0.22.1. The ARC role README's new Rust tool image section says how to declare it.Two things differ from the other tool images.
The
zigonPATHis a short script. rustc links gnullvm targets with-nolibc --unwindlib=libunwindand leaves the driver to add the library; Zig 0.17 ignores--unwindlib, and cargo-zigbuild asks for compiler-rt (rust-cross/cargo-zigbuild#439) but not libunwind, so every Windows link failed with undefined_Unwind_*symbols. The script adds-lunwindto those links, which also makes llvm-mingw unnecessary.The tag is
<Rust release>-r<revision>, because the other pins can change while the Rust release does not and a published tag is never rebuilt. The Rust toolchain workflow fails a pull request that changes the image under the same tag.That workflow builds the image natively on both architectures, fills a tool cache as the role's init container does, runs the role's job-started hook in the build runner image, cross-compiles a crate with a C source for every target and reads each executable's headers: an Apple one may load nothing outside
/usr/lib, a Linux one must be static, and each must be for its processor.Closes #273