Write .nvmrc for explicit-version Windows CI jobs#32
Open
mokagio wants to merge 2 commits into
Open
Conversation
The Windows explicit-version jobs hang at the nvm installer step, and the only difference from the passing `.nvmrc` jobs is which branch of this repository pre-command hook runs: the hanging jobs hit the early `exit 0`, the passing ones fall through after writing `.nvmrc`. Restructure so the no-op case falls off the end instead of calling `exit 0`, isolating whether that explicit exit is what wedges the later `curl | bash`. If the explicit-version Windows jobs pass after this, version-only on Windows works and the hang was a harness artifact — no plugin API change needed. --- Generated with the help of Claude Code, https://claude.com/claude-code Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Adjusts the Buildkite repository pre-command hook used in CI to avoid an explicit early exit 0, and to only create a .nvmrc file when the CI-only env var is provided—aiming to eliminate a Windows CI hang without changing the plugin’s public behavior.
Changes:
- Replace the early no-op
exit 0with a conditional write of.nvmrconly whenNVM_BUILDKITE_PLUGIN_TEST_NVMRC_VERSIONis set. - Restructure the hook so the no-op path naturally falls through (no explicit early exit).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+8
to
10
| if [[ -n "${NVM_BUILDKITE_PLUGIN_TEST_NVMRC_VERSION:-}" ]]; then | ||
| printf '%s\n' "$NVM_BUILDKITE_PLUGIN_TEST_NVMRC_VERSION" > .nvmrc | ||
| fi |
The explicit-version Windows jobs hang and get killed (`0xC000013A`): with no `.nvmrc` in the working directory, nvm v0.39.4's ancestor walk loops forever under the Windows agent's bash. Setting `NVM_BUILDKITE_PLUGIN_TEST_NVMRC_VERSION` makes the repo `pre-command` hook write one before the plugin runs, short-circuiting the walk. The plugin still installs via the `version:` property; the `.nvmrc` is only there to satisfy nvm's directory walk, so this is a CI-harness fix with no change to the plugin. Proven green by build 116 (PR #29 experiment). --- Generated with the help of Claude Code, https://claude.com/claude-code Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The explicit-version Windows jobs (
v20.19.5,v24.15.0) hang and get killed (exit0xC000013A) — not an assertion failure, a genuine hang. With no.nvmrcin the working directory, nvmv0.39.4's ancestor walk (nvm_find_project_dir) loops forever under the Windows agent's bash. The.nvmrc-fallback Windows job passes precisely because it has a.nvmrc.This is a CI-harness problem, not a plugin one: the plugin's
version:-property path is fine — real consumers that ship a.nvmrcnever hit the walk. So the fix stays in CI.Setting
NVM_BUILDKITE_PLUGIN_TEST_NVMRC_VERSIONon the explicit-version jobs makes the repopre-commandhook write a.nvmrcbefore the plugin runs, short-circuiting the walk. The plugin still installs via theversion:property; the.nvmrcis only a decoy for nvm's directory search.No change to
hooks/orplugin.yml.How to test
Watch the two explicit-version Windows jobs (
v20.19.5,v24.15.0) go green. This configuration already passed end-to-end in build 116 (the #29 experiment); this PR lands it as the minimal, clean change.