Description
🤖 Filed by GitHub Copilot acting for Naman Kanakiya (@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):
- Hash the options with folders made relative to
buildFolderand withoutconcurrency(and any other non-semantic fields), or - 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.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsNeeds triage
Activity