Fix build_files/ sharing between test executables#453
Open
lukstafi wants to merge 2 commits intoahrefs:masterfrom
Open
Fix build_files/ sharing between test executables#453lukstafi wants to merge 2 commits intoahrefs:masterfrom
lukstafi wants to merge 2 commits intoahrefs:masterfrom
Conversation
Collaborator
Author
|
@codex review Focus on bugs, correctness issues, and edge cases. Do not check adherence to a spec or plan. |
Multiple test executables write to the same build_files/ directory, causing races when dune runs them in parallel. Add a build_files_prefix option so each test uses build_files/<prefix>/ as its output directory. - Add build_files_prefix config option (cmdline/env/config file) - Update build_file() to create prefixed subdirectories - Scope clean_up_build_files_on_startup to prefix subdirectory when set - Update all 5 dune rules that copy from build_files/ to use prefixed paths - Document new option in ocannl_config.example Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
When no build_files_prefix is set, startup cleanup removes the entire build_files/ tree. The previous Sys.remove call fails on subdirectory entries left by prefixed test runs. Recurse into subdirectories before removing them. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
60dfffa to
45d1c1d
Compare
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.
Summary
build_files_prefixconfig option so each test executable can write to an isolatedbuild_files/<prefix>/subdirectory instead of the shared flatbuild_files/build_files/to pass--ocannl_build_files_prefix=<test-name>and use prefixed copy pathsclean_up_build_files_on_startupto only delete the prefix subdirectory when a prefix is setFixes parallel test execution races where multiple tests produce routines with the same name (gh-ocannl-351 follow-up item 4).
Test plan
dune build @checkcompiles cleanlybuild_files/are unaffected (default prefix is empty)🤖 Generated with Claude Code