Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitaly.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Steinhardt <psteinhardt@gitlab.com>2022-11-10 12:24:53 +0300
committerPatrick Steinhardt <psteinhardt@gitlab.com>2022-11-14 11:16:08 +0300
commit01625a5d16cd016512ce69535366fed9e05ba003 (patch)
treec74e9c631e8ea314de0422f1e27081cb675b755f /Makefile
parent8d71600be364ab06185d833d5fb9674d3270bb07 (diff)
Makefile: Fix race in `no-proto-changes` target
The `no-proto-changes` target first regenerates the Protobuf files and then checks whether there are any changes compared to the Protobuf definitions. To regenerate the files, we first delete the target directory that contains the generated code so that we start from a clean slate. This is causing problems though when this target is executed via `make verify`, which besides other targets also executes the `lint` target. Now if the code is getting deleted while the linter runs in parallel then it may happen that linting fails due to the missing code. Now that we have the ability to generate Protobuf code in a different directory thoulgh this is easy to fix. Instead of modifying our source directory, we can just generate Protobuf files in our build directory and compare this directory with our sources. Like this, actual source files files will never get deleted and thus the linter will be happy.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile3
1 files changed, 2 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index dab9819c9..424754abb 100644
--- a/Makefile
+++ b/Makefile
@@ -507,8 +507,9 @@ no-changes:
${Q}${GIT} diff --exit-code
.PHONY: no-proto-changes
+no-proto-changes: PROTO_DEST_DIR := ${BUILD_DIR}/proto-changes
no-proto-changes: proto | ${BUILD_DIR}
- ${Q}${GIT} diff --exit-code -- '*.pb.go'
+ ${Q}${GIT} diff --no-index --exit-code -- "${PROTO_DEST_DIR}" "${SOURCE_DIR}/proto/go"
.PHONY: dump-database-schema
## Dump the clean database schema of Praefect into a file.