Skip to content

Commit a236197

Browse files
committed
Fixed build error on macOS dist
The error was due to an increased git security constraints ... go: downloading github.com/xanzy/ssh-agent v0.2.1 go: downloading gopkg.in/warnings.v0 v0.1.2 error obtaining VCS status: exit status 128 Use -buildvcs=false to disable VCS stamping. Error: failed building for darwin/amd64: exit status 1 failed building for darwin/amd64: exit status 1 task: Failed to run task "dist:macOS_64bit": exit status 1 To fix this I followed the suggestion here elastic/golang-crossbuild#232
1 parent f242332 commit a236197

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Diff for: DistTasks.yml

+4-2
Original file line numberDiff line numberDiff line change
@@ -201,11 +201,12 @@ tasks:
201201
desc: Builds Mac OS X 64 bit binaries
202202
dir: "{{.DIST_DIR}}"
203203
cmds:
204+
# "git config safe.directory" is required until this is fixed https://github.com/elastic/golang-crossbuild/issues/232
204205
- |
205206
docker run -v `pwd`/..:/home/build -w /home/build \
206207
-e CGO_ENABLED=1 \
207208
{{.CONTAINER}}:{{.CONTAINER_TAG}} \
208-
--build-cmd "{{.BUILD_COMMAND}}" \
209+
--build-cmd "git config --global --add safe.directory /home/build && {{.BUILD_COMMAND}}" \
209210
-p "{{.BUILD_PLATFORM}}"
210211
211212
tar cz -C {{.PLATFORM_DIR}} {{.PROJECT_NAME}} -C ../.. LICENSE.txt -f {{.PACKAGE_NAME}}
@@ -235,11 +236,12 @@ tasks:
235236
desc: Builds Mac OS X ARM64 binaries
236237
dir: "{{.DIST_DIR}}"
237238
cmds:
239+
# "git config safe.directory" is required until this is fixed https://github.com/elastic/golang-crossbuild/issues/232
238240
- |
239241
docker run -v `pwd`/..:/home/build -w /home/build \
240242
-e CGO_ENABLED=1 \
241243
{{.CONTAINER}}:{{.CONTAINER_TAG}} \
242-
--build-cmd "{{.BUILD_COMMAND}}" \
244+
--build-cmd "git config --global --add safe.directory /home/build && {{.BUILD_COMMAND}}" \
243245
-p "{{.BUILD_PLATFORM}}"
244246
245247
tar cz -C {{.PLATFORM_DIR}} {{.PROJECT_NAME}} -C ../.. LICENSE.txt -f {{.PACKAGE_NAME}}

0 commit comments

Comments
 (0)