bazel-eclipse icon indicating copy to clipboard operation
bazel-eclipse copied to clipboard

Persist built package model on disk such that it can be reloaded quickly on next IDE restart

Open plaird opened this issue 4 years ago • 1 comments

Currently in BEF we have to recompute all the classpaths when Eclipse is restarted with an existing Bazel workspace. It would be better to persist the current model of each imported package such that we can load that quickly on restart.

Of course, it might be stale, but at least the developer can get working quickly in most cases. We should persist the lastmod time of the BUILD file and use that as a hint that we need to rebuild. This won't catch all cases, as a transitive upstream may have changed, which would invalidate the cached classpath as well. But that could be a case for the user to hit the Clean menu item.

This work should be portable across BEF and BJLS. The work done in #299 (do that first) will make this relatively easy.

plaird avatar Aug 22 '21 19:08 plaird

This will hopefully solve a class of bootstrapping issues. I just had a deadlock (stack traces attached) when reopening an existing workspace, preceded a very long recomputation of every aspect of every external dep in our sizable monorepo. Horrible user experience.

bef_reopen_deadlock.txt

plaird avatar Feb 28 '22 19:02 plaird

Now with #299 finished, this work will be straightforward.

Longer term, we also need a strategy to read/write classpath data to Bazel Remote Cache. This would allow CI to populate classpath data into cache, and then devs would have nearly instant activation of the projects on import/startup. The cache key will be the hash of the file.

plaird avatar Nov 08 '22 07:11 plaird