[heft-sass-plugin] Incremental cache file name depends on the machine (absolute build folder, core count)
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 68/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- sass, typescript
- Domain
- build-system
Research direction
The cache file name is computed in SassProcessor.loadCacheAsync from JSON.stringify(this.#options), and the options are assembled in SassPlugin. Check which fields there are absolute paths or concurrency, then either relativize them to buildFolder before hashing or switch to a fixed file name with the hash stored inside. Done when two builds in different checkout folders or core counts produce the same temp/build/sass listing and the cache still invalidates on real option changes.
Written by the indexing model from the issue text.
Description
🤖 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):
- 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.
- Dominant language
- TypeScript
- Stars
- 6.5k
- Forks
- 710
- Avg merge
- 1d 13h
- Merged PRs (30d)
- 45
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- No Dockerfile or Docker Compose file
- Has a pull request template
- No contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from microsoft/rushstack
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
[rush] Upgrade the pnpm-sync-lib dependency to 0.3.5.Possibly taken @martinnaj claimed this 15 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
microsoft/rushstack#5971 · 2 comments ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
microsoft/rushstack#5902 · 1 reaction ·
Maintainers usually reply within 1 day
All issues in microsoft/rushstack
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
wormhole-foundation/wormhole#5062 ·
Maintainers usually reply within 1 day
-
internal os specific
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
frostney/GocciaScript#1688 ·
Maintainers usually reply within 1 day
-
integration:hermes
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
vectorize-io/hindsight#5592 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
vercel/streamdown#673 · 1 reaction ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
apache/rocketmq-dashboard#6712 ·
Maintainers usually reply within 3 days