eclipse-tycho / tycho

Tycho project repository (tycho)
https://tycho.eclipseprojects.io
Eclipse Public License 2.0
170 stars 189 forks source link

Failure loading target platform with different hosted p2 repositories #2937

Closed thahnen closed 1 year ago

thahnen commented 1 year ago

TL;DR

When consuming a target platform in Tycho 4 (it was the same issue with Tycho 3) with a unit from a repository that returns a response in octet-stream format, the Maven build fails as it cannot work with that content type. In comparison, Eclipse can load it directly inside the IDE without any issue.

Expected behavior

The build succeeds like default for other units from a repository, no issue is thrown. This will be like having the same behavior inside the Eclipse IDE which can work nevertheless the response format.

Actual behavior

I was trying this with our SonarLint for Eclipse project, I've created a specific branch containing the following information. Both "states" mentioned below are different commits (the two recent ones) if someone wants to take a look themself!

I tried consuming the PyDev plug-in which is publishing its artifacts to GitHub as a release and to SourceForge. First I started with using GitHub as the repository as it seemed to be more convenient, doing so in Eclipse worked perfectly when refreshing and reloading the target platform (and when I installed the plug-in standalone and didn't consume it):

Target-Platform_GitHub

But when running our Maven build I got the following error (the last part is German but roughly translates to "content type is not allowed in the prologue"):

Tycho4-Error-Content-Type

Then I switched to using SourceForge as the repository and again, in Eclipse everything worked as expected including refreshing and reloading the target platform (and once again installing the plug-in standalone):

Target-Platform_SourceForge

This time the Maven build succeeded and threw no error regarding some response content type. In addition to that I've checked if there is any configuration missing but I found none and therefore assume this is a bug.

We consume the target platform in our pom.xml as follows:

<plugin>
  <groupId>org.eclipse.tycho</groupId>
  <artifactId>target-platform-configuration</artifactId>
  <configuration>
    <target>
      <!-- this one consumes another target platform containing changes I mentioned above -->
      <file>../target-platforms/build.target</file>
    </target>
    <environments>
      <!-- here are some environments, nothing fancy -->
    </environments>
  </configuration>
</plugin>

Edit 18.10.2023

Ping me when trying to fix the issue, I'd like to contribute if possible (and only for adding an integration test) 😄

thahnen commented 1 year ago

stacktrace.txt

laeubi commented 1 year ago

@thahnen interesting issue, can you provide an integration-test to demonstrate the issue so we have a reproducer before working on a fix?

laeubi commented 1 year ago

Might be the same issue as described here:

thahnen commented 1 year ago

I'm not sure if it is the same issue, looks similar indeed. I'll provide a IT and then we can check if it is already fixed by the PR changes done for the issue you mentioned.