Repository navigation
fix(fallback): repack only the target that provides the requested package - #460
Merged
Merged
Conversation
…kage A polyglot repository can declare a target rooted at generated output that its source tag cannot contain. `pack_all` fails on the first such target, so repacking a tag archive refused the whole repository and every package in it became unresolvable from github.com. Live case: `ORESoftware/ores-interfaces` declares `[targets.public-contracts] dir = "generated/public"`, which `.gitignore` excludes, so `zed pack` fails there too. That has nothing to do with the root package `oresoftware/ores-interfaces` a consumer actually asked for. `pack::pack_target` is the existing per-target body of `pack_all`, lifted into its own function; `pack_all` now calls it per target, so publishing is unchanged and digests still match byte for byte. The fallback selects the one target providing the requested package and packs only that. Verified with the registry pointed at http://127.0.0.1:9: the full ORESoftware/ores-compose graph installs — flags-2-env, ores-clis-core, ores-interfaces, ores-locks-and-leases, ores-otel/ores-interfaces and ores-contracts from github.com, next-loggers from a local checkout. cargo test --locked --lib: 619 passed. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.
Follow-up to #379 / #458 / #459, and the last blocker for installing the
ORESoftware/ores-composegraph from github.com while the registry origin is down.Problem
A polyglot repository can declare a target rooted at generated output that its source tag cannot contain.
pack_allfails on the first such target, so repacking a tag archive refused the entire repository — every package in it became unresolvable.Live case,
ORESoftware/ores-interfaces:zed packfails there too (target 'public-contracts' source root 'generated/public' is not a directory), so this is a faithful reproduction — but it has nothing to do with the root packageoresoftware/ores-interfacesthat the consumer actually asked for.Change
pack::pack_targetis the existing per-target body ofpack_all, lifted into its own function.pack_allnow calls it once per target, so publishing is unchanged and digests still match byte for byte.Evidence
Registry pointed at
http://127.0.0.1:9, fresh clones in a fleet layout,zed install --adapter none --install-mode copy --target rust --allow-ecosystem-mismatch:Every package except the local override came from github.com, with no registry and no CDN.
cargo test --locked --lib: 619 passed.🤖 Generated with Claude Code