crafter-build test: parallel jobs race on git pull in a shared external clone, every test fails #34
Labels
No labels
bug
claude:blocked
claude:done
claude:failed
claude:in-progress
claude:ready
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
Catcrafts/Crafter.Build#34
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
crafter-build testwith the default job count fails every test of a project whose test configurations share an unpinned external dependency. Seen in Crafter.Graphics (26 tests, 56 hardware threads), twice in a row:crafter-build test --jobs=1passes 26 of 26 (three runs).git pullby hand succeeds ("Already up to date").crafter-build
2.1.0-2-gc6b0bba, with local changes that do not touch dependency fetching. Line numbers refer toc6b0bba.Likely cause
Read from the code; I did not instrument it.
RunTestsbuilds the test configurations onjobsworker threads (implementations/Crafter.Build-Test.cpp:530,:604,:654).Configurationcarries its own copy ofexternalDependencies(tc.externalDependencies = cfg.externalDependencies, once per test in itsproject.cpp), including the unpinnedVulkan-HeadersandVulkan-Utility-Libraries.FetchGitrunsgit pullin the shared clone directory (implementations/Crafter.Build-External.cpp:43-74). Nothing serialises that per clone:ProjectCacheMutex(:302) guards the project cache only.Concurrent pulls in one clone race on
.git/FETCH_HEAD; the truncatedithub.com/…in the message looks like a torn read of that file. I did not work out why all 26 fail rather than a few.Suggested fix
depResultsmemoises configurations.FetchGit, so two crafter-build processes are safe too. The cache already keeps a.locknext to each std PCM.ConcurrentCacheRace: several configurations with the same unpinned external dependency, built in parallel.