Repository navigation
Open
Labels
area: ciGitHub Actions, fbuild, toolchainsdeferredTriage pass could not resolve this; skipped by ci/oldest_issue.pypriority: lowStyle, minor optimization — optionalstatus: triageNeeds initial assessmenttype: featureNew capability or enhancement
Description
Background
Issues #2410 (flag-drift detection) and #2411 (standardized sketches + opt-in PlatformIO comparison) cover a two-way comparison between fbuild and PlatformIO. That's already a big improvement over today's "only fbuild ever runs," but two backends only catch drift between those two.
A third independent reference implementation — arduino-cli — would convert this into a true three-way comparison and give us much higher confidence that any individual backend's flag set isn't subtly wrong.
Why arduino-cli is worth a third slot
- It's the upstream Arduino-team-blessed CLI build tool
- Many users actually compile with it (especially outside the PlatformIO/Teensyduino ecosystem) — so when things compile under arduino-cli but not fbuild, that's a real-user-impact bug
- It uses platform packages directly from
package_*_index.jsonfiles, so its flag set is closest to "what the platform vendor actually shipped" — useful as an independent oracle when fbuild and PlatformIO disagree - Some boards (e.g., several Adafruit/Seeed variants) only have first-class arduino-cli support
Investigation scope (this issue)
This is a research issue, not an implementation issue. Deliverables:
- Confirm arduino-cli supports every board currently in
boards.py(or document gaps) - Compare arduino-cli's
--show-properties/compile -voutput against the flag tables produced by ci: detect compiler-flag drift between fbuild and PlatformIO across all platforms #2410 for at least 3 boards (suggest:teensy41,esp32s3,uno) - Document any flag categories where arduino-cli systematically differs from both fbuild and PlatformIO
- Recommend whether a third-backend job is worth wiring into
build_template.yml(likely: only as a manual diagnostic, like the PlatformIO one in ci: standardize per-platform smoke sketches + opt-in PlatformIO comparison job in build_template.yml #2411)
Acceptance criteria for this investigation
- A markdown report (under
agents/docs/orci/READMEsection) summarizing findings for 3+ representative boards - Concrete recommendation: extend ci: standardize per-platform smoke sketches + opt-in PlatformIO comparison job in build_template.yml #2411's opt-in pattern to a
also_build_with_arduino_cliinput, OR drop the idea with documented reasoning
If the recommendation is positive, a separate implementation issue gets filed.
Related
- ci: detect compiler-flag drift between fbuild and PlatformIO across all platforms #2410 — fbuild ↔ PlatformIO flag drift detection (foundation)
- ci: standardize per-platform smoke sketches + opt-in PlatformIO comparison job in build_template.yml #2411 — standardized sketches + opt-in PlatformIO comparison job (extends the two-way to opt-in form)
- Discovered investigating uncommitted Teensy 4.x PROGMEM workaround on branch
pr-2395
Metadata
Metadata
Assignees
Labels
area: ciGitHub Actions, fbuild, toolchainsdeferredTriage pass could not resolve this; skipped by ci/oldest_issue.pypriority: lowStyle, minor optimization — optionalstatus: triageNeeds initial assessmenttype: featureNew capability or enhancement
Type
Projects
- StatusShow more project fieldsTriage
Activity
zackees commentedon Jun 5, 2026
Investigation: arduino-cli as a third backend
Working through this issue's three deliverables against
ci/boards.py(64 boards),arduino-cli 1.3.1, and the in-flight drift detector from PR #2801(
ci/check_backend_flag_drift.py— not yet merged but already extracts anormalized
(cc_flags, cxx_flags, defines, includes)shape from fbuild andPIO's
build_info_*.json).1. Board coverage of
ci/boards.pyunder arduino-clici/boards.pycurrently defines 64 boards. Mapping eachboard_nametothe closest arduino-cli FQBN:
arduino:*,teensy:avr,esp32:esp32,adafruit:*,SparkFun:apollo3)core install'd.--additional-urls)https://arduino.esp8266.com/stable/package_esp8266com_index.json,https://github.com/earlephilhower/arduino-pico/releases/download/global/package_rp2040_index.json,https://github.com/SpenceKonde/ATTinyCore/...,https://github.com/stm32duino/BoardManagerFiles/...).web(WASM, n/a),atmega8a(no modern core supports ATmega8A explicitly),esp32c5(not inesp32:[email protected]yet),supermini_nrf52840/nice_nano_nrf52840/nrfmicro_nrf52840(community-only variants onpdcook/nRFMicro-Arduino-Core, no Board-Manager index).Coverage table (full)
boards.pynameunoarduino:avr:unonanoarduino:avr:nanoleonardoarduino:avr:leonardonano_everyarduino:megaavr:nona4809uno_r4_wifiarduino:renesas_uno:unor4wifiatmega8aarduino:avr)attiny85ATTinyCore:avr:attinyx5attiny88ATTinyCore:avr:attinyx8attiny4313ATTinyCore:avr:attinyx313ATtiny1604megaTinyCore:megaavr:atxy4ATtiny1616megaTinyCore:megaavr:atxy6digispark-tinydigistump:avr:digispark-tinyesp8266esp8266:esp8266:genericesp32dev/upesy_wroom/esp32dev_qemu/esp32dev_i2s/esp32dev_idf33/esp32dev_idf44esp32:esp32:esp32esp32:[email protected]not possible; theidf33/idf44boards specifically need legacy PIO cores)esp32c2/c3/c6/h2/p4/s2/s3esp32:esp32:esp32cX/...esp32c5esp32:[email protected])esp32rmt_51esp32:esp32:esp32s3seeed_xiao_esp32s3esp32:esp32:XIAO_ESP32S3teensylc/30/31/32/35/36/40/41teensy:avr:teensyXXadafruit_feather_nrf52840_senseadafruit:nrf52:feather52840sensenrf52840_dkadafruit:nrf52:feather52840(closest)xiaoblesense*(3 entries)Seeeduino:nrf52:xiaonRF52840Sensesupermini_nrf52840/nice_nano_nrf52840/nrfmicro_nrf52840rp2040/rp2350rp2040:rp2040:rpipico{,2}sparkfun_xrp_controllerrp2040:rp2040:...(or sparkfun samd)stm32f103c8/cb/tb/f411ceSTMicroelectronics:stm32:GenF{1,4}nucleo_f429zi/nucleo_f439ziSTMicroelectronics:stm32:Nucleo_144stm32h747xiarduino:mbed_giga:gigaarduino_uno_qarduino:zephyr:unoqsam3x8e_duearduino:sam:arduino_due_xsamd21/samd21_zero/samd51j/samd51parduino:samd:*oradafruit:samd:*apollo3_red/apollo3_thing_explorableSparkFun:apollo3:sfe_artemis_atpetc.mgm240SiliconLabs:silabs:thingplusmatterwebBottom line on coverage: ~91 % of
boards.py(58/64) is reachable viaarduino-cli, but ~31 % requires
--additional-urlsfor board-manager URLsthat the project would have to standardize, and 6 boards are genuine gaps
(only one of which,
esp32c5, is likely to close on its own as theesp32:esp32core catches up).2. Three-way flag comparison (
teensy41,esp32s3,uno)Using:
build_info_teensy41.json(root) and.build/pio/teensy41/build_info_Blink.json(PIO baseline that the issue references — both come from the run that PR feat(ci): backend flag-drift detector for fbuild <-> PlatformIO (refs #2410) #2801's drift report used).arduino-cli compile --fqbn <FQBN> --show-properties examples/Blink/Blink.ino(for esp32,cpp_flagsis a@response-file— read the file directly out of~/AppData/Local/Arduino15/packages/esp32/tools/esp32-arduino-libs/.../esp32s3/flags/cpp_flags).I'm scoring only the CXX compile-line flags here (not includes/link/dep
machinery) since those are the ones that change codegen.
2a.
teensy41(cortex-m7, hard float)teensy:avr:teensy41)-Os-O2-O2-flto=auto -fno-fat-lto-objects-std=gnu++17(link side); cxx flags omit it (set by sketch?)-std=gnu++17-std=gnu++14boards.txt.-fno-rtti -fno-exceptions -felide-constructors-fno-rtti -fno-exceptions -felide-constructors-fpermissive/-Wno-error=narrowing-fno-threadsafe-statics-Wall -Wextra -Wno-unused-parameter-Wallonly via common)-Wall-Wextra+ extra-Wno.-nostdlib-mthumb -mcpu=cortex-m7 -mfloat-abi=hard -mfpu=fpv5-d16-ffunction-sections -fdata-sections-MMD-fno-fat-lto-objectsARDUINO=10819,TEENSYDUINO=159ARDUINO=10805,TEENSYDUINO=160,CORE_TEENSY,F_CPU=600000000(noL)ARDUINO=10607(default--show-propertiesstamp; ide_version varies),TEENSYDUINO=157,__IMXRT1062__ARDUINOandTEENSYDUINOnumbers — those are toolchain-version stamps, expected drift, but worth tagging as ignored noise.Conclusion (teensy41): PIO ↔ arduino-cli are extremely close (both
descend from Paul Stoffregen's
boards.txtvia Teensyduino). fbuild is theoutlier on optimization, LTO, RTTI/exceptions,
-nostdlib, and-fpermissive.The drift report from PR #2801 attributes the historical
.progmemsection-type bug to exactly this category — adding arduino-cli as a 3rd
oracle would not have caught the bug on its own (PIO already disagreed
with fbuild) but it would have given a clean tie-breaker: 2 of 3 agree
on the "correct" flag set.
2b.
esp32s3(xtensa LX7)We don't have a current
build_info_Blink.jsonfor esp32s3 on disk, so I'mreading fbuild and PIO defaults from the platform vendor scripts and
comparing against arduino-cli's
cpp_flagsresponse file (the canonicalupstream definition).
pioarduino/[email protected])esp32:esp32:esp32s3→cpp_flagsresponse file)-std=gnu++17(then-std=gnu++2boverride per arduino_libs)-std=gnu++17-std=gnu++2b -std=gnu++17(both in cpp_flags; last wins →gnu++17)-std=gnu++17.-Os-Os-Os-Wno-error=...set-Wno-error=...set-Wno-error=unused-function -Wno-error=unused-variable -Wno-error=unused-but-set-variable -Wno-error=deprecated-declarations -Wno-unused-parameter -Wno-sign-compare -Wno-enum-conversion -Wno-error=uninitialized -Wno-error=maybe-uninitialized -Wno-format-nonliteral -Wno-missing-field-initializers -Wno-error=array-bounds -Wno-write-stringsarduino-esp32package, so the surface should match but might differ if PIO patches the package.-mlongcalls-mlongcalls-mlongcalls -fno-builtin-memcpy -fno-builtin-memset -fno-builtin-bzero -fno-builtin-stpcpy -fno-builtin-strncpy -mdisable-hardware-atomics-fno-builtin-*family because they generate them lazily fromesp-arduino-libs. Worth diffing.-fstack-protector-fstack-protector -fstrict-volatile-bitfields -fno-jump-tables -fno-tree-switch-conversion-fno-exceptions(Arduino-default)-fno-exceptions-fexceptions -fno-rttiARDUINO_HOST_OS,ARDUINO_FQBN,ESP32,CORE_DEBUG_LEVEL,ARDUINO_USB_*ARDUINO_USB_MODE=1 ARDUINO_USB_CDC_ON_BOOT=0 ...(perboards.txt)build.extra_flagsis included.Conclusion (esp32s3): The biggest real divergence here is
-fexceptionsvs-fno-exceptionsand the LX7-fno-builtin-*set. Bothare likely to surface false-positive drift unless the normalizer learns
about them. The version-pinned PIO platform also rev-locks to a specific
arduino-esp32 commit (e.g.
54.03.20→idf-release_v5.3-cfea4f7c), whicharduino-cli's installed core (
3.3.8→v5.5.x) does NOT match — this isthe elephant in the room for esp32 cross-toolchain comparison: arduino-cli
will almost always be running a newer arduino-esp32 than PIO is, so most
of the diff is going to be "arduino-cli is ahead of PIO" rather than "fbuild
disagrees with both".
2c.
uno(avr atmega328p)arduino:avr:uno)-Os-Os-Os-std=gnu++17-std=gnu++11-std=gnu++11-flto-flto-flto-fno-fat-lto-objectscompiler.c.flags, not cpp.flags)-fpermissive-fno-exceptions-fno-threadsafe-statics-w(suppress warnings)-w); fbuild and PIO both turn them back on. This is the documented "why Arduino IDE always says 'compiled successfully'" gotcha.-Wno-error=narrowing-MMDConclusion (uno): Three-way drift is tractable here. The
-wvs no--wdifference is a real, intentional choice (you don't want CI silencing
warnings), so it would need to live on the normalizer's ignore-list when
arduino-cli is the comparand.
3. Integration recommendation
Recommend: implement as a manual opt-in third axis, NOT a default CI
gate, and put it behind the same opt-in pattern #2411 uses for PIO.
Concrete reasoning:
Coverage is good enough (~91 % of
boards.py, ~59 % first-partywithout extra URLs) — comparable to PIO's coverage of the same matrix.
This was the main "is it even feasible?" question; the answer is yes.
arduino-cli's signal value is mostly oracle, not gate. On every
board I checked, PIO and arduino-cli were closer to each other than
either was to fbuild — because both consume the same upstream
boards.txt/platform.txtfiles. That means arduino-cli's mostvaluable role is breaking ties when fbuild and PIO disagree, not
independently catching new drift.
Three real obstacles before this can be a CI gate, not just a
diagnostic:
esp32:[email protected](IDF5.5) is not pinnable to the older release that PIO's
pioarduino/[email protected](IDF 5.4) ships. Most"drift" the detector reports for esp32* will actually be arduino-cli
running ahead.
means
arduino-cli configplumbing to addesp8266,rp2040,STMicroelectronics,Seeeduino,ATTinyCore,megaTinyCore,digistump,SiliconLabsURLs. Doable but a lot of moving parts tokeep current.
webaside) — threeof them (
supermini_nrf52840,nice_nano_nrf52840,nrfmicro_nrf52840) live only on a single GitHub repo(
pdcook/nRFMicro-Arduino-Core) with no Board-Manager index, sothey'd have to be skipped permanently.
PR feat(ci): backend flag-drift detector for fbuild <-> PlatformIO (refs #2410) #2801 isn't merged yet. The drift detector is still in review.
Anything more invasive than a comment here should wait for feat(ci): backend flag-drift detector for fbuild <-> PlatformIO (refs #2410) #2801 to
land — otherwise we're building on top of an unmerged contract.
Suggested next steps (if/when this moves to implementation)
In order, smallest-first:
Land a
ci/install_arduino_cli.pyhelper that bootstrapsarduino-cli into
.build/tools/arduino-cli/(scoped, not system-wide),runs
arduino-cli config initagainst--config-file .build/tools/arduino-cli/arduino-cli.yaml, sets the additional-URLslist as data, and
core installthe cores that matchboards.py.This is the single most-reusable piece and unblocks everything else.
Extend
ci/check_backend_flag_drift.py(after feat(ci): backend flag-drift detector for fbuild <-> PlatformIO (refs #2410) #2801 merges) toaccept
--backend arduino-cliand use the same normalizer. Most ofthe work is in the FQBN-mapping table (see section 1 of this comment)
and in teaching the normalizer about the new ignore-list (
-wfor AVR,the LX7
-fno-builtin-*family for esp32, ARDUINO/TEENSYDUINO versionstamps).
Wire it in as a manual workflow_dispatch job (
also_build_with_arduino_cliinput on
build_template.yml, mirroring ci: standardize per-platform smoke sketches + opt-in PlatformIO comparison job in build_template.yml #2411'salso_build_with_pio),not as a required check. Run it on the 3 representative boards from
this comment plus 2-3 others where the project has historically caught
PIO vs fbuild drift.
Only if step 3 produces actionable signal for >1 month, promote to
a required gate — but only on the subset of boards where arduino-cli's
version pinning aligns with PIO's. (Realistically: avr family + teensy
family. Skip esp32 indefinitely until the version-skew problem is solved.)
Anti-recommendation
Don't try to make arduino-cli a required check on day 1 for any board
that depends on a 3rd-party core or where the PIO platform version is
pinned away from the arduino-cli default. That path leads to either (a)
constantly chasing false-positive drift caused by version skew, or (b)
building a much larger normalizer ignore-list than the project actually
needs.
Reproducible commands
Summary
boards.txt); fbuild is the consistent outlier. arduino-cli's value-add is tie-breaking, not independent gating.workflow_dispatchflag, after feat(ci): backend flag-drift detector for fbuild <-> PlatformIO (refs #2410) #2801 merges. Don't make it a required gate. Start withci/install_arduino_cli.pyas the smallest landable PR.zackees commentedon Aug 20, 2026
Deferred after a current-master audit. The investigation was directionally positive, but the required committed report, separate implementation issue, and real three-board fbuild/PlatformIO/arduino-cli flag comparison were never completed; ESP32-S3 used vendor defaults rather than a current PlatformIO snapshot. Resume after #2410 can produce maintained cross-backend flag tables for the requested boards.