Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

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

オープン 初心者向け
#6,126 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
68/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
sass, typescript
領域
build-system

調査の方向性

キャッシュファイル名は SassProcessor.loadCacheAsync で JSON.stringify(this.#options) から計算され, オプションは SassPlugin で組み立てられています。絶対パスになっているフィールドや concurrency がどれかを確認し、ハッシュ化の前に buildFolder からの相対パスに変えるか、固定のファイル名にしてハッシュをファイル内に保存するかのどちらかにしてください。異なるチェックアウトフォルダやコア数で行った2つのビルドが同じ temp/build/sass の一覧を生成し、実際のオプション変更では引き続きキャッシュが無効化されれば完了です。

索引モデルが issue の本文から書いたものです。

説明

🤖 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.

主要言語
TypeScript
スター
6.5k
フォーク
710
平均マージ
1日 13時間
マージ済み PR(30日)
45

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

  • Dockerfile・Docker Compose ファイルなし
  • プルリクエストのテンプレートあり
  • コントリビューションガイドなし

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

microsoft/rushstack のほかの issue

microsoft/rushstack の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。