Scanning dependencies taking 15 seconds


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?

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

; [env:debug]
; platform = teensy
; board = teensy31
; framework = arduino
; build_flags =
;     -Wall
;     -Werror
;     -std=c++17
;     -D DEBUG=1
;     -Wl,

; monitor_speed = 115200
; board_build.f_cpu = 72000000
default_envs = 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 =
    -D DEBUG=1

lib_ldf_mode = off

; monitor_port = COM6
monitor_speed = 115200
board_build.f_cpu = 72000000
extra_scripts = 
test_ignore = test_desktop

; not yet working
platform = native
test_ignore = test_embedded
src_filter = +<*> -<.git/> -<.svn/> -<example/> -<examples/> -<test/> -<tests/> -<lib/RealTimeClock>
build_flags =
    -D RELEASE=1
lib_ldf_mode = chain+