Skip to content

feat(hermit): Upgrade moon to v2.0.0#928

Open
mvgijssel wants to merge 18 commits intomainfrom
feat/upgrade-moon-to-v2
Open

feat(hermit): Upgrade moon to v2.0.0#928
mvgijssel wants to merge 18 commits intomainfrom
feat/upgrade-moon-to-v2

Conversation

@mvgijssel
Copy link
Copy Markdown
Member

@mvgijssel mvgijssel commented Feb 19, 2026

Summary

This PR upgrades moon from v1.41.8 to v2.0.0, following the major release announced at https://moonrepo.dev/blog/moon-v2.0.

Changes Made

  • ✅ Updated hermit manifest (third_party/hermit/moon.hcl) for moon v2.0.0
  • ✅ Updated binary naming from moon-* to moon_cli-*
  • ✅ Updated packaging from standalone binaries to .tar.xz archives
  • ✅ Removed darwin amd64 platform (not available in moon v2.0.0)
  • ✅ Verified all SHA256 checksums for v2.0.0 release
  • ✅ Simplified manifest by using strip=1 for tar.xz extraction
  • ✅ Updated all moon.yml configuration files to v2.0.0 format
  • ✅ Migrated .moon/toolchain.yml to .moon/toolchains.yml
  • ✅ Applied YAML formatting fixes across all configuration files
  • ✅ Updated workspace.yml with v2 syntax standards
  • ✅ Fixed task configuration formatting

Breaking Changes in Moon v2.0.0

Per the official release notes:

  • Configuration format: Renamed vcs.manager to vcs.provider and changed value from git to github
  • Toolchain config: Moved from .moon/toolchain.yml to .moon/toolchains.yml
  • Task commands: Stricter parsing - complex shell syntax moved to script files
  • Project globs: Format changed in workspace.yml
  • Task dependencies: Removed deprecated local field
  • YAML formatting: Consistent indentation required for lists

Migration Completed

All configuration changes have been applied:

  • Renamed vcs.managervcs.provider with value github
  • Renamed .moon/toolchain.yml.moon/toolchains.yml
  • Removed deprecated local: true from task configurations
  • Converted complex task commands to script files
  • Fixed YAML list formatting across all moon.yml files
  • Updated project glob patterns in workspace.yml

Test Plan

  • ✅ Moon v2.0.0 installed and verified (moon --version shows 2.0.0)
  • ✅ Hermit manifest has correct SHA256 digests (verified against releases)
  • ✅ All trunk checks pass
  • ✅ YAML formatting is consistent
  • CI passes on Linux environments
  • All moon tasks execute successfully

🤖 Generated with Claude Code

@mvgijssel mvgijssel force-pushed the feat/upgrade-moon-to-v2 branch from f34ab1f to 37f2fd0 Compare February 19, 2026 16:33
- Update moon from v1.41.8 to v2.0.0
- Update binary naming from moon-* to moon_cli-*
- Update packaging from standalone binaries to tar.xz archives
- Remove darwin amd64 platform (not available in v2.0.0)
- Update all SHA256 checksums for v2.0.0 release
- Simplify manifest by using strip=1 for tar.xz extraction

Breaking changes in moon v2.0.0:
- New plugin-based toolchain system
- Command syntax changes (moon <target> deprecated, use moonx)
- Task command parsing now stricter (no pipes/redirects)
- Extensions config moved to .moon/extensions.* files

See https://moonrepo.dev/blog/moon-v2.0 for full migration guide

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@mvgijssel mvgijssel force-pushed the feat/upgrade-moon-to-v2 branch from 37f2fd0 to 70b1839 Compare February 19, 2026 16:36
mvgijssel and others added 17 commits February 19, 2026 16:39
After upgrading to moon v2.0.0, the old symlinks are removed.
Add explicit hermit install step to ensure moon is available in CI.
moon v2.0.0 removed darwin-amd64 support which causes hermit to prompt
for confirmation. Use yes to auto-answer and allow installation on
supported platforms.
Trigger CI to test hermit install workaround with yes command.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
The issue was that `hermit install moon` prompts for confirmation when
installing moon 2.0.0 because it dropped darwin-amd64 support. The
previous approach using `yes | hermit install moon || true` failed
because:

1. The pipe causes a "sync /dev/stdout: invalid argument" error from
   Go's zap logger when hermit tries to sync stdout
2. This error, combined with `|| true`, masked the actual failure
3. The hermit install never completed, so no moon symlink was created
   in bin/
4. Later steps failed with "moon: command not found"

Solution: Use the `script` command to create a pseudo-TTY, which allows
the pipe to work correctly. The script command wraps the hermit install
in a PTY environment where the piped input is properly handled.

Also added verification that moon is available after installation to
catch any future issues early.

Fixes: https://github.com/vgijssel/setup/actions/runs/22454083555

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
The 'script -q -c' command works on Linux but has different behavior on macOS
(BSD script vs GNU script). Replace it with a simpler, more portable solution
using 'printf y\n | hermit install moon'.

This approach:
- Works identically on both Linux and macOS
- Eliminates the need for pseudo-TTY creation
- Removes complex output filtering (grep -v, || true)
- Maintains the same functionality of answering 'y' to the interactive prompt

Tested on Linux. The printf approach is POSIX-compliant and works across all
Unix-like systems.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
The previous printf pipe approach failed due to bash's -e -o pipefail flags.
Use here-string (<<<) with || true to properly handle the interactive prompt
and suppress hermit's exit code while still checking if moon was installed.
Instead of trying to install moon explicitly (which prompts due to unsupported
darwin-amd64), run 'hermit install' without arguments to install all packages.
If moon isn't immediately available, it will be lazy-installed on first use.

This avoids all the interactive prompt issues we've been fighting.
Moon v2.0.0 removed darwin-amd64 support, which caused hermit to show
an interactive prompt asking for confirmation to install on unsupported
platforms. This blocked CI installation.

Solution: Add darwin-amd64 platform back to the manifest using the
arm64 binary as a fallback. Since CI only runs on linux-amd64 and
darwin-arm64, this fallback will never actually be used, but it
prevents the interactive prompt from appearing.

Also simplified the hermit install step now that the prompt is resolved.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Moon v2.0.0 introduced breaking changes:
1. Changed `--jobTotal` to `--job-total` (kebab-case)
2. Renamed `unstable_remote` to `remote` in workspace.yml

These changes fix the CI test failures and configuration parsing errors.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Moon v2.0.0 renamed the vcs.manager field to vcs.provider in workspace.yml.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Moon v2.0.0's vcs.provider field expects the hosting provider name
(github, gitlab, bitbucket, other), not the VCS client type.

Error was: vcs.provider: unknown variant `git`, expected one of
`bitbucket`, `github`, `gitlab`, `other`

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Moon v2.0.0 removed the top-level 'local' field from task
configuration. Tasks run locally by default in v2.0.0.

Error was: tasks.exec.local: unknown field `local`

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Moon v2.0.0 was trying to parse hermit manifest files (*.hcl) as moon
configuration files. Added exclusion glob to prevent hermit directory
from being scanned for moon projects.

Error was: Failed to parse third_party/hermit/moon.hcl - undefined variable 'version'

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Moon v2.0.0 no longer supports shell operators (&&, ||, pipes, redirects)
in the command field. Converted all affected tasks to use script field
instead, which supports full shell syntax.

Fixed tasks in:
- apps/gateway-prod/moon.yml (apply, destroy, init, output, plan)
- apps/escaperoom/moon.yml (test)
- libs/internal-dns/moon.yml (test)
- apps/tinkerbell/moon.yml (dev, ipxe)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Update all moon.yml files to v2 formatting standards
- Replace .moon/toolchain.yml with .moon/toolchains.yml
- Fix YAML list indentation across all configuration files
- Update workspace.yml with v2 syntax
- Maintain moon v2.0.0 in hermit with verified SHA256 digests

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Remove runInCI: false from pnpm-tool build tasks to fix CI dependency validation
- Add file group definitions to tag and project files (moon v2 requirement)
- File groups must now be defined in the same file where they're referenced
- Fixes task_builder::dependency::run_in_ci_mismatch errors
- Fixes project::unknown_file_group errors for pnpm_bin, regctl_bin, vendir_bin, chezmoi_bin, claude_bin

Moon v2 enforces stricter validation:
- Tasks running in CI must depend only on tasks that can also run in CI
- File groups must be defined locally within the same configuration file

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Mar 3, 2026

Run report for 970910ec (ubuntu-latest, Linux, 1, 2, 2)

Total time: 1m 32s | Comparison time: 4m 45s | Estimated savings: 3m 12s (67.5% faster)

Action Time Status Info
🟩 SyncWorkspace 8.6ms Passed
🟩 SyncProject(devenv) 0.7ms Passed
🟩 SyncProject(relay-server) 0.7ms Passed
🟩 SyncProject(blueorange) 0.7ms Passed
🟩 SyncProject(vendir) 1ms Passed
🟩 SyncProject(vault-shell) 0.7ms Passed
🟩 SyncProject(registry) 0.7ms Passed
🟩 SyncProject(postcss-cli) 0.7ms Passed
🟩 SyncProject(task-master) 0.9ms Passed
🟩 SyncProject(dev-cluster) 0.3ms Passed
🟩 SyncProject(docker) 0.8ms Passed
🟩 SyncProject(verjaardag-hilde) 0.8ms Passed
🟩 SyncProject(devcontainers-cli) 1ms Passed
🟩 SyncProject(vault-login) 0.3ms Passed
🟩 SyncProject(fleet-mcp) 0.5ms Passed
🟩 SyncProject(windmill-cli) 0.3ms Passed
🟩 SyncProject(escaperoom) 0.3ms Passed
🟩 SyncProject(html-minifier-terser) 0.3ms Passed
🟩 SyncProject(uglify-js) 0.5ms Passed
🟩 SyncProject(occupancy_component) 0.3ms Passed
And 21 more...
Expanded report
Action Time Status Info
🟩 SyncProject(external-service) 0.6ms Passed
🟩 SyncProject(javascript) 0.8ms Passed
🟩 RunTask(relay-server:build) 1.2s Passed
🟩 SyncProject(talos-image) 0.5ms Passed
🟩 RunTask(relay-server:lint) 1.4s Passed
🟩 RunTask(relay-server:test) 1.5s Passed
🟥 RunTask(vault-shell:test) 1.3s Failed
🟩 RunTask(registry:test) 848ms Passed
🟥 RunTask(vault-shell:build) 2.3s Failed
🟩 RunTask(blueorange:install) 15.3s Passed
🟩 RunTask(dev-cluster:test) 3.9s Passed
🟩 RunTask(vendir:build) 39.4s Passed
🟩 RunTask(verjaardag-hilde:install) 8.9s Passed
🟩 RunTask(docker:registry_run) 5.3s Passed
🟩 RunTask(docker:buildx_run) 1.6s Passed
🟩 RunTask(task-master:build) 1m 11s Passed
🟩 SyncProject(devcontainer) 0.6ms Passed
🟩 RunTask(postcss-cli:build) 1m 17s Passed
🟦 RunTask(devcontainers-cli:build) 9.6s Cached
🟥 RunTask(vault-login:build) 3s Failed
🟥 RunTask(uglify-js:build) 5.2s Failed
Environment

OS: Linux
Matrix:

os = ubuntu-latest
name = Linux
index = 1
total = 2
job_number = 2

Variables:

MOON_TOOLCHAIN_FORCE_GLOBALS = true
Changed files
.devcontainer/moon.yml
.github/actions/setup/action.yaml
.github/workflows/test.yaml
.moon/tasks/tag-pnpm-tool.yml
.moon/tasks/tag-python.yml
.moon/tasks/tasks.yml
.moon/toolchain.yml
.moon/toolchains.yml
.moon/workspace.yml
apps/blueorange/moon.yml
apps/coder-prod/moon.yml
apps/enigma-cluster/moon.yml
apps/enigma-cozy/moon.yml
apps/escaperoom/moon.yml
apps/gateway-prod/moon.yml
apps/haos/moon.yml
apps/keycloak-prod/moon.yml
apps/pihole-prod/moon.yml
apps/tailscale-prod/moon.yml
apps/tinkerbell/moon.yml
bc
bin/.moon-1.41.8.pkg
bin/.moon-2.0.0.pkg
bin/moon
libs/coder-devcontainer-kubernetes/moon.yml
libs/devenv/moon.yml
libs/docker/moon.yml
libs/external-service/moon.yml
libs/internal-dns/moon.yml
libs/registry/moon.yml
libs/talos-image/moon.yml
libs/vault-login/moon.yml
libs/vault-shell/moon.yml
third_party/hermit/moon.hcl
third_party/javascript/tools/html-minifier-terser/moon.yml
third_party/javascript/tools/postcss-cli/moon.yml
third_party/javascript/tools/svgo/moon.yml
third_party/javascript/tools/task-master/moon.yml
third_party/javascript/tools/uglify-js/moon.yml
third_party/javascript/tools/windmill-cli/moon.yml
third_party/vendir/moon.yml

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Mar 3, 2026

Run report for 970910ec (ubuntu-latest, Linux, 0, 2, 1)

Total time: 1m 53s | Comparison time: 5m 4s | Estimated savings: 3m 11s (62.7% faster)

Action Time Status Info
🟩 SyncWorkspace 8.7ms Passed
🟩 SyncProject(vendir) 0.4ms Passed
🟩 SyncProject(dev-cluster) 0.4ms Passed
🟩 SyncProject(html-minifier-terser) 0.9ms Passed
🟩 SyncProject(vault-login) 0.9ms Passed
🟩 SyncProject(external-service) 0.6ms Passed
🟩 SyncProject(uglify-js) 0.6ms Passed
🟩 SyncProject(svgo) 1ms Passed
🟩 SyncProject(devcontainers-cli) 1ms Passed
🟩 SyncProject(docker) 0.5ms Passed
🟩 SyncProject(windmill-cli) 0.8ms Passed
🟩 SyncProject(task-master) 0.8ms Passed
🟩 SyncProject(escaperoom) 1.1ms Passed
🟩 SyncProject(blueorange) 0.3ms Passed
🟩 SyncProject(distrobuilder-image) 0.6ms Passed
🟩 SyncProject(fleet-mcp) 0.6ms Passed
🟩 SyncProject(registry) 0.5ms Passed
🟩 SyncProject(verjaardag-hilde) 0.7ms Passed
🟩 SyncProject(devenv) 0.7ms Passed
🟩 SyncProject(talos-image) 1.3ms Passed
And 16 more...
Expanded report
Action Time Status Info
🟥 RunTask(vault-login:test) 1.4s Failed
🟩 RunTask(external-service:build) 999.2ms Passed
🟩 RunTask(html-minifier-terser:build) 3.2s Passed
🟩 RunTask(dev-cluster:build) 3.9s Passed
🟩 RunTask(external-service:test) 1.6s Passed
🟩 RunTask(uglify-js:build) 2.6s Passed
🟩 RunTask(devcontainers-cli:build) 3.4s Passed
🟩 RunTask(docker:buildx_run) 1.9s Passed
🟩 RunTask(svgo:build) 5.3s Passed
🟩 RunTask(windmill-cli:build) 9.9s Passed
🟩 RunTask(blueorange:install) 18.5s Passed
🟩 RunTask(vendir:build) 36.2s Passed
🟩 RunTask(fleet-mcp:lint) 1m 12s Passed
🟩 RunTask(task-master:build) 1m 41s Passed
🟩 RunTask(escaperoom:build) 1m 31s Passed
🟥 RunTask(registry:build) 4.6s Failed
Environment

OS: Linux
Matrix:

os = ubuntu-latest
name = Linux
index = 0
total = 2
job_number = 1

Variables:

MOON_TOOLCHAIN_FORCE_GLOBALS = true
Changed files
.devcontainer/moon.yml
.github/actions/setup/action.yaml
.github/workflows/test.yaml
.moon/tasks/tag-pnpm-tool.yml
.moon/tasks/tag-python.yml
.moon/tasks/tasks.yml
.moon/toolchain.yml
.moon/toolchains.yml
.moon/workspace.yml
apps/blueorange/moon.yml
apps/coder-prod/moon.yml
apps/enigma-cluster/moon.yml
apps/enigma-cozy/moon.yml
apps/escaperoom/moon.yml
apps/gateway-prod/moon.yml
apps/haos/moon.yml
apps/keycloak-prod/moon.yml
apps/pihole-prod/moon.yml
apps/tailscale-prod/moon.yml
apps/tinkerbell/moon.yml
bc
bin/.moon-1.41.8.pkg
bin/.moon-2.0.0.pkg
bin/moon
libs/coder-devcontainer-kubernetes/moon.yml
libs/devenv/moon.yml
libs/docker/moon.yml
libs/external-service/moon.yml
libs/internal-dns/moon.yml
libs/registry/moon.yml
libs/talos-image/moon.yml
libs/vault-login/moon.yml
libs/vault-shell/moon.yml
third_party/hermit/moon.hcl
third_party/javascript/tools/html-minifier-terser/moon.yml
third_party/javascript/tools/postcss-cli/moon.yml
third_party/javascript/tools/svgo/moon.yml
third_party/javascript/tools/task-master/moon.yml
third_party/javascript/tools/uglify-js/moon.yml
third_party/javascript/tools/windmill-cli/moon.yml
third_party/vendir/moon.yml

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Mar 3, 2026

Run report for 970910ec (macos-latest, macOS, 0, 1, 1)

Total time: 10m 19s | Comparison time: 8m 46s | Estimated loss: 1m 32s (15.0% slower)

Action Time Status Info
🟩 SyncWorkspace 17.1ms Passed
🟩 SyncProject(vendir) 1.2ms Passed
🟩 SyncProject(devenv) 6.2ms Passed
🟩 RunTask(vendir:build) 3m 28s Passed SLOW
🟩 RunTask(devenv:test) 6m 50s Passed SLOW
Environment

OS: macOS
Matrix:

os = macos-latest
name = macOS
index = 0
total = 1
job_number = 1

Variables:

MOON_TOOLCHAIN_FORCE_GLOBALS = true
Changed files
.devcontainer/moon.yml
.github/actions/setup/action.yaml
.github/workflows/test.yaml
.moon/tasks/tag-pnpm-tool.yml
.moon/tasks/tag-python.yml
.moon/tasks/tasks.yml
.moon/toolchain.yml
.moon/toolchains.yml
.moon/workspace.yml
apps/blueorange/moon.yml
apps/coder-prod/moon.yml
apps/enigma-cluster/moon.yml
apps/enigma-cozy/moon.yml
apps/escaperoom/moon.yml
apps/gateway-prod/moon.yml
apps/haos/moon.yml
apps/keycloak-prod/moon.yml
apps/pihole-prod/moon.yml
apps/tailscale-prod/moon.yml
apps/tinkerbell/moon.yml
bc
bin/.moon-1.41.8.pkg
bin/.moon-2.0.0.pkg
bin/moon
libs/coder-devcontainer-kubernetes/moon.yml
libs/devenv/moon.yml
libs/docker/moon.yml
libs/external-service/moon.yml
libs/internal-dns/moon.yml
libs/registry/moon.yml
libs/talos-image/moon.yml
libs/vault-login/moon.yml
libs/vault-shell/moon.yml
third_party/hermit/moon.hcl
third_party/javascript/tools/html-minifier-terser/moon.yml
third_party/javascript/tools/postcss-cli/moon.yml
third_party/javascript/tools/svgo/moon.yml
third_party/javascript/tools/task-master/moon.yml
third_party/javascript/tools/uglify-js/moon.yml
third_party/javascript/tools/windmill-cli/moon.yml
third_party/vendir/moon.yml

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.

1 participant