Issues building with fresh marlin firmware and PlatformIO 2.2.1

Very interesting. But we should be getting to the bottom of this. Can you please

  • open the platformio.ini of the Marlin project and after the board line in the mega2560 environment

add the line

custom_verbose = 1

Then, remove the .pio folder in the project again, build the project and show logs. They should be more verbose now.

Then, please

It should hopefully start printing PATH: … and give some debug output as to why Marlin thinks that’s the right compiler path.