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

Feature request: Build and return SourceInfos when incremental compilation fails #932

Closed
adpi2 opened this issue Oct 8, 2020 · 5 comments

Comments

@adpi2
Copy link
Member

adpi2 commented Oct 8, 2020

When compilation fails, Zinc throws a xsbti.CompileFailed which contains:

  • arguments: Array[String]
  • problems: Array[Problem]

Based on the previous analysis and the CompileFailed instance I am trying to build an accurate description of the entire codebase but I am lacking information.

I don't know which of the old problems are still valid. Typically, a warning in a file is not reported again if the file is not recompiled, but I don't know if the file has been recompiled or not.

Ideally, the CompileFailed exception could contain an instance of SourceInfos which would give us the list of problems, the old ones that are still valid and the new ones.

At least, as an alternative, I would like to know which files have been recompiled.

@adpi2
Copy link
Member Author

adpi2 commented Sep 25, 2024

@Friendseeker Since you closed #1306, should we assume this issue cannot be fixed?

@Friendseeker
Copy link
Member

@adpi2 Might want to double check with the Scala 2 compiler folks but I do suspect this problem cannot be fixed. The issue is that the compiler early stops and does not necessarily return a complete list of all problems in the recompiled files.

@Friendseeker Friendseeker closed this as not planned Won't fix, can't repro, duplicate, stale Sep 26, 2024
@adpi2
Copy link
Member Author

adpi2 commented Sep 26, 2024

Re-reading your comment in #1306 I think it's fine that some errors are not reported. What I need is a complete view of the reported errors so that I don't have to buffer then in the BuildServerReporter in sbt.

It's kind of the consensus already: there are some errors, we fix them, and then some more errors can appear. Everybody seems okay with that.

So I think we should merge #1306

@Friendseeker Friendseeker reopened this Sep 27, 2024
@Friendseeker
Copy link
Member

@adpi2 Glad to hear your assessment. I shall work on getting #1306 merged. This is also a great opportunity to get #1309 merged as both require AnalysisCallback3. As long as we can get #1306 and #1309 merged in quick succession we can avoid the need to introduce AnalysisCallback4.

@eed3si9n
Copy link
Member

When we bump the AnalysisCallback, we probably want to send PRs to Scala 2.13 and Scala 3 so the Scala teams don't have to figure out what to change.

Friendseeker added a commit to Friendseeker/zinc that referenced this issue Sep 27, 2024
Zinc does not provide a way to surface list of all problems present in a
codebase.

by compiler including the old ones that are deemed valid by compiler
and the new ones.

This PR builds SourceInfos in Analysis Callback and in `handleErrors`,
the compiler bridge then throws an exception containing the SourceInfos
so build tools like sbt can access the informations.

Closes sbt#932
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

3 participants