Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

[heft-sass-plugin] Incremental cache file name depends on the machine (absolute build folder, core count)

Đang mở Phù hợp với người mới
#6,126 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

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

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
68/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ệ
sass, typescript
Lĩnh vực
build-system

Hướng nghiên cứu

Tên tệp cache được tính trong SassProcessor.loadCacheAsync từ JSON.stringify(this.#options), còn các tùy chọn được lắp ráp trong SassPlugin. Hãy kiểm tra những trường nào là đường dẫn tuyệt đối hoặc concurrency, sau đó hoặc chuyển chúng thành đường dẫn tương đối so với buildFolder trước khi băm, hoặc chuyển sang tên tệp cố định với mã băm được lưu bên trong. Hoàn thành khi hai lần build ở các thư mục checkout khác nhau hoặc số lõi khác nhau cho cùng một danh sách temp/build/sass và cache vẫn bị vô hiệu hóa khi các tùy chọn thực sự thay đổi.

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

Mô tả

🤖 Filed by GitHub Copilot acting for @namankanakiya (light review only).

Package: @rushstack/heft-sass-plugin 1.5.1 (with @rushstack/heft 1.3.3), Linux.

Summary: the plugin's incremental cache file name depends on the machine (the absolute build folder and the core count), so identical builds on different machines or in different checkout folders produce different output folder listings.

Source: SassProcessor.loadCacheAsync computes

configHash = getContentsHash('sass.json', JSON.stringify(this.#options)).slice(0, 8)

and writes temp/build/sass/sass_<configHash>.json. The options come from SassPlugin and include:

  • buildFolder (absolute),
  • srcFolder, dtsOutputFolders, cssOutputFolders, loadPaths (resolved to absolute paths),
  • concurrency = heftConfiguration.numberOfCores (os.availableParallelism()).

Repro: build the same project twice, once normally and once with taskset -c 0-7 (or from a different checkout folder). temp/build/sass contains sass_9nUQkQ8d.json in one build and sass_DDgrCciE.json in the other.

Observed: identical inputs give different output listings. Build-cache entries produced on different machines (for example CI vs a developer box) differ, and tools that compare or hash output folder listings see a change where there is none, which can trigger needless downstream rebuilds.

Expected: the file name depends only on options that affect the output.

Suggested fix (either):

  1. Hash the options with folders made relative to buildFolder and without concurrency (and any other non-semantic fields), or
  2. Use a fixed file name (for example temp/build/sass/sass.json) and store the options hash inside the file, invalidating the cache when it does not match.

Happy to test a candidate fix.

Ngôn ngữ chính
TypeScript
Star
6.5k
Fork
710
Merge trung bình
1 ngày 13 giờ
Pull request đã merge (30 ngày)
45

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

Mở trong Codespaces

Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.

  • Không có Dockerfile hay tệp Docker Compose
  • Có mẫu pull request
  • Không có hướng dẫn đóng góp

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 microsoft/rushstack

Tất cả issue của microsoft/rushstack

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.