Repository navigation
build(tests): pass test sources relatively so object names stay short (#2887) - #3753
Merged
Merged
Conversation
Closes #2887. The build system derives each object file's name from the source path it is handed. tests/meson.build passed absolute paths: test_source_abs = path_norm_root + '/tests/' + test_file so the entire absolute path got flattened into the object name: C__Users_niteris_dev_fastled_.claude_worktrees_<branch>_tests_misc_foo.cpp.obj In a normal checkout that is merely ugly. Under .claude/worktrees/<branch>/ the encoded name grows with the worktree path and pushes the full object path past Windows MAX_PATH, which is what broke `bash test --cpp` inside worktrees. `test_file` is already relative to tests/, so the absolute prefix was pure overhead. Passing it directly collapses the object name to misc_foo.cpp.obj. The same fix applies to the three test_shared_objs sources. Measured in a worktree whose root path is 91 characters: longest object path 289 -> 237 chars absolute-mangled objs 403 -> 0 237 is under MAX_PATH, so the build no longer depends on the host having long-path support enabled -- which is why this reproduced for the reporter but not on a machine with LongPathsEnabled=1. The issue suggested shortening the worktree path, moving worktrees outside the repo, or requiring long-path setup. None is needed: nothing about the path layout changes, and no per-developer machine setup is required. Validated: 357/357 on clean builds in both the main checkout and a worktree; lint green. Co-Authored-By: Claude <[email protected]>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughMeson test builds now provide relative source paths for shared test objects and per-test DLL sources. Comments document how these paths affect generated object names and Windows path-length behavior; test runner wiring and PCH usage remain unchanged. ChangesMeson test source path normalization
Estimated code review effort: 2 (Simple) | ~10 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 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 |
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.
Closes #2887.
Root cause — not what the issue guessed
The build system derives each object file's name from the source path it is handed.
tests/meson.buildpassed absolute paths:so the entire absolute path got flattened into the object name:
In a normal checkout that's merely ugly. Under
.claude/worktrees/<branch>/the encoded name grows with the worktree path — it's the worktree path, twice: once as the real directory, once flattened inside the filename. That's what pushed object paths past Windows MAX_PATH.test_fileis already relative totests/, so the absolute prefix was pure overhead. Passing it directly collapses the object name tomisc_foo.cpp.obj. The same applies to the threetest_shared_objssources.Measured, in a real worktree
Reproduced in a worktree with a 91-character root path:
237 is under MAX_PATH (260), so the build no longer depends on the host having long-path support enabled.
That also explains the reporting gap: this machine has
LongPathsEnabled=1andcore.longpaths=true, and I confirmed a 289-char object path building fine here. The bug is real, it just needs a host without long-path support — which is the default on Windows.Why not the suggested fixes
The issue proposed shortening the worktree path, moving worktrees outside the repo, or requiring long-path setup. None is needed, and each has a cost:
clud-prworkflow relies onLongPathsEnabledpushes per-developer machine setup onto every contributor, and silently doesn't help the ones who skip itThis changes nothing about path layout and requires no machine setup — the encoded name simply stops carrying a path it never needed.
Validation
bash lintgreen0 of 403objects still use absolute-mangled names after the changeRepro worktrees were removed afterwards; no leftovers.
🤖 Generated with Claude Code
Summary by CodeRabbit