You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
bash compile leaves an empty file named -r in the repo root #3867
Reproduced repeatedly on master at ccbdc9de34 (Windows 10, Git Bash). The file is always empty (0 bytes) and lands in the repo root.
Why it matters
It shows up as untracked in git status, so every bash compile dirties a clean working tree. That's noise for anyone (or any agent) whose workflow asserts a clean tree before committing, and the leading - makes it awkward to delete — rm ./-r or rm -- -r is required, plain rm -r is a very different command.
What I ruled out
A quick pass did not find the culprit:
ci/util/create_build_dir.py:148 — subprocess.run(["attrib", "-r", path]) is a list (no shell) and only runs from the rmtree readonly handler, which a clean compile shouldn't hit.
ci/lint/stage_impls.py:207,213 — ["uv", "run", "ci/run-clang-format.py", "-i", "-r", folder] is also a list, no shell.
ci/run-clang-format.py:287 — that -r is an argparse option definition.
Likely a shell=True invocation somewhere in the compile path where a -r argument gets separated from its command, or a stray redirect. ci/util/create_build_dir.py and ci/util/pio_runner.py both build command strings with list2cmdline + shell=True, which would be the place to look first.
I hit this while working on #3864 and did not chase it further, since it is unrelated to that issue. Filing so it is tracked rather than repeatedly deleted by hand.
Acceptance criteria
bash compile <board> --examples <ex> leaves the working tree clean.
The offending invocation is fixed at the source rather than by adding -r to .gitignore.
trigger needs a build that does real work — this initially produced false negatives
2
bash compile teensy41 --examples Audio (example switch → real work)
yes
reproducible trigger found
3
uv run ci/ci-compile.py … (bypass the bash compile wrapper)
yes
not the shell wrapper
4
audit-hook trace of ci-compile.py
—
stack at creation: ci/util/fbuild_runner.py:397 → RunningProcess.wait(), i.e. FastLED was merely waiting on the fbuild child. Only one in-process spawn all run (pio platform show), and no open() of -r. So no FastLED code writes it.
5
fbuild.exe … build -e teensy41 -c directly, without venv Scripts on PATH
no
—
6
same, with venv Scripts on PATH
yes
the difference is fbuild_subprocess_env() prepending the venv, which lets fbuild resolve zccache helpers
7
PATH containing onlyzccache*.exe
yes
isolated to zccache binaries
8
PATH containing only zccache.exe + zccache-daemon.exe (withhold zccache-fp.exe)
no (verified twice, 45.9s real work)
zccache-fp on PATH is the gate
9
fbuild run from a scratch CWD
yes, in the scratch dir
the file is CWD-relative, nothing to do with this repo
So: plain fbuild.exe, run from any directory, with zccache-fp on PATH, drops a 0-byte -r in the CWD on a clean build. No FastLED code is involved — FastLED just happens to invoke fbuild with CWD = repo root.
Additional characterisation:
Created during the Linking firmware.elf stage (caught with a 20 ms watcher snapshotting the verbose log at that instant).
Pre-creating a directory named -r blocks the write and the build still succeeds with no diagnostic — the error is silently swallowed.
Direct zccache-fp invocations (check, check --root ., check -r ., mark-success) do not create it, and zccache-fp check has no -r short flag, so this doesn't look like zccache-fp writing it unprompted.
fbuild embeds zccache fingerprint code (embedded fingerprint check failed for, .zccache_fp.json, stamp_cache.json; the build dir gets .project.zccache_fp.stamp_cache.json), gated on zccache-fp being present.
Two corrections to my original report
My original "What I ruled out" section pointed at create_build_dir.py / pio_runner.pyshell=True call sites. That was the wrong tree entirely — no FastLED Python writes this file.
During the bisection I briefly concluded the file was not CWD-relative. That was a false negative from a no-op build; re-running with timings visible showed it is CWD-relative. Worth flagging because this bug produces false negatives very easily — any verification must confirm the build actually did work (-c, and check the elapsed time).
Closing as not a FastLED bug — root cause is in fbuild/zccache, tracked with a minimal reproduction at FastLED/fbuild#1267. See the investigation above for the full bisection.
Reopening briefly to correct the record and close this properly — the earlier "not planned / no fix available" conclusion was wrong. A fix has now landed.
crates/fbuild-build-arm/src/teensy/teensy_linker.rs passed None as the working directory to run_command, on both the response-file and direct-args branches. So arm-none-eabi-gcc — and the collect2 / lto-wrapper processes it hands off to under -flto=auto -fuse-linker-plugin — ran in whatever cwd the fbuild daemon inherited, normally the user's project root. Those helpers write scratch files relative to the process cwd, and one of them is the 0-byte -r.
fbuild had already fixed this exact thing for the teensy deploy path; sweep_stray_dash_files' neighbouring comment states the remedy outright: "Run the loader in the firmware's own build directory rather than inheriting the daemon's working directory (which is typically the user's project/repo root)." The build path never got the same treatment. It also completes fbuild#261, which redirected the env-based LTO temp dir but left cwd inherited.
The fix passes the output directory as the link cwd, guarded on is_absolute() so a relative output_dir keeps the old behaviour (moving cwd would otherwise relocate the relative -o).
Verification
Same machine, same environment, real teensy41 clean build:
build
repo root
fbuild 2.5.14 (control)
succeeded in 37.7s
./-r CREATED
with the fix
succeeded in 46.4s
clean — stray now at .fbuild/build/release/-r, inside the gitignored tree
Byte-identical artifacts both ways (flash 72704, RAM 81984), so it is purely a relocation of where linker scratch files land. soldr cargo test -p fbuild-build-arm --lib → 204 passed, including two new tests.
Corrections to my earlier comments on this issue
"zccache-fp on PATH is the gate" was wrong. It reproduced with all three zccache binaries present and not twice without zccache-fp.exe, so I called it causal. It was coincidence — this bug is intermittent, which sweep_stray_dash_files' own comment already said. zccache is not involved at all. I've corrected fbuild#1267 too.
"There is no FastLED PR that can fix this, closing as not-planned" was premature. Correct that the fix didn't belong in FastLED — but I stopped at "not our bug" instead of going upstream and fixing it. The fix was a two-line change in a repo I could reach.
The original report's "what I ruled out" section blamed create_build_dir.py / pio_runner.pyshell=True sites. Wrong tree entirely — no FastLED Python ever wrote this file.
Getting the fix
0dd68b24 is on fbuild main but not yet released; FastLED pins fbuild==2.5.14. It arrives here when a release containing it is cut and the pin is bumped — the same gate as fbuild#1263 (see #3864). Until then bash compile will keep dropping the file; remove it with rm -- ./-r, never plain rm -r.
Also fixed along the way: #3868, because the gh pr merge review guard blocked merging the upstream PR by inspecting this checkout's branch instead of the PR being merged.
Activity
zackees commentedon Aug 7, 2026
Investigated — root cause is not in FastLED. Tracked upstream as FastLED/fbuild#1267.
I reproduced this deterministically and narrowed it by elimination. Summary of the bisection:
-rcreated?bash compile teensy41 --examples Blink(repeat, no-op rebuild)bash compile teensy41 --examples Audio(example switch → real work)uv run ci/ci-compile.py …(bypass thebash compilewrapper)ci-compile.pyci/util/fbuild_runner.py:397→RunningProcess.wait(), i.e. FastLED was merely waiting on the fbuild child. Only one in-process spawn all run (pio platform show), and noopen()of-r. So no FastLED code writes it.fbuild.exe … build -e teensy41 -cdirectly, without venvScriptson PATHScriptson PATHfbuild_subprocess_env()prepending the venv, which lets fbuild resolve zccache helperszccache*.exezccache.exe+zccache-daemon.exe(withholdzccache-fp.exe)zccache-fpon PATH is the gateSo: plain
fbuild.exe, run from any directory, withzccache-fpon PATH, drops a 0-byte-rin the CWD on a clean build. No FastLED code is involved — FastLED just happens to invoke fbuild with CWD = repo root.Additional characterisation:
Linking firmware.elfstage (caught with a 20 ms watcher snapshotting the verbose log at that instant).-rblocks the write and the build still succeeds with no diagnostic — the error is silently swallowed.zccache-fpinvocations (check,check --root .,check -r .,mark-success) do not create it, andzccache-fp checkhas no-rshort flag, so this doesn't look like zccache-fp writing it unprompted.embedded fingerprint check failed for,.zccache_fp.json,stamp_cache.json; the build dir gets.project.zccache_fp.stamp_cache.json), gated onzccache-fpbeing present.Two corrections to my original report
create_build_dir.py/pio_runner.pyshell=Truecall sites. That was the wrong tree entirely — no FastLED Python writes this file.-c, and check the elapsed time).Why there is no FastLED PR
Environment versions: fbuild 2.5.14, zccache 1.13.0.
The two FastLED-side "fixes" available are both wrong:
-rto.gitignore— explicitly ruled out by this issue's own acceptance criteria, and it would hide the bug rather than fix it.fbuild_subprocess_env()to stop prepending the venvScriptsdir — that prepend exists deliberately (infra(windows): zccache daemon balloons + locks; PATH-version mismatch breaks fbuild builds #2853) to stop a stray globalzccache.execausing cross-version daemon corruption. Removing it to dodge this would trade a cosmetic stray file for a real correctness hazard.Closing here and tracking at FastLED/fbuild#1267, which carries the minimal reproduction. Reopen if it turns out FastLED is provoking it after all.
zackees commentedon Aug 7, 2026
Closing as not a FastLED bug — root cause is in fbuild/zccache, tracked with a minimal reproduction at FastLED/fbuild#1267. See the investigation above for the full bisection.
fix(teensy): run the link in the build dir, not the inherited cwd (#1268
zackees commentedon Aug 7, 2026
Reopening briefly to correct the record and close this properly — the earlier "not planned / no fix available" conclusion was wrong. A fix has now landed.
zackees commentedon Aug 7, 2026
Fixed upstream — FastLED/fbuild#1268 (merged,
0dd68b24)Root cause
crates/fbuild-build-arm/src/teensy/teensy_linker.rspassedNoneas the working directory torun_command, on both the response-file and direct-args branches. Soarm-none-eabi-gcc— and the collect2 / lto-wrapper processes it hands off to under-flto=auto -fuse-linker-plugin— ran in whatever cwd the fbuild daemon inherited, normally the user's project root. Those helpers write scratch files relative to the process cwd, and one of them is the 0-byte-r.fbuild had already fixed this exact thing for the teensy deploy path;
sweep_stray_dash_files' neighbouring comment states the remedy outright: "Run the loader in the firmware's own build directory rather than inheriting the daemon's working directory (which is typically the user's project/repo root)." The build path never got the same treatment. It also completes fbuild#261, which redirected the env-based LTO temp dir but left cwd inherited.The fix passes the output directory as the link cwd, guarded on
is_absolute()so a relativeoutput_dirkeeps the old behaviour (moving cwd would otherwise relocate the relative-o).Verification
Same machine, same environment, real teensy41 clean build:
./-rCREATED.fbuild/build/release/-r, inside the gitignored treeByte-identical artifacts both ways (flash 72704, RAM 81984), so it is purely a relocation of where linker scratch files land.
soldr cargo test -p fbuild-build-arm --lib→ 204 passed, including two new tests.Corrections to my earlier comments on this issue
zccache-fp.exe, so I called it causal. It was coincidence — this bug is intermittent, whichsweep_stray_dash_files' own comment already said. zccache is not involved at all. I've corrected fbuild#1267 too.create_build_dir.py/pio_runner.pyshell=Truesites. Wrong tree entirely — no FastLED Python ever wrote this file.Getting the fix
0dd68b24is on fbuildmainbut not yet released; FastLED pinsfbuild==2.5.14. It arrives here when a release containing it is cut and the pin is bumped — the same gate as fbuild#1263 (see #3864). Until thenbash compilewill keep dropping the file; remove it withrm -- ./-r, never plainrm -r.Also fixed along the way: #3868, because the
gh pr mergereview guard blocked merging the upstream PR by inspecting this checkout's branch instead of the PR being merged.Closing as completed.
fix(arm): run the link in the build dir for every ARM linker (#1269) (#…
ci: fail board builds that leave stray files in the working tree (#1272)
chore(deps): bump fbuild pin to 2.5.15 (#3871)