Not sure what the issue is. I’ve tried removing and reinstalling PlatformIO multiple times and different marlin firmware’s and still the same error during building. Only this that has changed from before i was able to build is an update to PlatformIO, and a new processor which I don’t think would cause any issues.
CalledProcessError: Command '"C:\Users\Tony\.platformio\packages\toolchain-atmelavr\bin\avr-g++.exe" -D__MARLIN_FIRMWARE__ -D__MARLIN_DEPS__ -w -dM -E -x c++ buildroot/share/PlatformIO/scripts/common-dependencies.h' returned non-zero exit status 1.:
File "C:\users\tony\.platformio\penv\lib\site-packages\platformio\builder\main.py", line 168:
env.SConscript(item, exports="env")
File "C:\Users\Tony\.platformio\packages\tool-scons\scons-local-4.0.1\SCons\Script\SConscript.py", line 598:
return _SConscript(self.fs, *files, **subst_kw)
File "C:\Users\Tony\.platformio\packages\tool-scons\scons-local-4.0.1\SCons\Script\SConscript.py", line 287:
exec(compile(scriptdata, scriptname, 'exec'), call_stack[-1].globals)
File "C:\Marlin-bugfix-2.0.x\buildroot\share\PlatformIO\scripts\common-dependencies.py", line 327:
apply_features_config()
File "C:\Marlin-bugfix-2.0.x\buildroot\share\PlatformIO\scripts\common-dependencies.py", line 141:
if not env.MarlinFeatureIsEnabled(feature):
File "C:\Users\Tony\.platformio\packages\tool-scons\scons-local-4.0.1\SCons\Environment.py", line 219:
return self.method(*nargs, **kwargs)
File "C:\Marlin-bugfix-2.0.x\buildroot\share\PlatformIO\scripts\common-dependencies.py", line 292:
load_marlin_features()
File "C:\Marlin-bugfix-2.0.x\buildroot\share\PlatformIO\scripts\common-dependencies.py", line 280:
define_list = subprocess.check_output(cmd, shell=True).splitlines()
File "C:\Users\Tony\.platformio\python3\lib\subprocess.py", line 411:
**kwargs).stdout
File "C:\Users\Tony\.platformio\python3\lib\subprocess.py", line 512:
output=stdout, stderr=stderr)
That doesn’t look right. I’m a Linux user but I’m thinking that the path should be c:\users\tony\.platformio\... there’s a backslsh missing between “tony” and “.platformio”.
Can you check your %PATH% in control panel please.
What is the output when you manually execute "C:\Users\Tony\.platformio\packages\toolchain-atmelavr\bin\avr-g++.exe" -D__MARLIN_FIRMWARE__ -D__MARLIN_DEPS__ -w -dM -E -x c++ buildroot/share/PlatformIO/scripts/common-dependencies.h
Okay hm. Well the output shows that everything is good though. Does the program invocation still fail with CalledProcessError if you build normally now?
Does disabling any antivirus program that mightr be active change anything?
Verbose mode can be enabled via `-v, --verbose` option
CalledProcessError: Command 'avr-g++.exe -D__MARLIN_FIRMWARE__ -D__MARLIN_DEPS__ -w -dM -E -x c++ buildroot/share/PlatformIO/scripts/common-dependencies.h' returned non-zero exit status 1.:
File "C:\users\tony\.platformio\penv\lib\site-packages\platformio\builder\main.py", line 168:
env.SConscript(item, exports="env")
File "C:\Users\Tony\.platformio\packages\tool-scons\scons-local-4.0.1\SCons\Script\SConscript.py", line 598:
return _SConscript(self.fs, *files, **subst_kw)
File "C:\Users\Tony\.platformio\packages\tool-scons\scons-local-4.0.1\SCons\Script\SConscript.py", line 287:
exec(compile(scriptdata, scriptname, 'exec'), call_stack[-1].globals)
File "D:\Marlin-2.0.x\buildroot\share\PlatformIO\scripts\common-dependencies.py", line 286:
apply_features_config()
File "D:\Marlin-2.0.x\buildroot\share\PlatformIO\scripts\common-dependencies.py", line 118:
if not env.MarlinFeatureIsEnabled(feature):
File "C:\Users\Tony\.platformio\packages\tool-scons\scons-local-4.0.1\SCons\Environment.py", line 219:
return self.method(*nargs, **kwargs)
File "D:\Marlin-2.0.x\buildroot\share\PlatformIO\scripts\common-dependencies.py", line 262:
load_marlin_features()
File "D:\Marlin-2.0.x\buildroot\share\PlatformIO\scripts\common-dependencies.py", line 250:
define_list = subprocess.check_output(cmd, shell=True).splitlines()
File "C:\Users\Tony\.platformio\python3\lib\subprocess.py", line 411:
**kwargs).stdout
File "C:\Users\Tony\.platformio\python3\lib\subprocess.py", line 512:
output=stdout, stderr=stderr)
Hmm that should have been regenerated with the C:\Users\Tony\.platformio\packages\toolchain-atmelavr\bin\avr-g++.exe path when the .pio folder was deleted and rebuilt.
When you remove that .gcc_path file and hit “Build” again, does it still fail?
Does it fail when you manually replace the contents of that file with the path above?
Do you have a global AVR-GCC installation, by chance?
when i remove the gcc path and rebuild stills fails. I don’t not have another AVR-GCC installation, just a normal gcc from the mingw-64 install, not sure if that will impact it or not. Also it still fails when I replace the contents of the GCC path inside the build folder with “C:\Users\Tony.platformio\packages\toolchain-atmelavr\bin\avr-g++.exe”
Could you also again open a PIO CLI like in the first post and execute the two commands
"C:\Users\Tony\.platformio\packages\toolchain-atmelavr\bin\avr-g++.exe" -D__MARLIN_FIRMWARE__ -D__MARLIN_DEPS__ -w -dM -E -x c++ buildroot/share/PlatformIO/scripts/common-dependencies.h
$LASTEXITCODE
and post in pastebin/xyz what that outputs.
Btw, your case is really interesting, since we had sporadic reports of Marlin’s build script failing (this compiler-find logic), but we can’t figure out why exactly, since it is working on all machines I and the Marlin developers are testing it on ([BUG] 'CC' is not recognized as an internal or external command · Issue #20671 · MarlinFirmware/Marlin · GitHub). So I really appreciate your patience and the information we can gather from here to maybe finally erridicate this problem.
No worries i’m glad that someone is trying to help me with this issue. Also does the compiler act different when using different processors ie. amd to intel? Recently updated to amd from intel.