From 07d476139b7e999518c5b7e2d47ee8950a12dd0c Mon Sep 17 00:00:00 2001 From: ebkn Date: Thu, 13 Aug 2026 22:55:19 +0900 Subject: [PATCH] fix(init): repair the two brew bundle failures in CI Both setup workflows died in `brew bundle`, for unrelated reasons. macOS: homebrew-core deleted tflint on 2026-05-13 over its BUSL relicense, so `brew 'tflint'` now resolves to nothing ("No available formula"). The upstream tap only ships a cask, which would be macOS-only and needs `brew trust` for a third-party tap. Installing it with `go install` instead keeps tflint on Linux too and matches how terraform-ls and tfsec are already installed a few lines away. Ubuntu/WSL: the runners ship a preinstalled Homebrew with auto-update disabled. When it is older than the formula JSON API's schema it aborts mid-pour with "unknown install step: run", which took out tmux and gnupg. The scripts ran `brew upgrade` but never `brew update`, so Homebrew itself stayed stale; update_homebrew() now does both. --- bin/init/common.sh | 8 ++++++++ bin/init/macos.sh | 3 ++- bin/init/ubuntu.sh | 3 ++- bin/init/wsl.sh | 3 ++- brewfiles/Brewfile-lang | 5 +++-- zsh/alias.zsh | 1 + 6 files changed, 18 insertions(+), 5 deletions(-) diff --git a/bin/init/common.sh b/bin/init/common.sh index cc7f171..4cac6ad 100644 --- a/bin/init/common.sh +++ b/bin/init/common.sh @@ -128,6 +128,14 @@ install_or_upgrade_homebrew_linux() { activate_brew_shellenv } +# Refresh Homebrew itself before touching any formula. CI runners ship a +# preinstalled Homebrew with auto-update disabled, and a Homebrew older than the +# formula JSON API's schema aborts mid-pour with "unknown install step: run". +update_homebrew() { + brew update + brew upgrade +} + install_or_upgrade_brew_formula() { local formula formula="$1" diff --git a/bin/init/macos.sh b/bin/init/macos.sh index 40dad53..0deca5d 100644 --- a/bin/init/macos.sh +++ b/bin/init/macos.sh @@ -78,7 +78,7 @@ fi export PATH="/usr/local/bin:$PATH" export PATH="/opt/homebrew/sbin:$PATH" export PATH="/opt/homebrew/bin:$PATH" -brew upgrade +update_homebrew brew doctor || true log_step "Homebrew installed" @@ -196,6 +196,7 @@ install_go_tool "github.com/mikefarah/yq/v4@latest" install_go_tool "github.com/x-motemen/ghq@latest" install_go_tool "github.com/cloudspannerecosystem/spanner-cli@latest" install_go_tool "github.com/aquasecurity/tfsec/cmd/tfsec@latest" +install_go_tool "github.com/terraform-linters/tflint@latest" install_go_tool "mvdan.cc/gofumpt@latest" install_go_tool "tailscale.com/cmd/tailscale@main" install_go_tool "tailscale.com/cmd/tailscaled@main" diff --git a/bin/init/ubuntu.sh b/bin/init/ubuntu.sh index 55b0056..40c165b 100644 --- a/bin/init/ubuntu.sh +++ b/bin/init/ubuntu.sh @@ -75,7 +75,7 @@ install_or_upgrade_git_repo "https://github.com/ebkn/dotfiles" "$DOTFILES_DIR" log_step "Installing Homebrew" install_or_upgrade_homebrew_linux -brew upgrade +update_homebrew brew doctor || true log_step "Installing Google Cloud CLI" @@ -113,6 +113,7 @@ install_go_tool "github.com/mikefarah/yq/v4@latest" install_go_tool "github.com/x-motemen/ghq@latest" install_go_tool "github.com/cloudspannerecosystem/spanner-cli@latest" install_go_tool "github.com/aquasecurity/tfsec/cmd/tfsec@latest" +install_go_tool "github.com/terraform-linters/tflint@latest" install_go_tool "mvdan.cc/gofumpt@latest" install_go_tool "tailscale.com/cmd/tailscale@main" install_go_tool "tailscale.com/cmd/tailscaled@main" diff --git a/bin/init/wsl.sh b/bin/init/wsl.sh index a763e3d..c5f14fb 100644 --- a/bin/init/wsl.sh +++ b/bin/init/wsl.sh @@ -131,7 +131,7 @@ install_or_upgrade_git_repo "https://github.com/ebkn/dotfiles" "$DOTFILES_DIR" log_step "Installing Homebrew" install_or_upgrade_homebrew_linux -brew upgrade +update_homebrew brew doctor || true log_step "Installing Google Cloud CLI" @@ -192,6 +192,7 @@ install_go_tool "github.com/mikefarah/yq/v4@latest" install_go_tool "github.com/x-motemen/ghq@latest" install_go_tool "github.com/cloudspannerecosystem/spanner-cli@latest" install_go_tool "github.com/aquasecurity/tfsec/cmd/tfsec@latest" +install_go_tool "github.com/terraform-linters/tflint@latest" install_go_tool "mvdan.cc/gofumpt@latest" link_with_backup "${DOTFILES_DIR}/.vimrc" "${HOME}/.vimrc" diff --git a/brewfiles/Brewfile-lang b/brewfiles/Brewfile-lang index 5c6b950..584fd97 100644 --- a/brewfiles/Brewfile-lang +++ b/brewfiles/Brewfile-lang @@ -15,8 +15,9 @@ brew 'hadolint' # ShellScript brew 'shellcheck' -# Terraform -brew 'tflint' +# Terraform: tflint relicensed to BUSL and was dropped from homebrew-core +# (2026-05-13), so it is installed via install_go_tool alongside terraform-ls +# and tfsec in the platform init scripts. # Java brew 'java' diff --git a/zsh/alias.zsh b/zsh/alias.zsh index bbfba11..4c87d23 100644 --- a/zsh/alias.zsh +++ b/zsh/alias.zsh @@ -529,6 +529,7 @@ update-all() { go install github.com/x-motemen/ghq@latest go install github.com/cloudspannerecosystem/spanner-cli@latest go install github.com/aquasecurity/tfsec/cmd/tfsec@latest + go install github.com/terraform-linters/tflint@latest go install mvdan.cc/gofumpt@latest go install tailscale.com/cmd/tailscale{,d}@main # --ignore-scripts=false overrides ~/.npmrc's global ignore-scripts=true: this