Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions .github/workflows/release-validator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,24 @@ jobs:
strategy:
matrix:
arch: [amd64, arm64, arm]
os: [windows, linux]
exclude:
- os: windows
arch: arm64
- os: windows
arch: arm
timeout-minutes: 10
runs-on: ubuntu-22.04
container: ghcr.io/linkerd/dev:v45-rust-musl
steps:
- name: Install MinGW
if: matrix.os == 'windows'
run: apt-get update && apt-get install mingw-w64 -y
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- run: just validator arch=${{ matrix.arch }} profile=release version=${{ needs.meta.outputs.version }} package
- run: just validator arch=${{ matrix.arch }} os=${{ matrix.os }} profile=release version=${{ needs.meta.outputs.version }} package
- uses: actions/upload-artifact@v4
with:
name: ${{ matrix.arch }}-artifacts
name: ${{ matrix.arch }}-${{ matrix.os }}-artifacts
path: target/package/

publish:
Expand Down
21 changes: 13 additions & 8 deletions justfile-rust
Original file line number Diff line number Diff line change
Expand Up @@ -16,25 +16,30 @@ profile := 'debug'
# The architecture name to use for packages. Either 'amd64', 'arm64', or 'arm'.
arch := env_var_or_default("TARGETARCH", "amd64")

# The OS name to use for packages. Either 'linux' or 'windows'.
os := "linux"

# If an `_arch` is specified, then we change the default cargo `--target` to
# support cross-compilation. Otherwise, we use `rustup` to find the default.
_cargo-target := if arch == "amd64" {
_cargo-target := if os + '-' + arch == "linux-amd64" {
"x86_64-unknown-linux-musl"
} else if arch == "arm64" {
} else if os + '-' + arch == "linux-arm64" {
"aarch64-unknown-linux-musl"
} else if arch == "arm" {
} else if os + '-' + arch == "linux-arm" {
"armv7-unknown-linux-musleabihf"
} else if os + '-' + arch == "windows-amd64" {
"x86_64-pc-windows-gnu"
} else {
`rustup show | sed -n 's/^Default host: \(.*\)/\1/p'`
error("unsupported: os=" + os + " arch=" + arch)
}

_target-dir := "target" / _cargo-target / profile
_target-bin := _target-dir / crate
_target-bin := _target-dir / crate + if os == 'windows' { '.exe' } else { '' }

_package-name := crate + "-" + version + "-" + arch
_package-name := crate + "-" + version + "-" + arch + "-" + os
_package-tgz := "target/package" / _package-name + ".tgz"
_package-dir := "target/package" / _package-name
_package-bin := _package-dir / crate
_package-bin := _package-dir / crate + if os == 'windows' { '.exe' } else { '' }
_package-dbg := _package-bin + ".dbg"

_cargo := 'just-cargo profile=' + profile + ' target=' + _cargo-target
Expand All @@ -52,4 +57,4 @@ package: build

build *flags:
{{ _cargo }} fetch --locked
{{ _cargo }} build --workspace -p {{ crate }} {{ flags }}
{{ _cargo }} build {{ if crate == "" { "--workspace" } else { "-p " + crate } }} {{ flags }}
Copy link
Member Author

Choose a reason for hiding this comment

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

We do that to avoid compiling the whole workspace when we are just targeting one of the repos. One of the problems that happens if this is not in place is that when we are compiling for Windows systems, we try to compile the CNI repair controller as well which has some dependencies that cannot be compiled for Windows, making the whole build job fail.