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

Support automatic installation of a suitable JustJ in a product packaging #2064

Closed
laeubi opened this issue Feb 7, 2023 · 6 comments · Fixed by #3816
Closed

Support automatic installation of a suitable JustJ in a product packaging #2064

laeubi opened this issue Feb 7, 2023 · 6 comments · Fixed by #3816

Comments

@laeubi
Copy link
Member

laeubi commented Feb 7, 2023

Currently one has to do some quite special configuration in Tycho to get JustJ packaged that is of limited use in many cases ("just add a jre to my product") and Tycho can actually derive most of the data already:

  1. we can compute the maximum BREE of all product units
  2. we know for what os/arch we currently build the product
  3. we know what packages are required (if properly declared in the manifest)

so given we have the site https://download.eclipse.org/justj/jres/ we can derive the best item to be installed in a given product.

@mickaelistria
Copy link
Contributor

Currently one has to do some quite special configuration in Tycho to get JustJ packaged

Can you please elaborate? IIRC, this is just a matter of adding the justj feature to the .product.

@laeubi
Copy link
Member Author

laeubi commented Feb 8, 2023

Just take a look at the demo: https://github.com/eclipse-tycho/tycho/blob/master/demo/justj/product/pom.xml

Requires:

  1. JustJ updatesite added as repo
  2. Configure target platform special
  3. change the product (what will complain in the IDE that the feature is most likely not available)

Also the JustJ Documentation has a lot of steps to follow and that they recommend that makes this quite confusing:
https://www.eclipse.org/justj/?page=documentation

So in the end it could be just a simple config option in the publisher plugin to have an option <jreRepository>https://download.eclipse.org/justj/jres/<jreRepository> and one is all done.

@mickaelistria
Copy link
Contributor

OK, so only "Configure target platform special" is special and a source of confusion; everything else is standard.

So in the end it could be just a simple config option in the publisher plugin to have an option https://download.eclipse.org/justj/jres/ and one is all done.

Introducing new options to do things that can be done with standard existing approaches already is not always a simplification, unless the "legacy" approach can be fully removed.

@laeubi
Copy link
Member Author

laeubi commented Feb 8, 2023

Actually I don't want to specify anything more than "please pack a jre with my product", so I don't need extra updatesites (that blow up the dependency closure of my project), nor do I want configure my project (as this is a plain packaging concern like "include launcher artifacts") or configure target platform special.

Many things can be archived with "standard" aproaches, but one big benefit of Tycho is that one do not need to configure all the things (most of the time) and it can derive as much as possible from the meta-data.

@HannesWell
Copy link
Member

HannesWell commented Mar 24, 2023

Requires:

1. JustJ updatesite added as repo

You can also just add the JustJ feature in the TP as demonstrated in #2287, but one still has to specially configure the target-platform-configuration if the JustJ JRE verison is lower/different than the one running the build:

<plugin>
	<groupId>org.eclipse.tycho</groupId>
	<artifactId>target-platform-configuration</artifactId>
	<version>${tycho-version}</version>
	<configuration>
		<!--The execution environment must match the include jre, see https://www.eclipse.org/justj/?page=documentation -->
		<executionEnvironment>org.eclipse.justj.openjdk.hotspot.jre.full-${java.version}</executionEnvironment>
	</configuration>
</plugin>

Actually I don't want to specify anything more than "please pack a jre with my product", so I don't need extra updatesites (that blow up the dependency closure of my project), nor do I want configure my project (as this is a plain packaging concern like "include launcher artifacts") or configure target platform special.

The problem I see, when Tycho just packs a jre in the product that could mean just pack any JRE in the product. But there are different JRE versions (OK, at least the major version could be derived from the product's EE/vm config) and different variants. For JustJ there is jre.full, jre.full.stripped, jre.minimal, jre.base etc. Should we just choose the jre.full? Maybe many are happy with that choice but probably some want the smaller variants. Furthermore not everybody chooses JustJ as JRE Vendor. The JustJ documentation describes how you can build our own p2 IUs from any other JVM, so one maybe has created a Plug-in/Feature that contains the GraalVM or alike.

Therefore I think a user should still select the exact JVM Plugin/Feature included in the product by adding the Plugin/Feature to the TP and then just add it as content to the Product. Just like with every other Plugin or Feature. That is the usual workflow and IMHO intuitive; you want something in your product, you add it as content (and previously to the TP).
So the only thing I would change is, to make the extra target-platform-configuration plugin configuration obsolete.

@laeubi
Copy link
Member Author

laeubi commented Jan 26, 2024

I now added the PDE UI here to make it more convenient than currently to specify that one wants to include a JRE:

regarding choosing the JVM it is quite easy:

  1. Collect all EE requirements
  2. Collect all BREE
  3. Collect all packages java.* that are imported from any bundle
  4. Now select the JRE that satisfies all the requirements

For any special use-case this can still be customized with features as currently.

@laeubi laeubi linked a pull request May 5, 2024 that will close this issue
laeubi added a commit to laeubi/tycho that referenced this issue May 5, 2024
PDE recently added a new flag for the product to mark it to include a
jre eclipse-pde/eclipse.pde#1075 but this
currently has no effect in Tycho.

This now adds support for automatically include a JustJ JRE if the
option is selected.

Fix eclipse-tycho#2064
laeubi added a commit to laeubi/tycho that referenced this issue May 5, 2024
PDE recently added a new flag for the product to mark it to include a
jre eclipse-pde/eclipse.pde#1075 but this
currently has no effect in Tycho.

This now adds support for automatically include a JustJ JRE if the
option is selected.

Fix eclipse-tycho#2064
laeubi added a commit that referenced this issue May 5, 2024
PDE recently added a new flag for the product to mark it to include a
jre eclipse-pde/eclipse.pde#1075 but this
currently has no effect in Tycho.

This now adds support for automatically include a JustJ JRE if the
option is selected.

Fix #2064
laeubi added a commit to laeubi/tycho that referenced this issue May 5, 2024
PDE recently added a new flag for the product to mark it to include a
jre eclipse-pde/eclipse.pde#1075 but this
currently has no effect in Tycho.

This now adds support for automatically include a JustJ JRE if the
option is selected.

Fix eclipse-tycho#2064
laeubi added a commit that referenced this issue May 5, 2024
PDE recently added a new flag for the product to mark it to include a
jre eclipse-pde/eclipse.pde#1075 but this
currently has no effect in Tycho.

This now adds support for automatically include a JustJ JRE if the
option is selected.

Fix #2064
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 a pull request may close this issue.

3 participants