Skip to content
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

TychoGraphBuilder: -amd should pick up dependencies of dependants #608

Merged
merged 1 commit into from
Feb 2, 2022

Conversation

sratz
Copy link
Contributor

@sratz sratz commented Feb 1, 2022

-amd in general is of little practical use in Tycho build environments that typically contain downstream features + updatesites that depend on practically everything.

To make it somewhat useful (i.e. get something buildable in the first place out of it), -amd should pick up dependencies of dependents.

Also add a few more integration tests.

Change-Id: I0538fb5bd285c8d2d4132e95c4d44d09c5b2026c

@joeshannon
Copy link
Contributor

I'm not sure about this as I think it will imply a behaviour difference between vanilla maven vs tycho which may be unexpected by users.

In general for non-linear dependency relations, both -am and -amd would typically have to be used as far as I understand it.

I will just upload a demo vanilla maven project to demonstrate.

@laeubi
Copy link
Member

laeubi commented Feb 1, 2022

@joeshannon I don't know as its a bit unclear how it is supposed to work.
From a user perspective I would find it rather strange if I have to add all the transitive projects manually, but maybe that how it is supposed to work?

@github-actions
Copy link

github-actions bot commented Feb 1, 2022

Unit Test Results

146 files  146 suites   51m 4s ⏱️
240 tests 237 ✔️ 3 💤 0

Results for commit a3cf563.

♻️ This comment has been updated with latest results.

@joeshannon
Copy link
Contributor

Yes I have to admit I am also not hugely experienced with using these options in practice outside of simple builds so I am happy to concede to other views as to how this should behave. I was approaching this by attempting to match the behaviour of a pure maven demo. Here is that demo. I'll look at adding the additional modules as presented in this PR in a bit.

Whether we want to modify this behaviour in Tycho to enhance common use cases is another question I guess.

@laeubi
Copy link
Member

laeubi commented Feb 1, 2022

If we want to say that this document is normative they state:

If you wanted to run a portion of the larger build, you would use the -pl or --projects option with the -am or --also-make option. When you specify a project with the -am option, Maven will build all of the projects that the specified project depends upon (either directly or indirectly). Maven will examine the list of projects and walk down the dependency tree, finding all of the projects that it needs to build.

So if -pl A and specify -am would require that i build A and everything A depends on transitively this should work without adding anything beside the computed dependencies, as Tycho already computes a set of all transitive requirements. As mentioned above, for this we should even be able to skip computation of all projects dependencies but shortcircuit to only compute them for A (even we need to examine all others for their metadata).

the -amd or --also-make-dependents option configures Maven to build a project and any project that depends on that project. When using --also-make-dependents, Maven will examine all of the projects in our reactor to find projects that depend on a particular project. It will automatically build those projects and nothing else.

Given that -pl A and specify -amd should only add direct dependencies but not transitive ones! Even though I have no idea for what this is useful as it only will work for 'flat' structures, this will require to compute all project dependencies to be computed to find out who needs A but don't add anything else.

The interesting part would be (and that's what is not mentioned here) if we specify both options, should we only add dependencies of specified projects and what depends on them but not the dependent dependencies ...?

@laeubi
Copy link
Member

laeubi commented Feb 2, 2022

@sratz it seems one test is still failing do you plan to take a look at this?

Also add a few more integration tests.

Change-Id: I0538fb5bd285c8d2d4132e95c4d44d09c5b2026c
@laeubi laeubi merged commit a3cf563 into eclipse-tycho:master Feb 2, 2022
@laeubi
Copy link
Member

laeubi commented Feb 2, 2022

Thanks for the testcase + fix

@sratz sratz deleted the graph-amd branch February 2, 2022 17:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants