Skip to content

Fix build_files/ sharing between test executables#453

Open
lukstafi wants to merge 2 commits intoahrefs:masterfrom
lukstafi:ludics/task-d079849d-s3/root
Open

Fix build_files/ sharing between test executables#453
lukstafi wants to merge 2 commits intoahrefs:masterfrom
lukstafi:ludics/task-d079849d-s3/root

Conversation

@lukstafi
Copy link
Copy Markdown
Collaborator

Summary

  • Add build_files_prefix config option so each test executable can write to an isolated build_files/<prefix>/ subdirectory instead of the shared flat build_files/
  • Update all 5 dune rules that copy from build_files/ to pass --ocannl_build_files_prefix=<test-name> and use prefixed copy paths
  • Scope clean_up_build_files_on_startup to only delete the prefix subdirectory when a prefix is set

Fixes parallel test execution races where multiple tests produce routines with the same name (gh-ocannl-351 follow-up item 4).

Test plan

  • dune build @check compiles cleanly
  • All 5 build_files-related test rules produce correct output with prefixed paths
  • Tests not using build_files/ are unaffected (default prefix is empty)

🤖 Generated with Claude Code

@lukstafi
Copy link
Copy Markdown
Collaborator Author

@codex review Focus on bugs, correctness issues, and edge cases. Do not check adherence to a spec or plan.

lukstafi and others added 2 commits April 21, 2026 00:43
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>
@lukstafi lukstafi force-pushed the ludics/task-d079849d-s3/root branch from 60dfffa to 45d1c1d Compare April 20, 2026 22:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant