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: check if products were removed in inc compilation #1772

Merged
merged 1 commit into from
Aug 3, 2022

Conversation

dos65
Copy link
Collaborator

@dos65 dos65 commented Aug 2, 2022

Do it in the same way how it's implemeted in zinc - https://github.com/sbt/zinc/blob/189d33bcf6678fcc86e7e3e438c551d6cc51be8a/internal/zinc-core/src/main/scala/sbt/internal/inc/IncrementalCommon.scala#L396-L405

Technically it shouldn't be an issue, if user don't touch clasees then
there is no need to check removedProducts.

However, sometimes when I do a lot of switches between branches in
combination with Metals by some reason I'm getting an invalid state of project where some products were
removed and their sources aren't presented in changed files.

Verified

This commit was signed with the committer’s verified signature.
scottrigby Scott Rigby
Do it in the same way how it's implemeted in zinc - https://github.com/sbt/zinc/blob/189d33bcf6678fcc86e7e3e438c551d6cc51be8a/internal/zinc-core/src/main/scala/sbt/internal/inc/IncrementalCommon.scala#L396-L405

Technically it shouldn't be an issue, if user don't touch clasees then
there is no need to check `removedProducts`.

However, sometimes when I do a lot of switches between branches in
combination with Metals by some reason I'm getting an invalid state of project where some products were
removed and their sources aren't presented in changed files.
Copy link
Contributor

@tgodzik tgodzik left a comment

Choose a reason for hiding this comment

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

What kind of issues do you get? Bloop compiles things to a separate readonly directory and then it copies over the results (at least I think this is the intention). So no unused files should show up. Maybe it's an issue that we don't recompile when removing files?

@dos65
Copy link
Collaborator Author

dos65 commented Aug 2, 2022

@tgodzik
Sometimes after switching git branches I'm getting errors like: object $name is no member of package | not found value $name and others about not having a class and there is no way to get rid of them. This happens once in 2-3 weeks on a different projects.

The situation is exactly as it described in a test that I added with an only difference that class files just don't exists while the current analysis doesn't know about that. Unfortunately, I haven't found a reliable way to reproduce it.

I guess maybe Metals might trigger compilation in a half way of checkout (git performs a file rewrite as delete + write a fresh one) or it somehow related to sbt/zinc#683 or #980

Copy link
Contributor

@tgodzik tgodzik left a comment

Choose a reason for hiding this comment

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

Ok, let's merge this in that case. If we can reduce false positives that's only for the better.

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

2 participants