feat(package): record the variables a manifest read in the lock (#29) #337
Loading…
Reference in a new issue
No description provided.
Delete branch "loop/29-manifest-variables"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #29.
What: the variables the evaluation of a
project.trbread are recorded in the lock and named bytorb publish, as decided in the refine comment of #29.Manifest.variables: List<ReadVariable>(project/manifest.trb):ReadVariable.answered(name, value)hashessha256:overname + "\n" + value, or keeps the name alone for an unset variable.manifestOfreads afrom { variable ... }block back.EvaluatedManifest.variableNames()/.variables()(vm/manifest.trb): thevariable\t<name>lines the sandbox recorded, each once, sorted, answered from the environment the evaluation ran in.evaluatedManifest(cli/packages.trb) carries them, sotorb lockandtorb publishwrite them. A statically read manifest has none.settingsLines(package/lock.trb) closes asettingsblock withfrom { variable "X", hash: "sha256:..." / variable "Y", unset: true }, sorted, omitted when empty, so every literal manifest (the repository's own included) renders byte-identically to today. An older lock withoutfromis read unchanged.torb publishprintsreads: NAME (set|unset)per variable after thehash:line, aligned with the summary. The value is never printed or written.Tests
compiler/tests/packages.test.trb: exact rendering with a set and an unset variable, round triprenderLock(readLock(text)) == text, value absent; no variables means nofromand an unchanged round trip.compiler/tests/project.test.trb: recorded names deduplicated and sorted,variables()against the real environment (PATHand an unset name), the SHA-256 ofname\nvalueagainst a known digest.tools/packages.sh+tests/packages/sources/env-1.0.0: end to end,publish --dry-runof a manifest whose version readsPACKAGES_RELEASE(set) andPACKAGES_CHANNEL(unset) prints the tworeads:lines and never the value,torb lockwrites thefromblock, andlock --checkis current. The rest of the publish summary depends on archive bytes, so only the package line andreads:lines go into the transcript. This is the end-to-end program for the feature; atests/conformanceprogram doesn't fit because conformance runs programs, nottorb publish.Docs:
project-lock-trb.md(synopsis, parts table, ordering, pitfall:lock --checkdepends on the variables),torb-publish.md(summary, example, pitfall), PROJECT.md section 11 "What is left" (filelines remain, #331), ROADMAP, andskills/updated to match.Seed impact: none. No syntax change, no new native, no driver flag, no std name looked up by string.
The evaluation's recorded variables reach the settings of the lock as a trailing `from { }` block, by the SHA-256 of name and value or as `unset: true`; `torb publish` names each one, never the value. Refs #29Review of
3c9def1(CI green for this head).Findings
mainmoved toe1d13b07(feat(package): resolve and lock two majors of one package, plus two runtime commits) after this branch forked froma1f9f97. A trial merge of this head ontoe1d13b07conflicts incompiler/src/package/lock.trb(thesettingsLines/ header-doc region);cli/packages.trb,tests/packages.test.trbandPROJECT.mdauto-merge. Rebase onto currentmain, resolvelock.trbkeeping both changes, and push; CI has to run again on the rebased head, because the two-majors change touches the same lock/packages code and tests (tools/packages.shtranscript included).Checklist (everything else ok on this head)
publish --dry-run/lock/lock --checktranscript with a value-leak guard. okfromlast insettings, sorted, omitted when empty (literal manifests render as before), older locks read unchanged; value never printed or written. okfilelines left to #331). okNo other blockers; once the rebase is green this should be an approve.
3c9def1a188e03e22057New head: this review was requested for
3c9def1a, but the PR is now at8e03e220. Not reviewing the old head; the review runs again for the new head once its CI has finished.Review of
8e03e22(CI green for this head, combined status success).Earlier blocker (1, not mergeable): fixed. The branch is rebased onto current
main(e1d13b07, merge base = main head), the PR is mergeable,lock.trbcarries both the two-majors change and thefromblock, and CI ran again on the rebased head including thetools/packages.shtranscript.Changed since the last review: the rebase and
8e03e22(the env fixture importsstd/os/environment, closure keeps the call canon). Nothing else.Checklist
publish --dry-run/lock/lock --checktranscript with a value-leak guard. okfromlast insettings, sorted, omitted when empty (literal manifests render as before), older locks read unchanged; value never printed or written. okfilelines left to #331). okNo blockers.