fix(build): #234 use @response file for teensy link on Windows#235
Conversation
Teensy boards (notably teensy41 with ~500 .o files) blew past Windows' ~32 KB CreateProcessW limit at link time, surfacing as "os error 206: The filename or extension is too long". Linux (~128 KB) and macOS (~256 KB) absorbed the same cmdline so CI stayed green while Windows developers were blocked. Mirror the existing ArmLinker (STM32/RP2040/NRF52) and Esp32Linker pattern: on Windows, when args.len() > 50, write the linker args to a hash-named .rsp under output_dir/tmp/ via fbuild_core::response_file::write_response_file and invoke arm-none-eabi-gcc with @<rsp>. Linux/macOS keep the direct invocation. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThis PR adds Windows-specific response file handling to the Teensy linker step. When compiling on Windows with over 50 arguments, the linker arguments are written to a response file with normalized path separators, and the linker is invoked using GCC's ChangesWindows Linker Response File
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
Closes #234.
teensy41with ~500.ofiles) exceeded Windows' ~32 KBCreateProcessWcmdline limit at link time, failing withio error: The filename or extension is too long. (os error 206).ArmLinker(STM32/RP2040/NRF52) andEsp32Linkeralready use GCC@responsefiles for the link step on Windows.TeensyLinkerwas the outlier.ArmLinkerpattern incrates/fbuild-build/src/teensy/teensy_linker.rs: whencfg!(windows) && args.len() > 50, write the linker args tooutput_dir/tmp/fbuild_teensy_link_<hash>.rspvia the sharedfbuild_core::response_file::write_response_file, then invokearm-none-eabi-gcc @<rsp>. Linux/macOS keep the direct invocation.No new utilities, no behavior change for small sketches, no change to the existing Teensy integration test (
crates/fbuild-build/tests/teensy_build.rs).Test plan
uv run soldr cargo fmt --alluv run soldr cargo check --workspace --all-targetsuv run soldr cargo clippy -p fbuild-build --all-targets -- -D warningsuv run soldr cargo test -p fbuild-build --lib(499 passed)bash compile teensy41 --examples Blinkagainst a FastLED checkout producesfirmware.elfand a.fbuild/build/teensy41/release/tmp/fbuild_teensy_link_*.rspfile. (Best verified post-merge in CI/local Windows; companion FastLED PR for the section-conflict compile error is still needed to actually reach the link step on that branch.)🤖 Generated with Claude Code
Summary by CodeRabbit