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-05-13 15:26:39 +0300
committerPatrick Steinhardt <psteinhardt@gitlab.com>2022-05-23 08:45:13 +0300
commit1ebdf10b70869a54e46df7291f07142e0cf19fba (patch)
tree66824740a77c199a10f0f7cc300c5c5f753d318c
parent316f0078fa88aa2f1991f197efb425c065d9c6df (diff)
Makefifle: Only replace build IDs on Linux
The Go build chain doesn't write a GNU build ID into executables in case the executable format is not ELF. This is most importantly the case on macOS, which means that our `replace-buildid` tool fails to work on that platform because it cannot find the GNU build ID. Let's fix this by only trying to replace the build ID on Linux.
-rw-r--r--Makefile10
1 files changed, 7 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index 282461c99..792c58f24 100644
--- a/Makefile
+++ b/Makefile
@@ -511,9 +511,13 @@ ${BUILD_DIR}/bin/%: ${BUILD_DIR}/intermediate/% | ${BUILD_DIR}/bin
@ # GNU build-id from the empty string and causing guaranteed collisions.
${Q}GO_BUILD_ID=$$(go tool buildid "$<" || openssl rand -hex 32) && \
GNU_BUILD_ID=$$(echo $$GO_BUILD_ID | sha1sum | cut -d' ' -f1) && \
- go run "${SOURCE_DIR}"/tools/replace-buildid \
- -input "$<" -input-build-id "${TEMPORARY_BUILD_ID}" \
- -output "$@" -output-build-id "$$GNU_BUILD_ID"
+ if test "${OS}" = "Linux"; then \
+ go run "${SOURCE_DIR}"/tools/replace-buildid \
+ -input "$<" -input-build-id "${TEMPORARY_BUILD_ID}" \
+ -output "$@" -output-build-id "$$GNU_BUILD_ID"; \
+ else \
+ install "$<" "$@"; \
+ fi
${BUILD_DIR}/intermediate/gitaly: GO_BUILD_TAGS = ${SERVER_BUILD_TAGS}
${BUILD_DIR}/intermediate/praefect: GO_BUILD_TAGS = ${SERVER_BUILD_TAGS}