-
Notifications
You must be signed in to change notification settings - Fork 44
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
Bundles placed to "linked" locations not found since 4.31 #450
Comments
OK, listening to #456 I've stumbled over the sentence in https://wiki.eclipse.org/Equinox/p2/Getting_Started#Dropins that
So I've started the p2.director task we execute with options file containing
... and that for every bundle we have ... which results in
So the fun is: p2 director and the application are running on Java 21 and they run without any issues on Eclipse 4.30. So p2.director that works perfectly fine with this line in MANIFEST.MF on 4.30 is somehow broken in 4.31 :
Any ideas why??? |
The Java-SE usually is not taken from the running java but from the profile or update site, so you should make sure that your product contains Java-21 or it could be installed (e.g. JustJ Updatesite) |
Why should we add Java that is installed on every workstation to the product?
Same here. |
I didn't wrote you should do that ...
... but as said this is mostly irrelevant to P2 as it requires a unit (usually some java.jre.se...) that claims your product is running on Java (whatever).
dropins is a p2 feature and it complains that your product does not contain any unit (==metadata) that fulfills |
Sorry, I'm not p2 expert. |
Could you provide any pointer what piece of software on which update site contains the magic "Java 21 unit"? PS: JustJ Updatesite is not an answer, as we don't use any JustJ artifacts because we use our own Java builds. |
it is usually at the "producer" site so the one that produces your site from where you install the items into your product and/or bundles to publish so one needs to know how these are produced, configured and so on, e.g. you can look at the
build result as described here and search in
It depends a bit actually this is nothing you should expect from any platform release site as platform using Java-17, it is possible that it contains more units but that neither mandatory nor guaranteed. |
Ugh. We don't have any site, we modify SDK via p2 director (by adding/removing bundles) and ship the result via rpm. So what exact piece of software should we produce now to make p2 happy? A bundle? A feature? Just any bundle saying "here I'm the Java 21 unit looking for" via some p2.inf? |
You should have a site that you pass to p2director (e.g. -repository parameter) or what is the source of bundles to install?
This is usually metadata only so no physical file, P2 contains the JREAction to generate such units so one might can even produce something like this as a standalone it is just very unusual, therfore I think you should check if it can't be created at the sources. For example P2 ships with the UpdateSite Publisher Application, that has a parameter For example if you are using Features And Bundles Publisher Application or p2.publish.featuresAndBundles ant task, this currently seems not supporting that but its quite easy to add such an option (if one don't need site/category xml) |
So running that application from command line results in Java 17 added (even if I run on Java 21) => #461
Created at which sources? I have SDK & run some p2 tasks via command line. What also wonders me: in the SDK itself, as it delivered via tar.gz file, which part / p2 config contains something related to that I don't see it (I've grepped). Only SDK 4.30 p2 repository contains |
That's possible, I just looked through P2 what actually ever will publish a JRE Unit, so this either needs another option or rethink if always using the current JVM a fixed one sounds strange as if your are running with Java 11 it obviously can't generate one of Java 17 from it.
Nowadays the answer is that usually Tycho is doing that for you as I mentioned here theoretically there are also ant task but obviously no one cares to maintain / enhance them to catch up with the faster developing cycles, new features are testing with other than current platform Java versions.
It is not configured in any way, Tycho can derive everything automatically, and it will add configured (== toolchains.xml for example) JREs and at the minimum the one you are running with, e.g go here and search for [2024-02-12T10:05:35.967Z] [INFO] --- tycho-p2-publisher:4.0.6-SNAPSHOT:publish-osgi-ee (default-publish-osgi-ee) @ equinox-sdk ---
Its hard to tell I'm still not sure what is then used, the |
OK, it means Do you mean, we need to have at least one p2 task executed by maven+tycho in order to get bundles that require Java 21 running on Java 21? That's surely an overkill to force clients use some technology just to state an "obvious" thing that Java 21 is compatible with Java 21 execution environment... So far we could run our build fully offline and without maven. |
Update:
our bundles requiring Java 21 can be finally installed on Java 21 based application. Why does p2 insists to see Also note, I doubt this while metadata installation will work if |
This has been requested since the inception of p2 more or less; and no-one implemented it because it's not so trivial. |
Also note that now that more and more products happily use JustJ and don't need those a.jre units as JustJ is a p2 good citizen and makes real update path capable of updating JustJ as well, it's very unlikely that the hype grows on the topic of dynamically creating a.jre units. |
As explained above, we do not plan to use JustJ simply because we use our evaluated, tested and patched JVM's that satisfy our needs. If someone can point me to the place in p2 resolver that checks that |
Imagine being at the receiving end of this comment. So often we all experience frustrations, but what good comes from venting it in this way? |
I've literally spent a week trying to understand what in 4.31 broke our build process. That was supposed to be a no-brainer - check & fix missing dependency etc, but turned to be something saying: "here p2, install bunch of extra generated xml that you've just generated from the Java 21 you are running on if you don't trust me that you really run on Java 21". I mean, if one can generate that xml by running p2 own JREAction, why can't the p2 resolver itself just do the same without extra xml generation & installation steps? |
I certainly understand and can relate very much to your frustration(s). I’m sure though that a long rant from me about my very long list of those frustrations would be well-received by no one and would accomplish nothing. Indeed in a proper fully-functional design, p2 would, in an installation, synthesize an iu for the system bundle. That iu should be visible during planning. Problem solved. But of course the devil is in the details. E.g., the director might run on Java 11 but needs to create an installation that requires Java 21. It can’t know anything about Java 21 except what is recorded in some p2 repo, perhaps one with a JustJ 21 JRE, even one with a restricted subset of modules hence restricted package capabilities than a full standard JRE. Let’s not assume this is insane nonsense just because it’s really complicated and we don’t understand it well. That it’s very frustrating is something we can all relate to. |
@iloveeclipse I tried to explain the technical background but seems to fail. Nothing in 4.31 broke your buildprocess, it is broken before you just didn't noticed it as you are maybe not using Java 21 before, there was some other source for a Java 21 JRE UI or whatever we simply don't know. As Ed explained, it might be doable but no one has doing it and want to touch the very basic operation of P2 that has "worked for 20 years this way now". In fact I'm always working towards not requiring this and automate this stuff but the main issue is as we have no idea how do you produce the source repository (that is the one where the additional bundle(s) to install from) we can't give you better advice, I just gave you a hint how to workaround this, as the product is usually not the source of the JRE IU it is just installed as a consequence of it being required. So effectively we don't know where/how "we" should improve P2 that it works for "your" process... Beside that it really has nothing to do with JusJ, even though it is a great way to ship/update the JRE for a product. |
What is needed is something like so that if we install something into SDK that requires Java 21 while we are running on Java 21 p2 is able to proceed without saying If someone could point me to the right place / rough idea how to do that, I could try to add that operation to p2 director. |
The director is implemented by Lines 1044 to 1072 in 12f4524
If I where to implement such feature, I would go for something like:
you can take a look at |
I’m not at a computer. If the jre iu data is in the installation it will be in the profile and is hard to search because it's in a *.gz. Somewhere nested under the p2 folder. |
Just FYI I tried this out in Tycho context and it worked like a charm, I can inject automatically generated java.se units into the director and then it does not complains that EEs are missing: so something similar should work for P2 / Director / PDE / ... as well, just in case something bothers to implement something similar there. |
Yes, it is still on my list. |
Unfortunately I do not have (public) reproducer yet, I'm trying to create one, but it takes time.
Historically, our SDK based application consists of multiple parts and is deployed on Linux via rpm's.
Because of that:
-configuration
argument redirecting the config area to dedicated location on user home.links
directory as parts of the application (like help with few GB size) are shared between different application versions installed on same workstation.So we always built our application in a structure where we had something like
So while building the application from SDK + CDT + Xtext etc + our code we did some p2 director tasks to install/uninstall things we want or don't want to see
eclipse --launcher.suppressErrors -consoleLog -nosplash -application org.eclipse.equinox.p2.director ...
and after that started our application.
eclipse -application ourApplication -configuration some_path ...
That worked till 4.31, and doesn't work anymore because the application is not found anymore on startup... We also see that
bundles.info
file generated after p2 director tasks doesn't contain "our" bundles from linked folders anymore.The problem seem to be related to both application bundle located under "linked" directory and redirection of OSGI configuration area via
-configuration
argument.So it seem to me that something prevents OSGI (or p2 or extension registry at the and) to find the application contribution in our case.
If the problem is a bug (and not a build / configuration issue in our code), it is a big problem to similar Eclipse based applications...
Does anyone has any pointer what is changed in p2 / OSGI area in 4.31 that could be related?
The text was updated successfully, but these errors were encountered: