PlatformIO Community

Pio 4.0.0b3 potential bug in .cprojet.tpl

Hello,

I’m just testing pio v4.0.0b3 and found that there is mistakenly added “debug” in builder_target of the
generated .cproject file. …

--- ve_pio/Lib/site-packages/platformio/ide/tpls/eclipse/.cproject.tpl.orig	2019-06-26 11:06:44.487003300 +0200
+++ ve_pio/Lib/site-packages/platformio/ide/tpls/eclipse/.cproject.tpl	2019-06-26 11:07:48.996395800 +0200
@@ -117,7 +117,7 @@
					<folderInfo id="0.910961921.1363900502." name="/" resourcePath="">
						<toolChain id="org.eclipse.cdt.build.core.prefbase.toolchain.2116690625" name="No ToolChain" resourceTypeBasedDiscovery="false" superClass="org.eclipse.cdt.build.core.prefbase.toolchain">
							<targetPlatform binaryParser="org.eclipse.cdt.core.ELF" id="org.eclipse.cdt.build.core.prefbase.toolchain.2116690625.848954921" name=""/>
-							<builder arguments="-f -c eclipse debug" cleanBuildTarget="run --target clean" command="platformio" enableCleanBuild="false" id="org.eclipse.cdt.build.core.settings.default.builder.985867833" incrementalBuildTarget="" keepEnvironmentInBuildfile="false" managedBuildOn="false" name="Gnu Make Builder" superClass="org.eclipse.cdt.build.core.settings.default.builder"/>
+							<builder arguments="-f -c eclipse"  cleanBuildTarget="run --target clean" command="platformio" enableCleanBuild="false" id="org.eclipse.cdt.build.core.settings.default.builder.985867833" incrementalBuildTarget="" keepEnvironmentInBuildfile="false" managedBuildOn="false" name="Gnu Make Builder" superClass="org.eclipse.cdt.build.core.settings.default.builder"/>
							<tool id="org.eclipse.cdt.build.core.settings.holder.libs.1855678035" name="holder for library settings" superClass="org.eclipse.cdt.build.core.settings.holder.libs"/>
							<tool id="org.eclipse.cdt.build.core.settings.holder.30528994" name="Assembly" superClass="org.eclipse.cdt.build.core.settings.holder">
								<option id="org.eclipse.cdt.build.core.settings.holder.incpaths.794801023" name="Include Paths" superClass="org.eclipse.cdt.build.core.settings.holder.incpaths" valueType="includePath">

Sorry for pasting a patch with this lengthy lines, but I did not found an upload button.

Best Regards, Axel

1 Like

Since it is somewhat hard to see the change in the patch, here are essential lines:

old: <builder arguments="-f -c eclipse debug" 
new: <builder arguments="-f -c eclipse" 

OIC, this breaks the debug command … will dig further into it.

Got the standard build commands to work now. Therefore in the template file in all targets needs to be changed
<useDefaultCommand>true</useDefaultCommand>
to
<useDefaultCommand>false</useDefaultCommand>

This change allows run targets like clean and build correctly.

Here again the patch:

--- ve_pio/Lib/site-packages/platformio/ide/tpls/eclipse/.cproject.tpl.orig	2019-06-26 11:06:44.487003300 +0200
+++ ve_pio/Lib/site-packages/platformio/ide/tpls/eclipse/.cproject.tpl	2019-06-26 13:33:48.878256000 +0200
@@ -117,7 +117,7 @@
 					<folderInfo id="0.910961921.1363900502." name="/" resourcePath="">
 						<toolChain id="org.eclipse.cdt.build.core.prefbase.toolchain.2116690625" name="No ToolChain" resourceTypeBasedDiscovery="false" superClass="org.eclipse.cdt.build.core.prefbase.toolchain">
 							<targetPlatform binaryParser="org.eclipse.cdt.core.ELF" id="org.eclipse.cdt.build.core.prefbase.toolchain.2116690625.848954921" name=""/>
-							<builder arguments="-f -c eclipse debug" cleanBuildTarget="run --target clean" command="platformio" enableCleanBuild="false" id="org.eclipse.cdt.build.core.settings.default.builder.985867833" incrementalBuildTarget="" keepEnvironmentInBuildfile="false" managedBuildOn="false" name="Gnu Make Builder" superClass="org.eclipse.cdt.build.core.settings.default.builder"/>
+							<builder arguments="-f -c eclipse debug --interface gdb"  cleanBuildTarget="run --target clean" command="platformio" enableCleanBuild="false" id="org.eclipse.cdt.build.core.settings.default.builder.985867833" incrementalBuildTarget="" keepEnvironmentInBuildfile="false" managedBuildOn="false" name="Gnu Make Builder" superClass="org.eclipse.cdt.build.core.settings.default.builder"/>
 							<tool id="org.eclipse.cdt.build.core.settings.holder.libs.1855678035" name="holder for library settings" superClass="org.eclipse.cdt.build.core.settings.holder.libs"/>
 							<tool id="org.eclipse.cdt.build.core.settings.holder.30528994" name="Assembly" superClass="org.eclipse.cdt.build.core.settings.holder">
 								<option id="org.eclipse.cdt.build.core.settings.holder.incpaths.794801023" name="Include Paths" superClass="org.eclipse.cdt.build.core.settings.holder.incpaths" valueType="includePath">
@@ -221,7 +221,7 @@
 				<buildArguments>-f -c eclipse</buildArguments>
 				<buildTarget>run -t program</buildTarget>
 				<stopOnError>true</stopOnError>
-				<useDefaultCommand>true</useDefaultCommand>
+				<useDefaultCommand>false</useDefaultCommand>
 				<runAllBuilders>false</runAllBuilders>
 			</target>
 			<target name="PlatformIO: Upload SPIFFS image" path="" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
@@ -229,7 +229,7 @@
 				<buildArguments>-f -c eclipse</buildArguments>
 				<buildTarget>run -t uploadfs</buildTarget>
 				<stopOnError>true</stopOnError>
-				<useDefaultCommand>true</useDefaultCommand>
+				<useDefaultCommand>false</useDefaultCommand>
 				<runAllBuilders>false</runAllBuilders>
 			</target>
 			<target name="PlatformIO: Build" path="" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
@@ -237,7 +237,7 @@
 				<buildArguments>-f -c eclipse</buildArguments>
 				<buildTarget>run</buildTarget>
 				<stopOnError>true</stopOnError>
-				<useDefaultCommand>true</useDefaultCommand>
+				<useDefaultCommand>false</useDefaultCommand>
 				<runAllBuilders>false</runAllBuilders>
 			</target>
 			<target name="PlatformIO: Upload" path="" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
@@ -245,7 +245,7 @@
 				<buildArguments>-f -c eclipse</buildArguments>
 				<buildTarget>run -t upload</buildTarget>
 				<stopOnError>true</stopOnError>
-				<useDefaultCommand>true</useDefaultCommand>
+				<useDefaultCommand>false</useDefaultCommand>
 				<runAllBuilders>false</runAllBuilders>
 			</target>
 			<target name="PlatformIO: Clean" path="" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
@@ -253,7 +253,7 @@
 				<buildArguments>-f -c eclipse</buildArguments>
 				<buildTarget>run -t clean</buildTarget>
 				<stopOnError>true</stopOnError>
-				<useDefaultCommand>true</useDefaultCommand>
+				<useDefaultCommand>false</useDefaultCommand>
 				<runAllBuilders>false</runAllBuilders>
 			</target>
 			<target name="PlatformIO: Test" path="" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
@@ -261,7 +261,7 @@
 				<buildArguments>-f -c eclipse</buildArguments>
 				<buildTarget>test</buildTarget>
 				<stopOnError>true</stopOnError>
-				<useDefaultCommand>true</useDefaultCommand>
+				<useDefaultCommand>false</useDefaultCommand>
 				<runAllBuilders>false</runAllBuilders>
 			</target>
 			<target name="PlatformIO: Update platforms and libraries" path="" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
@@ -269,7 +269,7 @@
 				<buildArguments>-f -c eclipse</buildArguments>
 				<buildTarget>update</buildTarget>
 				<stopOnError>true</stopOnError>
-				<useDefaultCommand>true</useDefaultCommand>
+				<useDefaultCommand>false</useDefaultCommand>
 				<runAllBuilders>false</runAllBuilders>
 			</target>
 			<target name="PlatformIO: Rebuild C/C++ Project Index" path="" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
@@ -277,7 +277,7 @@
 				<buildArguments>-f -c eclipse</buildArguments>
 				<buildTarget>init --ide eclipse</buildTarget>
 				<stopOnError>true</stopOnError>
-				<useDefaultCommand>true</useDefaultCommand>
+				<useDefaultCommand>false</useDefaultCommand>
 				<runAllBuilders>false</runAllBuilders>
 			</target>
 		</buildTargets>

1 Like

The file is here in GitHub if you want to do a Pull Request or raise a issue about it :wink:

Hello @pfeerick
thanks for the hint, the pull request has gone to: https://github.com/platformio/platformio-core/pull/2714.

Best, Axel.

1 Like

Thanks for the PR! Merged! :blush:

1 Like