Skip to content

Commit 47747ce

Browse files
committed
make: Fix race generating markdown docs
Sequence the `doctest` and `toc` prerequisites in the `doc` target as both of the prerequisites change the same files. If they run in parallel and start with the same input, and one changes a file but the other does not and the one that does not finishes last, you end up with an unchanged file, wiping out the changes of the first. This can cause the `check-uptodate` target to falsely report the docs are up to date. This seems to have happened when adding the `Pi` variable to the built-in docs. The PR successfully passed CI, yet the table of contents did not contain the entry for `Pi`. Looking at the CI run [1], both `doctest.awk` and `toc.awk` ran close together and the toc should have been updated causing the workspace to be dirty, but because `doctest.awk` takes a lot longer to run on `builtins.md` (as it has to run and format many evy programs), it is likely it generated a file without the updated toc and it all appeared clean. Sequencing these two prerequisites should let `doctest` run to completion first, then `toc` runs, using the output of `doctest` as input. If either make changes, we should now fail the up-to-date check. Link: https://github.com/evylang/evy/actions/runs/10901756581/job/30252189731#step:3:117
1 parent 9acf198 commit 47747ce

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ conform: install
151151
.PHONY: check-fmt-evy conform fmt-evy lint-go lint-node
152152

153153
# --- Docs ---------------------------------------------------------------------
154-
doc: doctest godoc toc usage
154+
doc: godoc usage doctest .WAIT toc
155155

156156
DOCTEST_CMD = ./build-tools/doctest.awk $(md) > $(O)/doctest-out.md && mv $(O)/doctest-out.md $(md)
157157
DOCTESTS = docs/builtins.md docs/spec.md docs/syntax-by-example.md

0 commit comments

Comments
 (0)