Scanning dependencies taking 15 seconds

Greetings,

I have inherited PlatformIO for a Teensy32 Arduino project. It takes about 15 seconds on a fast computer to scan the dependencies and begin compilation.

How can I reduce the time spent on this Scanning Dependencies step?

I see that there is an option to turn lib_ldf_mode = off which would rely on “manifests (library.json, module.json ) or using lib_deps option.”
Ref: Library Dependency Finder (LDF) — PlatformIO latest documentation

library.json looks like something that might be a nice output to get from the dependency scanner. module.json seems similar. lib_deps appears unused in this project (pio lib list is empty).

This seems like natural complication to make the build process easy and flexible.

I am ignorant of the underlying PlatformIO technology. I would like to have a more efficient build process. For one, rescanning dependencies every time is unnecessary. It only needs to be rescanned when I want to generate the new build scripts (e.g. Makefiles).

Second, how can I generate this library.json or other manifest file? Perhaps using the scanner somehow?

Cheers,
Joe Gorse

Edit: the platformio.ini file.

;PlatformIO Project Configuration File
;
;   Build options: build flags, source filter
;   Upload options: custom upload port, speed and extra flags
;   Library options: dependencies, extra library storages
;   Advanced options: extra scripting
;
; Please visit documentation for the other options and examples
; https://docs.platformio.org/page/projectconf.html

; [env:debug]
; platform = teensy
; board = teensy31
; framework = arduino
; build_flags =
;     -I$PROJECT_DIR/src -I$PROJECT_DIR/lib
;     -Wall
;     -Werror
;     -std=c++17
;     -D DEBUG=1
;     -Wl,-Map=mapfile.map

; monitor_speed = 115200
; board_build.f_cpu = 72000000
[platformio]
default_envs = release

[env:release]
platform = teensy
board = teensy31
framework = arduino
;-I$PROJECT_DIR/lib//src -I$PROJECT_DIR/lib//src -I$PROJECT_DIR/lib//src -I$PROJECT_DIR/lib//src
build_flags =
    -I$PROJECT_DIR/src -I$PROJECT_DIR/lib
    -Wall
    -Werror
    -std=c++17
    -D DEBUG=1

lib_ldf_mode = off

; monitor_port = COM6
monitor_speed = 115200
board_build.f_cpu = 72000000
extra_scripts = 
;    pre:build_versioning.py
test_ignore = test_desktop

[env:native]
; not yet working
platform = native
test_ignore = test_embedded
src_filter = +<*> -<.git/> -<.svn/> -<example/> -<examples/> -<test/> -<tests/> -<lib/RealTimeClock>
build_flags =
    -I$PROJECT_DIR/src -I$PROJECT_DIR/lib
    -I$PROJECT_DIR/lib/i2c_t3
    -I$PROJECT_DIR/lib/U8g2_ID942/src
    -I$PROJECT_DIR/lib/RealTimeClock/src
    -Wall
    -Werror
    -std=c++17
    -D RELEASE=1
lib_ldf_mode = chain+

Hi @jhgorse, did you solve your problem? I have the same issue: 15 seconds juste to scan the dependencies.

No. I gave up. The obfuscation platformio offers for creating a list of source files with options to compile is not worth the learning curve. Much better use of time to read the manual, operate the compiler, and do your build, deploy, and debug use cases using minimal abstraction. I ended up with Make, Segger usb tools (GDB and RTT), and VS Code Cortex Debug. In the future I intend to move away from VS Code to Vim or eMacs based IDE for C/C++ development. Godbolt online compiler is good for unit test level data structure and compiler verification.

Cheers,
Joe