Skip to content

Resolve major.minor version pins to the newest available patch - #449

Open
myl7 wants to merge 1 commit into
Jimver:masterfrom
myl7:major-minor-pins
Open

myl7 wants to merge 1 commit into
Jimver:masterfrom
myl7:major-minor-pins

Conversation

@myl7

@myl7 myl7 commented Oct 16, 2026 •

Copy link
Copy Markdown

Problem

getVersion() parses the cuda input with new SemVer(versionString), so any major.minor-only pin throws before installation starts:

##[error]TypeError: Invalid Version: 12.6

Strict semver requires all three components, but a major.minor pin ("install whatever patch of 12.6 is current") is a natural way to use this action, and it matches how the Linux network path actually installs (cuda-nvcc-<major>-<minor> via apt, with apt resolving the patch).

Change

  • A full semver string keeps its exact behavior: install that version or fail with Version not available.
  • A major.minor pin (12.6) resolves to the newest listed patch of that series (currently 12.6.3).
  • A major-only pin (12) resolves to the newest listed release of that major series.
  • Anything that is neither full semver nor a bare major(.minor) number still throws the same TypeError: Invalid Version: ....
  • The cuda output now reports the resolved installed version instead of the raw input.

Jest covers pin resolution (major.minor and major-only), unavailable pins, and a full-but-unlisted version; dist is rebuilt.

Complements #448 (CUDA 13.4 links) — with both, cuda: 13.4 works end to end.

@myl7
myl7 marked this pull request as ready for review October 16, 2026 12:59
@myl7
myl7 requested a review from Jimver as a code owner October 16, 2026 12:59
Copilot AI balanced review requested due to automatic review settings October 16, 2026 12:59

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Major-only pins select the wrong minor series, and the action output reports the unresolved input.

2 open findings
What changed in this PR

Adds partial CUDA version resolution to the action while preserving exact-version lookup for full semver inputs.

Changes:

  • Resolves partial pins against available download versions.
  • Adds regression tests and documents major.minor pins.
  • Updates the shipped bundle.
File Description
src/​version.ts Parses partial pins and selects matching releases.
README.md Documents version-pin behavior.
dist/​index.js Includes the updated resolver.
tests/​version.test.ts Tests pin resolution and unavailable versions.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/version.ts Resolved
Comment thread src/version.ts Resolved
@myl7
myl7 force-pushed the major-minor-pins branch from 3e71e7b to a6b7135 Compare October 16, 2026 14:22
vhrabar added a commit to vhrabar/cuda-toolkit that referenced this pull request Oct 19, 2026
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