Repository navigation
fix(ts): resolve a binding through a renamed dependency - #182
Conversation
Quest-Claim: c9a29eabe67bf368
…s name for it
A binding's path named a dependency by its crate name, so `foo = { package = "bar" }`
could only be bound as `bar::Item`, a path the package's source can't write. Resolve
the first segment through the `--extern` name rustc loaded the crate by, and a crate
the package reaches only through another by its own name.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
kixelated
left a comment
There was a problem hiding this comment.
Automated review by review (OpenAI)
Reviewed commit: fdf02b6
No actionable bugs found in the renamed-dependency resolution change. Using rustc's resolved extern name is a simpler and more appropriate source of identity than selecting a direct dependency among matching crate names. Local-item precedence is preserved, and the migration note makes the old-name incompatibility explicit. The renamed fixture and refusal of its old name exercise the central change.
Verification: static review of the complete diff, surrounding binding/path resolution, and fixture configuration. I did not run builds, differential tests, or census; the multi-version and indirect-only dependency paths are not demonstrated by the added fixture.
(Written by OpenAI)
Part of quest/m3/ts-bind-gaps.md: the renamed-dependency gap. The quest now lists only the collection-key gap.
Problem
A binding's path named a dependency by its crate name. With
foo = { package = "bar" },foo::Itemwas "no such item", and onlybar::Item, a path the package's own source can't write, resolved.Approach
CStore::resolved_extern_crate: the--externname the package loaded the crate by, so a renamed dependency goes by its new name, and of several versions of a crate, the one the package names wins.--externname now covers.Tests
bindfixture depends onblobasbuf = { package = "blob" }and bindsbuf::Blob. Differential against native wasm32: 16,273 cases, 1,387 matching panics, 0 differences. Its output snapshot is unchanged, since modules still go under the crate's own name.refused.tomlbindsblob::Blob, the renamed crate's own name: "no such item".just checkandjust testpass.Census
just ts censusat the pinned moq revision, base vs head: unchanged, and the reports are byte-identical. moq renames none of the crates it binds.net.toml)model.toml)Impact
foo::Item), no longer by its crate name (bar::Item).ts/MIGRATE.mdhas the entry.Alternatives
Follow-ups
(written by Claude Opus 5.5)
🤖 Generated with Claude Code