Skip to content

Commit

Permalink
Merge #38857
Browse files Browse the repository at this point in the history
38857: build: adding missing bin/.bootstrap order-only dependency r=bobvawter a=petermattis

Any rule which uses `gofmt` or `goimports` needs to have an order-only
dependency on `bin/.bootstrap`, otherwise the `bin/.bootstrap` rule can
run in parallel causing a race between `bin/gofmt` getting created and
it being used by the rule. This would result in rare "text file busy"
errors when running a partially written `bin/gofmt`.

Release note: None

Co-authored-by: Peter Mattis <[email protected]>
  • Loading branch information
craig[bot] and petermattis committed Jul 15, 2019
2 parents b98f5a6 + 37f2e7f commit 1fa1205
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -1376,7 +1376,7 @@ pkg/sql/lex/tokens.go: pkg/sql/parser/gen/sql.go.tmp
# The lex package is now the primary source for the token constant
# definitions. Modify the code generated by goyacc here to refer to
# the definitions in the lex package.
pkg/sql/parser/sql.go: pkg/sql/parser/gen/sql.go.tmp
pkg/sql/parser/sql.go: pkg/sql/parser/gen/sql.go.tmp | bin/.bootstrap
(echo "// Code generated by goyacc. DO NOT EDIT."; \
echo "// GENERATED FILE DO NOT EDIT"; \
cat $^ | \
Expand Down Expand Up @@ -1413,12 +1413,12 @@ pkg/sql/parser/gen/sql-gen.y: pkg/sql/parser/sql.y pkg/sql/parser/replace_help_r
mv -f $@.tmp $@
rm pkg/sql/parser/gen/types_regex.tmp

pkg/sql/lex/reserved_keywords.go: pkg/sql/parser/sql.y pkg/sql/parser/reserved_keywords.awk
pkg/sql/lex/reserved_keywords.go: pkg/sql/parser/sql.y pkg/sql/parser/reserved_keywords.awk | bin/.bootstrap
awk -f pkg/sql/parser/reserved_keywords.awk < $< > $@.tmp || rm $@.tmp
mv -f $@.tmp $@
gofmt -s -w $@

pkg/sql/lex/keywords.go: pkg/sql/parser/sql.y pkg/sql/lex/all_keywords.go
pkg/sql/lex/keywords.go: pkg/sql/parser/sql.y pkg/sql/lex/all_keywords.go | bin/.bootstrap
go run -tags all-keywords pkg/sql/lex/all_keywords.go < $< > $@.tmp || rm $@.tmp
mv -f $@.tmp $@
gofmt -s -w $@
Expand All @@ -1433,12 +1433,12 @@ sqlparser-unused-unreserved-keywords: pkg/sql/parser/sql.y pkg/sql/parser/unrese
fi \
done

pkg/sql/parser/helpmap_test.go: pkg/sql/parser/gen/sql-gen.y pkg/sql/parser/help_gen_test.sh
pkg/sql/parser/helpmap_test.go: pkg/sql/parser/gen/sql-gen.y pkg/sql/parser/help_gen_test.sh | bin/.bootstrap
@pkg/sql/parser/help_gen_test.sh < $< >$@.tmp || rm $@.tmp
mv -f $@.tmp $@
gofmt -s -w $@

pkg/sql/parser/help_messages.go: pkg/sql/parser/sql.y pkg/sql/parser/help.awk
pkg/sql/parser/help_messages.go: pkg/sql/parser/sql.y pkg/sql/parser/help.awk | bin/.bootstrap
awk -f pkg/sql/parser/help.awk < $< > $@.tmp || rm $@.tmp
mv -f $@.tmp $@
gofmt -s -w $@
Expand Down

0 comments on commit 1fa1205

Please sign in to comment.