-
Notifications
You must be signed in to change notification settings - Fork 189
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
product / repository contains source jars by default #3522
Comments
@sratz source are resolved by default (if contained in the target) but the product / updatesite should only contain them if enabled, do you think you can provide a little example showing the problem? |
By the way maybe it is because you include all requirements? The probably you want to disable source in the target altogether with targetDefinitionIncludeSource = |
That would be some effort, I'll try.
The target file is shared among the maven reactor. Based on this common target we produce several artifacts:
So I don't want to change anything in the target definition. What about 2053d37#diff-9a9726aa0be8197a6082b700e8219a18531b5f9ba103b2f9fc5f162b154794eaR74 If I set this to |
This is a configuration option in Tycho to override what is defined in the target
false will completely disable resolving of additional source bundles so they are not visible, as said what controls this is the one in the product builds, this only resolves possible items for Tycho to consider, so it all depends a bit on how you build your products / sites. |
@sratz I'll also try to take a closer look tomorrow but actually any tycho example that build a product from the integration tests should be able to reproduce the behavior if you for example just use the latest eclipse updatesite (that should contain the sources). |
I got a reproducer: pom.xml: <?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>tycho-its-project.product.selContainedWithoutSources</groupId>
<artifactId>product.product</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>eclipse-repository</packaging>
<properties>
<!-- Important: This update site must have already been generated with the new P2 that adds the source as optional dependencyies with <filter>(org.eclipse.update.install.sources=true)</filter> metadata for the problem to show -->
<target-platform>https://download.eclipse.org/eclipse/updates/I-builds/</target-platform>
</properties>
<repositories>
<repository>
<id>e342</id>
<layout>p2</layout>
<url>${target-platform}</url>
</repository>
</repositories>
<build>
<plugins>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-maven-plugin</artifactId>
<version>${tycho-version}</version>
<extensions>true</extensions>
</plugin>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>target-platform-configuration</artifactId>
<version>${tycho-version}</version>
</plugin>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-p2-repository-plugin</artifactId>
<version>${tycho-version}</version>
<configuration>
<includeAllSources>false</includeAllSources>
<includeAllDependencies>true</includeAllDependencies>
</configuration>
</plugin>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-p2-director-plugin</artifactId>
<version>${tycho-version}</version>
<executions>
<execution>
<id>materialize-products</id>
<goals>
<goal>materialize-products</goal>
</goals>
</execution>
<execution>
<id>archive-products</id>
<goals>
<goal>archive-products</goal>
</goals>
</execution>
</executions>
<configuration>
<products>
<product>
<id>product.product</id>
</product>
</products>
</configuration>
</plugin>
</plugins>
</build>
</project> product.product:
This results in
even though the source is not desired. The materialized product on the other hand, does not have the source, only
|
Same here with our product build using 4.0.6. Tycho is fetching source bundles into |
I'll take a look, but wanted to note (because it is often confused) that there is no such thing as "product update site", in this example you are building a repository that among others contains a product but this is usually not suitable as an update site for that product as it can contain many different things (depending on what is specified) and might lead to bad update behavior (e.g. always update the whole product / changes configurations / ...). Instead one should have one product repository project and one site repository project (that contains a The product should then list all updatable items as root features, the |
I understand the distinction, but why does Tycho now fetch source bundles and add them to the product repository when it didn't do that in 4.0.5? |
I think the problem is here: And since eclipse-equinox/p2#446 those sources are now visible and are picked up. |
@sratz nice finding, this is really nasty |
Feature based. Here. |
@Phillipus can youprobabbly provide an integration-test to demonstrate the issue based on @sratz example and your product configuration (maybe stripped down a bit of course). |
|
There are always a whole bunch of "tooling" things whenever you build a product. I can confirm that I see the same behavior for the product repository (or whatever you want to call it) having all kind of sources that are simply never used or needed. Probably every product will have this problem so perhaps some existing integration test case also has this problem, but has no assertions to check for the problem? |
Here's a test consisting of Please note - I am not a maven/tycho expert and know only just enough to do a build and run tests! |
Yes that's possible if I search for |
Note that when setting |
@Phillipus thanks for testing and providing an example, the |
|
Yes, looking at the code @sratz references, that context property was unconditionally added... |
As said this property is just that Tycho collects everything in the target (like it does for features) this does not mean it should be selected as one can see the product does not contain the sources ... |
In the presence of products, P2 adds a virtual 'tooling.source.default' IU which optionally depends on all sources. If these sources are avaialble in the target platform, this would cause them to be picked up even if assemble-repository was configured with <includeAllSources>false</includeAllSources>. This scenario has become much more likely with recent changes to P2 [1]. To prevent this, we actively prevent this from happening by ignoring the requirements of the 'tooling.source.default' IU unless includeAllSources is explicitly enabled. These would be picked up even if If however, assemble-repository is Fixes eclipse-tycho#3522. [1] eclipse-equinox/p2#446
In the presence of products, P2 adds a virtual 'tooling.source.default' IU which optionally depends on all sources. If these sources are available in the target platform, this would cause them to be picked up even if assemble-repository was configured with <includeAllSources>false</includeAllSources>. This scenario has become much more likely with recent changes to P2 [1]. We actively prevent this from happening by ignoring the requirements of the 'tooling.source.default' IU, unless includeAllSources is explicitly enabled. Fixes eclipse-tycho#3522. [1] eclipse-equinox/p2#446
In the presence of products, P2 adds a virtual 'tooling.source.default' IU which optionally depends on all sources. If these sources are available in the target platform, this would cause them to be picked up even if assemble-repository was configured with <includeAllDependencies>true<includeAllDependencies> but with <includeAllSources>false</includeAllSources>. This scenario has become much more likely with recent changes to P2 [1]. We do not want includeAllDependencies to imply includeAllSources, so we actively prevent this from happening by ignoring the <required namespace='org.eclipse.equinox.p2.eclipse.type' name='source' range='0.0.0' optional='true' multiple='true' greedy='false'/> requirements if 'includeAllSources' is not specified. Fixes eclipse-tycho#3522. [1] eclipse-equinox/p2#446
In the presence of products, P2 adds a virtual 'tooling.source.default' IU which optionally depends on all sources. If these sources are available in the target platform, this would cause them to be picked up even if assemble-repository was configured with <includeAllDependencies>true<includeAllDependencies> but with <includeAllSources>false</includeAllSources>. This scenario has become much more likely with recent changes to P2 [1]. We do not want includeAllDependencies to imply includeAllSources, so we actively prevent this from happening by ignoring the <required namespace='org.eclipse.equinox.p2.eclipse.type' name='source' range='0.0.0' optional='true' multiple='true' greedy='false'/> requirements if 'includeAllSources' is not specified. Fixes #3522. [1] eclipse-equinox/p2#446
In the presence of products, P2 adds a virtual 'tooling.source.default' IU which optionally depends on all sources. If these sources are available in the target platform, this would cause them to be picked up even if assemble-repository was configured with <includeAllDependencies>true<includeAllDependencies> but with <includeAllSources>false</includeAllSources>. This scenario has become much more likely with recent changes to P2 [1]. We do not want includeAllDependencies to imply includeAllSources, so we actively prevent this from happening by ignoring the <required namespace='org.eclipse.equinox.p2.eclipse.type' name='source' range='0.0.0' optional='true' multiple='true' greedy='false'/> requirements if 'includeAllSources' is not specified. Fixes #3522. [1] eclipse-equinox/p2#446 (cherry picked from commit 51e39d6)
In the presence of products, P2 adds a virtual 'tooling.source.default' IU which optionally depends on all sources. If these sources are available in the target platform, this would cause them to be picked up even if assemble-repository was configured with <includeAllDependencies>true<includeAllDependencies> but with <includeAllSources>false</includeAllSources>. This scenario has become much more likely with recent changes to P2 [1]. We do not want includeAllDependencies to imply includeAllSources, so we actively prevent this from happening by ignoring the <required namespace='org.eclipse.equinox.p2.eclipse.type' name='source' range='0.0.0' optional='true' multiple='true' greedy='false'/> requirements if 'includeAllSources' is not specified. Fixes #3522. [1] eclipse-equinox/p2#446 (cherry picked from commit 51e39d6)
After migration from Tycho 4.0.5 to 4.0.6 I noticed that our product update site suddenly contains the source jar files even though none of the config was changed.
I bisected that to #3456, specifically https://github.com/eclipse-tycho/tycho/pull/3456/files#diff-9a9726aa0be8197a6082b700e8219a18531b5f9ba103b2f9fc5f162b154794eaR74
The related P2 change eclipse-equinox/p2#446 explicitly mentions that this new feature should be disabled by deafult.
Shouldn't
2053d37#diff-9a9726aa0be8197a6082b700e8219a18531b5f9ba103b2f9fc5f162b154794eaR74
set this to
false
?The text was updated successfully, but these errors were encountered: