Re: [equinox-dev] [p2] How to use director/mirror app against an RCP as p2 repo

2017-06-27 Thread Mickael Istria
I didn't try that, but I don't think it fits my use-case well (EPP uses
mirror application with iu queries).
I've tried another path:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=518813 and managed to easily
write a patch it Tycho to get it working and usable in EPP. I suggest we
continue the discussion on this ticket if you're interested.
Thanks a lot to both for your insights, they've been helping a lot!
___
equinox-dev mailing list
equinox-dev@eclipse.org
To change your delivery options, retrieve your password, or unsubscribe from 
this list, visit
https://dev.eclipse.org/mailman/listinfo/equinox-dev

Re: [equinox-dev] [p2] How to use director/mirror app against an RCP as p2 repo

2017-06-27 Thread Carsten Reckord
Have you tried something like this?

$ ~/ profiles-ide/eclipse/eclipse.exe -application 
org.eclipse.equinox.p2.director -metadataRepository 
file:/C:/Users/creckord/profiles-ide/eclipse/p2/org.eclipse.equinox.p2.engine/profileRegistry/D__data_profiles_installations_profiles-ide_eclipse.profile/
 -artifactRepository file:/C:/Users/creckord/profiles-ide/eclipse/ -destination 
C:/Users/creckord/git/profiles/tmp -installIU org.eclipse.core.runtime

It works for me. The Eclipse installation folder (or your bundle pool) has an 
artifacts.xml and can act like a regular artifact repository. You might run 
into some strangeness with features and product IUs though, since they aren't 
preserved 1:1 in their original form (features are usually extracted, but P2 
will rebundle them on the fly for you; I don't quite remember what the 
situation was with products, but I've run into some repackaging issues way back 
in the Buckminster days)

> -Original Message-
> From: equinox-dev-boun...@eclipse.org [mailto:equinox-dev-
> boun...@eclipse.org] On Behalf Of Mickael Istria
> Sent: Monday, June 26, 2017 8:43 PM
> To: Equinox development mailing list 
> Subject: Re: [equinox-dev] [p2] How to use director/mirror app against an
> RCP as p2 repo
> 
> Thanks Carsten, that's a good hint.
> 
> So I tried to use the profile directory, and it's encouraging: I can list
> its content and install them in another IDE. So there is definitely
> everything necessary in it to use p2 director or p2 mirror.
> 
> However, I've tried using CLI:
> ```
> mistria@mistria-rh:~/sandbox/mirror$ ~/eclipse/eclipse -application
> org.eclipse.equinox.p2.artifact.repository.mirrorApplication -source
> file:/home/mistria/git/org.eclipse.epp.packages/packages/org.eclipse.epp.p
> ackage.javascript.product/target/products/epp.package.javascript/linux/gtk
> /x86/eclipse/p2/org.eclipse.equinox.p2.engine/profileRegistry/epp.package.
> javascript.profile/ -destination $(pwd)
> ```
> 
> Fails with
> ```
> !MESSAGE Application error
> !STACK 1
> org.eclipse.equinox.p2.core.ProvisionException: No repository found at
> file:/home/mistria/git/org.eclipse.epp.packages/packages/org.eclipse.epp.p
> ackage.javascript.product/target/products/epp.package.javascript/linux/gtk
> /x86/eclipse/p2/org.eclipse.equinox.p2.engine/profileRegistry/epp.package.
> javascript.profile/.
> at
> org.eclipse.equinox.internal.p2.repository.helpers.AbstractRepositoryManag
> er.fail(AbstractRepositoryManager.java:395)
> at
> org.eclipse.equinox.internal.p2.repository.helpers.AbstractRepositoryManag
> er.loadRepository(AbstractRepositoryManager.java:692)
> at
> org.eclipse.equinox.internal.p2.artifact.repository.ArtifactRepositoryMana
> ger.loadRepository(ArtifactRepositoryManager.java:104)
> at
> org.eclipse.equinox.p2.internal.repository.tools.AbstractApplication.addRe
> pository(AbstractApplication.java:147)
> at
> org.eclipse.equinox.p2.internal.repository.tools.AbstractApplication.initi
> alizeRepos(AbstractApplication.java:119)
> at
> org.eclipse.equinox.p2.internal.repository.tools.MirrorApplication.run(Mir
> rorApplication.java:189)
> at
> org.eclipse.equinox.p2.internal.repository.tools.MirrorApplication.start(M
> irrorApplication.java:85)
> at
> org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.jav
> a:196)
> ```
> 
> 
> and
> 
> ```
> mistria@mistria-rh:~/sandbox/mirror$ ~/eclipse/eclipse -application
> org.eclipse.equinox.p2.director -repository
> file:/home/mistria/git/org.eclipse.epp.packages/packages/org.eclipse.epp.p
> ackage.javascript.product/target/products/epp.package.javascript/linux/gtk
> /x86/eclipse/p2/org.eclipse.equinox.p2.engine/profileRegistry/epp.package.
> javascript.profile/ -destination $(pwd) -installIU
> org.eclipse.core.runtime
> ```
> 
> (using director instead of mirror) fails with
> ```
> !ENTRY org.eclipse.equinox.p2.artifact.repository 4 1000 2017-06-26
> 20:30:51.793
> !MESSAGE No repository found at
> file:/home/mistria/git/org.eclipse.epp.packages/packages/org.eclipse.epp.p
> ackage.javascript.product/target/products/epp.package.javascript/linux/gtk
> /x86/eclipse/p2/org.eclipse.equinox.p2.engine/profileRegistry/epp.package.
> javascript.profile/.
> 
> !ENTRY org.eclipse.equinox.p2.core 4 0 2017-06-26 20:30:52.716
> !MESSAGE Unable to load repositories.
> ```
> 
> 
> I share Roland's analysis there. It looks like the profile directory is a
> good IMetadataRepository, but not a viable IArtifactRepsitory. p2 UI seems
> to have some magic make a p2 repo out of this profile directory. I'll need
> to investigate what this magic is.
> 
> 
> I'll keep you posted.
> 

___
equinox-dev mailing list
equinox-dev@eclipse.org
To change your delivery options, retrieve your password, or unsubscribe from 
this list, visit
https://dev.eclipse.org/mailman/listinfo/equinox-dev


Re: [equinox-dev] [p2] How to use director/mirror app against an RCP as p2 repo

2017-06-26 Thread Mickael Istria
Thanks Carsten, that's a good hint.
So I tried to use the profile directory, and it's encouraging: I can list
its content and install them in another IDE. So there is definitely
everything necessary in it to use p2 director or p2 mirror.
However, I've tried using CLI:
```
mistria@mistria-rh:~/sandbox/mirror$ ~/eclipse/eclipse -application
org.eclipse.equinox.p2.artifact.repository.mirrorApplication -source
file:/home/mistria/git/org.eclipse.epp.packages/packages/org.eclipse.epp.package.javascript.product/target/products/epp.package.javascript/linux/gtk/x86/eclipse/p2/org.eclipse.equinox.p2.engine/profileRegistry/epp.package.javascript.profile/
-destination $(pwd)
```
Fails with
```
!MESSAGE Application error
!STACK 1
org.eclipse.equinox.p2.core.ProvisionException: No repository found at
file:/home/mistria/git/org.eclipse.epp.packages/packages/org.eclipse.epp.package.javascript.product/target/products/epp.package.javascript/linux/gtk/x86/eclipse/p2/org.eclipse.equinox.p2.engine/profileRegistry/epp.package.javascript.profile/.
at
org.eclipse.equinox.internal.p2.repository.helpers.AbstractRepositoryManager.fail(AbstractRepositoryManager.java:395)
at
org.eclipse.equinox.internal.p2.repository.helpers.AbstractRepositoryManager.loadRepository(AbstractRepositoryManager.java:692)
at
org.eclipse.equinox.internal.p2.artifact.repository.ArtifactRepositoryManager.loadRepository(ArtifactRepositoryManager.java:104)
at
org.eclipse.equinox.p2.internal.repository.tools.AbstractApplication.addRepository(AbstractApplication.java:147)
at
org.eclipse.equinox.p2.internal.repository.tools.AbstractApplication.initializeRepos(AbstractApplication.java:119)
at
org.eclipse.equinox.p2.internal.repository.tools.MirrorApplication.run(MirrorApplication.java:189)
at
org.eclipse.equinox.p2.internal.repository.tools.MirrorApplication.start(MirrorApplication.java:85)
at
org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
```

and

```
mistria@mistria-rh:~/sandbox/mirror$ ~/eclipse/eclipse -application
org.eclipse.equinox.p2.director -repository
file:/home/mistria/git/org.eclipse.epp.packages/packages/org.eclipse.epp.package.javascript.product/target/products/epp.package.javascript/linux/gtk/x86/eclipse/p2/org.eclipse.equinox.p2.engine/profileRegistry/epp.package.javascript.profile/
-destination $(pwd) -installIU org.eclipse.core.runtime
```
(using director instead of mirror) fails with
```
!ENTRY org.eclipse.equinox.p2.artifact.repository 4 1000 2017-06-26
20:30:51.793
!MESSAGE No repository found at
file:/home/mistria/git/org.eclipse.epp.packages/packages/org.eclipse.epp.package.javascript.product/target/products/epp.package.javascript/linux/gtk/x86/eclipse/p2/org.eclipse.equinox.p2.engine/profileRegistry/epp.package.javascript.profile/.

!ENTRY org.eclipse.equinox.p2.core 4 0 2017-06-26 20:30:52.716
!MESSAGE Unable to load repositories.
```

I share Roland's analysis there. It looks like the profile directory is a
good IMetadataRepository, but not a viable IArtifactRepsitory. p2 UI seems
to have some magic make a p2 repo out of this profile directory. I'll need
to investigate what this magic is.

I'll keep you posted.
___
equinox-dev mailing list
equinox-dev@eclipse.org
To change your delivery options, retrieve your password, or unsubscribe from 
this list, visit
https://dev.eclipse.org/mailman/listinfo/equinox-dev

Re: [equinox-dev] [p2] How to use director/mirror app against an RCP as p2 repo

2017-06-26 Thread Roland Grunberg
On Mon, 2017-06-26 at 12:33 +, Carsten Reckord wrote:
> In the IDE, this works directly: In "Install new software", you can use the 
> P2 profile directory inside of another Eclipse installation as your 
> repository location and install from there. E.g. 
> /p2/org.eclipse.equinox.p2.engine/profileRegistry/SDKProfile.profile
> I'm not sure how the director/mirror app handle this - they seem to be more 
> picky and have fewer heuristics. So I could imagine that in order to get it 
> to work, you might need to specify artifact and metadata repositories 
> separately. In that case, I would assume that the profile directory should 
> work as the metadata repo, while the Eclipse installation directory (or your 
> bundle pool location) would be your artifact repo. This is all guess work 
> though, and I didn't try it myself.

If this is the case, then I would guess there should be an
IArtifactRepository implementation for an installation directory, or
simply some artifact repository that is "close enough" to handle the
format since it's not that different. I know that a profile .tar.gz
file can be parsed by some metadata repo implementation so there should
also be enough info in there to reconstruct where the files are
located.

For Fedora (https://github.com/rgrunber/fedoraproject-p2), we needed to
supply plain directories as part of the target platform that may or may
not have osgi bundles, but aren't p2 repositories, so we ended up
creating our own I{Metadata,Artifact}Repository implementations but
that's a little more generic than what you need.

Cheers,
-- 
Roland Grunberg
___
equinox-dev mailing list
equinox-dev@eclipse.org
To change your delivery options, retrieve your password, or unsubscribe from 
this list, visit
https://dev.eclipse.org/mailman/listinfo/equinox-dev


Re: [equinox-dev] [p2] How to use director/mirror app against an RCP as p2 repo

2017-06-26 Thread Carsten Reckord
In the IDE, this works directly: In "Install new software", you can use the P2 
profile directory inside of another Eclipse installation as your repository 
location and install from there. E.g. 
/p2/org.eclipse.equinox.p2.engine/profileRegistry/SDKProfile.profile

I'm not sure how the director/mirror app handle this - they seem to be more 
picky and have fewer heuristics. So I could imagine that in order to get it to 
work, you might need to specify artifact and metadata repositories separately. 
In that case, I would assume that the profile directory should work as the 
metadata repo, while the Eclipse installation directory (or your bundle pool 
location) would be your artifact repo. This is all guess work though, and I 
didn't try it myself.

HTH,
Carsten

> -Original Message-
> From: equinox-dev-boun...@eclipse.org [mailto:equinox-dev-
> boun...@eclipse.org] On Behalf Of Mickael Istria
> Sent: Monday, June 26, 2017 8:28 AM
> To: Equinox development mailing list 
> Subject: [equinox-dev] [p2] How to use director/mirror app against an RCP
> as p2 repo
> 
> Hi all,
> 
> 
> It seems like a RCP app p2 profile is somehow like a p2 repo.
> Is there a way, for a given p2-able RCP app, to use it as a software
> source just like a p2 repo on which we can apply director or mirror
> application? The goal is to properly extract content out of an RCP (in
> this case EPP packages) in order to generate another artifact.
> 
> In the context of EPP, that could save about 50% build time as we could
> skip some assemble-repository steps if we can apply what's described above
> instead.
> 
> 
> Cheers,
> 
> --
> 
> Mickael Istria
> 
> Eclipse IDE 
> developer, at Red Hat Developers 
> community

___
equinox-dev mailing list
equinox-dev@eclipse.org
To change your delivery options, retrieve your password, or unsubscribe from 
this list, visit
https://dev.eclipse.org/mailman/listinfo/equinox-dev


[equinox-dev] [p2] How to use director/mirror app against an RCP as p2 repo

2017-06-26 Thread Mickael Istria
Hi all,

It seems like a RCP app p2 profile is somehow like a p2 repo.
Is there a way, for a given p2-able RCP app, to use it as a software source
just like a p2 repo on which we can apply director or mirror application?
The goal is to properly extract content out of an RCP (in this case EPP
packages) in order to generate another artifact.
In the context of EPP, that could save about 50% build time as we could
skip some assemble-repository steps if we can apply what's described above
instead.

Cheers,
-- 
Mickael Istria
Eclipse IDE 
developer, at Red Hat Developers  community
___
equinox-dev mailing list
equinox-dev@eclipse.org
To change your delivery options, retrieve your password, or unsubscribe from 
this list, visit
https://dev.eclipse.org/mailman/listinfo/equinox-dev