Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Improved build cache invalidation #1105

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

Merged
merged 1 commit into from
Feb 19, 2022

Conversation

nevkontakte
Copy link
Member

Previously GopherJS used to store its build cache under
$GOPATH/pkg/$GOOS_$GOARCH, and after Go Modules introduction some parts
of it were stored under os.UserCacheDir().

Starting from this commit, all build cache is located under
os.UserCacheDir(), in a manner similar to the modern Go tool. The cache
is keyed by a set of build options (such as minification, compiler
version, etc.) to ensure that incompatible archives aren't picked up
(see #440 for example).

This change doesn't solve all possible cache-related issues (for
example, it still relies on timestamps to invalidate the cache, see
#805), but should eliminate a large class of confusing failure
modes.

Fixes #440, #598, #620

Copy link
Member

@flimzy flimzy left a comment

Choose a reason for hiding this comment

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

A few comments, any of which can be done in a future PR, if decided. Looks good to me.

build/build.go Show resolved Hide resolved
build/cache/cache.go Show resolved Hide resolved
build/cache/cache.go Outdated Show resolved Hide resolved
@nevkontakte nevkontakte force-pushed the better-cache branch 2 times, most recently from dad6ef5 to 6dcbb3b Compare February 19, 2022 20:19
Previously GopherJS used to store its build cache under
$GOPATH/pkg/$GOOS_$GOARCH, and after Go Modules introduction some parts
of it were stored under os.UserCacheDir().

Starting from this commit, *all* build cache is located under
os.UserCacheDir(), in a manner similar to the modern Go tool. The cache
is keyed by a set of build options (such as minification, compiler
version, etc.) to ensure that incompatible archives aren't picked up
(see gopherjs#440 for example).

This change doesn't solve *all* possible cache-related issues (for
example, it still relies on timestamps to invalidate the cache, see
gopherjs#805), but should eliminate a large class of confusing failure
modes.
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.

Wrongly reusing cached precompiled code when changing build tags
2 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.