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

Remove warning about No system packages found in profile nor toolchain for missing JRE #655

Closed
vogella opened this issue Feb 16, 2022 · 17 comments · Fixed by #995
Closed
Milestone

Comments

@vogella
Copy link
Contributor

vogella commented Feb 16, 2022

I use a certain Java release to build, currently Java 17, in my Tycho build I see lots of warnings.

I already set
<resolveWithExecutionEnvironmentConstraints>false</resolveWithExecutionEnvironmentConstraints>

Is their somthing missing on my side to get rid of these warnings? Of does the messae not use this setting?

[WARNING] No system packages found in profile nor toolchain for JRE-1.1, using current JRE system packages.
This can cause faulty dependency resolution, consider adding a definition for a 'jdk' with id=JRE-1.1 in your toolchains.xml
[WARNING] No system packages found in profile nor toolchain for JavaSE-11, using current JRE system packages.
This can cause faulty dependency resolution, consider adding a definition for a 'jdk' with id=JavaSE-11 in your toolchains.xml
[WARNING] No system packages found in profile nor toolchain for JavaSE-16, using current JRE system packages.
This can cause faulty dependency resolution, consider adding a definition for a 'jdk' with id=JavaSE-16 in your toolchains.xml
[WARNING] No system packages found in profile nor toolchain for JavaSE-18, using current JRE system packages.
This can cause faulty dependency resolution, consider adding a definition for a 'jdk' with id=JavaSE-18 in your toolchains.xml

@vogella
Copy link
Contributor Author

vogella commented Feb 16, 2022

Example build: https://github.com/vogellacompany/eclipse4book

@mickaelistria
Copy link
Contributor

the setting is not related to the message. The setting is misnamed, what it actually does is that it tries to inject all available EEs into the resolution, so you happen to load more EE than you really need.
Best solution is the one in the message: make sure your toolchains.xml contain the EE you're building against, so you'd get some insurance you compile against the right classes.

@laeubi
Copy link
Member

laeubi commented Feb 16, 2022

@mickaelistria as noted elsewhere this warning has nothing to do with the EE your building it is emitted when building update-sites/products regardless of EE present in the build. You can even see this in the tycho build but I always was just to lazy to investigate/fix this ;-)

The setting is misnamed,

Would you like to open an issue so we can rename it in Tycho 3.0?

@vogella
Copy link
Contributor Author

vogella commented Feb 16, 2022

it is emitted when building update-sites/products regardless of EE present in the build

In this case I suggest to simply delete the message.

@mickaelistria
Copy link
Contributor

In this case I suggest to simply delete the message.

We first need to audit whether this message has an impact on the build: this message may mean that you're adding into your RCP product some definition of a.jre.* units that are totally wrong and could then lead to further issues.
From p2 POV, this is probably a symptom of https://bugs.eclipse.org/bugs/show_bug.cgi?id=568150 . If one day we have p2 automatically generating the units from the actual runtime and not requiring some static (and potentially unmatching) definition of the runtime, then there will be no more need to publish those units, no more need to read system packages while publishing.

@mickaelistria
Copy link
Contributor

@laeubi If we are to do anything about resolveWithExecutionEnvironmentConstraints, the best would probably be to remove this option and figure out better solutions -and I even believe those solutions are already here- for the problems that have required it so far.

@vogella
Copy link
Contributor Author

vogella commented Feb 16, 2022

One issue resolveWithExecutionEnvironmentConstraints allows it to add a JustJ JRE to the product. Without it I get dependency issues with the JustJ runtime and the a.jre.* packages.

@mickaelistria
Copy link
Contributor

It's been documented for some time now that the proper way to force JustJ in the p2 repo/product is to use <executionEnvironment>none</executionEnvironment> https://www.eclipse.org/tycho/sitedocs/target-platform-configuration/target-platform-configuration-mojo.html#executionEnvironment

@laeubi
Copy link
Member

laeubi commented Feb 16, 2022

It's been documented for some time now that the proper way to force JustJ in the p2 repo/product is to use <executionEnvironment>none</executionEnvironment> https://www.eclipse.org/tycho/sitedocs/target-platform-configuration/target-platform-configuration-mojo.html#executionEnvironment

I don't think this is the "proper" way but the current workaround-way as it requires you to configure the product build different from the rest of the build and your target platform needs to be resolved twice.

@mickaelistria
Copy link
Contributor

It is the most proper way so far. And yes, it requires some 1 extra configuration for the product, so it could probably be improved for sure, but at the moment it's way less wrong than injecting more EEs than necessary as <resolveWithExecutionEnvironmentConstraints>false</resolveWithExecutionEnvironmentConstraints> does, which is basically doing the opposite of what is desired by user when they want to include JustJ.

@laeubi
Copy link
Member

laeubi commented Feb 16, 2022

<executionEnvironment>none</executionEnvironment>

@vogella can you try that out in your build I think I recently add basic support for even building plugins with that settings.

@vogella
Copy link
Contributor Author

vogella commented Feb 16, 2022

If I use <executionEnvironment>none</executionEnvironment> instead of <resolveWithExecutionEnvironmentConstraints>false</resolveWithExecutionEnvironmentConstraints> with the Tycho 2.6.0 version I get a build error.

ERROR] Internal error: java.lang.IllegalStateException: Full specification of custom profile is not (yet) determined -> [Help 1]
org.apache.maven.InternalErrorException: Internal error: java.lang.IllegalStateException: Full specification of custom profile is not (yet) determined
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:120)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:77)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:568)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
Caused by: java.lang.IllegalStateException: Full specification of custom profile is not (yet) determined
    at org.eclipse.tycho.core.ee.ExecutionEnvironmentConfigurationImpl.getFullSpecification (ExecutionEnvironmentConfigurationImpl.java:131)
    at org.eclipse.tycho.core.osgitools.OsgiBundleProject.getResolverState (OsgiBundleProject.java:325)
    at org.eclipse.tycho.core.osgitools.OsgiBundleProject.resolveClassPath (OsgiBundleProject.java:196)
    at org.eclipse.tycho.core.resolver.DefaultTychoResolver.resolveProject (DefaultTychoResolver.java:173)
    at org.eclipse.tycho.core.maven.TychoMavenLifecycleParticipant.lambda$resolveProjects$0 (TychoMavenLifecycleParticipant.java:147)
    at java.util.stream.ForEachOps$ForEachOp$OfRef.accept (ForEachOps.java:183)
    at java.util.stream.WhileOps$1$1.accept (WhileOps.java:99)
    at java.util.ArrayList$ArrayListSpliterator.tryAdvance (ArrayList.java:1602)
    at java.util.stream.ReferencePipeline.forEachWithCancel (ReferencePipeline.java:129)
    at java.util.stream.AbstractPipeline.copyIntoWithCancel (AbstractPipeline.java:527)
    at java.util.stream.AbstractPipeline.copyInto (AbstractPipeline.java:513)
    at java.util.stream.AbstractPipeline.wrapAndCopyInto (AbstractPipeline.java:499)
    at java.util.stream.ForEachOps$ForEachOp.evaluateSequential (ForEachOps.java:150)
    at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential (ForEachOps.java:173)
    at java.util.stream.AbstractPipeline.evaluate (AbstractPipeline.java:234)
    at java.util.stream.ReferencePipeline.forEach (ReferencePipeline.java:596)
    at org.eclipse.tycho.core.maven.TychoMavenLifecycleParticipant.resolveProjects (TychoMavenLifecycleParticipant.java:178)
    at org.eclipse.tycho.core.maven.TychoMavenLifecycleParticipant.afterProjectsRead (TychoMavenLifecycleParticipant.java:105)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:264)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:77)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:568)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/InternalErrorException

@laeubi
Copy link
Member

laeubi commented Feb 16, 2022

Please always try out the current tycho snapshot build.

@vogella
Copy link
Contributor Author

vogella commented Feb 16, 2022

Please always try out the current tycho snapshot build.

I guess the following statement made me assume it is supported since a while :-)

It's been documented for some time now that the proper way to force JustJ in the p2 repo/product is to use

@laeubi
Copy link
Member

laeubi commented Feb 16, 2022

Please always try out the current tycho snapshot build.

I guess the following statement made me assume it is supported since a while :-)

It's been documented for some time now that the proper way to force JustJ in the p2 repo/product is to use

<executionEnvironment>none</executionEnvironment> is supported for quite a while but using it inside a regular plugin build is only supported from 2.7.0+ as far as I remember....

@laeubi
Copy link
Member

laeubi commented Mar 8, 2022

@vogella can you provide a small reproducer or integration test?

@wimjongman
Copy link

With the flag set to >none< I get this for every module:

[WARNING] The following locally built units have been used to resolve project dependencies:
[WARNING]   a.jre.javase/18.0.0

[INFO] The following Execution Environments are currently known but are ignored by configuration:
[INFO]     1.0.0 -> JRE, JavaSE, OSGi/Minimum
[INFO]     1.1.0 -> JRE, JavaSE, OSGi/Minimum
[INFO]     1.2.0 -> JavaSE, OSGi/Minimum
[INFO]     1.3.0 -> JavaSE
[INFO]     1.4.0 -> JavaSE
[INFO]     1.5.0 -> JavaSE
[INFO]     1.6.0 -> JavaSE
[INFO]     1.7.0 -> JavaSE
[INFO]     1.8.0 -> JavaSE, JavaSE/compact1, JavaSE/compact2, JavaSE/compact3
[INFO]     10.0.0 -> JavaSE, JavaSE/compact1, JavaSE/compact2, JavaSE/compact3
[INFO]     11.0.0 -> JavaSE, JavaSE/compact1, JavaSE/compact2, JavaSE/compact3
[INFO]     12.0.0 -> JavaSE, JavaSE/compact1, JavaSE/compact2, JavaSE/compact3
[INFO]     13.0.0 -> JavaSE, JavaSE/compact1, JavaSE/compact2, JavaSE/compact3
[INFO]     14.0.0 -> JavaSE, JavaSE/compact1, JavaSE/compact2, JavaSE/compact3
[INFO]     15.0.0 -> JavaSE, JavaSE/compact1, JavaSE/compact2, JavaSE/compact3
[INFO]     16.0.0 -> JavaSE, JavaSE/compact1, JavaSE/compact2, JavaSE/compact3
[INFO]     17.0.0 -> JavaSE, JavaSE/compact1, JavaSE/compact2, JavaSE/compact3
[INFO]     18.0.0 -> JavaSE
[INFO]     9.0.0 -> JavaSE, JavaSE/compact1, JavaSE/compact2, JavaSE/compact3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants