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

build_invalidator and patns cache mismatch causes classes to not get written to pants #5546

Closed
LarryFinn opened this issue Mar 5, 2018 · 3 comments

Comments

@LarryFinn
Copy link
Contributor

Affects 1.3.0 (maybe more).
Requirements: JVM project with zinc (see https://github.com/jsirois/lf-example for example) with multiple branches affecting the same class (in this case Example class)

  1. Start off in branch A. Do a ./pants compile ::. See the Example class appear in the cache directory
  2. Switch to branch B. Do a ./pants compile ::. See both versions of the Example class in the cache directory
  3. Delete the cache directory for just the Example class
  4. Switch back to branch A. Do a ./pants compile ::. Pants should recompile Example class but it does NOT write it to the cache.

It seems like the build_invalidator thinks that the class is in the cache, and when it isn't it gets recompiled but nothing gets pushed to cache. I believe the class should be written to the cache. Running pants invalidate between switching branches fixes the problem.

@stuhood
Copy link
Member

stuhood commented Mar 5, 2018

I explained this in https://pantsbuild.slack.com/archives/C046T6T9U/p1520268937000694 ... it is intended that zinc incremental compiles are not written to the build cache, as incremental compiles with zinc are super buggy (still). See compile tickets under https://github.com/pantsbuild/pants/labels/jvm for an (incomplete) list.

@LarryFinn
Copy link
Contributor Author

LarryFinn commented Mar 5, 2018

how does pants determine that this is an "incremental" compile? Because it is not in a clean state?
the thing is, if i dont do step #3, everything works fine. It pushes the classes to the cache fine.

@stuhood
Copy link
Member

stuhood commented Mar 6, 2018

Which cache directory are you deleting here:

Delete the cache directory for just the Example class

?

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

No branches or pull requests

2 participants