Bug 566953 - Core starts UI
Summary: Core starts UI
Status: NEW
Alias: None
Product: CDT
Classification: Tools
Component: cdt-core (show other bugs)
Version: Next   Edit
Hardware: PC Windows 10
: P3 normal with 1 vote (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact: Jonah Graham CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-09-14 08:04 EDT by Wim Jongman CLA
Modified: 2020-09-14 11:42 EDT (History)
3 users (show)

See Also:


Attachments
stacktrace (229.16 KB, application/octet-stream)
2020-09-14 08:04 EDT, Wim Jongman CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Wim Jongman CLA 2020-09-14 08:04:21 EDT
Created attachment 284123 [details]
stacktrace

It looks like the core builder starts the UI. We are running a headless build which ends in error because cdt.ui is started in this process:

The offending statement that starts the UI is:

org.eclipse.cdt.managedbuilder.internal.core.CommonBuilder$CfgBuildInfo.getConsole(CommonBuilder.java:177)

The full stacktrace is attached.
Comment 1 Jonah Graham CLA 2020-09-14 10:20:31 EDT
If you are doing a headless build, but not with the headless builder there are some manual setup steps you need to perform. 

For this issue you need to set the console to use for build output, otherwise the UI bundle's provided one is used.

				System.setProperty("org.eclipse.cdt.core.console", "org.eclipse.cdt.core.systemConsole"); //$NON-NLS-1$ //$NON-NLS-2$

should do it. If it does, please let me know and I can close off this bug.

See org.eclipse.cdt.managedbuilder.internal.core.HeadlessBuilder.start(IApplicationContext) for what the headless builder does.
Comment 2 jan baeyens CLA 2020-09-14 11:11:24 EDT
@jonah
FYI this is the issue you are looking into for Sloeber.
Comment 3 Wim Jongman CLA 2020-09-14 11:16:24 EDT
(In reply to Jonah Graham from comment #1)
> If you are doing a headless build, but not with the headless builder there
> are some manual setup steps you need to perform. 
> 
> For this issue you need to set the console to use for build output,
> otherwise the UI bundle's provided one is used.
> 
> 				System.setProperty("org.eclipse.cdt.core.console",
> "org.eclipse.cdt.core.systemConsole"); //$NON-NLS-1$ //$NON-NLS-2$
> 
> should do it. If it does, please let me know and I can close off this bug.
> 
> See
> org.eclipse.cdt.managedbuilder.internal.core.HeadlessBuilder.
> start(IApplicationContext) for what the headless builder does.

Thanks for the quick response, Jonah. I will try this.
Comment 4 jan baeyens CLA 2020-09-14 11:42:27 EDT
As Jonah suggested: Adding
System.setProperty("org.eclipse.cdt.core.console", "org.eclipse.cdt.core.systemConsole"); //$NON-NLS-1$ //$NON-NLS-2$

to the unit setup code fixed (on my system) the error in the log file during the maven build.