Upgrading V to latest version
If V is already installed on a machine, it can be upgraded to its latest version
by using the V's built-in self-updater.
To do so, run the command v up.
This also refreshes the bundled TCC binaries used for fast C compilation.
On Linux, an older compatible TCC bundle stays in place while its upstream revision
is unchanged and it still passes the host compatibility check. Repeated updates
preserve its file metadata so cached modules can reuse their objects.
On macOS, TCC builds use its runtime thread fence directly, including when
preprocessed C identifies ARM64 with __arm64__ alone.
After updating, v up refreshes previously cached vlib modules with the compiler
and flags used to cache them, including normal and -prod builds. Unchanged
modules are reused. Each module being cached is printed to standard output as
Caching module <name>.... A failed cache refresh makes v up fail.
The final configuration count includes checks that reused every cached object.
Different build flags, program or test modes, and import sequences can require
separate checks. Pass v up -v to see each checked configuration.
Cached module headers preserve struct field attribute groups, so valid deprecation
attributes do not introduce warnings during refresh.
make also warms the default test configuration's builtin module bundle, including
strings, strconv, hash and bits. Compatible test builds reuse these objects
when the program introduces new error types, retaining builtin error dispatch ID dependencies.
Dispatch hash collisions retain the full error-type dependency. Without a bundled collector,
the warmup uses -gc none; an explicit -gc setting takes precedence.
A missing object for another module rebuilds that module while retaining compatible cached
modules. Ignored local names remain stable when cached headers replace source files, so
reparsed modules can reuse identical C objects. Compiler flags, source changes and dependency
changes still invalidate the affected objects.
Ordinary builds report cache progress on standard error. Refreshes retain absolute
module search paths, resolved C compiler commands, and build modes. They omit
linker-only flags, including operands embedded in -cflags. Relative V3CACHE
and VTMP paths are resolved against the directory where v up was invoked.
Refreshes retain each build's working directory for relative C compilation inputs
and its effective -run-only test selectors and assertion display mode.
Object flags include source #flag directives. Records with vanished project
directories or required compile inputs are skipped. Builds without relative inputs
or project interface scopes share refresh records across projects.
Project directives are merged with flags from the updated modules, so changes to
vlib #flag directives take effect during refresh. Cached TCC production builds
apply the production optimization flags to both module objects and the program.
Refreshes use the original entry when needed to preserve project interface
implementers, stopping before linking or running the program. Refreshes
retain absolute -file-list operands for live entries, re-expanding directories
to include their current sources. Records whose listed files or directories vanished
are skipped. Historical records sharing the same live command, working directory,
entry and assertion display mode refresh once. Synthetic refreshes
also replay source C driver options such as sanitizers at link time. Records for
unavailable C compilers are skipped.
Unreadable, truncated, and unsupported inventory files are skipped. Live entries
retain their project source identity; after the project input changes, obsolete
configurations are skipped until a successful build records the current inputs.
Older live records without source identities require rebuilding the project once.
Isolated test caches use the primary V compiler executable, including when
v up runs through the fallback compiler or as a separate tool, or a build uses
the delegated ownership compiler. Ownership dispatch preserves the primary path
through V3_PRIMARY_VEXE, independently of the helper's VEXE.
For caches created before V recorded their build settings, v up identifies the
cached vlib modules and refreshes them in both modes for the available C compilers,
for programs and tests. Successful migrations mark the old headers so subsequent
updates use the new inventory without repeating the fallback matrix.
v up reports the agent skills that the new revision left behind, since a new
revision may ship updated copies of them. It writes nothing: the skills belong to
the user, and updating the compiler is not consent to overwrite them. Pass
-skills to refresh the ones that were not edited locally, or run
v skills update --global to choose which ones.
The report is about the skills installed for the whole machine, so
v skills update needs --global to act on them; on its own it defaults to the
project directory, which is a different installation. Skills with local changes,
and skills installed before V recorded what it installed, are reported either way
and left alone; see v skills update below.