-
Notifications
You must be signed in to change notification settings - Fork 201
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
Headless build ignores project dependencies and builds in random order #529
Conversation
Something like this I guess. I'll see if we can add testing, especially for the new sorting. |
Failed test is known flaky #194 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This code seems to be handling this type of references:
But the CDT has its own project references model (which I hope works for headless):
See the documentation about CDT's more advanced references here.
...dt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/HeadlessBuilder.java
Show resolved
Hide resolved
I tried this after trying project references, neither helps with the headless build. From what I see in the headless builder code, the workspace root is asked for all workspace projects, then those are put in a hash map. The hash map order determines the build order. I.e. there is no actual order. Unlike the build in the IDE. I did see that setting up the CDT references results also in project references. |
That makes it sound like the entry point is too low. Without the original authors around it will be interesting to understand what was done on purpose and what wasn't. |
AFAICT, each project build makes sure that its referenced config of other project is built first. However, there can be a case where project is built twice, like B references project A then first A is built and then build is again invoked on A because B references it. Can you please share the console logs after adding project references in
Yes, thats correct. But for build order, it relies on CDT references which takes configuration level references in account. |
This change adjusts HeadlessBuilder.buildConfigurations() to sort the input projects, based on their references. Projects that are referenced are built first, so that their dependencies are available to referring projects. Fixes: eclipse-cdt#528 Signed-off-by: Simeon Andreev <[email protected]>
Output with projects that have no references:
Console output after adding a reference in the paths and symbols tab, for
After the headless build, if I check the project, the reference is still there.
Where is that supposed to be done during a headless build? |
Ah, I think I see what you mean, looking at the output. So the referenced config will be built as the project gets built, and then the project gets built again (later on, clean build)? I think that works for our users, I'll have to double check with them though. Thanks! |
It seems that your problem is fixed for Test2/Debug; Test1/Debug is built first as Test2/Debug depends on it. The problem is with Test2/Release. I think you haven't added the reference for Test2/Release. Use Configuration combo in References tab to select Release config and add appropriate config reference. |
Closing for now - see discussion at #528 (comment) |
This change adjusts HeadlessBuilder.buildConfigurations() to sort the input projects, based on their references. Projects that are referenced are built first, so that their dependencies are available to referring projects.
Fixes: #528