#build-harness (2020-04)
Help with the Cloud Posse build-harness https://github.com/cloudposse/build-harness
2020-04-21
![Chris Barlock avatar](https://secure.gravatar.com/avatar/5732d4c371e3b72bd4362f0062fd3848.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0015-72.png)
I’m stumped. I have a little make file:
GO ?= $(shell which go 2>/dev/null)
GOEXT_TMP_DIR := $(shell pwd -P)/tmp
.PHONY: test
test:
export GOPATH=$(GOEXT_TMP_DIR) && \
$(GO) get -u github.com/securego/gosec/cmd/gosec
This go get
command is supposed to get the source files for this gosec
tool, build it and install the binary to $GOPATH/bin. It works fine:
romulus:cicd-test cbarlock$ make -f test.mak
export GOPATH=/Users/cbarlock/vscode/cicd-test/tmp && \
/usr/local/go/bin/go get -u github.com/securego/gosec/cmd/gosec
romulus:cicd-test cbarlock$ ls tmp
bin src
romulus:cicd-test cbarlock$ ls tmp/bin
gosec
But when I run the same target as a build harness extension:
romulus:cicd-test cbarlock$ make test
export GOPATH=/Users/cbarlock/vscode/cicd-test/tmp && \
/usr/local/go/bin/go get -u github.com/securego/gosec/cmd/gosec
romulus:cicd-test cbarlock$ ls tmp
src
Only the source files are downloaded and the binary is not created. Any ideas why this is happening?
![David Schmidt avatar](https://avatars.slack-edge.com/2020-04-21/1077502645890_5c4efc47a53e39444bb4_72.jpg)
Are you actually using the build-harness-extensions
function? There’s a few things that can get confusing about paths and so on if you’re doing things like installing vendor executables and so on.
![Chris Barlock avatar](https://secure.gravatar.com/avatar/5732d4c371e3b72bd4362f0062fd3848.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0015-72.png)
Yes. I didn’t do the work to hook our extensions to the build harness, but our stuff is “installed” in build-harness-extensions/modules/...
.
![Chris Barlock avatar](https://secure.gravatar.com/avatar/5732d4c371e3b72bd4362f0062fd3848.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0015-72.png)
For this gosec
command, I am literally setting the GOPATH to a temp dir, downloading gosec
, running it and deleting it.
![Chris Barlock avatar](https://secure.gravatar.com/avatar/5732d4c371e3b72bd4362f0062fd3848.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0015-72.png)