Skip to content

fix(deps): qualify bare dep names, part 1 of 2 - #553

Merged
Sunrisepeak merged 1 commit into
mainfrom
fix/dep-namespace-sweep-1
Aug 8, 2026
Merged

fix(deps): qualify bare dep names, part 1 of 2#553
Sunrisepeak merged 1 commit into
mainfrom
fix/dep-namespace-sweep-1

Conversation

@Sunrisepeak

Copy link
Copy Markdown
Member

Batch 1 of 2 of the index-wide sweep, split so the per-package install test covers ten packages rather than forty-six. The guard that enforces this lands with batch 2, once no bare name is left for it to trip on.

Merge #549 first — cpp in batch 2 needs its type = "config" uninstall tolerance.

The defect

A dep declared expat@2.6.2 rather than xim:expat@2.6.2 resolves only while exactly one index provides that name. CI registers every changed recipe a second time under local:, so the moment a PR touches both consumer and dependency, resolution reports package 'expat@2.6.2' is ambiguous and the install stops.

Latent by construction: the failure is a property of the changed set, not of the recipe — so it surfaces by accident on an unrelated PR (fontconfig, #497) rather than on the one that introduced it.

Why the recipes are loaded, not grepped

npm assigns one table to xpm.{linux,windows,macosx} after the literal, so a text sweep sees one dep where the load sees three rows on three platforms. code builds its version entries from top-level functions. Both parse correctly only because the recipe is executed.

One file changes more than a prefix

graphics.lua's wsl-gl-host-link dep was deliberately bare, with a comment explaining the package was new and unpublished — correct at the time. That inverts once it ships (#540): a published recipe a PR also changes exists under both namespaces, where a bare name is ambiguous. Prefix added, comment rewritten to say why the exemption ended rather than left asserting the opposite of the code.

Verification

Every changed file re-parsed and its deps re-enumerated per platform. Stripping xim: from both sides makes nine of ten byte-identical to main; the tenth differs only by that comment block. 1116 static tests pass.

🤖 Generated with Claude Code

Batch 1 of the index-wide sweep, split so the per-package install test covers
ten packages rather than forty-six. The guard that enforces this lands with
batch 2, once no bare name is left for it to trip on.

A dep declared as `expat@2.6.2` rather than `xim:expat@2.6.2` resolves fine only
while exactly one index provides that name -- and CI registers every CHANGED
recipe a second time under `local:`, so the moment a PR touches both the consumer
and the dependency, resolution reports `package 'expat@2.6.2' is ambiguous` and
the install stops. It is latent by construction: the failure is a property of the
changed set, not of the recipe, so it surfaces by accident on an unrelated PR
(fontconfig, #497) rather than on the one that introduced it.

Found by loading each recipe AS LUA rather than grepping it, and that is
load-bearing: npm assigns one table to xpm.{linux,windows,macosx} after the
literal, so a text sweep sees one dep where the load sees three rows on three
platforms; code builds its version entries from top-level functions. Both parse
correctly only because the recipe is executed.

graphics.lua is the one file here that changes more than a prefix. Its
`wsl-gl-host-link` dep was deliberately bare, with a comment explaining that the
package was new and unpublished -- correct at the time, and it inverts once the
package ships (#540): a published recipe that a PR also changes exists under both
namespaces, where a bare name is ambiguous. The prefix is added and the comment
rewritten to say why the exemption ended, rather than left asserting the opposite
of the code.

Verified: every changed file re-parsed and its deps re-enumerated per platform;
stripping `xim:` from both sides makes nine of the ten byte-identical to main,
and the tenth differs only by that comment block. 1116 static tests pass.
@Sunrisepeak
Sunrisepeak merged commit c576ffa into main Aug 8, 2026
13 checks passed
Sunrisepeak added a commit that referenced this pull request Aug 8, 2026
…gain (#555)

The guard could not land with either sweep half -- it cannot pass while any bare
name remains, and a guard merged red is a guard someone switches off. Both halves
are in (#553, #554), so it goes in now. Touches no pkgs/, so its CI is minutes.

Three assertions, each of which has already shipped as red CI:

  * a bare dep name that collides with a package this index provides
  * a prefix that disagrees with the provider's own declared namespace --
    rustup-mirror is `config:`, so `xim:rustup-mirror` named nothing and rust
    failed to install on every platform
  * a dep whose provider has no section for the platform declaring it --
    xim:python is linux+windows, so rosdep/vcstool/hermes-agent's macosx deps
    could never resolve

xpm.debian and xpm.ubuntu are deliberately NOT reported: detect_platform()
returns build_os(), which is linux/macosx/windows and nothing else, so a dep
inside those sections cannot fail at install time. A check with unfixable
findings gets ignored wholesale.

TWO HARNESS FIXES FOR THINGS I BROKE OR MISREAD

The loader/libc scan walked every file under xpkgs for every package. That is
quadratic across a 25-package run: by the late alphabet the store holds every
earlier payload, so the step printed its header and sat for minutes with nothing
after it, which I read as a hang and reported as one. It was not -- the job
passed in 21m48s. It is now scoped with `-newer` against a marker dropped just
before the install, which covers this package and the deps pulled in with it:
exactly the set this install could have broken. An older payload is still
checked, on the run where it is the package under test.

And the Windows bound I added redirected output to a file, so nothing printed
until the process exited -- the log showed "==> [vc6] install" and then silence
for the whole install. That is the same ambiguity the bound was meant to remove,
relocated rather than fixed. It now tails the file while waiting, and prints only
the unread remainder at the end.

Co-authored-by: sunrisepeak <x.d2learn.org@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants