Repository navigation
Description
Split out of #1380, which fixed the same class of bug for ESP8266 (#1398).
The exposure
adafruit/ArduinoCore-samd is fetched from GitHub's auto-generated source archive:
// crates/fbuild-library/src/library/samd_core.rs
"https://github.com/adafruit/ArduinoCore-samd/archive/refs/tags/1.7.16.tar.gz"Those archives omit submodules by design. That tag declares two, both under libraries/:
path = libraries/Adafruit_TinyUSB_Arduino
path = libraries/Adafruit_ZeroDMA
So a sketch including a TinyUSB or ZeroDMA header should fail the same way ESP8266's <LittleFS.h> did — inside the core's own tree, with the directory present and empty, and with __has_include still passing so no consumer-side guard catches it.
Why it is not a copy of the ESP8266 fix
ESP8266 was easy because the project publishes a release asset that bundles submodule contents (esp8266-3.1.2.zip). Adafruit publishes no release assets for 1.7.16:
$ gh release view 1.7.16 --repo adafruit/ArduinoCore-samd --json assets -q '.assets[] | .name'
(empty)
So the options are different, and each needs its own verification:
- Submodule-aware fetch —
git clone --recurse-submodulesat the tag. Changes the package fetch path from "download + extract archive" to "clone", whichPackageBasedoes not currently do. - Vendor-published bundle — Adafruit's Arduino package index (
package_adafruit_index.json) points at a prepared core archive; PlatformIO consumes something equivalent. Needs checking whether that artifact actually contains the submodule contents. - Post-unpack sanity check — ESP8266 core cached without the littlefs submodule; any <LittleFS.h> include fails #1380's other suggestion: after extracting a core, verify its declared library headers resolve. Cheap to detect an empty submodule directory at package time; expensive to diagnose at compile time. This is the generalizable one and would have caught ESP8266 too.
Not yet confirmed
I have not reproduced a samd build failure. The reasoning is by analogy with the confirmed ESP8266 case plus the .gitmodules contents at the pinned tag. Someone should verify a TinyUSB-including sketch actually breaks before picking a fix — it is possible those libraries are unused by fbuild's samd builds, in which case this is latent rather than active.
Also worth a look
SiliconLabs/[email protected] declares one submodule, extra/core-api. It does publish a release asset (silabs_arduino_core-2.2.0.zst). Whether extra/core-api is on any include path is unknown — I did not check.
Cores confirmed clean
ArduinoCore-avr, ArduinoCore-mbed, ArduinoCore-API, ATTinyCore — no .gitmodules at their pinned tags.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsTriage
Activity
fix(samd): fetch the core from Adafruit's bundle so submodules come w…
chore: bump version to 2.5.23
chore(deps): move the fbuild pin to 2.5.23, restoring the SAMD boards (…