Repository navigation
fix(renesas): compile the bundled Arduino libraries a sketch includes - #2022
Merged
Merged
Conversation
A UNO R4 WiFi sketch that did `#include <WiFiS3.h>` (or SPI, Wire, RTC, ...) died at the include on fbuild 2.5.51: src/main.cpp:1:10: fatal error: WiFiS3.h: No such file or directory ArduinoCore-renesas ships 23 libraries in the core's own `libraries/` directory, and the Renesas orchestrator never put any of them on the include path or in the compile set, so the core's bundled libraries were unreachable even though Arduino CLI builds the same sketch against renesas_uno 1.6.0 (#2020, the Renesas sibling of #1994 on ESP8266). Fix, following the Teensy/STM32/RP2040/ESP8266 shape: - renesas/framework_libs.rs: resolve the bundled libraries the project actually reaches with the shared library-dependency finder (active `#if` branches, `lib_deps`, compiler include path) and contribute their include dirs and sources. Only reached libraries are added, so `Arduino_FreeRTOS`, `LittleFilesystem`, ... cannot shadow a core header; a plain sketch adds nothing. - RenesasCores::get_framework_libraries() discovers `libraries/<name>` through the shared `discover_framework_libraries` helper. - uno_r4_wifi.json carries `-DARDUINO_UNOWIFIR4`, the `build.board` macro from the core's `boards.txt` (unor4wifi.build.board=UNOWIFIR4) that Arduino's recipe passes on every compilation. Without it WiFiS3 takes its `#else` branch (`ModemClass(D24,D25)`) and fails to compile. - renesas_compiler.rs: the core's own bundled libraries are compiled one standard back (`-std=gnu++14`). fbuild pins GCC 15.2 while the core is validated against the vendor's 7.2.1; in gnu++17 the newer libstdc++ declares `std::byte` from `<cstddef>` (pulled in by `<string>` since GCC 13) and their `using namespace std;` next to the core's `typedef uint8_t byte` makes every unqualified `byte` ambiguous. `-fpermissive` does not downgrade that (verified against the pinned toolchain). Sketch and project sources stay at gnu++17. The per-source flags now flow through one `effective_extra_flags` seam shared by the compile call, the rebuild signature and the artifact cache key (the #404 FSP demotions use it too, so the three paths cannot drift). Verified on Linux with the pinned ARM GCC 15.2.1 and the real renesas_uno 1.6.0 core: before (installed 2.5.50 CLI, same project): `build error: ... fatal error: WiFiS3.h: No such file or directory` after (this branch, clean build): `build succeeded in 10.6s (flash: 33844 bytes, ram: 16640 bytes)`, 8 WiFiS3 translation units compiled from `libraries/WiFiS3/src/` (verified on the real g++ command lines in the daemon log: `-std=gnu++14`), sketch still at `-std=gnu++17`. Tests: new `renesas_acceptance::uno_r4_wifi_sketch_with_bundled_wifis3_library_builds` (ignored, real toolchain: builds the sketch and asserts WiFiS3 sources are in the compile database), 8 selection unit tests (selected / unselected / inactive branch / active defined branch / lib_deps / no libraries / logging / no project sources), 2 compiler tests for the compatibility standard and its rebuild-signature coverage, 1 board-config test for the boards.txt macro. Gates: fbuild-build-arm lib 40 renesas tests pass (whole crate clippy --no-deps clean), fbuild-library 337 passed/8 ignored, fbuild-config 250 passed/1 ignored, pre-existing UNO R4 acceptance test still passes, rustfmt clean, platform boundary 44/43. Fixes #2020
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
|
The selection wrapper and its tests were left untracked by the previous commit, so the orchestrator referenced a module that was not in the tree. No behaviour change: the same code that was built and tested locally (#2020).
14 of 17 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fix(renesas): compile the bundled Arduino libraries a sketch includes
A UNO R4 WiFi sketch that did
#include <WiFiS3.h>(or SPI, Wire, RTC, ...)died at the include on fbuild 2.5.51:
src/main.cpp:1:10: fatal error: WiFiS3.h: No such file or directory
ArduinoCore-renesas ships 23 libraries in the core's own
libraries/directory, and the Renesas orchestrator never put any of them on the include
path or in the compile set, so the core's bundled libraries were unreachable
even though Arduino CLI builds the same sketch against renesas_uno 1.6.0
(#2020, the Renesas sibling of #1994 on ESP8266).
Fix, following the Teensy/STM32/RP2040/ESP8266 shape:
actually reaches with the shared library-dependency finder (active
#ifbranches,
lib_deps, compiler include path) and contribute their includedirs and sources. Only reached libraries are added, so
Arduino_FreeRTOS,LittleFilesystem, ... cannot shadow a core header; a plain sketch addsnothing.
libraries/<name>through the shared
discover_framework_librarieshelper.-DARDUINO_UNOWIFIR4, thebuild.boardmacrofrom the core's
boards.txt(unor4wifi.build.board=UNOWIFIR4) thatArduino's recipe passes on every compilation. Without it WiFiS3 takes its
#elsebranch (ModemClass(D24,D25)) and fails to compile.standard back (
-std=gnu++14). fbuild pins GCC 15.2 while the core isvalidated against the vendor's 7.2.1; in gnu++17 the newer libstdc++
declares
std::bytefrom<cstddef>(pulled in by<string>since GCC13) and their
using namespace std;next to the core'stypedef uint8_t bytemakes every unqualifiedbyteambiguous.-fpermissivedoes not downgrade that (verified against the pinnedtoolchain). Sketch and project sources stay at gnu++17. The per-source
flags now flow through one
effective_extra_flagsseam shared by thecompile call, the rebuild signature and the artifact cache key (the build(renesas): scope -Wno-error= overrides on uno_r4_wifi (return-mismatch, implicit-function-declaration, int-conversion, incompatible-pointer-types) to FSP only #404
FSP demotions use it too, so the three paths cannot drift).
Verified on Linux with the pinned ARM GCC 15.2.1 and the real
renesas_uno 1.6.0 core:
before (installed 2.5.50 CLI, same project):
build error: ... fatal error: WiFiS3.h: No such file or directoryafter (this branch, clean build):
build succeeded in 10.6s (flash: 33844 bytes, ram: 16640 bytes), 8 WiFiS3 translation units compiled fromlibraries/WiFiS3/src/(verified on the real g++ command lines in thedaemon log:
-std=gnu++14), sketch still at-std=gnu++17.Tests: new
renesas_acceptance::uno_r4_wifi_sketch_with_bundled_wifis3_library_builds(ignored, real toolchain: builds the sketch and asserts WiFiS3 sources are in
the compile database), 8 selection unit tests (selected / unselected /
inactive branch / active defined branch / lib_deps / no libraries /
logging / no project sources), 2 compiler tests for the compatibility
standard and its rebuild-signature coverage, 1 board-config test for the
boards.txt macro.
Gates: fbuild-build-arm lib 40 renesas tests pass (whole crate clippy
--no-deps clean), fbuild-library 337 passed/8 ignored, fbuild-config
250 passed/1 ignored, pre-existing UNO R4 acceptance test still passes,
rustfmt clean, platform boundary 44/43.
Fixes #2020