Skip to content

Commit 2ef6d72

Browse files
committed
Print build dependencies on boot
1 parent 901e2a4 commit 2ef6d72

File tree

5 files changed

+69
-28
lines changed

5 files changed

+69
-28
lines changed

.github/workflows/build-clang-doxy.yml

Lines changed: 32 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ jobs:
3333
echo >>$GITHUB_ENV WS_VERSION=$(git describe --dirty --tags)
3434
- uses: actions/checkout@v4
3535
with:
36-
repository: adafruit/ci-arduino
36+
repository: tyeth/ci-arduino
37+
ref: WS_ARDUINO_598-preprocessor-script-for-printing-the-library-versions-to-boot_outtxt
3738
path: ci
38-
ref: ci-wippersnapper
3939
- name: Checkout Board Definitions
4040
uses: actions/checkout@v4
4141
with:
@@ -72,8 +72,8 @@ jobs:
7272
- name: Install Dependencies (esptool)
7373
run: |
7474
pip3 install esptool
75-
- name: Build for ESP32-SX
76-
run: python3 ci/build_platform.py ${{ matrix.arduino-platform }} --build_timeout 48000
75+
- name: Build for ESP32-SX (esptool)
76+
run: python3 ci/build_platform.py ${{ matrix.arduino-platform }} --build_timeout 48000 --include_print_dependencies_header ./src/print_dependencies.h
7777
- name: list files
7878
run: |
7979
ls -Rla examples/
@@ -182,9 +182,9 @@ jobs:
182182
echo >>$GITHUB_ENV WS_VERSION=$(git describe --dirty --tags)
183183
- uses: actions/checkout@v4
184184
with:
185-
repository: adafruit/ci-arduino
185+
repository: tyeth/ci-arduino
186+
ref: WS_ARDUINO_598-preprocessor-script-for-printing-the-library-versions-to-boot_outtxt
186187
path: ci
187-
ref: ci-wippersnapper
188188
- name: Install CI-Arduino
189189
run: bash ci/actions_install.sh
190190
- name: Install extra Arduino libraries
@@ -214,11 +214,11 @@ jobs:
214214
run: |
215215
cp /home/runner/Arduino/libraries/Adafruit_LittlevGL_Glue_Library/lv_conf.h /home/runner/Arduino/libraries
216216
- name: Build for ESP32-SX
217-
run: python3 ci/build_platform.py ${{ matrix.arduino-platform }} --build_timeout 48000
218-
- name: list
219217
run: |
220-
ls
221-
ls examples/*/build/
218+
python3 ci/build_platform.py ${{ matrix.arduino-platform }} --build_timeout 48000 --include_print_dependencies_header ./src/print_dependencies.h
219+
- name: list files (tree)
220+
run: |
221+
tree
222222
- name: Rename build artifacts to reflect the platform name
223223
run: |
224224
mv examples/*/build/*/Wippersnapper_demo.ino.uf2 wippersnapper.${{ matrix.arduino-platform }}.${{ env.WS_VERSION }}.uf2
@@ -264,9 +264,9 @@ jobs:
264264
echo >>$GITHUB_ENV WS_VERSION=$(git describe --dirty --tags)
265265
- uses: actions/checkout@v4
266266
with:
267-
repository: adafruit/ci-arduino
267+
repository: tyeth/ci-arduino
268+
ref: WS_ARDUINO_598-preprocessor-script-for-printing-the-library-versions-to-boot_outtxt
268269
path: ci
269-
ref: ci-wippersnapper
270270
- name: Checkout Board Definitions
271271
uses: actions/checkout@v4
272272
with:
@@ -290,7 +290,7 @@ jobs:
290290
run: |
291291
pip3 install esptool
292292
- name: build ESP32 platforms
293-
run: python3 ci/build_platform.py ${{ matrix.arduino-platform }} --build_timeout 48000
293+
run: python3 ci/build_platform.py ${{ matrix.arduino-platform }} --build_timeout 48000 --include_print_dependencies_header ./src/print_dependencies.h
294294
- name: Check artifacts
295295
run: |
296296
ls examples/Wippersnapper_demo/build/*
@@ -373,7 +373,8 @@ jobs:
373373
echo >>$GITHUB_ENV WS_VERSION=$(git describe --dirty --tags)
374374
- uses: actions/checkout@v4
375375
with:
376-
repository: adafruit/ci-arduino
376+
repository: tyeth/ci-arduino
377+
ref: WS_ARDUINO_598-preprocessor-script-for-printing-the-library-versions-to-boot_outtxt
377378
path: ci
378379
- name: Install CI-Arduino
379380
run: bash ci/actions_install.sh
@@ -392,8 +393,8 @@ jobs:
392393
# Copy files to WipperSnapper's src/nanopb directory
393394
cp nanopb/pb_common.* nanopb/pb_encode.* nanopb/pb_decode.* src/nanopb
394395
mv nanopb/pb.h src/nanopb/nanopb.pb.h
395-
- name: build platforms
396-
run: python3 ci/build_platform.py ${{ matrix.arduino-platform }} --build_timeout 48000
396+
- name: build SAMD platforms
397+
run: python3 ci/build_platform.py ${{ matrix.arduino-platform }} --build_timeout 48000 --include_print_dependencies_header ./src/print_dependencies.h
397398
- name: Rename build artifacts to reflect the platform name
398399
run: |
399400
mv examples/*/build/*/Wippersnapper_demo.ino.uf2 wippersnapper.${{ matrix.arduino-platform }}.${{ env.WS_VERSION }}.uf2
@@ -425,7 +426,8 @@ jobs:
425426
echo >>$GITHUB_ENV WS_VERSION=$(git describe --dirty --tags)
426427
- uses: actions/checkout@v4
427428
with:
428-
repository: adafruit/ci-arduino
429+
repository: tyeth/ci-arduino
430+
ref: WS_ARDUINO_598-preprocessor-script-for-printing-the-library-versions-to-boot_outtxt
429431
path: ci
430432
- name: Install CI-Arduino
431433
run: bash ci/actions_install.sh
@@ -443,8 +445,8 @@ jobs:
443445
# Copy files to WipperSnapper's src/nanopb directory
444446
cp nanopb/pb_common.* nanopb/pb_encode.* nanopb/pb_decode.* src/nanopb
445447
mv nanopb/pb.h src/nanopb/nanopb.pb.h
446-
- name: build platforms
447-
run: python3 ci/build_platform.py ${{ matrix.arduino-platform }} --build_timeout 48000
448+
- name: build RP2040 platforms
449+
run: python3 ci/build_platform.py ${{ matrix.arduino-platform }} --build_timeout 48000 --include_print_dependencies_header ./src/print_dependencies.h
448450
- name: Rename build artifacts to reflect the platform name
449451
run: |
450452
mv examples/*/build/*/Wippersnapper_demo.ino.uf2 wippersnapper.${{ matrix.arduino-platform }}.${{ env.WS_VERSION }}.uf2
@@ -475,7 +477,8 @@ jobs:
475477
echo >>$GITHUB_ENV WS_VERSION=$(git describe --dirty --tags)
476478
- uses: actions/checkout@v4
477479
with:
478-
repository: adafruit/ci-arduino
480+
repository: tyeth/ci-arduino
481+
ref: WS_ARDUINO_598-preprocessor-script-for-printing-the-library-versions-to-boot_outtxt
479482
path: ci
480483
- name: Install CI-Arduino
481484
run: bash ci/actions_install.sh
@@ -493,8 +496,8 @@ jobs:
493496
# Copy files to WipperSnapper's src/nanopb directory
494497
cp nanopb/pb_common.* nanopb/pb_encode.* nanopb/pb_decode.* src/nanopb
495498
mv nanopb/pb.h src/nanopb/nanopb.pb.h
496-
- name: build platforms
497-
run: python3 ci/build_platform.py ${{ matrix.arduino-platform }} --build_timeout 48000
499+
- name: build SAMD (no-FS) platforms
500+
run: python3 ci/build_platform.py ${{ matrix.arduino-platform }} --build_timeout 48000 --include_print_dependencies_header ./src/print_dependencies.h
498501

499502
build-esp8266:
500503
name: 🏗️ESP8266
@@ -515,7 +518,8 @@ jobs:
515518
echo >>$GITHUB_ENV WS_VERSION=$(git describe --dirty --tags)
516519
- uses: actions/checkout@v4
517520
with:
518-
repository: adafruit/ci-arduino
521+
repository: tyeth/ci-arduino
522+
ref: WS_ARDUINO_598-preprocessor-script-for-printing-the-library-versions-to-boot_outtxt
519523
path: ci
520524
- name: Install CI-Arduino
521525
run: bash ci/actions_install.sh
@@ -531,8 +535,8 @@ jobs:
531535
# Copy files to WipperSnapper's src/nanopb directory
532536
cp nanopb/pb_common.* nanopb/pb_encode.* nanopb/pb_decode.* src/nanopb
533537
mv nanopb/pb.h src/nanopb/nanopb.pb.h
534-
- name: build platforms
535-
run: python3 ci/build_platform.py ${{ matrix.arduino-platform }} --build_timeout 48000
538+
- name: build ESP8266 platforms
539+
run: python3 ci/build_platform.py ${{ matrix.arduino-platform }} --build_timeout 48000 --include_print_dependencies_header ./src/print_dependencies.h
536540
- name: list build artifacts
537541
run: |
538542
ls
@@ -578,9 +582,9 @@ jobs:
578582
echo >>$GITHUB_ENV WS_VERSION=$(git describe --dirty --tags)
579583
- uses: actions/checkout@v4
580584
with:
581-
repository: adafruit/ci-arduino
585+
repository: tyeth/ci-arduino
586+
ref: WS_ARDUINO_598-preprocessor-script-for-printing-the-library-versions-to-boot_outtxt
582587
path: ci
583-
ref: ci-wippersnapper
584588
- name: Install CI-Arduino
585589
run: bash ci/actions_install.sh
586590
- name: Install extra Arduino libraries
@@ -610,7 +614,7 @@ jobs:
610614
run: |
611615
cp /home/runner/Arduino/libraries/Adafruit_LittlevGL_Glue_Library/lv_conf.h /home/runner/Arduino/libraries
612616
- name: Build for ESP32-SX
613-
run: python3 ci/build_platform.py ${{ matrix.arduino-platform }} --build_timeout 48000
617+
run: python3 ci/build_platform.py ${{ matrix.arduino-platform }} --build_timeout 48000 --include_print_dependencies_header ./src/print_dependencies.h
614618
- name: list
615619
run: |
616620
ls

src/print_dependencies.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#include "print_dependencies.h"
2+
3+
const char *project_dependencies = R"(
4+
Libraries and Versions:
5+
** This is a placeholder, you can fill this in automatically by running arduino-cli and copying the output here. **
6+
7+
Platforms and Versions:
8+
** Board Support Package placeholder **
9+
)";

src/print_dependencies.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#ifndef PROJECT_DEPENDENCIES_H
2+
#define PROJECT_DEPENDENCIES_H
3+
4+
#define PRINT_DEPENDENCIES 0
5+
extern const char *project_dependencies;
6+
#endif // PROJECT_DEPENDENCIES_H

src/provisioning/littlefs/WipperSnapper_LittleFS.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,14 @@
2828
*/
2929
/**************************************************************************/
3030
WipperSnapper_LittleFS::WipperSnapper_LittleFS() {
31+
#if PRINT_DEPENDENCIES
32+
// Print project build dependencies
33+
WS_DEBUG_PRINTLN("Build Dependencies:");
34+
WS_DEBUG_PRINTLN("*********************");
35+
WS_DEBUG_PRINTLN(project_dependencies);
36+
WS_DEBUG_PRINTLN("*********************");
37+
#endif
38+
3139
// Attempt to initialize filesystem
3240
if (!LittleFS.begin()) {
3341
setStatusLEDColor(RED);

src/provisioning/tinyusb/Wippersnapper_FS.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
* BSD license, all text here must be included in any redistribution.
1313
*
1414
*/
15+
1516
#if defined(ARDUINO_MAGTAG29_ESP32S2) || defined(ARDUINO_METRO_ESP32S2) || \
1617
defined(ARDUINO_FUNHOUSE_ESP32S2) || \
1718
defined(ADAFRUIT_PYPORTAL_M4_TITANO) || \
@@ -27,6 +28,7 @@
2728
defined(ARDUINO_ADAFRUIT_FEATHER_ESP32S3_REVTFT) || \
2829
defined(ARDUINO_ADAFRUIT_FEATHER_ESP32S2_REVTFT) || \
2930
defined(ARDUINO_ADAFRUIT_QTPY_ESP32S3_N4R2)
31+
#include "print_dependencies.h"
3032
#include "Wippersnapper_FS.h"
3133
// On-board external flash (QSPI or SPI) macros should already
3234
// defined in your board variant if supported
@@ -89,6 +91,13 @@ bool setVolumeLabel() {
8991
*/
9092
/**************************************************************************/
9193
Wippersnapper_FS::Wippersnapper_FS() {
94+
#if PRINT_DEPENDENCIES
95+
WS_DEBUG_PRINTLN("Build Dependencies:");
96+
WS_DEBUG_PRINTLN("*********************");
97+
WS_DEBUG_PRINTLN(project_dependencies);
98+
WS_DEBUG_PRINTLN("*********************");
99+
WS_PRINTER.flush();
100+
#endif
92101
// Detach USB device during init.
93102
TinyUSBDevice.detach();
94103
// Wait for detach
@@ -277,6 +286,11 @@ bool Wippersnapper_FS::createBootFile() {
277286
bootFile.print("MAC Address: ");
278287
bootFile.println(sMAC);
279288

289+
#if PRINT_DEPENDENCIES
290+
bootFile.println("Build dependencies:");
291+
bootFile.println(project_dependencies);
292+
#endif
293+
280294
// Print ESP-specific info to boot file
281295
#ifdef ARDUINO_ARCH_ESP32
282296
// Get version of ESP-IDF

0 commit comments

Comments
 (0)