platform-espressif32 icon indicating copy to clipboard operation
platform-espressif32 copied to clipboard

Got stuck on the `develop` branch for my `platform` & could not build for hours, even after changing the value several times and removing directories entirely

Open aremmell opened this issue 6 months ago • 5 comments

I am not entirely sure what happened in what order, but:

  1. At some point today, in an attempt to get a new board working, I changed my platformio.ini to look like this:
[env:adafruit_qualia_s3_rgb666]
platform = https://github.com/platformio/platform-espressif32.git
platform_packages = framework-espidf
board = adafruit_qualia_s3_rgb666
framework = arduino, espidf
  1. After I made this change, removing ~/.espressif/packages/platform-espressif32* entirely, plus completely removing and reinstalling ESP-IDF several times, I was apparently stuck on the develop branch of the git repository for my platform package.

I know this is true, because I reverted the syntax to platform = espressif32, and even platform = espressif32 @ 6.4.0 (and re-deleted the directories), but I still got the following error from CMakeFiles.txt:19 every time I tried to build:

if (idf_version VERSION_GREATER max_supported_idf_version)
  message(FATAL_ERROR "Arduino-esp32 can be used with ESP-IDF versions "
                      "between ${min_supported_idf_version} and ${max_supported_idf_version}, "
                      "but a newer version is detected: ${idf_version}.")
endif()

The numbers were something like: "between 4.4.0 and 4.4.99, but a newer version is detected: 5.1.2"

I knew I had explicitly installed ESP-IDF 4.x.x, so I could not understand how I kept getting this error.

  1. In an effort to figure out WTF was going on, I inadvertently stumbled upon commit https://github.com/platformio/platform-espressif32/commit/bc5b51f0202afc794e1a49dfb34ebcb82b080140 and noticed that the version number had been bumped up for ESP-IDF. I first thought I must be going crazy, because I wasn't supposed to be pulling this library from git any longer, but sure enough, I reverted those changes and set my platform = espressif32 @ 6.4.0 and platform_packages = framework-espidf @ ~3.40405.0; now everything is back to normal.

I suppose I am suggesting two things:

  1. The aforementioned commit is bad and has broken the build, since the CMake scripts are still looking for 4.x.x, yet 5.1.2 is purposely installed.
  2. There is a bug lurking somewhere around setting the platform to a git repository URL, then changing it back after the fact. It's getting stuck and continuing to pull from git (or it has locally cached it) instead of the specified version in the ini file.

Please let me know if there are any logs I can send, or if you'd like me to repro with some conditions set up in a certain way. I'd be glad to do that in order to prevent someone else from losing half a day on this!

Versions:

  • macOS 14.2.1
  • VS Code latest, PlatformIO latest

aremmell avatar Dec 24 '23 01:12 aremmell