Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 350770 - autotools project build project function does not work
Summary: autotools project build project function does not work
Status: RESOLVED FIXED
Alias: None
Product: CDT
Classification: Tools
Component: cdt-autotools (show other bugs)
Version: 8.1.0   Edit
Hardware: PC Linux
: P3 minor (vote)
Target Milestone: ---   Edit
Assignee: Jeff Johnston CLA
QA Contact: Jeff Johnston CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-06-30 02:42 EDT by Liping Ke CLA
Modified: 2013-02-19 05:30 EST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Liping Ke CLA 2011-06-30 02:42:37 EDT
Build Identifier: 3.0.9.201106060936

We have a yocto project plugin which extends auto tools project. We have an extension point called 
org.eclipse.core.resources.natures->runtime ->org.eclipse.linutools.cdt.autotools.core.genmakebuilderV2(builder),
work plugin works fine.
But when I new c project->GNU Autotools-> Hello World ANSI C Autotools Project, and then click build project, I found the build function defined in autotools plugin will not be called.
Obviously our extension will make autotools build does not work.


Reproducible: Always

Steps to Reproduce:
1. Extend autotools plugin with the extension point of org.eclipse.linutools.cdt.autotools.core.genmakebuilderV2
2. new autotools C project
3. Autotools project build function will not be called, obviously default c builder is called

A work around is that we manually Reconfigure the project and use default c builder. We can build this autotools project.

Any suggestion or idea about this problem? 

Regards,
criping
Comment 1 Jeff Johnston CLA 2011-06-30 15:08:05 EDT
(In reply to comment #0)
> Build Identifier: 3.0.9.201106060936
> 
> We have a yocto project plugin which extends auto tools project. We have an
> extension point called 
> org.eclipse.core.resources.natures->runtime
> ->org.eclipse.linutools.cdt.autotools.core.genmakebuilderV2(builder),
> work plugin works fine.
> But when I new c project->GNU Autotools-> Hello World ANSI C Autotools Project,
> and then click build project, I found the build function defined in autotools
> plugin will not be called.
> Obviously our extension will make autotools build does not work.
> 
> 

I'm not clear about what you are doing.

Please provide more details about how you have extended the Autotools project.  Are you extending some of the classes in Autotools or just extending the Autotools nature?  If you provide some snippets here (schema and plugin.xml snippets) it might be more obvious what is going on.  Are you overriding the Autotools builder id with your own builder?  The Autotools project goes through the builders and does a reorder so that the Autotools builder appears before the CDT common builder.  This allows configuration before processing the Makefile.  It uses the id to identify the various builders.
Comment 2 Liping Ke CLA 2011-07-01 01:36:22 EDT
Thanks a lot for your help!
Below is our extension description which is involved, I observed that genmakebuilderV2 cause the problem that blocks the autotools project build. But I can't remove this extension, the reason is that we override some debugger configurations ( I also paste the related code). If I remove this extension, the override will not take effect. (We need to change default Debugger page->Main->GDB Debugger location and ->GDB command file location).

Thanks a lot for your help!

criping

   <extension
         id="YoctoSDKNature"
         name="%extension.name.0"
         point="org.eclipse.core.resources.natures">
      <requires-nature
            id="org.eclipse.linuxtools.cdt.autotools.core.autotoolsNatureV2">
      </requires-nature>
      <runtime>
         <run
               class="org.yocto.sdk.ide.YoctoSDKProjectNature">
         </run>
      </runtime>
      <builder
            id="org.eclipse.linuxtools.cdt.autotools.core.genmakebuilderV2">
      </builder>
   </extension

code piece for chaning debugger page settings.

ILaunchConfigurationWorkingCopy w_copy = configType.newInstance(project, project.getName()+"_gdb_"+sTargetTriplet);
			String sDebugInitFile = project.getLocation().toString() + "/.gdbinit";
			FileWriter out = new FileWriter(new File(sDebugInitFile));
			out.write("set sysroot " + sSysroot);
			out.flush();
			out.close();			
			w_copy.setAttribute("org.eclipse.cdt.debug.mi.core.GDB_INIT", sDebugInitFile);
			w_copy.setAttribute("org.eclipse.cdt.dsf.gdb.GDB_INIT", sDebugInitFile);
			w_copy.setAttribute("org.eclipse.cdt.debug.mi.core.AUTO_SOLIB", false);
			w_copy.setAttribute("org.eclipse.cdt.dsf.gdb.AUTO_SOLIB", false);		
			w_copy.setAttribute("org.eclipse.cdt.debug.mi.core.DEBUG_NAME", strDebugger);
			w_copy.setAttribute("org.eclipse.cdt.dsf.gdb.DEBUG_NAME", strDebugger);
			String projectName = project.getName();
			w_copy.setAttribute("org.eclipse.cdt.launch.PROJECT_ATTR", projectName);
			if(!project.hasNature(YoctoSDKEmptyProjectNature.YoctoSDK_EMPTY_NATURE_ID))
			{
				String project_src = "src/"+projectName;
				w_copy.setAttribute("org.eclipse.cdt.launch.PROGRAM_NAME", project_src);
			}
			w_copy.setAttribute("org.eclipse.cdt.debug.mi.core.protocol", "mi");
			w_copy.doSave();
Comment 3 Jeff Johnston CLA 2012-07-19 16:14:49 EDT
Please confirm if this problem has been rectified or not.  From what I understood in talking to Anna D. at the CDT summit, the yocto autotools extension is working now.


(In reply to comment #2)
> Thanks a lot for your help!
> Below is our extension description which is involved, I observed that
> genmakebuilderV2 cause the problem that blocks the autotools project build. But
> I can't remove this extension, the reason is that we override some debugger
> configurations ( I also paste the related code). If I remove this extension,
> the override will not take effect. (We need to change default Debugger
> page->Main->GDB Debugger location and ->GDB command file location).
> 
> Thanks a lot for your help!
> 
> criping
> 
>    <extension
>          id="YoctoSDKNature"
>          name="%extension.name.0"
>          point="org.eclipse.core.resources.natures">
>       <requires-nature
>             id="org.eclipse.linuxtools.cdt.autotools.core.autotoolsNatureV2">
>       </requires-nature>
>       <runtime>
>          <run
>                class="org.yocto.sdk.ide.YoctoSDKProjectNature">
>          </run>
>       </runtime>
>       <builder
>             id="org.eclipse.linuxtools.cdt.autotools.core.genmakebuilderV2">
>       </builder>
>    </extension
> 
> code piece for chaning debugger page settings.
> 
> ILaunchConfigurationWorkingCopy w_copy = configType.newInstance(project,
> project.getName()+"_gdb_"+sTargetTriplet);
>             String sDebugInitFile = project.getLocation().toString() +
> "/.gdbinit";
>             FileWriter out = new FileWriter(new File(sDebugInitFile));
>             out.write("set sysroot " + sSysroot);
>             out.flush();
>             out.close();            
>             w_copy.setAttribute("org.eclipse.cdt.debug.mi.core.GDB_INIT",
> sDebugInitFile);
>             w_copy.setAttribute("org.eclipse.cdt.dsf.gdb.GDB_INIT",
> sDebugInitFile);
>             w_copy.setAttribute("org.eclipse.cdt.debug.mi.core.AUTO_SOLIB",
> false);
>             w_copy.setAttribute("org.eclipse.cdt.dsf.gdb.AUTO_SOLIB", false);   
>             w_copy.setAttribute("org.eclipse.cdt.debug.mi.core.DEBUG_NAME",
> strDebugger);
>             w_copy.setAttribute("org.eclipse.cdt.dsf.gdb.DEBUG_NAME",
> strDebugger);
>             String projectName = project.getName();
>             w_copy.setAttribute("org.eclipse.cdt.launch.PROJECT_ATTR",
> projectName);
>            
> if(!project.hasNature(YoctoSDKEmptyProjectNature.YoctoSDK_EMPTY_NATURE_ID))
>             {
>                 String project_src = "src/"+projectName;
>                 w_copy.setAttribute("org.eclipse.cdt.launch.PROGRAM_NAME",
> project_src);
>             }
>             w_copy.setAttribute("org.eclipse.cdt.debug.mi.core.protocol",
> "mi");
>             w_copy.doSave();
Comment 4 Alexander Kurtakov CLA 2013-02-19 05:30:00 EST
No reply from the reporter in more than 6 months. Closing. Please reopen if the problem still exists.