diff options
author | Sami Hiltunen <shiltunen@gitlab.com> | 2023-02-09 13:39:21 +0300 |
---|---|---|
committer | Sami Hiltunen <shiltunen@gitlab.com> | 2023-02-09 13:39:21 +0300 |
commit | 97706c79cc6e5e6e144bd028fbdff950ac49ba18 (patch) | |
tree | 5f4b75869a1a70755765b983d29e528ed87501e3 | |
parent | 3c6adcdc2bee186adb2dd5ff05cdc263ad4cb7e5 (diff) | |
parent | 13f87e714d2addfa3e2f7ad272a8a10cf5ca67f4 (diff) |
Merge branch 'jmd-fix-make-go-build-from-symlink' into 'master'qmnguyen0711/gitaly-proxy-poc
Change dir to SOURCE_DIR prior to go build
Closes #4645
See merge request https://gitlab.com/gitlab-org/gitaly/-/merge_requests/5363
Merged-by: Sami Hiltunen <shiltunen@gitlab.com>
Approved-by: Sami Hiltunen <shiltunen@gitlab.com>
Co-authored-by: john.mcdonnell <jmcdonnell@gitlab.com>
-rw-r--r-- | Makefile | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -618,7 +618,8 @@ ${BUILD_DIR}/intermediate/%: clear-go-build-cache-if-needed .FOR @ # We're building intermediate binaries first which contain a fixed build ID @ # of "TEMP_GITALY_BUILD_ID". In the final binary we replace this build ID with @ # the computed build ID for this binary. - ${Q}go build -o "$@" -ldflags '-B 0x${TEMPORARY_BUILD_ID} ${GO_LDFLAGS}' -tags "${GO_BUILD_TAGS}" $(addprefix ${SOURCE_DIR}/cmd/,$(@F)) + @ # We cd to SOURCE_DIR to avoid corner cases where workdir may be a symlink + ${Q}cd ${SOURCE_DIR} && go build -o "$@" -ldflags '-B 0x${TEMPORARY_BUILD_ID} ${GO_LDFLAGS}' -tags "${GO_BUILD_TAGS}" $(addprefix ${SOURCE_DIR}/cmd/,$(@F)) # This is a build hack to avoid excessive rebuilding of targets. Instead of # depending on the Makefile, we start to depend on tool versions as defined in |