[2.0] Exclude build-host native artifacts from the generic binding release

Chiusa
#477 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
15/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
rust, typescript

Direzione di ricerca

Start with the files field in packages/binding/package.json, then the packing step in scripts/semantic-release-workspace.mjs, and compare it with the rejection logic in scripts/site-toolchain-snapshot.mjs. The loader order in packages/binding/src/native-loader.ts around lines 407-411 shows why the local artifact wins. Done means a packed @master/css-binding tarball contains no artifacts/mastercss.node or artifacts/mcss, and the matching target package is still selected for each platform.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Parent: #470 (release tracker #467)

Release blocker

The standard release can publish the build host's native binary inside the platform-neutral @master/css-binding package. Its loader prioritizes that local artifact over the correct optional target package, breaking consumers on another OS/architecture.

Evidence

  • packages/binding/package.json includes artifacts in files.
  • cargo xtask build-native writes packages/binding/artifacts/mastercss.node and the CLI executable. The release runs the root build before packing.
  • scripts/semantic-release-workspace.mjs packs the package without excluding those development artifacts.
  • packages/binding/src/native-loader.ts:407-411 selects resolvePackageArtifact('mastercss.node') before the matching target package.
  • Calling the actual release plugin's prepare in a disposable workspace produced a tarball containing both package/artifacts/mastercss.node and package/artifacts/mcss.
  • Simulating the Linux release binary in that generic package on macOS reproduced NATIVE_LOAD_FAILED / invalid Mach-O even with the matching Darwin package available to resolution. No working-tree binary was changed.

The snapshot staging path already rejects this condition in scripts/site-toolchain-snapshot.mjs, but the standard release path lacks the same protection. A successful native target smoke test does not exercise the generic wrapper tarball.

Acceptance

  • Generic binding tarballs contain no build-host native artifacts; native binaries ship only in matching target packages.
  • Add a packed-wrapper check to the actual release preparation/validation path, not only snapshot staging.
  • Test the assembled public dependency closure on every supported target, verifying selection of the matching addon and CLI.
  • Preserve intentional local-checkout artifact loading without exporting it into published archives.
  • Reconcile snapshot and normal release packing so one cannot succeed with an artifact shape the other correctly rejects.
Lingua principale
TypeScript
Stelle
2k
Fork
44
Merge medio
1g 14h
PR unite (30g)
1

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di master-co/css

Tutte le issue di master-co/css

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.