Repository navigation
tools: a directory of the build is made on Windows as idempotently as mkdir -p, so two spellings of one directory made at once no longer fail - #43
Merged
Conversation
… mkdir -p, so that two spellings of one directory made at once no longer fail the second The asio lane openssl-upstream-msvc-14.5 of CI run 44690351573 failed its first action, `...failed common.mkdir bin\third_party...`, and skipped everything under it, the two upstream suites among them; its 14.3 twin, the same commands, passed. b2 makes each directory of a target's path once per spelling of it (common.MkDir), and the lane names bin\third_party by two: absolute, for each OpenSSL configuration's own directory (webcpp-third-party.directory), and relative, for the consumers' selections in their variant directories; likewise bin\libs\asio\test\tls, relative for the programs and absolute for the oracle's node-modules.stamp. A dry run of a fresh tree lists both spellings of each. The two mkdirs are independent, so b2 -j runs them at once, and b2's action on Windows, `if not exist "d" mkdir "d"`, fails when the other one makes the directory between its test and its mkdir; elsewhere b2 runs mkdir -p, which does not. tools/webcpp-mkdir.jam, which webcpp.jam loads, gives Windows's action a last line that decides by the directory alone, `if exist "d\" (exit /b 0) else (exit /b 1)`: a mkdir that lost the race is a success, and a directory that cannot be made is still a failure. Under Wine's cmd, b2's own action with the directory already made exits 1 and the new one 0; b2.exe under Wine builds 400 directories each made under both spellings with -j64. The new tools/test/mkdir_test.py dry-runs a project that imports webcpp with b2 believing it is on Windows and checks the action of each directory; without the module it fails. AGENTS.md's b2 facts record the race.
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.
Cause
Job "CI / Own lane (asio, openssl-upstream-msvc-14.5, native)" of run 44690351573 failed its very first action and skipped everything under it, the two upstream suites among them:
The 14.3 twin runs the same commands and passed; neither restored OpenSSL from a cache, both built it from scratch. Nothing in
tools/openssl/build.pyis involved (it only writes inside the configuration directory b2 made before it), and the runner image's move to MSVC 14.52 is unrelated.b2 makes each directory of a target's path once per spelling of it (
common.MkDirdedups by name), and this lane names some directories by two:bin/third_party: absolute for each OpenSSL configuration's own directory (webcpp-third-party.directoryroots the build directory atpath.pwd), relative for each consumer'sopenssl-config-<hash>.selectedin its variant directory;bin/libs/asio/test/tls: relative for the programs, absolute for the oracle'snode-modules.stamp(tools/oracle/oracle.jam).A dry run of a fresh tree (
b2 -n -a toolset=clang libs/asio/test/tls//openssl-upstream) listscommon.mkdir bin/third_partyandcommon.mkdir /.../bin/third_party. The two mkdirs are independent, sob2 -jruns them at once. b2's action on Windows isif not exist "d" mkdir "d", which fails when the other action makes the directory between its test and its mkdir (cmd'smkdirof an existing directory exits 1); elsewhere b2 runsmkdir -p, which cannot fail that way. Most other native own lanes (beast, cobalt, trystero, webrtc, hash c-suites) name theirbin/libs/...test directories both ways too, through the oracle's stamp; only the MSVC lanes run the Windows action.Fix
tools/webcpp-mkdir.jam, loaded bytools/webcpp.jam(so every build that imports webcpp, a user's included, has it), gives Windows's action a last line that decides by the directory alone:A mkdir that lost the race is a success; a directory that cannot be made is still a failure. This fixes the failing operation for every spelling and every concurrent creator, rather than one spelling at a time.
Tests
tools/test/mkdir_test.py: dry-runs a project that imports webcpp with b2 believing it is on Windows and checks, for each directory, b2's test and mkdir and the deciding last line. It fails without the module.-j64: exit 0, all 800 files written, the new action in the log.tools/test/openssl_test.py(MSVC dry-run cases, one configuration built once, interrupted configuration) andtools/test/webcpp_jam_test.pypass.The race itself does not reproduce under Wine (its process start-up is far slower than a runner's), so the evidence for the cause is the CI log, the dry run's two spellings and the action's semantics above.
AGENTS.md's b2 facts record the race and the module.
🤖 Generated with Claude Code