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

Đã đóng
#477 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
15/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
rust, typescript
Lĩnh vực
build-system, release

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.
Ngôn ngữ chính
TypeScript
Star
2k
Fork
44
Merge trung bình
1 ngày 14 giờ
Pull request đã merge (30 ngày)
1

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của master-co/css

Tất cả issue của master-co/css

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.