Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [tycho-user] target definitions and dependency resolution

A target-platform defines the bundles that are available for dependency resolutions. Using "planner" mode would include transitive dependencies (so guava 21.0) while "slicer" mode allows to set statically and explicitly the content
In your case, if you need tight control,you should use slicer,which would allow you to not have guava 21.0 participating to dependency resolution (unless you explicitly include it or a feature that includes it).
But if one bundle depends on it, then this bundle won't resolve and might transitively prevent one of your bundle or artifacts to fail at building. A target file cannot fix a bad dependency in a MANIFEST.MF.

Another value of target definitions id that the same one can be used in IDE with PDE and build with Tycho, making dev-time and build-time more consistent (ie saving a lot of time fixing one relatively to the other).

On Monday, August 5, 2019, Homer, Tony <tony.homer@xxxxxxxxx> wrote:
> Thanks for responding Mickeal.
>
>  
>
> I’m not sure how PDE resolves it, sorry.  I’m sure you are right and dep resolution finds it’s good enough – also there is at least one component* that has version="[21.0.0,22.0.0)" in it’s manifest.
>
>  
>
> But my question is about how I can best force a version (in my case this is for security reasons).  I thought using a target definition was the mechanism for defining the set of installable units but it doesn’t seem to be working in this case.  I suppose I can switch to tycho platform filtering, but then I am not sure if there is a point to maintaining target definitions.
>
>  
>
> Was I wrong about the purpose of target definitions? 
>
>  
>
> * https://git.eclipse.org/r/plugins/gitiles/epp/org.eclipse.epp.logging/+/refs/heads/master/bundles/org.eclipse.epp.logging.aeri.core/META-INF/MANIFEST.MF#14
>
>  
>
> From: <tycho-user-bounces@xxxxxxxxxxx> on behalf of Mickael Istria <mistria@xxxxxxxxxx>
> Reply-To: Tycho user list <tycho-user@xxxxxxxxxxx>
> Date: Friday, August 2, 2019 at 11:52 PM
> To: Tycho user list <tycho-user@xxxxxxxxxxx>
> Subject: Re: [tycho-user] target definitions and dependency resolution
>
>  
>
> Does PDE resolve it differently?
>
> It could be that your TP also includes guava 21 as an transitive dependency and that further dep ressolution finds it's good enough for your build, if it doesn't specify a requirement to 27 in manifest, feature or other.
>
>  
>
> On Saturday, August 3, 2019, Homer, Tony <tony.homer@xxxxxxxxx> wrote:
>
> How does the list of installable units in a target definition location affect dependency resolution?
>
> Let’s say I have something like the following set of locations and units.
>
>  
>
> <location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit">
>
> <repository location="a hosted repo in MY NEXUS INSTANCE"/>
>
> <unit id="com.google.guava" version="27.0.1.jre"/>
>
> </location>
>
> <location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit">
>
> <repository location="P2 proxy of upstream eclipse-2019-06 in MY NEXUS INSTANCE"/>
>
> <!-- a bunch of installable units NOT INCLUDING guava -->
>
> </location>
>
>  
>
> I would expect that this should force guava 27.0.1 to be resolved, but it does not.
>
> Instead, guava 21.0.0.v20170206-1425 is being resolved from the upstream P2 proxy repo.
>
>  
>
> From reading the wiki (https://wiki.eclipse.org/Tycho/Packaging_Types#eclipse-target-definition) I expect that when I use a target definition the list of installable units defines the set from which dependencies are resolved.  That is, dependency resolution should not consider all of the bundles in the repositories listed in the target definition.  It should only consider the installable units that I have listed. 
>
> Because this is not the behavior I am seeing, either my understanding must be wrong or dependency resolution is not working as expected.
>
>  
>
> Can someone who understands this please explain?  If the list of units in the target definition does not define the set to be considered for dependency resolution, what is the point to using a target definition?
>
>  
>
> Thanks!
>
> Tony Homer
>
>  
>
> P.S. I know that I can use filtering (https://wiki.eclipse.org/Tycho/Target_Platform#Filtering) to force a particular version and that is what I intend to do for now, but I don’t think I should have to do this.  It seems to me that the target definition is not being applied in the way that I understand it should be, so I’d like to understand more details about how it is applied.  Thanks.
>
>  
>
> --
>
> Mickael Istria
>
> Eclipse IDE developer, for Red Hat Developers
>
>

--
Mickael Istria
Eclipse IDE developer, for Red Hat Developers


Back to the top