Skip to content

Commit 4c64fb5

Browse files
peffgitster
authored andcommitted
Documentation/Makefile: fix lint-docs mkdir dependency
Since 8650c62 (doc lint: make "lint-docs" non-.PHONY, 2021-10-15), we put the output for gitlink linter into .build/lint-docs/gitlink. There are order-only dependencies to create the sequence of subdirs like: .build/lint-docs: | .build $(QUIET)mkdir $@ .build/lint-docs/gitlink: | .build/lint-docs $(QUIET)mkdir $@ where each level has to depend on the prior one (since the parent directory must exist for us to create something inside it). But the "howto" and "config" subdirectories of gitlink have the wrong dependency; they depend on "lint-docs", not "lint-docs/gitlink". This usually works out, because the LINT_DOCS_GITLINK targets which depend on "gitlink/howto" also depend on just "gitlink", so the directory gets created anyway. But since we haven't given make an explicit ordering, things can racily happen out of order. If you stick a "sleep 1" in the rule to build "gitlink" like this: ## Lint: gitlink .build/lint-docs/gitlink: | .build/lint-docs - $(QUIET)mkdir $@ + $(QUIET)sleep 1 && mkdir $@ then "make clean; make lint-docs" will fail reliably. Or you can see it as-is just by building the directory in isolation: $ make clean [...] $ make .build/lint-docs/gitlink/howto GEN mergetools-list.made GEN cmd-list.made GEN doc.dep SUBDIR ../ make[1]: 'GIT-VERSION-FILE' is up to date. SUBDIR ../ make[1]: 'GIT-VERSION-FILE' is up to date. mkdir: cannot create directory ‘.build/lint-docs/gitlink/howto’: No such file or directory make: *** [Makefile:476: .build/lint-docs/gitlink/howto] Error 1 The fix is easy: we just need to depend on the correct parent directory. Signed-off-by: Jeff King <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 8650c62 commit 4c64fb5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Documentation/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -493,9 +493,9 @@ print-man1:
493493
## Lint: gitlink
494494
.build/lint-docs/gitlink: | .build/lint-docs
495495
$(QUIET)mkdir $@
496-
.build/lint-docs/gitlink/howto: | .build/lint-docs
496+
.build/lint-docs/gitlink/howto: | .build/lint-docs/gitlink
497497
$(QUIET)mkdir $@
498-
.build/lint-docs/gitlink/config: | .build/lint-docs
498+
.build/lint-docs/gitlink/config: | .build/lint-docs/gitlink
499499
$(QUIET)mkdir $@
500500
LINT_DOCS_GITLINK = $(patsubst %.txt,.build/lint-docs/gitlink/%.ok,$(HOWTO_TXT) $(DOC_DEP_TXT))
501501
$(LINT_DOCS_GITLINK): | .build/lint-docs/gitlink

0 commit comments

Comments
 (0)