Skip to content

Add unit tests for hermetic_erlang_repository's OS/arch mapping#96

Merged
aaylward merged 1 commit into
mainfrom
claude/gleam-bazel-rules-review-0pfz4h
Jul 3, 2026
Merged

Add unit tests for hermetic_erlang_repository's OS/arch mapping#96
aaylward merged 1 commit into
mainfrom
claude/gleam-bazel-rules-review-0pfz4h

Conversation

@aaylward

@aaylward aaylward commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Follow-up from Add gleam_host convenience repository; complete Phase 4 #95: erlang/private/hermetic_erlang_repository.bzl's _ARCH mapping table has the exact same shape as gleam_host's (arm64/amd64 vs. aarch64/x86_64 spellings), and it's the file where the original macOS hermetic-Erlang arch bug was found earlier this session — purely via a real CI failure on a real macOS runner, since no test existed for this file at all.
  • Extracts the OS/arch/platform-constraint resolution out of _hermetic_erlang_repository_impl into a pure resolve_host(repository_ctx) function, using the same technique already used for gleam_host's host_platform (a plain fake struct standing in for a real repository_ctx, no Bazel machinery needed).
  • Adds test/unit/hermetic_erlang_repository/ covering every OS x arch combination (including both the raw and erlef-normalized arch spellings on both Linux and macOS) plus the two failure cases (fail() on unsupported OS/arch), so a repeat of that bug class fails fast locally instead of needing a real CI run on the affected platform to notice.
  • No behavior change: resolve_host reproduces the exact same URL/checksum-key/constraint values the inlined per-branch logic did before.

Test plan

  • buildifier -mode=diff/-lint=warn clean on all changed/added files (buildifier built locally via go install since Bazel itself is unavailable in this environment)
  • Relevant pre-commit hooks pass (end-of-file-fixer, typos)
  • CI: bazel test //test/... (new hermetic_erlang_repository_test_suite)
  • CI: existing examples/hermetic_erlang build/test still passes on both Linux and macOS (proves the refactor didn't change runtime behavior)

Generated by Claude Code

This file's _ARCH mapping table has the exact same shape as gleam_host's (arm64/amd64 vs.
aarch64/x86_64 spellings), and it's where the original macOS hermetic-Erlang arch bug was found
earlier -- purely via a real CI failure on a real macOS runner, since no test existed for this
file at all.

Extracted the OS/arch/platform-constraint resolution out of _hermetic_erlang_repository_impl
into a pure resolve_host(repository_ctx) function (same technique used for gleam_host's
host_platform), and added test/unit/hermetic_erlang_repository covering every OS x arch
combination (including both raw and erlef-normalized arch spellings) plus the two failure
cases, so a repeat of that bug class fails fast locally instead of needing a real CI run to
notice.

No behavior change: resolve_host reproduces the exact same URL/checksum-key/constraint values
the inlined per-branch logic did before.
@aaylward aaylward merged commit bd15ad6 into main Jul 3, 2026
5 checks passed
@aaylward aaylward deleted the claude/gleam-bazel-rules-review-0pfz4h branch July 3, 2026 23:06
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