Skip to content
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

Fix turbo build issues with gitignored files like .hydrogen #287

Merged
merged 1 commit into from
Dec 5, 2022

Conversation

jplhomer
Copy link
Contributor

@jplhomer jplhomer commented Dec 1, 2022

Turbo caches inputs and matches them using a hash-based output: https://turbo.build/repo/docs/core-concepts/caching. Turbo only considers git-versioned assets as "inputs", and by default tracks dist and build folders as "outputs." When an input hash matches the output hash, Turbo restores the dist contents to their respective folders from an internal cache and says "HEY I DON'T NEED TO BUILD! I'M ALL DONE!".

However, we introduced git-ignored folders like .hydrogen. This means Turbo doesn't know about them, and it does not restore them properly from the internal cache. When it sees that the dev dependencies (like hydrogen-remix#build) are cache hits, the .hydrogen folder is not restored — or it is not restored with the correct contents. This leads to sporadic build errors when Turbo has an active cache.

This PR tells Turbo about these gitignored "output" files to ensure they are accounted for.

Copy link
Contributor

@frandiox frandiox left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the explanation!

@jplhomer jplhomer merged commit b65f0d2 into v0.x-2022-10 Dec 5, 2022
@jplhomer jplhomer deleted the jl-fix-turbo-build branch December 5, 2022 14:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants