Skip to content

[Bug]: pack-addons core tarball ships the build's development addons.json (absolute file: links); init --with needs URLCODE_ADDONS and a skew round #1002

Closed

Description

@jimhoyd

From the fourth agent workflow trial (setup). The same step cost a correction round in the second, third and fourth trials.

Runtime revision and environment

main 7454d3f2, npm run build, node scripts/workspaces.ts run build, then node scripts/pack-addons.ts <tmp>/pack. macOS.

Minimal reproduction

  1. Pack as above and install the packed core into a CLI directory: npm install <tmp>/pack/jimhoyd-urlcode-0.6.5.tgz.
  2. Without URLCODE_ADDONS: urlcode init booking --with auth,store.
  3. With URLCODE_ADDONS=<tmp>/pack/addons.json: urlcode init booking --with auth,store.

Relevant output

The packed core's own manifest is the build's development manifest, with absolute file: links into the checkout that built it:

$ tar -xOzf pack/jimhoyd-urlcode-0.6.5.tgz package/dist/addons.json
  "audit": { ..., "url": "file:/Users/<builder>/.../packages/audit", "integrity": null },

So step 2 succeeds, but the site's package.json names the source directories, unpinned, and the output carries only "development":true to say so:

"@jimhoyd/urlcode": "0.6.5",
"@jimhoyd/urlcode-auth": "file:/Users/<builder>/.../packages/auth",
"@jimhoyd/urlcode-store": "file:/Users/<builder>/.../packages/store"

On another machine those paths do not exist. Step 3 installs the packed add-ons, but init pins core from the registry and the add-ons refuse to load:

{"event":"error","message":"Could not import @jimhoyd/urlcode-auth/extension: SyntaxError: The requested module '@jimhoyd/urlcode/extensions' does not provide an export named 'joinHostLease'. Version skew: the add-on catalog (URLCODE_ADDONS=...) points at local add-on tarballs (file: pins) built for core 0.6.5, but this site installed @jimhoyd/urlcode 0.6.5 from the npm registry, ... Point the site's core at the build the catalog came from (for example `npm install --save-exact --ignore-scripts <path to the jimhoyd-urlcode-0.6.5.tgz packed beside it>` ...","code":"addon-load"}

The refusal names its fix (urlcode init, npm install the packed core, extensions add), which works.

Expected: a core tarball packed by pack-addons.ts carries the addons.json it writes beside it (tarball URLs and sha512), so init --with from that core installs the packed add-ons pinned, and pins the site's core to the same tarball, with no URLCODE_ADDONS and no skew round. At least, the development manifest's absolute builder paths should not ship in a tarball meant to be installed elsewhere.

Not verified: whether the release workflow's packed core has the same property; it writes its own manifest before packing, so it is probably unaffected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions