Bug 581000 - Cannot build Trace Compass Incubator RCP or custom RCP locally
Summary: Cannot build Trace Compass Incubator RCP or custom RCP locally
Status: NEW
Alias: None
Product: Tracecompass
Classification: Tools
Component: Releng (show other bugs)
Version: unspecified   Edit
Hardware: PC Linux
: P3 normal
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact: Project Inbox CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-11-07 13:14 EST by Christophe Bedard CLA
Modified: 2022-11-24 16:16 EST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Christophe Bedard CLA 2022-11-07 13:14:39 EST
I'm building a custom RCP. It used to work fine up until about 2 months ago, but now it fails. Since my custom RCP is based on the Incubator RCP, I've tried building it. However, it also fails, and I'm assuming that it is the same underlying issue.

Steps using master (TC: 6463d292, TC Incubator: a577af89):

```
cd org.eclipse.tracecompass/
mvn clean install -DskipTests=true -e -X
cd ..
cd org.eclipse.tracecompass.incubator/
mvn clean install -DskipTests=true -e -X
```

Everything works fine for TC. Building/installing the TC Incubator works for everything except the RCP. Relevant part of the error message:

```
Installing org.eclipse.tracecompass.incubator.rcp 0.3.0.202211071742.
Installing org.eclipse.tracecompass.jsontrace.feature.group 8.1.0.202211071709.
Installing org.eclipse.tracecompass.rcp.feature.group 8.1.0.202211071709.
Installing org.eclipse.tracecompass.incubator.rcp.feature.group 0.3.0.202211071742.
Installing org.eclipse.tracecompass.tmf.cli.feature.group 8.1.0.202211071709.
Installing org.eclipse.tracecompass.incubator.filters.feature.group 0.3.0.202211071742.
Installing org.eclipse.tracecompass.incubator.scripting.feature.group 0.3.0.202211071742.
Installing org.eclipse.tracecompass.incubator.scripting.javascript.feature.group 0.3.0.202211071742.
Installing org.eclipse.tracecompass.incubator.scripting.python.feature.group 0.3.0.202211071742.
Installation failed.
Cannot complete the install because one or more required items could not be found.
        Software being installed: Trace Compass Scripting (Incubation) 0.3.0.202211071742 (org.eclipse.tracecompass.incubator.scripting.feature.group 0.3.0.202211071742)
        Missing requirement: Trace Compass State System Core Plug-in 5.2.0.202211071709 (org.eclipse.tracecompass.statesystem.core 5.2.0.202211071709) requires 'java.package; com.google.gson 0.0.0' but it could not be found
        Cannot satisfy dependency:
                From: Trace Compass Scripting (Incubation) 0.3.0.202211071742 (org.eclipse.tracecompass.incubator.scripting.feature.group 0.3.0.202211071742)
                To: org.eclipse.equinox.p2.iu; org.eclipse.tracecompass.statesystem.core 0.0.0

...


[INFO] Trace Compass Incubator RCP Product 0.3.0-SNAPSHOT . FAILURE [ 48.363 s]
```

One interesting thing to note is that I do not get this error when I delete the contents of my `$HOME/.m2/repository` directory and build/install *only* the Incubator (and thus rely on official TC packages). However, I'm not sure what to do with this possible clue, as I don't have much experience with the build/packaging side.
Comment 1 Bernd Hufmann CLA 2022-11-07 13:44:36 EST
Which target definition do you use? 

There has been updates to the tracecompass-incubator-master.target after the Trace Compass 8.1.0 release. Make sure that Trace Compass baseline, Trace Compass incubator and your custom RCP versions are align.
Comment 2 Christophe Bedard CLA 2022-11-07 13:48:26 EST
> Which target definition do you use?

I'm not sure what answer to give here. In the example I gave above, I'm simply building from master. Do I have to do anything other than the `mvn clean install ...` commands to get it to build properly?
Comment 3 Christophe Bedard CLA 2022-11-07 16:28:12 EST
I think this means I'm using tracecompass-e4.25 for TC and tracecompass-incubator-master for the Incubator. I also tried to change tracecompass-e4.25 so that it is equal to tracecompass-incubator-master, but that didn't work.

I assumed that building the Incubator RCP using TC and TC Incubator @ master (as-is) would work. I cannot find any documentation about it.
Comment 4 Bernd Hufmann CLA 2022-11-07 18:21:44 EST
First of all, if you want to build the incubator RCP, you don't need to build Trace Compass mainline before. The incubator build will download the Trace Compass features from the corresponding trace compass update site. In fact, sometimes having Trace Compass built before can interfere with the incubator build, if the trace compass artifacts built locally and the referenced ones from the incubator target are not the same version.

If such a failure happens I usually clear the maven reactor cache in ~/.m2/repository and build the incubator again.

About the target definition, when building the incubator from master, the following target definition is used:

./common/org.eclipse.tracecompass.incubator.target/tracecompass-incubator-master.target

This file defines all the dependencies and version to be used for the incubator build.

About your custom RCP, I don't know how your custom repository is structured. If you have a custom target definition in your custom repository, make sure it is aligned with the incubator target definition.
Comment 5 Christophe Bedard CLA 2022-11-08 13:27:51 EST
> In fact, sometimes having Trace Compass built before can interfere with the incubator build, if the trace compass artifacts built locally and the referenced ones from the incubator target are not the same version.

I see. That is unfortunate, because I need to re-build Trace Compass mainline since I need to apply a patch (while waiting for it to get merged upstream).

Is there any way I can build TC mainline the same way it is built for the update site so that I can use it for my custom RCP? If this is somehow possible, it would be great to document it so that people like me (who assumed this would work out-of-the-box) don't get weird surprises and actually have a documented way to do this!

> About your custom RCP, I don't know how your custom repository is structured. If you have a custom target definition in your custom repository, make sure it is aligned with the incubator target definition.

I'll make sure they're aligned.
Comment 6 Bernd Hufmann CLA 2022-11-08 13:40:35 EST
(In reply to Christophe Bedard from comment #5)
> > In fact, sometimes having Trace Compass built before can interfere with the incubator build, if the trace compass artifacts built locally and the referenced ones from the incubator target are not the same version.
> 
> I see. That is unfortunate, because I need to re-build Trace Compass
> mainline since I need to apply a patch (while waiting for it to get merged
> upstream).
> 
> Is there any way I can build TC mainline the same way it is built for the
> update site so that I can use it for my custom RCP? If this is somehow
> possible, it would be great to document it so that people like me (who
> assumed this would work out-of-the-box) don't get weird surprises and
> actually have a documented way to do this!
> 

Yes, there is a way to do that. You can build Trace Compass on your laptop. This will create the Trace Compass and RCP update sites. In the incubator target as well as your custom target definition, you need to specify this local update sites instead the ones at Eclipse.org.

Here are the update sites:
[1] org.eclipse.tracecompass/releng/org.eclipse.tracecompass.releng-site/target/repository
[2] org.eclipse.tracecompass/rcp/org.eclipse.tracecompass.rcp.product/target/repository

In the target definition you can reference them with using file:/ URLs

Please note if you change the incubator code as well, then you need to repeat the same steps with the incubator update sites built locally.
Comment 7 Marco Miller CLA 2022-11-15 13:57:59 EST
I get this maven build error locally in Incubator when trying the above out. There must be incompatibilities when trying to use a locally built master version of TC core within Incubator's own master version. The latter currently pins TC version 4.24, which is older than master indeed. I don't know how to work around this; do you?

[ERROR] Cannot resolve target definition:
[ERROR]   Software being installed: org.eclipse.tracecompass.rcp.feature.group 8.1.0.202211141935
[ERROR]   Software being installed: org.eclipse.xsd 2.18.0.v20220312-1031
[ERROR]   Only one of the following can be installed at once: [org.eclipse.xsd 2.18.0.v20200917-0747, org.eclipse.xsd 2.18.0.v20220312-1031, org.eclipse.xsd 2.18.0.v20220616-0915]
[ERROR]   Cannot satisfy dependency: org.eclipse.tracecompass.rcp.feature.group 8.1.0.202211141935 depends on: org.eclipse.equinox.p2.iu; org.eclipse.xsd [2.18.0.v20220616-0915,2.18.0.v20220616-0915]
Comment 8 Christophe Bedard CLA 2022-11-22 16:13:20 EST
I haven't been able to find a fix yet. I tried changing the Incubator's target platform file to point to my local TC mainline update site (using file:/ and many other variations), but Maven didn't recognize it.
Comment 9 Christophe Bedard CLA 2022-11-22 17:33:23 EST
> There must be incompatibilities when trying to use a locally built master version of TC core within Incubator's own master version. The latter currently pins TC version 4.24, which is older than master indeed

I was however indeed able to build the Incubator RCP from source after building mainline TC from source without relying on my local update site, which I wasn't able to do before. I changed TC mainline to 4.24 as follows:

diff --git a/org.eclipse.tracecompass/pom.xml b/org.eclipse.tracecompass/pom.xml
index 791f532315..03f8c38e86 100644
--- a/org.eclipse.tracecompass/pom.xml
+++ b/org.eclipse.tracecompass/pom.xml
@@ -57,7 +57,7 @@
     <tycho-use-project-settings>true</tycho-use-project-settings>
     <tycho.scmUrl>scm:git:git://git.eclipse.org/gitroot/tracecompass/org.eclipse.tracecompass.git</tycho.scmUrl>
     <cbi-plugins.version>1.3.2</cbi-plugins.version>
-    <target-platform>tracecompass-e4.25</target-platform>
+    <target-platform>tracecompass-e4.24</target-platform>
     <help-docs-eclipserun-repo>http://download.eclipse.org/eclipse/updates/4.20</help-docs-eclipserun-repo>
 
     <rcptt-version>2.5.3</rcptt-version>

Seems like the Incubator should be aligned on mainline/4.25.
Comment 10 Bernd Hufmann CLA 2022-11-22 17:51:18 EST
> Seems like the Incubator should be aligned on mainline/4.25

We could not align the incubator to mainline e4.25 because there was a breaking change in the webtools dependencies that prevented that. So, for the time being and until 4.26 release, the incubator stayed on e4.24. We provided a fix for webtools so that for 4.26 we can uplift mainline and incubator to e4.26.

See https://bugs.eclipse.org/bugs/show_bug.cgi?id=580775 for more details.
Comment 11 Christophe Bedard CLA 2022-11-23 16:12:39 EST
I see, thanks for the explanation. That means that building locally and relying on packages from the local .m2 repository instead of the local update sites should work again out-of-the-box in the future, correct? If so, I think we can close this issue.
Comment 12 Bernd Hufmann CLA 2022-11-23 16:21:57 EST
It works also right now. You just have to build with the correct target files and make sure that you update the target files with local updates sites that contain your specific changes.
Comment 13 Christophe Bedard CLA 2022-11-23 16:26:22 EST
> It works also right now. You just have to build with the correct target files

Indeed, but this wasn't obvious to me; I just assumed that it would work out-of-the-box. With your explanation, it makes sense, though.

> and make sure that you update the target files with local updates sites that contain your specific changes.

I personally wasn't able to change the update site to point to a local directory (like file:/).
Comment 14 Bernd Hufmann CLA 2022-11-23 17:11:17 EST
(In reply to Christophe Bedard from comment #13)
> > It works also right now. You just have to build with the correct target files
> 
> Indeed, but this wasn't obvious to me; I just assumed that it would work
> out-of-the-box. With your explanation, it makes sense, though.
> 

No, it's not obvious. I also struggle, when I need to build other Eclipse projects.

> > and make sure that you update the target files with local updates sites that contain your specific changes.
> 
> I personally wasn't able to change the update site to point to a local
> directory (like file:/).

Can you try it with two slashes (like file://)?
Comment 15 Marco Miller CLA 2022-11-23 17:15:55 EST
What I tried locally (only) to some successful extent was this syntax [3,4]:

[3] <repository location="file:///home/myself/git/org.eclipse.tracecompass/releng/org.eclipse.tracecompass.releng-site/target/repository/"/>
[4] <repository location="file:///home/myself/git/org.eclipse.tracecompass/rcp/org.eclipse.tracecompass.rcp.product/target/repository/"/>
Comment 16 Christophe Bedard CLA 2022-11-24 16:16:18 EST
I swear I tried file:/home, file://home and file:///home, and none of them worked. That last one seems to work now, though, thank you!