diff options
author | Patrick Steinhardt <psteinhardt@gitlab.com> | 2022-05-13 15:26:39 +0300 |
---|---|---|
committer | Patrick Steinhardt <psteinhardt@gitlab.com> | 2022-05-23 08:45:13 +0300 |
commit | 1ebdf10b70869a54e46df7291f07142e0cf19fba (patch) | |
tree | 66824740a77c199a10f0f7cc300c5c5f753d318c | |
parent | 316f0078fa88aa2f1991f197efb425c065d9c6df (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-- | Makefile | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -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} |