Skip to content

fix(manifest): refetch manifests cached by another dtvem version - #308

Merged
CalvinAllen merged 1 commit into
mainfrom
fix/manifest/refresh-on-upgrade
Nov 13, 2026
Merged

CalvinAllen merged 1 commit into
mainfrom
fix/manifest/refresh-on-upgrade

Conversation

@CalvinAllen

Copy link
Copy Markdown
Contributor

Description

After upgrading to v0.7.3, dtvem install python 3.12.10 --signed reported that no 3.12 version had a signed build for windows-amd64, although the live manifest lists one. dtvem update fixed it.

The manifest cache only checked its format and its 24-hour age. A pre-release build of #304 had cached the Python manifest in the current format (2), but from before the manifest listed python.org builds. v0.7.3 read that cache as valid and saw no signed builds. It would have kept doing so until the cache expired.

Installing a new dtvem should always fetch fresh manifests. A new version may read manifest fields that the version which wrote the cache didn't know about, or that didn't exist yet when it wrote it.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)

Related Issues

Relates to #304

Changes Made

  • Each cache file records the dtvem version that wrote it (cli_version). A cache file from any other version is treated as missing and fetched again, like an expired one.
  • cmd.Execute passes Version to manifest.SetCLIVersion before any command runs. DefaultSource gives that version to its cache. The shim doesn't use the manifest package, so it's unaffected.
  • Every pre-release build is dev, so two of them share a cache, as before. A release never reads a cache a dev build wrote.
  • The format check stays. CLAUDE.md now describes both checks.

Testing

Test Environment

  • OS: Windows 11
  • Go Version: 1.25.3 (toolchain)

Test Steps

  1. TestCachedSource_IgnoresOtherVersion: a stale manifest cached by dev, by an older release, or with no recorded version is fetched again by 0.7.4, and the fresh copy is then served from the cache. A version reading its own cache doesn't fetch.
  2. TestSetCLIVersion_DefaultSource: the default source's cache uses the version passed to SetCLIVersion.
  3. End to end: a binary built with -X ...cmd.Version=0.7.4-test ran list-all python against a scratch root whose cache an earlier build had written. It fetched again, recording "cli_version":"0.7.4-test", and a second run used that cache unchanged.

Test Results

before:           {"format":2,"cached_at":"2026-11-13T13:29:05...",
after 0.7.4-test: {"format":2,"cli_version":"0.7.4-test","cached_at":"2026-11-13T13:49:02...",
second run:       {"format":2,"cli_version":"0.7.4-test","cached_at":"2026-11-13T13:49:02...",

golangci-lint: 0 issues. ./rnr check fails only on TestGlobalVersion_NoConfigFile and TestGlobalVersion_RuntimeNotInConfig in internal/config, which fail the same way on unmodified main on the machine I tested on.

Checklist

  • My code follows the Google Go Style Guide
  • I have run golangci-lint run and fixed all issues (includes gofmt, govet, and 40+ linters)
  • I have run go mod tidy to clean up dependencies
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes (go test ./...) (apart from the two internal/config tests above, unchanged from main)
  • I have commented my code, particularly in hard-to-understand areas
  • I have updated the documentation (README.md, CONTRIBUTING.md, etc.) if needed
  • My changes generate no new warnings or errors
  • I have added appropriate error handling
  • I have followed conventional commit format in my commit messages

Breaking Changes

N/A. The first run of the new version fetches each manifest once; after that, caching works as before.

The manifest cache only checked its format and age, so a newly installed
dtvem kept reading a manifest an older build had cached for up to a day.
A pre-release build had cached the Python manifest in the current format
from before it listed python.org builds, and the release then reported
no signed builds until the cache expired or dtvem update ran.

The cache now records the dtvem version that wrote it, and a cache from
any other version is fetched again.
@CalvinAllen
CalvinAllen merged commit 879b704 into main Nov 13, 2026
11 checks passed
@CalvinAllen
CalvinAllen deleted the fix/manifest/refresh-on-upgrade branch November 13, 2026 19:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant