New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Build reproducibility inconsistent CSS file names in vite manifest #8291
Comments
I don't understand this to tell whether it's a Vite issue or not. I don't see any manifest difference when running the repro build multiple times. The CSS file names are the same to me. |
…ty (#1670) # Motivation No `vite-manifest.json`, no build reproducibility issue 😉. See commented code for details. # Changes - delete `vite-manifest.json` with a post build script - remove `make-reproducible` as it becomes unused # Notes I opened today two issues in SvelteKit repo to share what we discovered: - sveltejs/kit#8290 - sveltejs/kit#8291
# Motivation In #1666 we have moved scoped styles to global style to workaround the build reproducibility of SvelteKit+ViteJS [#8291](sveltejs/kit#8291). This PR redo the changes has #1670 will solve the reproducibility issue by removing the unused vite manifest file from our build results. # PRs - [x] #1670 # Changes - redo scoped style and remove related global style
I can reproduce this, though I had to update the repro as we now delete the // scripts/make-reproducible.js
import glob from 'tiny-glob/sync.js';
console.log(glob('**', { cwd: '.svelte-kit/output/client/_app/immutable' }).join('\n')); First run:
Second run:
This seems like a fairly serious bug — as well as making builds non-reproducible, it affects cache stability meaning it directly affects users. Will see if I can create a repro without SvelteKit. |
Struggling a bit to create a repro, so I'll leave this for others... |
Closing in favour of vitejs/vite#11911 |
Thanks for digging into this! |
# Motivation As far as tested, this does not solve the reproducibility but, bumping the dev dependencies should introduce a non deterministic improvement developed in Rollup. References: - Rollup: rollup/rollup#4909 - Vite: vitejs/vite#11911 - SvelteKit: sveltejs/kit#8291 # Notes I bumped all dev dependencies except Playwright and the types of jest and marked.
Describe the bug
Validating the reproducibility of build results is innacurate because the CSS resources listed in
vite-manifest.json
are not consistent.i.e. if routes are using components, their common CSS are collected to avoid duplication. The generated entries inherit a name that changes on each
npm run build
. Entries which are added tovite-manifest.json
and have for results to produces a differentvite-manifest.json
on each build. Per extension, validating the build results - e.g. comparing hashes of results - is not possible.Reproduction
Logs
No response
System Info
Severity
annoyance
Additional Information
Follow-up of my other issue regarding reproducibility #8290
vite-manifest.json
should be sorted what is solved in the sample repo with a post scriptWorkaround
Find and remove the duplicated Css scoped in components and extract these to
global
CSS styles.The text was updated successfully, but these errors were encountered: