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

Java Compilation does not show error messages for failed annotation processors. #126

Open
AZWN opened this issue Feb 15, 2023 · 1 comment
Labels
C-Bug Category: bug. Not working as expected

Comments

@AZWN
Copy link
Contributor

AZWN commented Feb 15, 2023

Summary

When compiling a language project, several annotation processor (such as dagger) are executed.
However, (error) messages from annotation processors are not reported in the editor.

What you did

  1. Clone the java-front project on this branch.
  2. Import the java8.spoofax3 project in Eclipse.
  3. Build the project.

What actually happened

Now, several errors appear that mb.java8.DaggerJava8Component and mb.java8.DaggerJava8EclipseComponent cannot be resolved. Indeed, these files do not exist in their proper location (build/generated/sources/annotationProcessor/java/main). However, there was no information telling me why these files were not generated.

What you expected to happen

To investigate further, I reproduced the invocation of the compiler on the command-line, which gave the following errors:

// Lots of missing file errors

build/generated/sources/adapter/mb/java8/Java8Component.java:29: error: [Dagger/MissingBinding] mb.statix.referenceretention.stratego.InteropRegisterer cannot be provided without an @Inject constructor or an @Provides-annotated method.
public interface Java8Component extends LanguageComponent  {
       ^
      mb.statix.referenceretention.stratego.InteropRegisterer is injected at
          mb.java8.Java8Module.provideStrategoRuntimeBuilderFactory(…, interopRegisterer0, …)
      mb.java8.Java8StrategoRuntimeBuilderFactory is injected at
          mb.java8.Java8Module.provideQualifiedStrategoRuntimeBuilder(factory)
      @mb.java8.Java8Qualifier("") mb.stratego.common.StrategoRuntimeBuilder is requested at
          mb.java8.Java8Component.getStrategoRuntimeBuilder()
  The following other entry points also depend on it:
      mb.java8.Java8Component.getLanguageInstance()
      mb.java8.Java8Component.getTaskDefs()
      mb.java8.Java8Component.getStrategoRuntimeProvider()
      mb.java8.Java8Component.getJava8GetStrategoRuntimeProvider()
      mb.java8.Java8Component.getJava8Analyze()
      mb.java8.Java8Component.getJava8AnalyzeMulti()
      mb.java8.Java8Component.getJava8AnalyzeFile()
      mb.java8.Java8Component.getJava8ShowPreAnalyzeAst()
      mb.java8.Java8Component.getJava8ShowScopeGraph()
      mb.java8.Java8Component.getJava8ShowScopeGraphAst()
      and 12 others
build/generated/sources/eclipse/mb/java8/Java8EclipseComponent.java:27: error: [Dagger/MissingBinding] mb.statix.referenceretention.stratego.InteropRegisterer cannot be provided without an @Inject constructor or an @Provides-annotated method.
public interface Java8EclipseComponent extends EclipseLanguageComponent, mb.java8.Java8Component {
       ^
      mb.statix.referenceretention.stratego.InteropRegisterer is injected at
          mb.java8.Java8Module.provideStrategoRuntimeBuilderFactory(…, interopRegisterer0, …)
      mb.java8.Java8StrategoRuntimeBuilderFactory is injected at
          mb.java8.Java8Module.provideQualifiedStrategoRuntimeBuilder(factory)
      @mb.java8.Java8Qualifier("") mb.stratego.common.StrategoRuntimeBuilder is requested at
          mb.java8.Java8Component.getStrategoRuntimeBuilder()
  The following other entry points also depend on it:
      mb.java8.Java8Component.getLanguageInstance() [mb.java8.Java8EclipseComponent]
      mb.java8.Java8Component.getTaskDefs() [mb.java8.Java8EclipseComponent]
      mb.java8.Java8Component.getStrategoRuntimeProvider() [mb.java8.Java8EclipseComponent]
      mb.java8.Java8Component.getJava8GetStrategoRuntimeProvider() [mb.java8.Java8EclipseComponent]
      mb.java8.Java8Component.getJava8Analyze() [mb.java8.Java8EclipseComponent]
      mb.java8.Java8Component.getJava8AnalyzeMulti() [mb.java8.Java8EclipseComponent]
      mb.java8.Java8Component.getJava8AnalyzeFile() [mb.java8.Java8EclipseComponent]
      mb.java8.Java8Component.getJava8ShowPreAnalyzeAst() [mb.java8.Java8EclipseComponent]
      mb.java8.Java8Component.getJava8ShowScopeGraph() [mb.java8.Java8EclipseComponent]
      mb.java8.Java8Component.getJava8ShowScopeGraphAst() [mb.java8.Java8EclipseComponent]
      and 12 others

This was the information that I would have liked to see in the editor

Context

  • Spoofax version: 0.19.2, specifically tested at commit ff1ccad
  • Operating system & version: MacOS

Additional information

The manual javac command can be found in java8.spoofax3/run-javac.sh. The classpath and processorpath (which unfortunately use absolute paths) are obtained from setting a breakpoint here, and inspecting the options object.

@AZWN AZWN added the C-Bug Category: bug. Not working as expected label Feb 15, 2023
@AZWN
Copy link
Contributor Author

AZWN commented Feb 15, 2023

The underlying issue was fixed in d825c2f, so the reproduction scenario does not work in later versions anymore. However, reporting these (and similar) errors in the editor would still be a good idea.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-Bug Category: bug. Not working as expected
Projects
None yet
Development

No branches or pull requests

1 participant