Christoph Laeubrich CLA Friend 2020-12-28 01:44:33 EST
OSGI has a native repository format [1], we should support building this with tycho as an alternative to the eclipse-repository format.
[1] https://docs.osgi.org/specification/osgi.cmpn/7.0.0/service.repository.html
[2] https://github.com/osgi/bindex/tree/885fa197903fe981c10038f69c0dc9a4260ebac6
[3] https://bnd.bndtools.org/chapters/250-resolving.html
[tag] [reply] [−] Comment 1 Christoph Laeubrich CLA Friend 2020-12-28 01:48:16 EST
[4] https://felix.apache.org/documentation/subprojects/apache-felix-osgi-bundle-repository.html
[tag] [reply] [−] Comment 2 Mickael Istria CLA Friend 2021-01-04 08:42:12 EST
Tycho is for building Eclipse artifacts. Before working on publishing to this format, we should work on making Eclipse IDE able to install content from such OBR repositories, and that is more something for p2. Please consider reopening bug 393648 and adding support for OBR in p2 first.
[tag] [reply] [−] Comment 3 Christoph Laeubrich CLA Friend 2021-01-04 08:52:01 EST
From your mentioned bug-report it seems it is not directly related to P2 but to PDE to support this in a target file right?
Supporting it in P2 would be just to resolve dependencies from other P2 Units and even though that's clearly possible it sounds a bit uncommon to me?
BTW Tycho supports some features that PDE/Eclipse won't (multiple target files, special entries in category.xml, ...) so it seams that at least in the past it was okay to have tycho support other things first :-)
Its also a bit of a chicken-egg problem, if we can't produce OBR how would someone want to use it? But of course I think for a real solution there will be needs to support it in tycho and in the IDE!
[tag] [reply] [−] Comment 4 Mickael Istria CLA Friend 2021-01-04 09:09:08 EST
(In reply to Christoph Laeubrich from comment #3)
From your mentioned bug-report it seems it is not directly related to P2 but
to PDE to support this in a target file right?
Supporting it in P2 would be just to resolve dependencies from other P2
Units and even though that's clearly possible it sounds a bit uncommon to me?
It was initially about P2 being able to consume OBR bundle, so it would automatically cascade to Tycho and PDE and others having this feature.
However, you may be right, a dev-time only feature (eg support in .target) could be enough. I'm just not sure having it in Tycho and PDE is in the end easier than having it directly in p2.
BTW Tycho supports some features that PDE/Eclipse won't (multiple target
files, special entries in category.xml, ...) so it seams that at least in
the past it was okay to have tycho support other things first :-)
That's right.
I think what makes a difference here is that OBR is not a technology that has been necessary for Eclipse-based development for a long time. So adding support for it seems to widen the scope of Tycho; and the wider the scope is the more difficult it's to maintain the project.
Its also a bit of a chicken-egg problem, if we can't produce OBR how would
someone want to use it?
What's the actual use-case here? If there are no pre-existing OBR repos, why even trying to support and produce them when p2 does the job?
I see this as a nice-to-have feature; but I'm curious about actual user-stories that can make the effort profitable both on short and long term.
[tag] [reply] [−] Comment 5 Christoph Laeubrich CLA Friend 2021-01-04 11:32:41 EST
(In reply to Mickael Istria from comment #4)
It was initially about P2 being able to consume OBR bundle, so it would
automatically cascade to Tycho and PDE and others having this feature.
However, you may be right, a dev-time only feature (eg support in .target)
could be enough. I'm just not sure having it in Tycho and PDE is in the end
easier than having it directly in p2.
AFAIK OBR does not really has the concept of "units" instead it uses filter expressions to reference items to install, I'm not sure if this maps well to the P2 concepts.
I think what makes a difference here is that OBR is not a technology that
has been necessary for Eclipse-based development for a long time. So adding
support for it seems to widen the scope of Tycho; and the wider the scope is
the more difficult it's to maintain the project.
Its a bit a matter of a self fulfilling prophecy, if there is no support for it people won't use it and because people don't use it we won't add support for it :-)
What's the actual use-case here? If there are no pre-existing OBR repos, why
even trying to support and produce them when p2 does the job?
I see this as a nice-to-have feature; but I'm curious about actual
user-stories that can make the effort profitable both on short and long term.
For my use-case there are two major problems with P2:
- P2 is a complete dependency mess (it requires ~40 bundles to be added to a plain RCP application to work) the UI is so tightly coupled to Eclipse E3 that makes it impossible to reuse it outside a fully-fledged Eclipse IDE
- It is proprietary to eclipse and thus limits its use in other platforms/frameworks e.g. the felix-bundle-plugin generates an OBR index file for bundles installed into local maven repo, if tycho would reuse this instead of creating proprietary p2 metadata interaction between those would be much more easy
because of that for years I have used the approach to build a repository and generate an OBR from the "plugins" folder using bindex command-line tool, that works but of course is far away from a nice solution.
These repos are then used inside the application to support a very slim updater for an RCP Application.
[tag] [reply] [−] Comment 6 Mickael Istria CLA Friend 2021-01-04 12:22:57 EST
So the goal is to make Tycho artifacts more easily consumed by Felix?
[tag] [reply] [−] Comment 7 Christoph Laeubrich CLA Friend 2021-01-04 14:17:46 EST
Or any OBR compatible implementation, BND also supports OBR repositories, also karaf.
[tag] [reply] [−] Comment 8 Mickael Istria CLA Friend 2021-01-04 14:24:04 EST
And can't we already use some already existing BND plugin to produce those OBR repository?
[tag] [reply] [−] Comment 9 Christoph Laeubrich CLA Friend 2021-01-04 14:46:31 EST
There is a command line utility [1] and bnd lib contains a utility class for creating such indexes that could be reused here.
[1] https://bnd.bndtools.org/commands/index.html
[2] https://github.com/bndtools/bnd/blob/a33a1a0a42ba70bae26226058ca81a5d69f6c0a8/biz.aQute.bndlib/src/aQute/bnd/osgi/repository/SimpleIndexer.java
[tag] [reply] [−] Comment 10 Mickael Istria CLA Friend 2021-01-04 15:03:48 EST
(In reply to Christoph Laeubrich from comment #9)
There is a command line utility [1] and bnd lib contains a utility class for
creating such indexes that could be reused here.
Good. Have you investigated using the maven-antrun-plugin or the exec-maven-plugin or any other executor plugin with bnd in the classpath to invoke java aQute.bnd.main.bnd index ...
as part of the reactor ?
See https://bugs.eclipse.org/bugs/show_bug.cgi?id=569937