Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 322152

Summary: NPE in New Project Wizard when MBS turned off
Product: [Tools] CDT Reporter: Doug Schaefer <cdtdoug>
Component: cdt-buildAssignee: Doug Schaefer <cdtdoug>
Status: RESOLVED INVALID QA Contact: Andrew Gvozdev <angvoz.dev>
Severity: normal    
Priority: P3 CC: jamesblackburn+eclipse
Version: 8.0   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description Doug Schaefer CLA 2010-08-09 11:49:33 EDT
I was curious to see what happened when I turned off the managedbuilder plug-ins. The result is an NPE in CDTMainWizardPage in the switchTo method. Both the wizard handler and entry descriptor are null.

I'm not sure what the right answer is supposed to be. I was expecting to at least see the Makefile project type to be available with the unknown toolchain.
Comment 1 Doug Schaefer CLA 2010-08-09 11:50:37 EDT
I'll investigate. This is important to my strategy of supporting external managed build systems. We should be able to do that without MBS involvement.
Comment 2 Andrew Gvozdev CLA 2010-08-09 12:58:56 EDT
(In reply to comment #0)
> I was curious to see what happened when I turned off the managedbuilder
> plug-ins. The result is an NPE in CDTMainWizardPage in the switchTo method. Both
> the wizard handler and entry descriptor are null.
> I'm not sure what the right answer is supposed to be. I was expecting to at
> least see the Makefile project type to be available with the unknown toolchain.
Currently MBS is used to create Makefile project which is basically a MBS project with 1 default configuration. If we are talking about turning MBS off that would be unavailable but perhaps you expect old Make project wizards? Those that were commented out in cdt.make.ui plugin.xml and then removed in revision 1.83. If I enable those I am getting exception dialog trying to create a project but it does create the project on disk which can be imported and there is all that old 3.2 UI which is actually working AFAICS.
Comment 3 Andrew Gvozdev CLA 2010-08-09 15:27:36 EDT
Thinking about it a bit more, perhaps the right answer is a choice of creating plain C/C++ project having only C/C++ nature and no MBS or Make nature. Many users use CDT for code navigation only without building.
Another thought is to use Capabilities to be able to turn off MBS or the whole Build.
Comment 4 Doug Schaefer CLA 2010-08-09 15:49:41 EDT
Well, the root cause of the NPE seems to be the fact that there are no templates defined without MBS. In fact the Empty templates are defined in the MBS.gnu.ui plug-in.

So there are a couple of issues there. First, the fact we need the Empty templates to begin with. Second, why are the in the gnu.ui plug-in.

The Makefile project type and any associated templates need to be in the make.* plug-ins. My next step is to figure out why they are not.
Comment 5 Doug Schaefer CLA 2010-08-09 15:58:59 EDT
Actually I take that back. The Empty project templates are special. I can't find their declaration. Need to dig deeper.
Comment 6 Doug Schaefer CLA 2010-08-09 16:08:46 EDT
Well, that's odd. You get a totally different set of CNewWizard's when you have MBS turned on. I bet this TemplateCNewWizard has never been run, at least not in a long time.
Comment 7 Doug Schaefer CLA 2010-08-09 22:04:58 EDT
Ah, I get it, now.

There are three CNewWizards. One for MBS which adds Exec and the Libs. One for Std which adds Makefile, and then the Templates one which adds in the templates to those. Bizarre, but it works as intended.

So the NPE was caused because Std and MBS wizards and all the templates are in the MBS plug-ins. Without them, there are no project types or templates so there's nothing to show, thus NPE.

I'm OK with that. I want to muck with all that anyway. Marking this invalid.