Bug 546407 - Project dependencies are not built in the correct order
Summary: Project dependencies are not built in the correct order
Status: RESOLVED FIXED
Alias: None
Product: CDT
Classification: Tools
Component: cdt-build-managed (show other bugs)
Version: Next   Edit
Hardware: PC All
: P3 critical (vote)
Target Milestone: 9.9.0   Edit
Assignee: Umair Sair CLA
QA Contact: Doug Schaefer CLA
URL:
Whiteboard:
Keywords:
: 375882 (view as bug list)
Depends on:
Blocks:
 
Reported: 2019-04-14 08:05 EDT by Umair Sair CLA
Modified: 2022-03-08 10:42 EST (History)
4 users (show)

See Also:


Attachments
The sample projects (26.05 KB, application/zip)
2019-04-14 08:05 EDT, Umair Sair CLA
no flags Details
Linked projects (299.40 KB, application/x-zip-compressed)
2020-03-27 09:21 EDT, Adrian Oltean CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Umair Sair CLA 2019-04-14 08:05:18 EDT
Created attachment 278275 [details]
The sample projects

Scenario:
=========
1. There are three projects; say a, b and c.
2. a depends on b and c.
3. b depends on c.

Correct build order:
====================
1. c
2. b
3. a

Current build order:
====================
1. b
2. c
3. a

Attachment:
===========
1. Attachment contains 3 project; hw-managed, lib, lib2.
2. hw-managed Debug config depends on Release configs on lib and lib2.
3. lib Release config depends on Release config of lib2.

Steps:
======
1. Start fresh workspace and import the project from attachment.
2. Right click hw-managed > Build Configurations > Build Selected...
3. Select Debug config and uncheck clean option.
4. Select OK.

Note:
=====
1. Sometimes the issue is not reproduced; it depends in which order the referenced configs are found.
2. This issue is also observed in headless.
Comment 1 Eclipse Genie CLA 2019-04-14 09:08:35 EDT
New Gerrit change created: https://git.eclipse.org/r/140558
Comment 3 Jonah Graham CLA 2019-06-21 13:19:00 EDT
Thank you Umair for this fix. It is going in early in the 9.9.0 release cycle to hopefully maximise opportunities to verify this in the community.
Comment 4 Marc-André Laperle CLA 2019-06-24 00:45:44 EDT
*** Bug 375882 has been marked as a duplicate of this bug. ***
Comment 5 Adrian Oltean CLA 2020-03-27 09:21:38 EDT
Created attachment 282249 [details]
Linked projects

The patch associated with this ticket introduces a serious problem - a stack overflow. Problem can be reproduced with Eclipse IDE for C/C++ 2019-12/2020-03. 

Attached zip contains some 'hello world' projects that reference each other in a complex hierarchy. Once any project is attempted to be built, the IDE ends-up in a StackOverflowError. 

To reproduce the problem, import the attached projects inside IDE 2020-03 running on a Linux host and then build any of them.
Comment 6 Umair Sair CLA 2020-03-27 12:15:48 EDT
Hi Adrian,

I had a quick look on your attachment. I found a cycle in it; E depends on F and F depends on E. Can you please tell the behavior of CDT before the fix of this bug?
Comment 7 Adrian Oltean CLA 2020-03-27 12:28:47 EDT
Hi Umair,

Indeed, there might be cycles involved. But these did not stop IDE 2019-03 to build them. There's no stack overflow when using 2019-03.

Thanks,
Adrian
Comment 8 Eclipse Genie CLA 2020-03-27 15:21:30 EDT
New Gerrit change created: https://git.eclipse.org/r/160115
Comment 9 Marco Stornelli CLA 2020-03-28 06:54:42 EDT
Please open another bug report as major problem, we'll link this one as it has been marked as resolved fixed and the new one is a side-effect of this one.
Comment 10 Adrian Oltean CLA 2020-03-30 01:35:16 EDT
Thank you for the quick follow-up. I logged ticket #561568