Custom board missing file: pins_arduino.h: No such file or directory

The pins_arduino.h is usually a part of the variants folder of the framework, that is, if a board declares "variant":"xyz" in its board JSON file, then <package dir>/framework-arduinoespressif32/variants/xyz/pins_arduino.h is expected to exist.

As you can see in

the builder script however also allows a redirection of the variants directory from the framework package to a project-local folder. I.e., if your project has a variants folder, you can do

board_build.variants_dir = variants

to resolve the issue.

This has been discussed before.