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
Reproducer for 'tycho-compiler-jdt unable to compile test code when module-info.java is present' / Issue 230 #809
base: main
Are you sure you want to change the base?
Conversation
@jason-faust this change seems to include a lot of unrelated changes, can you rebase it and only submit relevant changes? |
@laeubi Which branch do you want it to target? 2.7 or master? |
master please, if suitable we can backport it later on. |
75b5cdb
to
e112aa2
Compare
Hopefully this works. |
Is this the error you are expecting? |
That is the error, but a little lower down in the output. There may also be some follow on issues with the compiler plugin passing along the source and target options when it should only be passing the release option, but that is unrelated to the current issue.
|
Can you try to force target/source to 11 just to see if this changes anything? |
Testing locally has the same error when using source, test, and release at 11. |
@mickaelistria @akurtakov any one has an idea whats wrong here? Is this an EJC issue? |
Indeed, it looks like the tycho-compiler-jdt doesn't support the |
So any jdt / maven compiler expert who can help here? |
For the record, here is the full commandline passed to jdt and the error message:
|
@iloveeclipse can you tell if tycho is doing anything wrong here or if this is a user error? |
I'm not a module expert. Spec is here: https://openjdk.org/jeps/261 If you would attach source code in a project with configuration as it is expected to work plus the actual command line that triggers ECJ, it would simify debugging. |
The code is here: https://github.com/eclipse-tycho/tycho/tree/8d696d614a95000438b379bdeb41f2e0d9f322e7/tycho-its/projects/compiler.mavenCompilerPlugin.moduleWithTests If I understand @jason-faust correctly |
I really meant exact that above. Not some random files somewhere, but as a proect with compiler settings. |
I'm not sure if one can transform this into an eclipse project, this uses maven to replace the I think one can emulate this by
|
By the way javac says:
If I remove those,
So I maybe messed up the call a bit but maybe it still helps as |
@iloveeclipse is the provided example suitable? Is this a bug I should report to JDT? |
Would you please fix the conflict with master? |
By the way, the documentation of maven-compiler-plugin and other discussions recommends <plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<compilerId>eclipse</compilerId>
</configuration>
<dependencies>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-compiler-eclipse</artifactId>
<version>...</version>
</dependency>
<dependency>
<groupId>org.eclipse.jdt</groupId>
<artifactId>ecj</artifactId>
<version>...</version>
</dependency>
</dependencies>
</plugin> So if this works, then I don't think Tycho should support the use-case you describe here and the |
Probably its the other way round, if |
Ideally, yes. However, back then (and maybe not now) Tycho required some access to non-API of the compiler plugin that made it easier for it to kind of form the maven-compiler-plugin. |
8d696d6
to
ea5c48c
Compare
@laeubi Should be in sync again. |
ea5c48c
to
07c2840
Compare
Test Results362 files ±0 362 suites ±0 2h 38m 25s ⏱️ - 4m 31s For more details on these errors, see this check. Results for commit 6a3c586. ± Comparison against base commit afbdc64. ♻️ This comment has been updated with latest results. |
07c2840
to
6a3c586
Compare
6a3c586
to
2ba1368
Compare
@stephan-herrmann @iloveeclipse any idea on this? This seems to be plain maven with plain compiler so no special tycho involved, using |
@jason-faust sorry to ask again but now there are conflicts that need to be resolved :-\ If someone has an idea how to address this please let me know so it could be included in the upcoming bugfix release. |
As I already wrote above, if you want help from JDT, please provide a simple Java project (with all settings) that demonstrates the problem without any 3rd party tooling between. So no maven, tycho, whatever else. Once you have that, open a bug in JDT and provide there all information you have + project. |
@iloveeclipse you can't have a "java project" as only the batch compiler is involved, I added a description using a main class that can be used in a java project or any tooling that seems suitable (I just put it into the jdt.core bundle): |
By the way I don't know if it is a bug in JDT or wrong call so main question is if I call batch compiler with this:
is it "wrong" or is it supposed to work... if the later I can of course add a bug to JDT as well. |
See https://bugs.eclipse.org/bugs/show_bug.cgi?id=526110#c3 The compiler has support for the option, just the batch compiler doesn't parse it (and the above got forgotten due to little demand ...) |
@stephan-herrmann thanks for the insight, so should I open a bug at JDT or is there already an issue that tracks it? |
No issue in github yet, so please create one, and link also to the old bugzilla, thanks, which can then be closed as MOVED (with another link). |
Depends on
|
@jason-faust can you try out if using javac instead of ecj fixes the problem for you: |
@laeubi That won't fix my problem as I want to be able to use the Eclipse compiler. I ultimately want to be able to generate the same compiler warnings and errors that the Eclipse IDE will generate, so to use the same compiler, not to use a different compiler. |
You can at least validate if it actually can work :-) |
@laeubi The issue is about the JDT plugin to the maven compiler plugin, not the tycho compiler. |
So does it compile if you use javac maven compiler? |
2ba1368
to
8a28264
Compare
Updated to fix the merge conflict. And if you remove the call out to the |
It would be interesting to know the exact options which maven passes into javac. |
From the test output (excerpt)
|
Thanks. Just to be sure: these are the arguments that work with In those args source, target and release don't seem to match (1.7 != 17), but other than that I don't see anything magic, so fixing |
Demonstration of the problem reported in issue #230