improvement: re-check the subproject PLT outside mix check's parallel section - #246
Merged
Conversation
"meterial" -> "material", and regenerate the DSL cheat sheet.
jimsynz
marked this pull request as ready for review
August 26, 2026 22:43
Contributor
Author
|
reopening to kick off the workflows |
…el section Deleting `_build/*/*.plt.hash` forces dialyxir to re-check the PLT against bb's current source, but it left that check inside `mix check`, where it runs alongside every other tool. The check spends twenty seconds or so reading beams out of `_build/dev`, and a tool that recompiles the project during that window empties the ebin and the consolidated protocol directory underneath it — `bb_example_wx200` and `bb_example_so101` run `mix gettext.extract`, which force-recompiles, and dialyzer halts with "No .beam files to analyze". Priming the PLT in its own step shrinks dialyzer's exposure inside `mix check` to the moment it globs the ebin, and moves the same work out of the parallel section rather than adding any.
dialyzer step racing gettext in _buildmix check's parallel section
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.
Fixes #245 together with beam-bots/bb_example_wx200#97 and
beam-bots/bb_example_so101#91.
Root cause
Not the cache key, and not a stale PLT.
mix gettext.extract --check-up-to-datere-expands the gettext macros by force-recompiling the project
(
mix compile --force-elixir+mix compile.elixir --force), and a forcedrecompile empties
_build/dev/lib/<app>/ebinand.../consolidatedbeforerefilling them. Polled every 50 ms in
bb_example_wx200, that window is abouttwo seconds:
ex_checkruns thegettexttool in parallel withdialyzer. Elixir's buildlock serialises the two compiles — that is what the "Waiting for lock on the
build directory" lines in the failing logs are — but not dialyzer's beam reads,
which happen after it releases the lock: first the PLT check, then the
Path.wildcardinDialyxir.Project.dialyzer_files/0that builds its file list.A wipe landing across both gives exactly the reported failure: the PLT check
can't read a consolidated protocol beam, and the file list comes back empty.
Only
bb_example_wx200andbb_example_so101carry bothgettextanddialyxir, which is why only those two jobs fail —bb_example_so101failedidentically on the
v0.30.1tag push (run 32619948357), so it was never reallyPR-only either. The issue's
consolidate_protocolslead is a red herring: thosetwo are Phoenix apps and don't set it, so they do consolidate in
:dev. Settingit would remove one of the two error lines and leave the empty file list.
What this changes
The
Force a PLT re-checkstep deleted_build/*/*.plt.hashand left there-check itself to
mix check, where it runs alongside every other tool andspends twenty-odd seconds reading every beam in the build directory. That is the
amplifier: with a valid hash, dialyzer's exposure is the ~0.15 s between
releasing the build lock and globing the ebin; with the hash deleted it is the
whole PLT check. This PR primes the PLT in that step instead, so the re-check
still happens — same correctness, same total work, moved out of the parallel
section.
That narrows the window; it doesn't close it. The two
.check.exsPRs aboveclose it, by making the
gettexttool depend ondialyzerso the forcedrecompile runs when nothing else is reading
_build. All three are needed.The first commit is the real source touch used to make the downstream matrix
recompile
bb(a one-character typo fix in thecolorentity's docs, plus theregenerated cheat sheet). It's a genuine fix, so it stays rather than being
reverted.
Verification
Reproduced locally, byte for byte. In
bb_example_wx200withBB_VERSION=localand_build/*/*.plt.hashdeleted, overlappingmix gettext.extract --check-up-to-datewithmix dialyzer:Same file, same empty
files: []as the CI logs. With the.check.exsfix,mix check --no-retrymoves the forced recompile to the last three seconds ofthe run, after dialyzer has finished.
Not reproduced naturally in CI, and I can show why. The
bb_example_wx200and
bb_example_so101jobs pass on this PR — but they also pass on a scratch PRcarrying only the source touch with this workflow unchanged (#247, closed), so
that green is not evidence of a fix. Re-running the 23 Aug job that failed
(run 32674375855, job 97280389283) unchanged, today, also passes. The timings
against the same
_buildcache key have moved a long way since:ex_unitdialyzergettextis gated onex_unit, so it now starts around 50 s in, well clear ofdialyzer's PLT check. That is consistent with a timing race rather than anything
about the branch, and it means CI cannot currently demonstrate either the break
or the fix.
This PR's step does behave as intended (job 98350500869): the PLT check runs
in its own step for 81 s, and
mix dialyzerinsidemix checkthen drops from0:21–0:36 to 0:16 with no PLT-check phase at all.