Skip to content

fix(resolver): resolve absolute local children without a parent source root - #14

Closed
mwolson wants to merge 1 commit into
contrib/bun-native-relative-tarballfrom
contrib/tarball-transitive-local-dep
Closed

mwolson wants to merge 1 commit into
contrib/bun-native-relative-tarballfrom
contrib/tarball-transitive-local-dep

Conversation

@mwolson

@mwolson mwolson commented Oct 25, 2026

Copy link
Copy Markdown
Owner

Summary

A local tarball dependency can declare another local package by absolute
file: path when exotic subdependencies are allowed.

Problem and Fix

Problem and Why it Happened Fix
With block-exotic-subdeps=false, a tarball parent's absolute file: child failed with cannot be resolved without the parent package source root. The guard required a parent source directory for every path-backed child, and tarballs have none. Absolute paths no longer need a parent source root. The exotic-source policy still runs first, and unanchored relative paths are still rejected because pnpm, Bun and npm disagree on their base.

Validation

  • Repro tarball-transitive-local-dep passes; pnpm 12.14.0, npm 11.6.2 and Bun 1.4.3 accept the same fixture.
  • Resolver tests cover directory and tarball children, the default security block, and relative-path rejection.
  • 56 lifecycle scenarios across aube, pnpm, npm and Bun lockfiles pass under aube.

@mwolson
mwolson added this pull request to stack #17 October 25, 2026 00:55
@mwolson
mwolson removed this pull request from stack #17 October 25, 2026 03:08
@mwolson
mwolson force-pushed the contrib/bun-native-relative-tarball branch from 10aa8a9 to dc7896a Compare October 25, 2026 03:08
@mwolson
mwolson force-pushed the contrib/tarball-transitive-local-dep branch from 012d89c to dd3405d Compare October 25, 2026 03:08
@mwolson
mwolson added this pull request to stack #19 October 25, 2026 03:08
…e root

Tarball parents have no directory source root. Permit their absolute
local child paths, matching pnpm and npm, while retaining the exotic
source policy and the guard for unanchored relative paths.
@mwolson
mwolson removed this pull request from stack #19 October 25, 2026 17:27
@mwolson
mwolson force-pushed the contrib/tarball-transitive-local-dep branch from dd3405d to 8f26f4f Compare October 25, 2026 17:27
@mwolson
mwolson force-pushed the contrib/bun-native-relative-tarball branch from dc7896a to 93aa663 Compare October 25, 2026 17:27
@mwolson
mwolson added this pull request to stack #20 October 25, 2026 17:27
jdx added a commit to aubepkg/aube that referenced this pull request Oct 25, 2026
#1852)

<!-- entire-trail-link-start -->
https://entire.com/gh/aubepkg/-/trails/209/changes/aube/209
<!-- entire-trail-link-end -->

A local tarball dependency whose manifest declares another local package
by absolute path could not be installed, even with the
exotic-subdependency block turned off:

```ini
# .npmrc
block-exotic-subdeps=false
```

```json
// host.tgz → package.json
{ "name": "host", "version": "1.0.0", "dependencies": { "child": "file:/abs/path/child.tgz" } }
```

**Before:** `aube install` failed with `transitive local specifier
file:/abs/path/child.tgz cannot be resolved without the parent package
source root`. A tarball parent has no source directory, and the guard
demanded one for every path-backed child.

**After:** absolute `file:`/`link:` children resolve without a parent
source root (pnpm, npm and Bun accept the same layout). The
exotic-source policy still runs first, so the default
`block-exotic-subdeps=true` still blocks it, and relative paths with no
anchor are still rejected, since package managers disagree on their
base.

Validation: new resolver unit tests cover directory and tarball absolute
children, the default block, and relative-path rejection; `cargo test -p
aube-resolver` passes; fmt and clippy clean for the touched crates. Not
run: full bats suite. Reported in discussion #1830; patch adapted from
mwolson#14.

*AI-assisted — Tool: Claude Code; model: anthropic/claude-sonnet-5-5;
version: unavailable.*

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Mike Olson <mwolson@member.fsf.org>
Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
@mwolson
mwolson removed this pull request from stack #20 October 25, 2026 21:33
@mwolson

mwolson commented Oct 25, 2026

Copy link
Copy Markdown
Owner Author

Absorbed upstream by aubepkg#1852 resolver-absolute-local-children (the frozen-install half stays in #4 pnpm-lock-rewrite-metadata) in the 2026-10-25 refresh onto upstream 9cafd04.

@mwolson mwolson closed this Oct 25, 2026
@mwolson
mwolson deleted the contrib/tarball-transitive-local-dep branch October 25, 2026 21:33
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.

1 participant