feat(project): load two majors of one package side by side #360
Loading…
Reference in a new issue
No description provided.
Delete branch "loop/324-two-majors"
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 #324
What
A workspace whose lock pins two majors of one package now keeps both as packages and resolves
use "acme/json"per importer, sotorb checkaccepts a graph the resolver produced in #323.feat(project): load two majors of one package side by sideWorkspace.dependencyOf(importer, name): the only package of the name; with two majors the importer's own for its own name, else the highest version the importer's requirement allows (a spanning>=1 <3takes the higher), else the first.packageNamedstays for the toolchain'sstd/*lookups.resolveImport,noteImports,programPackagesOfand the reached-package walk go through it.withLockedPackagesskips a locked entry only for a member of the same name and version; the dependency check of installed packages useslockedWithin.not a dependency/has no modulename the major (acme/json 2.x) only where two are present.feat(checker): name both majors in a type mismatch and refuse to lower themExpected \acme/json 2.x Value`, found `acme/json 1.x Value`). OtherdescribeType` callers are unchanged, and two same-named types of one major still print bare.lowerWorkspacerefuses a program that reaches two packages of one name:acme/json is in the program in two majors, which build and run cannot keep apart yet (#325). Nothing is lowered, sobuildandrunwrite no binary.docs/design/PROJECT.md6a andRELEASE.mdsay what #324 did and what #325 still has to. Nodocs/page that feedsskills/changed.Tests
compiler/tests/packages.test.trb: two majors are two packages with their own dependent; a spanning requirement takes the higher; a lock without either major namestorb update.compiler/tests/check.test.trb: each member resolves to its own major's file and the workspace checks clean; not-a-dependency and missing-module name the major; the mismatch names both; same-major types print bare; the lowering guard message.Seed impact
None.
seed/andrelease/*are untouched.Tests were not run locally (no toolchain on the loop host); forge CI is the check.
0101640246735851d9a9735851d9a93468a08df9Approved. Checklist against head
3468a08:torb update) and check.test.trb (per-importer resolution, not-a-dependency and missing-module naming the major, mismatch naming both, same-major types still bare, lowering guard). CI is green for this head (tier A/B, bootstrap, gates, pdisc, commit messages); the skipped jobs are the non-PR runners.dependencyOfreturns the only package of a name as before for single-major graphs, so existing messages and behaviour stay; with two majors it picks the importer's own, then the highest version its requirement allows, then the first.holdstreats an empty lock version (path/git/archive) as a match, so members are not duplicated.describeQualifiedapplies only when the two plain renderings are equal.build/runfrom mangling two majors under one name until #325.Non-blocking: the lowering guard reports its diagnostic with
Span(0, 0)onmodules[0]; pointing it at the importingusewould read better once #325 reworks this.