Skip to content

feat(docker): refuse --docker for macOS targets (cli#471 X3) - #503

Merged
apotema merged 3 commits into
mainfrom
feat/docker-refuse-macos
Sep 29, 2026
Merged

apotema merged 3 commits into
mainfrom
feat/docker-refuse-macos

Conversation

@apotema

@apotema apotema commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Part of #471, item X3 (decision D6: refuse the --docker macOS cross build).

What

  • --docker --target=<arch>-macos[-abi] now fails at argument parsing (build and run) with: --docker does not cross-compile for macOS (--target=…); build on a Mac, or pick a Linux or Windows target.
  • Deletes the container snippet that cloned Corendos/xcode-frameworks and patched the generated build.zig.
  • Linux and Windows cross builds are unchanged, and the help text says so.
  • cli/docker.zig leaves the agnostic guard's allowlist: 18 → 17 entries.

Tests

  • A unit test for dockerTargetRefused, plus an args test: macOS is refused, x86_64-windows passes through.
  • zig build test passes 13/13 steps (1134 tests).

It conflicts trivially with #502 (X2) on the allowlist's history comment and count. Whichever merges second rebases.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

@coderabbitai

coderabbitai Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

Warning

Review limit reached

Next included review available in 49 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available. Your 105 included PR review attempts over the past 7 days set your current allowance at 1 review per hour.

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Team

Run ID: b7e66a82-934d-473f-a5a3-6cb6f53337d9

📥 Commits

Reviewing files that changed from the base of the PR and between 46dbf47 and 8fb89fd.

📒 Files selected for processing (7)
  • docs/migrating-to-3.0.md
  • src/agnostic_guard_test.zig
  • src/cli/args.zig
  • src/cli/args_tests.zig
  • src/cli/args_value_flag_tests.zig
  • src/cli/docker.zig
  • src/cli/help.zig

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Team

Run ID: 542ec9cc-ecd5-457e-8d2b-70b79ae9cdfe

📥 Commits

Reviewing files that changed from the base of the PR and between 4953e2c and 46dbf47.

📒 Files selected for processing (7)
  • docs/migrating-to-3.0.md
  • src/agnostic_guard_test.zig
  • src/cli/args.zig
  • src/cli/args_tests.zig
  • src/cli/args_value_flag_tests.zig
  • src/cli/docker.zig
  • src/cli/help.zig

Included review availability: This review used your included allowance. 0 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 1 review per hour.


📝 Walkthrough

Walkthrough

Docker builds now refuse macOS targets, whether the target is explicit or inferred from a Mac host. The Docker build script no longer fetches or injects macOS framework paths. Linux and Windows Docker targets remain supported.

Changes

Docker macOS target handling

Layer / File(s) Summary
Validate Docker targets
src/cli/args.zig, src/cli/args_tests.zig, src/cli/args_value_flag_tests.zig, src/cli/help.zig, docs/migrating-to-3.0.md
Argument parsing refuses Docker builds for explicit macOS targets and for macOS host defaults. Tests cover rejected and accepted targets, including generate --docker, which bypasses the check. Help and migration guidance describe the restriction.
Remove Docker macOS setup
src/cli/docker.zig, src/agnostic_guard_test.zig
The Docker build script no longer fetches or injects xcode-frameworks paths or selects macOS-specific setup. The migration guard removes cli/docker.zig from its allowlist and updates the related history and stale-entry test.

Priority: ➖ Normal

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Bug fix

Merge Risk: ⚪ Minimal · up to 46dbf

The macOS Docker-build restriction appears consistent with the updated build path, tests, and guidance. No issue identified here needs resolution before merge.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: refusing Docker builds for macOS targets.
Description check ✅ Passed The description directly explains the macOS Docker refusal, removed cross-compilation setup, unchanged Linux and Windows behavior, and related tests.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-29T12:46:14.575046Z 8fb89fd New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@opencode-agent

Copy link
Copy Markdown

User coderabbitai[bot] does not have write permissions

github run

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 23877aad92

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/cli/args.zig Outdated
std.debug.print("labelle {s}: --target requires a value (e.g. --target=x86_64-windows)\n", .{cmd_name});
return null;
}
if (dockerTargetRefused(val)) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Validate the effective target for Docker builds

This validates only explicit --target values and ignores whether Docker is enabled. On a macOS host, labelle build --docker without --target passes parsing, then docker.runBuild falls back to the *-macos host_target (docker.zig:203-205) and attempts the now-unsupported build after the framework setup was deleted. Conversely, --target=x86_64-macos is rejected even without --docker, although the pipeline otherwise treats --target without Docker as a no-op. Perform this check after parsing, conditional on docker_build, against the explicit target or the implicit host target.

Useful? React with 👍 / 👎.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 30412061cf

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/cli/args.zig Outdated
dir_set = true;
}
}
if (refuseDockerBuild(cmd_name, docker_build, docker_target)) return null;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Skip the Docker target refusal for generate

On macOS, labelle generate --docker now fails parsing here because an omitted target is treated as the host macOS target. However, generate returns immediately after the host-side generation stage (pipeline.zig:395) and never calls docker.runBuild; the provider-bypass logic also explicitly treats generate --docker as a supported path. Limit this refusal to commands that actually reach the container build so generation remains usable on Macs.

Useful? React with 👍 / 👎.

Comment thread src/cli/args.zig
Comment on lines +411 to +414
var parts = std.mem.splitScalar(u8, t, '-');
_ = parts.next() orelse return false; // arch
const os = parts.next() orelse return false;
return std.mem.eql(u8, os, "macos");

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Recognize versioned macOS target queries

When a valid Zig target query includes an OS version, such as aarch64-macos.13.0, the extracted component is macos.13.0, so this equality check lets it through. docker.runBuild then passes that target to Zig after this commit has removed the framework setup, reaching precisely the unsupported macOS link path this guard is intended to reject. Parse the target query or compare the OS tag before its version suffix.

Useful? React with 👍 / 👎.

Comment thread src/cli/help.zig
\\ has, and a target without its provider fails naming the package to add
\\ (looked up in the provider registry; `LABELLE_OFFLINE=1` skips the lookup).
\\ `--docker` builds the `desktop` target only; a provider target refuses it.
\\ `--target` cross-compiles for Linux or Windows; a macOS target is refused.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Update the migration guide's Docker claim

This new restriction conflicts with docs/migrating-to-3.0.md:137-138, which explicitly says that labelle build --docker [--target=<triple>] for desktop is unchanged. Because the help immediately directs upgrading users to that guide, users of the removed macOS Docker path receive contradictory migration guidance and no explanation of the required native-build replacement. Update the guide alongside this help text.

Useful? React with 👍 / 👎.

@apotema
apotema force-pushed the feat/docker-refuse-macos branch from 3041206 to 46dbf47 Compare September 29, 2026 12:32
Per the RFC's D6, the container build no longer cross-compiles for macOS.
It could only link by cloning a third-party copy of Apple's frameworks and
patching the generated build.zig. `--docker --target=<arch>-macos` now
fails at argument parsing with a one-line message. Linux and Windows cross
builds are unchanged.

Deletes the fetch-and-patch snippet, which takes cli/docker.zig off the
agnostic guard's allowlist (17 entries).
…ocker

Checking only an explicit --target missed a bare `--docker` on a Mac,
which falls back to the host's macOS target. It also refused
`--target=<arch>-macos` without --docker, where --target is only a warned
no-op. Check once after parsing: with --docker, against the explicit
target or else the host's.
… 3.0 guide

- `generate --docker` generates on the host and never reaches the
  container build, so it is no longer refused on a Mac.
- An OS version suffix (`aarch64-macos.13.0`) no longer hides a macOS
  target.
- docs/migrating-to-3.0.md said `build --docker` for desktop was
  unchanged. It now says macOS targets are refused and why.
- The value-flag test for `build --scene intro --docker` names an
  explicit Linux target, so it passes on a Mac host too.
@apotema
apotema force-pushed the feat/docker-refuse-macos branch from 46dbf47 to 8fb89fd Compare September 29, 2026 12:42
@apotema
apotema merged commit d2a9323 into main Sep 29, 2026
5 checks passed
@apotema
apotema deleted the feat/docker-refuse-macos branch September 29, 2026 12:59
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