Skip to content

Fix docs/_code/samples build on Apple Silicon#85

Open
alexander-yevsyukov wants to merge 1 commit into
masterfrom
claude/relaxed-euclid-5d2a51
Open

Fix docs/_code/samples build on Apple Silicon#85
alexander-yevsyukov wants to merge 1 commit into
masterfrom
claude/relaxed-euclid-5d2a51

Conversation

@alexander-yevsyukov

Copy link
Copy Markdown
Contributor

What

Makes the docs/_code/samples Gradle build succeed again. Verified with
./gradlew -p docs/_code/samples clean buildAll (compileJava, compileTestJava,
and test all pass) on an arm64 Mac.

Why

spine.enableJava().server() (Spine Bootstrap 1.7.0, from 2020) drives all
repository and codegen-tool configuration, and two things it sets are now broken:

  1. Dead repository. Bootstrap injects the shut-down JCenter as the source
    for third-party artifacts such as protoc. Nothing resolves from it.
  2. No Apple Silicon binaries. It pins protoc:3.13.0 and
    protoc-gen-grpc-java:1.28.1, which predate Apple Silicon — no osx-aarch_64
    build of either exists at any repository, so :generateProto fails on arm64 Macs.

What changed

Only docs/_code/samples/build.gradle, after spine.enableJava().server():

  • Remove the dead BintrayJCenter repo and add mavenCentral(). Spine's own
    artifacts keep resolving from the spine.mycloudrepo.io repositories Bootstrap
    also injects — only the third-party source is repointed.
  • On arm64 macOS only, force the osx-x86_64 protoc and gRPC binaries
    (...:osx-x86_64@exe). They run under Rosetta 2 and stay pinned at the exact
    Bootstrap-selected versions, so generated code is identical to every other
    platform. Non-mac platforms keep the auto-detected native binary, so the Linux
    CI job is unaffected. Versions are unchanged — the v1 Bootstrap/protoc line is
    preserved.

Reviewer notes

  • CI already exercises this. check-code-embedding.ymlbuild-embedded-code
    runs ./gradlew :buildAll (root task fans out to every included build) on
    ubuntu-latest/JDK 8. It's Linux-x86_64 only, which is why this only ever broke
    local arm64 Mac builds. This change also moves samples off the sunset JCenter,
    hardening that job.
  • Sibling examples have the same arm64 gap (examples/hello, Bootstrap 1.9.0;
    examples/airport, Bootstrap 1.8.0) — both fail on protoc-3.13.0-osx-aarch_64.
    Those are pinned spine-examples/* submodules, so the equivalent fix belongs
    upstream and is not included here.
  • gradlew.bat shows as modified in the working tree — an unrelated pre-existing
    line-ending change, deliberately left out of this PR.

🤖 Generated with Claude Code

Spine Bootstrap 1.7.0 configures the samples build to resolve third-party
artifacts (protoc, the gRPC codegen plugin) from JCenter, which is shut
down, and pins protoc 3.13.0 / protoc-gen-grpc-java 1.28.1 — versions
that predate Apple Silicon and have no `osx-aarch_64` build at any
repository. As a result `:generateProto` fails on arm64 Macs, and the
JCenter reference is dead weight everywhere else.

Repoint third-party resolution to Maven Central (Spine's own artifacts
keep resolving from the `spine.mycloudrepo.io` repositories Bootstrap
also injects), and, on arm64 macOS only, force the `osx-x86_64` protoc
and gRPC binaries so they run under Rosetta 2 while staying pinned at the
exact Bootstrap-selected versions — generated code is byte-for-byte
identical to every other platform. Non-mac platforms keep Bootstrap's
auto-detected native binary, so the Linux CI job is unaffected.

Verified with `./gradlew -p docs/_code/samples clean buildAll`
(compileJava, compileTestJava, and test all pass) on an arm64 Mac.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@alexander-yevsyukov alexander-yevsyukov moved this to 🏗 In progress in v2.0 Jul 24, 2026
@alexander-yevsyukov alexander-yevsyukov self-assigned this Jul 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 🏗 In progress

Development

Successfully merging this pull request may close these issues.

1 participant