Skip to content

Fix cache invalidation of compiler instance #5921

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 14, 2019

Conversation

smarter
Copy link
Member

@smarter smarter commented Feb 14, 2019

In #5835 I changed the scalaInstance used for bootstrapped projects to
use class directories instead of jars for the local dependencies, but
this breaks the cache invalidation mechanism used by sbt to decide whether
to keep using the same compiler instance or not, in particular this
means that running:

dotty-library-bootstrapped/compile

Then if we edit code in the compiler, we expect the next call to
dotty-library-bootstrapped/compile to use the new compiler, but it
kept using the original one since the cache wasn't invalidated.

In scala#5835 I changed the scalaInstance used for bootstrapped projects to
use class directories instead of jars for the local dependencies, but
this breaks the cache invalidation mechanism used by sbt to decide whether
to keep using the same compiler instance or not, in particular this
means that running:

> dotty-library-bootstrapped/compile

Then if we edit code in the compiler, we expect the next call to
`dotty-library-bootstrapped/compile` to use the new compiler, but it
kept using the original one since the cache wasn't invalidated.
@smarter smarter force-pushed the fix/scalainstance-cache branch from d5da8f0 to 3138bde Compare February 14, 2019 13:08
@sjrd
Copy link
Member

sjrd commented Feb 14, 2019

Might be easier to just use exportJars := true in those projects instead, like here.

Copy link
Member

@sjrd sjrd left a comment

Choose a reason for hiding this comment

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

Otherwise, if you don't want exportJars, LGTM.

@smarter
Copy link
Member Author

smarter commented Feb 14, 2019

Avoiding exportJars means that we don't go through jars when compiling the non-bootstrapped projects, so I'd rather not use it for now at least.

@smarter smarter merged commit 89a87d3 into scala:master Feb 14, 2019
@allanrenucci allanrenucci deleted the fix/scalainstance-cache branch February 14, 2019 19:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants