Conversation
[platform].registries declares the ordered rock-server list a project resolves against. An entry is an HTTP(S) URL or a local directory, and a relative path is taken relative to the manifest. rocks.EffectiveRegistries picks the list a command must use: the first of the command line, the environment and the manifest that names anything, falling back to the built-in defaults. The layers replace one another rather than merging, because the list is ordered and first-found-wins - appending would change which server answers instead of adding a fallback. Each entry carries the layer it came from, so a listing can say why a server is being queried. Part of TNTP-9960
tt package build, fetch, pack, resolve, add, remove and update now take --registry, read TT_REGISTRIES, and fall back to the manifest and then to the defaults, so the server list a run queries is settled in one place instead of being the adapter default everywhere. An unusable list is reported before the run starts rather than at the first query, so a dependency edit is not written against servers that were never reachable. Part of TNTP-9960
A new package for the three commands that address rock servers rather than a dependency graph. Download is a mirror builder, not a file fetcher: it writes the LuaRocks manifest beside the files it fetches, so the directory it leaves behind is a rock server. Point a registry at it and the project builds with no network. With no arguments it mirrors the locked closure - every product's dependencies and the dev closure - at the exact locked versions. Indexing is the one operation still served by the Lua engine, since the native one implements no admin command. It is local: a directory walk, no network. The package joins the strict linter's adopted set. Part of TNTP-9960
tt registry list prints the effective server list in resolution order, each server with the layer it came from, so a build querying an unexpected server can be explained without guessing. tt package search reports every version every server offers, since a search asks what exists rather than picking one artifact. A term that matches nothing is not an error. tt package download builds a mirror. The acceptance test stops the loopback server before building, so a build that succeeds cannot have reached it. Part of TNTP-9960
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.
Stacked on #1377 — the base is that branch, so the diff here is only this
change. Re-target to
v3once #1377 merges.What this adds
Configurable registries. One precedence, everywhere:
--registry>TT_REGISTRIES>[platform].registries> the built-indefaults. A dependency's own
registrykey still wins for that dependency.The layers replace one another rather than merging: a rock-server list is
ordered and first-found-wins, so appending a layer would change which server
answers instead of adding a fallback. An entry is an http(s) URL or a local
directory; a relative path resolves against the manifest for the manifest's
own list, and against the working directory otherwise.
rocks.EffectiveRegistriesis the single function that settles it, and every command that queries a
server now goes through it —
build,fetch,pack,resolve,add,remove,update,search,downloadandregistry list.tt registry list [-o table|json|yaml]. The effective list in resolutionorder, each server with the layer it came from, so an unexpected server can be
explained rather than guessed at.
tt package search <term> [-o …]. Every version every server offers.Unlike resolution, which stops at the first server that has a rock, a search
asks all of them. A term nothing matches is not an error: the table writes
nothing to stdout and a line to stderr, the machine formats print an empty
list.
tt package download [<name>[@<version>]…] [--dir <path>]. A mirrorbuilder, not a file fetcher. It writes the LuaRocks
manifestbeside the rockfiles it fetches, so the directory it leaves behind is a rock server. With
no arguments it mirrors the project's locked closure — every product's
dependencies plus the dev closure — at the exact locked versions. Re-running
overwrites and re-indexes, so a mirror is extended in place.
Deviations worth review
per-dependency registry:
manifest.LockDependencycarries name, version,source, checksum, path and content hash and nothing else. Every locked rock
is fetched from the effective list. Related and pre-existing:
build.materializeinstalls from the global server list too, so a rockresolved from a per-dependency
registryis already installed fromelsewhere. Not touched here.
rocks.EffectiveRegistriestakes the manifest's list as[]stringratherthan a
*manifest.Manifest, socli/manifest/rocksdoes not import theroot package and the layering stays as the package docs describe it.
--registryis also onremoveandpack, which were not in the originallist: both re-resolve or build, so omitting them would leave two commands
querying different servers from their neighbours.
cli/manifest/registryis added to the strict.golangci.ymladopted set.Verified by planting a deliberate violation and watching it get reported.
Verification
Go 1.26.0 (
GOTOOLCHAIN=go1.26.0), golangci-lint 2.13.2 — the versionmagefile.goand CI pin; the linter on the machine was 2.11.4 and was not used.go build ./...,go vet ./...,mage lint:golang— clean.git rev-list, 8 iterations, 0 unbuildable).mage unit: 48 packages ok.cli/configure'sTestConfigureClifailsidentically on the base commit (a macOS
/privatesymlink assertion).cli/manifest/rocks, 5 lock-walkcases plus ref/format/render coverage in
cli/manifest/registry.test/integration/package+test/integration/registry— 75passed, 3 skipped (docker).
Mutations
TestEffectiveRegistriesPrecedence/flag_wins_over_everythingand…LayersDoNotMergego red…ResolvesRelativePaths/a_manifest_path_is_relative_to_the_project_directorygoes redmanifestfrom a built mirrorremote.FileRemoteIndex: load …: no manifest variant foundwhere the control build succeedsEvery mutant was checked to build (
go vetclean) before its test result was read.The acceptance test is the one that matters:
and
.rocks/share/tarantool/stat/init.luais there afterwards. The server isstopped before the build, so a build that succeeds cannot have reached it.
Part of TNTP-9960