PlatformIO goes into (almost) infinite loop updating configuration

I have a project with numerous environments defined in platformio.ini.

Almost every time I update platformio.ini or do a compile, PlatformIO goes into an infinite loop updating the configuration. Very strange. Especially since it’s installing a library that isn’t called for in the selected environment.

[env]
  build_src_filter = -<*.*>
  framework = arduino
  monitor_filters = time
  monitor_speed = 115200
  build_flags =
    -D DEVELOPMENT_MODE
    -D ENABLE_FUNCTION_TRACING
    -D ENABLE_SERIAL_PRINT

[env:feather_32u4_base]
  extends = env
  platform = atmelavr
  board = feather32u4
  upload_port = /dev/cu.usbmodem1442401
  monitor_port = /dev/cu.usbmodem1442401

[env:mac_address_test_32u4]
  extends = env:feather_32u4_base
  build_src_filter = +<macAddressTest.cpp>
  build_flags =
    ${env.build_flags}
    -D MAC_ADDRESS_PRINTABLE
    -D MAC1="0x02, 0x44, 0x50, 0x01, 0x00, 0x01"
    -D MAC2="0x024450010002"

Here is the output from the config operation:

Resolving mac_address_test_32u4 dependencies...
Library Manager: Installing arduino-libraries/Ethernet @ ^2.0.0
Unpacking 0% 10% 20% 30% 40% 50% 60% 70% 80% 90% 100%
Library Manager: Ethernet@2.0.2 has been installed!
Already up-to-date.
Updating metadata for the vscode IDE...
Configuration process has been terminated!

As you can see, it’s installing the Ethernet library which is not listed as a dependency for the environment.

After displaying that message, the notice in the lower-right goes away and a few seconds later it comes back and repeats the process.

It will eventually error out with a “too many something or other request” error.

What on earth is causing this and how do I fix it?

TIA,

D.

Do you have any library installed in the lib/ folder of your project?

Do you have a global library installed in C:\Users\<user>\.platformio\lib?

What is the first few lines of the output of project tasks → Advanced → Verbose Build?

I have a number of libraries in lib/.

I do not have anything in ~/.platformio/lib (that directory doesn’t even exist).

What do either of those have to do with this problem?

Thanks.

What is their manifest? (library.properties, library.json)?

PlatformIO shouldn’t just decide to install arduino-libraries/Ethernet by itself, some library or script must be instructing it to do it.

Ah. Yep one of my libraries was specifying Ethernet as a dependency in library.json.

That doesn’t explain the infinite loop, though.

Ideas on that?

Thanks.

Distill it into a minimal reproducable example and post it to https://github.com/platformio/platformio-core/issues/ to get it investigated.