Commit fc2d61c
fix(library-select): honor Arduino library spec for 1.0 flat layout; release v2.2.6
Closes #267 (Fix 2 — the scanner correctness fix).
## The bug
`fbuild 2.2.5` fails to build any sketch for `teensy41`:
fatal error: ft2build.h: No such file or directory
23 | #include <ft2build.h>
compilation terminated.
The offending file is `framework-arduinoteensy/libraries/ssd1351/fontconvert/fontconvert.c`
— a *host-only* desktop tool that links `-lfreetype`. ssd1351 ships it
as a font preprocessor; it was never intended to be ARM-cross-compiled.
## Root cause
`collect_library_sources` in `framework_library.rs` walked the entire
library directory recursively for 1.0 flat-layout libraries (no `src/`),
violating the Arduino library specification. The spec says:
- **1.5 recursive layout** (has `src/`): scan `src/**` only.
- **1.0 flat layout** (no `src/`): scan root *non-recursively* plus
the literal `utility/` subdirectory.
Subdirectories like `fontconvert/`, `util/`, `Fonts/`, `examples/`,
and `extras/` must be ignored. The ssd1351 author parked `fontconvert.c`
in `fontconvert/` (not `utility/`) precisely so Arduino IDE / PlatformIO
would skip it. fbuild's recursive walk swept it in.
## The fix
Rewrite `collect_library_sources` to dispatch on layout:
- 1.5 (has `src/`): recurse into `src/` only — already correct.
- 1.0 (no `src/`): `collect_root_level_sources` (non-recursive) +
recurse into `utility/` only.
This matches `arduino-cli` exactly and protects fbuild from any
well-formed library shipping companion tooling in a non-`utility/`
subdirectory.
## Tests
- `collect_library_sources_flat_layout_arduino_spec` — fixture mimics
ssd1351 (root .cpp + utility/ + fontconvert/ + util/ + Fonts/ +
examples/). Asserts only root + utility/ are returned; fontconvert/
(with the `#include <ft2build.h>` that breaks the build), util/,
Fonts/, and examples/ are dropped.
- `collect_library_sources_recursive_layout_arduino_spec` — fixture
with `src/SPI.cpp`, `src/sub/bar.cpp`, root-level `baz.cpp`,
and `examples/`. Asserts only `src/**` is returned; root `baz.cpp`
and examples/ are dropped.
Full workspace cargo check / clippy / fmt / test all green.
## Release v2.2.6
Patch release rolling up the #267 scanner-correctness fix. Both teensy41
regressions from earlier today (#261 LTO tmpdir, #263 bundled FastLED
dup) carry over from v2.2.5.
Cargo.toml + pyproject.toml bumped to 2.2.6.
## Deferred (out of scope for this PR)
Fix 1 from #267 — investigate why ssd1351 is reaching the compile set
at all when Blink doesn't `#include <ssd1351.h>` — is a separate
LDF-leak investigation. With Fix 2 in place, even if ssd1351 IS
selected, only `ssd1351.cpp` at the root would be compiled (which
should cross-compile fine for ARM). The user-reported build failure
is resolved.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 48bf377 commit fc2d61c
4 files changed
Lines changed: 171 additions & 38 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
| 21 | + | |
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| |||
Lines changed: 155 additions & 22 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
80 | | - | |
| 80 | + | |
| 81 | + | |
81 | 82 | | |
82 | | - | |
83 | | - | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
84 | 98 | | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | 99 | | |
95 | | - | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
96 | 114 | | |
97 | 115 | | |
98 | 116 | | |
99 | 117 | | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
100 | 135 | | |
101 | 136 | | |
102 | 137 | | |
| |||
117 | 152 | | |
118 | 153 | | |
119 | 154 | | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
| 155 | + | |
| 156 | + | |
129 | 157 | | |
130 | 158 | | |
131 | 159 | | |
132 | 160 | | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
133 | 170 | | |
134 | 171 | | |
135 | 172 | | |
| |||
164 | 201 | | |
165 | 202 | | |
166 | 203 | | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
167 | 300 | | |
168 | 301 | | |
169 | 302 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
0 commit comments