Skip to content

release: add cli for aarch64-darwin#2278

Draft
sespiros wants to merge 14 commits intomainfrom
sse/darwin-cli
Draft

release: add cli for aarch64-darwin#2278
sespiros wants to merge 14 commits intomainfrom
sse/darwin-cli

Conversation

@sespiros
Copy link
Copy Markdown
Collaborator

@sespiros sespiros commented Mar 24, 2026

This is rebased on top of #2260

Fixes #874

@sespiros sespiros added changelog PRs that should be part of the release notes do not merge This shouldn't be merged at this point labels Mar 24, 2026
@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 24, 2026

PR Preview Action v1.8.1

QR code for preview link

🚀 View preview at
https://edgelesssys.github.io/contrast/pr-preview/pr-2278/

Built to branch gh-pages at 2026-04-01 14:27 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 25, 2026

Do the documentation changes need to be backported?

Changes to /docs/docs won't be visible until the next release.
If you are fixing something in the docs that should be immediately visible, the changes needs to be made to both /docs/docs and /docs/versioned_docs/version-X.Y, where X.Y is the version of the latest minor release.
This can be done in this same PR.

  • Yes, this should be backported to the current version of the docs.
  • No, the PR only contains docs changes relevant for future versions.

sespiros added 14 commits April 1, 2026 12:50
The mdsh-fmt script only uses mdsh and jq. busybox was an unnecessary
dependency that causes build failures on darwin since nixpkgs' darwin
busybox is broken.

Signed-off-by: Spyros Seimenis <sse@edgeless.systems>
Separate push scripts into container-scripts.nix so container images
(linux-only) can be overridden independently from push scripts (which
need to run natively on the developer's machine).

Signed-off-by: Spyros Seimenis <sse@edgeless.systems>
The let/in binding was needed when containers.nix merged container
images with push scripts. Now that push scripts are in a separate
file, the wrapper is unnecessary.

Signed-off-by: Spyros Seimenis <sse@edgeless.systems>
The contrast runtime (coordinator, initializer, kata, containers) only
runs on x86_64-linux, but client-side tools (CLI, resourcegen, e2e) can
run on any platform. Separate these by introducing a runtimePkgs overlay
that replaces linux-only packages with their x86_64-linux equivalents on
non-linux hosts (e.g. aarch64-darwin).

This enables building and using the CLI natively on macOS while runtime
packages are transparently sourced from x86_64-linux.

Signed-off-by: Spyros Seimenis <sse@edgeless.systems>
The renovate package fails to build on darwin due to better-sqlite3
requiring libtool which is missing from the nixpkgs build environment.
Since renovate-config-validator only validates a bot config file and
the linux CI still checks it, skip it on non-linux systems.

Signed-off-by: Spyros Seimenis <sse@edgeless.systems>
Signed-off-by: Spyros Seimenis <sse@edgeless.systems>
The Rust openssl-sys crate resolves OpenSSL on macOS by first checking
hardcoded homebrew paths (/opt/homebrew/opt/openssl@3), then falling
back to pkg-config. GitHub Actions macOS runners have homebrew
pre-installed, so the path exists and openssl-sys commits to it, but
the actual headers are inaccessible inside the nix sandbox — causing
the build to fail before pkg-config is ever tried.

On developer machines without homebrew the path doesn't exist, so
openssl-sys falls through to pkg-config which finds nix's OpenSSL.

Setting OPENSSL_DIR explicitly bypasses the search heuristic entirely,
making the build work consistently regardless of what's installed on
the host.

Signed-off-by: Spyros Seimenis <sse@edgeless.systems>
Build the darwin CLI and formatter on a macOS runner to catch
darwin-specific build failures (broken nixpkgs deps, missing platform
guards, etc.). The job depends on cli-build so linux dependencies are
available in cachix — the macOS runner only builds the darwin-native
parts.

Make the setup_nix action cross-platform by gating linux-specific steps
(apparmor, btrfs) on runner.os == 'Linux'.

Signed-off-by: Spyros Seimenis <sse@edgeless.systems>
Override contrastPkgsStatic on darwin: use linux static packages from
runtimePkgs but keep genpolicy as a native darwin build since the CLI
embeds and runs it on the host. The full darwin contrastPkgsStatic
fails to evaluate because genpolicy's C deps (aws-lc-sys) don't build
with darwin's static toolchain.
Copy the CLI binary from the nix store to workspace/contrast-${SYSTEM}
instead of referencing it through the nix out-link symlink. The symlink
points to a read-only nix store path, so writing additional files next
to the binary (needed for multi-arch releases) would fail. This also
updates the artifact paths output and update-contrast-releases.sh to
use the new path.
Add a release-aarch64-darwin job that builds the CLI on macos-latest
and uploads it as an artifact. A separate attach-darwin-cli job waits
for both the draft release and the darwin build, then attaches the
binary to the GitHub release. The publish job now also waits for the
darwin binary to be attached before marking the release as non-draft.

The update-main job downloads the darwin artifact so that
update-contrast-releases.sh can hash it into contrast-releases.json.
Add a tabbed platform selector (Linux/macOS) to the CLI install page.
The macOS tab downloads the aarch64-darwin binary and includes a note
about the Gatekeeper quarantine workaround for browser downloads.

Signed-off-by: Spyros Seimenis <sse@edgeless.systems>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog PRs that should be part of the release notes do not merge This shouldn't be merged at this point

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Release contrast cli for Mac OS on Apple Silicon (nix: aarch64-darwin)

1 participant