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.
The output and link shows that the command could be executed successfully and the return-code of the invocation was 0 meaning no-error.
Then how in the world does it do a non-zero exit v
when compiled in VSCode + PlatformIO? >.<
Do you have any antivirus installed beyond the default/builtin Windows defender?
Can you also
follow this guide in conjunction with docs to add the C:\Users\Tony\.platformio\python3\Scripts folder to the PATH? (Check that it exists first)
compeltely remove all folders within C:\Users\Tony\.platformio\packages and C:\Users\Tony\.platformio\platforms
then completely remove the Marlin project folder
Reclone it fresh from the repo
Open a terminal (Windows + R → cmd.exe), change directory into the Marlin folder where the platformio.ini using the cd <path> command and execute pio run. Does it stilll fail, and if yes, with what exact error?
Just to clarify, just run “pio run”? Trying that errors out saying the pio is not a recognized command. I looked at the docs and installed platformio, which created a virtual environment with platformio installed
My bad, the path that needs to be added to the SYSTEM PATH should be C:\Users\Tony\.platformio\penv\Scripts. If you open this folder you also see the pio executable in it, right?
Looks like the change to the common-dependencies.py worked, I reverted to the original and the it threw the same error as before. So seems that linked common-dependencies.py is the solution to my issue.
The command structure looks absolutely right. I have literally no idea what’s holding this back anymore / causing it to fail with return code 1.
Please open an issue at Issues · MarlinFirmware/Marlin · GitHub referencing this thread and the version of Marlin you’ve downloaded for the Marlin developers.