From 96ad5e8e5d94f799b829e7932a844a7d4c820648 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Mon, 11 Dec 2017 22:56:12 -0500 Subject: [PATCH 01/14] fix: update SSHCOMMAND_URL to v0.7.0 --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 7a8155f0d..9fbe01a42 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ DOKKU_VERSION ?= master -SSHCOMMAND_URL ?= https://raw.githubusercontent.com/dokku/sshcommand/v0.6.0/sshcommand +SSHCOMMAND_URL ?= https://raw.githubusercontent.com/dokku/sshcommand/v0.7.0/sshcommand PLUGN_URL ?= https://github.com/dokku/plugn/releases/download/v0.3.0/plugn_0.3.0_linux_x86_64.tgz SIGIL_URL ?= https://github.com/gliderlabs/sigil/releases/download/v0.4.0/sigil_0.4.0_Linux_x86_64.tgz STACK_URL ?= https://github.com/gliderlabs/herokuish.git From 7a8cc2687df868176563d56a9bda28f7b25591cc Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Mon, 11 Dec 2017 22:56:34 -0500 Subject: [PATCH 02/14] fix: ensure we call apt-get update when calling apt-get install --- contrib/build.Dockerfile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/contrib/build.Dockerfile b/contrib/build.Dockerfile index 17ec3137d..57cbcd89a 100644 --- a/contrib/build.Dockerfile +++ b/contrib/build.Dockerfile @@ -2,8 +2,7 @@ FROM ubuntu:14.04 ENV DEBIAN_FRONTEND=noninteractive -RUN apt-get update -RUN apt-get -y install gcc git build-essential wget ruby-dev ruby1.9.1 lintian rpm help2man man-db +RUN apt-get update && apt-get -y install gcc git build-essential wget ruby-dev ruby1.9.1 lintian rpm help2man man-db RUN command -v fpm > /dev/null || sudo gem install fpm --no-ri --no-rdoc ARG GOLANG_VERSION From 465c6e9a62bef50e484d921cdbffeb5a28f6e2ff Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Mon, 11 Dec 2017 22:59:38 -0500 Subject: [PATCH 03/14] fix: allow lintian to pass on hardening-no-relro --- debian/lintian-overrides | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/debian/lintian-overrides b/debian/lintian-overrides index b567152e9..caaa754f0 100644 --- a/debian/lintian-overrides +++ b/debian/lintian-overrides @@ -3,3 +3,7 @@ dokku: maintainer-script-calls-systemctl postinst:87 dokku: changelog-file-missing-in-native-package dokku: statically-linked-binary dokku: unstripped-binary-or-object + +# The Go compiler is currently unable to produce read-only relocations +# (it produces static binaries). +dokku: hardening-no-relro From 1d46208ac2d9015e5cdde5755a6d8498f77bc175 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Mon, 11 Dec 2017 23:00:25 -0500 Subject: [PATCH 04/14] fix: ensure we have a src-clean make target for the config plugin --- plugins/config/Makefile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/plugins/config/Makefile b/plugins/config/Makefile index 4eb670252..74d8ef36e 100644 --- a/plugins/config/Makefile +++ b/plugins/config/Makefile @@ -23,3 +23,6 @@ subcommands/%: src/subcommands/*/%.go clean: rm -rf commands subcommands + +src-clean: + rm -rf .gitignore src vendor Makefile From 58cc0884450e17b35b071b0d5a322403d8413a7e Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Mon, 11 Dec 2017 23:16:03 -0500 Subject: [PATCH 05/14] feat: converge upon a more standard Makefile for golang plugins --- plugins/network/Makefile | 34 ++++++++++++++++------------------ plugins/repo/Makefile | 16 +++++++++------- 2 files changed, 25 insertions(+), 25 deletions(-) diff --git a/plugins/network/Makefile b/plugins/network/Makefile index c3017156f..5774b0f37 100644 --- a/plugins/network/Makefile +++ b/plugins/network/Makefile @@ -1,29 +1,33 @@ include ../../common.mk +GO_ARGS ?= -a + +SUBCOMMANDS = subcommands/rebuild subcommands/rebuildall subcommands/report subcommands/set +TRIGGERS = install network-build-config network-compute-ports network-config-exists network-get-ipaddr network-get-listeners network-get-port network-get-property network-write-ipaddr network-write-port post-create post-delete build-in-docker: clean docker run --rm \ -v $$PWD/../..:$(GO_REPO_ROOT) \ -w $(GO_REPO_ROOT)/plugins/network \ $(BUILD_IMAGE) \ - bash -c "make build" || exit $$? + bash -c "GO_ARGS='$(GO_ARGS)' make build" || exit $$? build: commands subcommands triggers -subcommands: subcommands/rebuild subcommands/rebuildall subcommands/report subcommands/set -triggers: install network-build-config network-compute-ports network-config-exists network-get-ipaddr network-get-listeners network-get-port network-get-property network-write-ipaddr network-write-port post-create post-delete + commands: **/**/commands.go - go build -a -o commands src/commands/commands.go + go build $(GO_ARGS) -o commands src/commands/commands.go -subcommands/rebuild: **/**/**/rebuild.go - go build -a -o subcommands/rebuild src/subcommands/rebuild/rebuild.go +subcommands: $(SUBCOMMANDS) -subcommands/rebuildall: **/**/**/rebuildall.go - go build -a -o subcommands/rebuildall src/subcommands/rebuildall/rebuildall.go +subcommands/%: src/subcommands/*/%.go + go build $(GO_ARGS) -o $@ $< -subcommands/report: **/**/**/report.go - go build -a -o subcommands/report src/subcommands/report/report.go +clean: + rm -rf commands subcommands network-* install post-create post-delete -subcommands/set: **/**/**/set.go - go build -a -o subcommands/set src/subcommands/set/set.go +src-clean: + rm -rf .gitignore src vendor Makefile + +triggers: $(TRIGGERS) install: **/**/**/install.go go build -a -o install src/triggers/install/install.go @@ -60,9 +64,3 @@ post-create: **/**/**/post-create.go post-delete: **/**/**/post-delete.go go build -a -o post-delete src/triggers/post-delete/post-delete.go - -clean: - rm -rf commands subcommands network-* install post-create post-delete - -src-clean: - rm -rf .gitignore src vendor Makefile diff --git a/plugins/repo/Makefile b/plugins/repo/Makefile index 6c127ac4b..3940279d1 100644 --- a/plugins/repo/Makefile +++ b/plugins/repo/Makefile @@ -1,23 +1,25 @@ include ../../common.mk +GO_ARGS ?= -a + +SUBCOMMANDS = subcommands/gc subcommands/purge-cache + build-in-docker: clean docker run --rm \ -v $$PWD/../..:$(GO_REPO_ROOT) \ -w $(GO_REPO_ROOT)/plugins/repo \ $(BUILD_IMAGE) \ - bash -c "make build" || exit $$? + bash -c "GO_ARGS='$(GO_ARGS)' make build" || exit $$? build: commands subcommands -subcommands: subcommands/gc subcommands/purge-cache commands: **/**/commands.go - go build -a -o commands src/commands/commands.go + go build $(GO_ARGS) -o commands src/commands/commands.go -subcommands/gc: **/**/**/gc.go - go build -a -o subcommands/gc src/subcommands/gc/gc.go +subcommands: $(SUBCOMMANDS) -subcommands/purge-cache: **/**/**/purge-cache.go - go build -a -o subcommands/purge-cache src/subcommands/purge-cache/purge-cache.go +subcommands/%: src/subcommands/*/%.go + go build $(GO_ARGS) -o $@ $< clean: rm -rf commands subcommands From 6bd6cad8fd8b0f2551d65ac583085bf281d9c3bb Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Mon, 11 Dec 2017 23:21:04 -0500 Subject: [PATCH 06/14] refactor: simplify triggers targets --- plugins/network/Makefile | 37 ++----------------------------------- 1 file changed, 2 insertions(+), 35 deletions(-) diff --git a/plugins/network/Makefile b/plugins/network/Makefile index 5774b0f37..a29d16d79 100644 --- a/plugins/network/Makefile +++ b/plugins/network/Makefile @@ -29,38 +29,5 @@ src-clean: triggers: $(TRIGGERS) -install: **/**/**/install.go - go build -a -o install src/triggers/install/install.go - -network-build-config: **/**/**/network-build-config.go - go build -a -o network-build-config src/triggers/network-build-config/network-build-config.go - -network-compute-ports: **/**/**/network-compute-ports.go - go build -a -o network-compute-ports src/triggers/network-compute-ports/network-compute-ports.go - -network-config-exists: **/**/**/network-config-exists.go - go build -a -o network-config-exists src/triggers/network-config-exists/network-config-exists.go - -network-get-ipaddr: **/**/**/network-get-ipaddr.go - go build -a -o network-get-ipaddr src/triggers/network-get-ipaddr/network-get-ipaddr.go - -network-get-listeners: **/**/**/network-get-listeners.go - go build -a -o network-get-listeners src/triggers/network-get-listeners/network-get-listeners.go - -network-get-port: **/**/**/network-get-port.go - go build -a -o network-get-port src/triggers/network-get-port/network-get-port.go - -network-get-property: **/**/**/network-get-property.go - go build -a -o network-get-property src/triggers/network-get-property/network-get-property.go - -network-write-ipaddr: **/**/**/network-write-ipaddr.go - go build -a -o network-write-ipaddr src/triggers/network-write-ipaddr/network-write-ipaddr.go - -network-write-port: **/**/**/network-write-port.go - go build -a -o network-write-port src/triggers/network-write-port/network-write-port.go - -post-create: **/**/**/post-create.go - go build -a -o post-create src/triggers/post-create/post-create.go - -post-delete: **/**/**/post-delete.go - go build -a -o post-delete src/triggers/post-delete/post-delete.go +triggers/%: src/triggers/*/%.go + go build $(GO_ARGS) -o $@ $< From a96c1d644aa5b760062ee7e7b9fadd0f2ac7a693 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Mon, 11 Dec 2017 23:22:11 -0500 Subject: [PATCH 07/14] fix: turn off CGO for all go builds --- plugins/config/Makefile | 4 ++-- plugins/network/Makefile | 6 +++--- plugins/repo/Makefile | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/plugins/config/Makefile b/plugins/config/Makefile index 74d8ef36e..0d2932927 100644 --- a/plugins/config/Makefile +++ b/plugins/config/Makefile @@ -14,12 +14,12 @@ build-in-docker: clean build: commands subcommands commands: **/**/commands.go - go build $(GO_ARGS) -o commands src/commands/commands.go + CGO_ENABLED=0 go build $(GO_ARGS) -o commands src/commands/commands.go subcommands: $(SUBCOMMANDS) subcommands/%: src/subcommands/*/%.go - go build $(GO_ARGS) -o $@ $< + CGO_ENABLED=0 go build $(GO_ARGS) -o $@ $< clean: rm -rf commands subcommands diff --git a/plugins/network/Makefile b/plugins/network/Makefile index a29d16d79..bb25a4fb7 100644 --- a/plugins/network/Makefile +++ b/plugins/network/Makefile @@ -14,12 +14,12 @@ build-in-docker: clean build: commands subcommands triggers commands: **/**/commands.go - go build $(GO_ARGS) -o commands src/commands/commands.go + CGO_ENABLED=0 go build $(GO_ARGS) -o commands src/commands/commands.go subcommands: $(SUBCOMMANDS) subcommands/%: src/subcommands/*/%.go - go build $(GO_ARGS) -o $@ $< + CGO_ENABLED=0 go build $(GO_ARGS) -o $@ $< clean: rm -rf commands subcommands network-* install post-create post-delete @@ -30,4 +30,4 @@ src-clean: triggers: $(TRIGGERS) triggers/%: src/triggers/*/%.go - go build $(GO_ARGS) -o $@ $< + CGO_ENABLED=0 go build $(GO_ARGS) -o $@ $< diff --git a/plugins/repo/Makefile b/plugins/repo/Makefile index 3940279d1..f8ef7c600 100644 --- a/plugins/repo/Makefile +++ b/plugins/repo/Makefile @@ -14,12 +14,12 @@ build-in-docker: clean build: commands subcommands commands: **/**/commands.go - go build $(GO_ARGS) -o commands src/commands/commands.go + CGO_ENABLED=0 go build $(GO_ARGS) -o commands src/commands/commands.go subcommands: $(SUBCOMMANDS) subcommands/%: src/subcommands/*/%.go - go build $(GO_ARGS) -o $@ $< + CGO_ENABLED=0 go build $(GO_ARGS) -o $@ $< clean: rm -rf commands subcommands From 9b431321fac43ee308b59262087f6bbaa5eccf1e Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Mon, 11 Dec 2017 23:22:27 -0500 Subject: [PATCH 08/14] feat: use the built-in net package instead of linking to system --- plugins/config/Makefile | 2 +- plugins/network/Makefile | 2 +- plugins/repo/Makefile | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/config/Makefile b/plugins/config/Makefile index 0d2932927..d087def37 100644 --- a/plugins/config/Makefile +++ b/plugins/config/Makefile @@ -1,6 +1,6 @@ include ../../common.mk -GO_ARGS ?= -a +GO_ARGS ?= -a -tags netgo SUBCOMMANDS = subcommands/export subcommands/get subcommands/set subcommands/unset subcommands/keys subcommands/bundle diff --git a/plugins/network/Makefile b/plugins/network/Makefile index bb25a4fb7..5f7d2cc51 100644 --- a/plugins/network/Makefile +++ b/plugins/network/Makefile @@ -1,6 +1,6 @@ include ../../common.mk -GO_ARGS ?= -a +GO_ARGS ?= -a -tags netgo SUBCOMMANDS = subcommands/rebuild subcommands/rebuildall subcommands/report subcommands/set TRIGGERS = install network-build-config network-compute-ports network-config-exists network-get-ipaddr network-get-listeners network-get-port network-get-property network-write-ipaddr network-write-port post-create post-delete diff --git a/plugins/repo/Makefile b/plugins/repo/Makefile index f8ef7c600..f049b15ff 100644 --- a/plugins/repo/Makefile +++ b/plugins/repo/Makefile @@ -1,6 +1,6 @@ include ../../common.mk -GO_ARGS ?= -a +GO_ARGS ?= -a -tags netgo SUBCOMMANDS = subcommands/gc subcommands/purge-cache From a999f9d4e5d267b4a7caca4c0ad7bd31e3ec0cfc Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Mon, 11 Dec 2017 23:26:33 -0500 Subject: [PATCH 09/14] fix: set the TRIGGERS make variable properly --- plugins/network/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/network/Makefile b/plugins/network/Makefile index 5f7d2cc51..6026278ee 100644 --- a/plugins/network/Makefile +++ b/plugins/network/Makefile @@ -3,7 +3,7 @@ include ../../common.mk GO_ARGS ?= -a -tags netgo SUBCOMMANDS = subcommands/rebuild subcommands/rebuildall subcommands/report subcommands/set -TRIGGERS = install network-build-config network-compute-ports network-config-exists network-get-ipaddr network-get-listeners network-get-port network-get-property network-write-ipaddr network-write-port post-create post-delete +TRIGGERS = triggers/install triggers/network-build-config triggers/network-compute-ports triggers/network-config-exists triggers/network-get-ipaddr triggers/network-get-listeners triggers/network-get-port triggers/network-get-property triggers/network-write-ipaddr triggers/network-write-port triggers/post-create triggers/post-delete build-in-docker: clean docker run --rm \ -v $$PWD/../..:$(GO_REPO_ROOT) \ From 228eb9ed7a8e0a924c5db5c21bc2d9a49003863d Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Mon, 11 Dec 2017 23:43:59 -0500 Subject: [PATCH 10/14] revert: re-enable CGO_ENABLED=0 --- plugins/config/Makefile | 6 +++--- plugins/network/Makefile | 8 ++++---- plugins/repo/Makefile | 6 +++--- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/plugins/config/Makefile b/plugins/config/Makefile index d087def37..1a14616e4 100644 --- a/plugins/config/Makefile +++ b/plugins/config/Makefile @@ -1,7 +1,7 @@ include ../../common.mk GO_ARGS ?= -a -tags netgo - +CGO_ENABLED ?= 1 SUBCOMMANDS = subcommands/export subcommands/get subcommands/set subcommands/unset subcommands/keys subcommands/bundle build-in-docker: clean @@ -14,12 +14,12 @@ build-in-docker: clean build: commands subcommands commands: **/**/commands.go - CGO_ENABLED=0 go build $(GO_ARGS) -o commands src/commands/commands.go + CGO_ENABLED=$(CGO_ENABLED) go build $(GO_ARGS) -o commands src/commands/commands.go subcommands: $(SUBCOMMANDS) subcommands/%: src/subcommands/*/%.go - CGO_ENABLED=0 go build $(GO_ARGS) -o $@ $< + CGO_ENABLED=$(CGO_ENABLED) go build $(GO_ARGS) -o $@ $< clean: rm -rf commands subcommands diff --git a/plugins/network/Makefile b/plugins/network/Makefile index 6026278ee..3d5420401 100644 --- a/plugins/network/Makefile +++ b/plugins/network/Makefile @@ -1,7 +1,7 @@ include ../../common.mk GO_ARGS ?= -a -tags netgo - +CGO_ENABLED ?= 1 SUBCOMMANDS = subcommands/rebuild subcommands/rebuildall subcommands/report subcommands/set TRIGGERS = triggers/install triggers/network-build-config triggers/network-compute-ports triggers/network-config-exists triggers/network-get-ipaddr triggers/network-get-listeners triggers/network-get-port triggers/network-get-property triggers/network-write-ipaddr triggers/network-write-port triggers/post-create triggers/post-delete build-in-docker: clean @@ -14,12 +14,12 @@ build-in-docker: clean build: commands subcommands triggers commands: **/**/commands.go - CGO_ENABLED=0 go build $(GO_ARGS) -o commands src/commands/commands.go + CGO_ENABLED=$(CGO_ENABLED) go build $(GO_ARGS) -o commands src/commands/commands.go subcommands: $(SUBCOMMANDS) subcommands/%: src/subcommands/*/%.go - CGO_ENABLED=0 go build $(GO_ARGS) -o $@ $< + CGO_ENABLED=$(CGO_ENABLED) go build $(GO_ARGS) -o $@ $< clean: rm -rf commands subcommands network-* install post-create post-delete @@ -30,4 +30,4 @@ src-clean: triggers: $(TRIGGERS) triggers/%: src/triggers/*/%.go - CGO_ENABLED=0 go build $(GO_ARGS) -o $@ $< + CGO_ENABLED=$(CGO_ENABLED) go build $(GO_ARGS) -o $@ $< diff --git a/plugins/repo/Makefile b/plugins/repo/Makefile index f049b15ff..dd33ee878 100644 --- a/plugins/repo/Makefile +++ b/plugins/repo/Makefile @@ -1,7 +1,7 @@ include ../../common.mk GO_ARGS ?= -a -tags netgo - +CGO_ENABLED ?= 1 SUBCOMMANDS = subcommands/gc subcommands/purge-cache build-in-docker: clean @@ -14,12 +14,12 @@ build-in-docker: clean build: commands subcommands commands: **/**/commands.go - CGO_ENABLED=0 go build $(GO_ARGS) -o commands src/commands/commands.go + CGO_ENABLED=$(CGO_ENABLED) go build $(GO_ARGS) -o commands src/commands/commands.go subcommands: $(SUBCOMMANDS) subcommands/%: src/subcommands/*/%.go - CGO_ENABLED=0 go build $(GO_ARGS) -o $@ $< + CGO_ENABLED=$(CGO_ENABLED) go build $(GO_ARGS) -o $@ $< clean: rm -rf commands subcommands From b4492274672eea64c8e0e737671086b7fc534092 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Mon, 11 Dec 2017 23:46:08 -0500 Subject: [PATCH 11/14] revert: re-enable system net usage --- plugins/config/Makefile | 2 +- plugins/network/Makefile | 2 +- plugins/repo/Makefile | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/config/Makefile b/plugins/config/Makefile index 1a14616e4..d975333ba 100644 --- a/plugins/config/Makefile +++ b/plugins/config/Makefile @@ -1,6 +1,6 @@ include ../../common.mk -GO_ARGS ?= -a -tags netgo +GO_ARGS ?= -a CGO_ENABLED ?= 1 SUBCOMMANDS = subcommands/export subcommands/get subcommands/set subcommands/unset subcommands/keys subcommands/bundle diff --git a/plugins/network/Makefile b/plugins/network/Makefile index 3d5420401..f9d7641a9 100644 --- a/plugins/network/Makefile +++ b/plugins/network/Makefile @@ -1,6 +1,6 @@ include ../../common.mk -GO_ARGS ?= -a -tags netgo +GO_ARGS ?= -a CGO_ENABLED ?= 1 SUBCOMMANDS = subcommands/rebuild subcommands/rebuildall subcommands/report subcommands/set TRIGGERS = triggers/install triggers/network-build-config triggers/network-compute-ports triggers/network-config-exists triggers/network-get-ipaddr triggers/network-get-listeners triggers/network-get-port triggers/network-get-property triggers/network-write-ipaddr triggers/network-write-port triggers/post-create triggers/post-delete diff --git a/plugins/repo/Makefile b/plugins/repo/Makefile index dd33ee878..f62dc7d8b 100644 --- a/plugins/repo/Makefile +++ b/plugins/repo/Makefile @@ -1,6 +1,6 @@ include ../../common.mk -GO_ARGS ?= -a -tags netgo +GO_ARGS ?= -a CGO_ENABLED ?= 1 SUBCOMMANDS = subcommands/gc subcommands/purge-cache From 64252b282a427cb16b7781a90967b8fb02da722a Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Mon, 11 Dec 2017 23:58:50 -0500 Subject: [PATCH 12/14] hack: ignore libc dependency --- debian/lintian-overrides | 3 +++ 1 file changed, 3 insertions(+) diff --git a/debian/lintian-overrides b/debian/lintian-overrides index caaa754f0..52a34c0e4 100644 --- a/debian/lintian-overrides +++ b/debian/lintian-overrides @@ -7,3 +7,6 @@ dokku: unstripped-binary-or-object # The Go compiler is currently unable to produce read-only relocations # (it produces static binaries). dokku: hardening-no-relro + +# Built golang binaries link to libc +dokku: missing-dependency-on-libc From 5d5ede2b85bcc26786c2c230f6bc2a564aff24b9 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Tue, 12 Dec 2017 00:09:36 -0500 Subject: [PATCH 13/14] revert: drop reference to CGO_ENABLED completely --- plugins/config/Makefile | 6 +++--- plugins/network/Makefile | 8 ++++---- plugins/repo/Makefile | 6 +++--- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/plugins/config/Makefile b/plugins/config/Makefile index d975333ba..74d8ef36e 100644 --- a/plugins/config/Makefile +++ b/plugins/config/Makefile @@ -1,7 +1,7 @@ include ../../common.mk GO_ARGS ?= -a -CGO_ENABLED ?= 1 + SUBCOMMANDS = subcommands/export subcommands/get subcommands/set subcommands/unset subcommands/keys subcommands/bundle build-in-docker: clean @@ -14,12 +14,12 @@ build-in-docker: clean build: commands subcommands commands: **/**/commands.go - CGO_ENABLED=$(CGO_ENABLED) go build $(GO_ARGS) -o commands src/commands/commands.go + go build $(GO_ARGS) -o commands src/commands/commands.go subcommands: $(SUBCOMMANDS) subcommands/%: src/subcommands/*/%.go - CGO_ENABLED=$(CGO_ENABLED) go build $(GO_ARGS) -o $@ $< + go build $(GO_ARGS) -o $@ $< clean: rm -rf commands subcommands diff --git a/plugins/network/Makefile b/plugins/network/Makefile index f9d7641a9..74084bae6 100644 --- a/plugins/network/Makefile +++ b/plugins/network/Makefile @@ -1,7 +1,7 @@ include ../../common.mk GO_ARGS ?= -a -CGO_ENABLED ?= 1 + SUBCOMMANDS = subcommands/rebuild subcommands/rebuildall subcommands/report subcommands/set TRIGGERS = triggers/install triggers/network-build-config triggers/network-compute-ports triggers/network-config-exists triggers/network-get-ipaddr triggers/network-get-listeners triggers/network-get-port triggers/network-get-property triggers/network-write-ipaddr triggers/network-write-port triggers/post-create triggers/post-delete build-in-docker: clean @@ -14,12 +14,12 @@ build-in-docker: clean build: commands subcommands triggers commands: **/**/commands.go - CGO_ENABLED=$(CGO_ENABLED) go build $(GO_ARGS) -o commands src/commands/commands.go + go build $(GO_ARGS) -o commands src/commands/commands.go subcommands: $(SUBCOMMANDS) subcommands/%: src/subcommands/*/%.go - CGO_ENABLED=$(CGO_ENABLED) go build $(GO_ARGS) -o $@ $< + go build $(GO_ARGS) -o $@ $< clean: rm -rf commands subcommands network-* install post-create post-delete @@ -30,4 +30,4 @@ src-clean: triggers: $(TRIGGERS) triggers/%: src/triggers/*/%.go - CGO_ENABLED=$(CGO_ENABLED) go build $(GO_ARGS) -o $@ $< + go build $(GO_ARGS) -o $@ $< diff --git a/plugins/repo/Makefile b/plugins/repo/Makefile index f62dc7d8b..3940279d1 100644 --- a/plugins/repo/Makefile +++ b/plugins/repo/Makefile @@ -1,7 +1,7 @@ include ../../common.mk GO_ARGS ?= -a -CGO_ENABLED ?= 1 + SUBCOMMANDS = subcommands/gc subcommands/purge-cache build-in-docker: clean @@ -14,12 +14,12 @@ build-in-docker: clean build: commands subcommands commands: **/**/commands.go - CGO_ENABLED=$(CGO_ENABLED) go build $(GO_ARGS) -o commands src/commands/commands.go + go build $(GO_ARGS) -o commands src/commands/commands.go subcommands: $(SUBCOMMANDS) subcommands/%: src/subcommands/*/%.go - CGO_ENABLED=$(CGO_ENABLED) go build $(GO_ARGS) -o $@ $< + go build $(GO_ARGS) -o $@ $< clean: rm -rf commands subcommands From 39abbdc5dd106b958c94414168b456f3288e8573 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Tue, 12 Dec 2017 00:22:18 -0500 Subject: [PATCH 14/14] fix: ensure the trigger is moved into the correct directory --- plugins/network/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/network/Makefile b/plugins/network/Makefile index 74084bae6..2d6a5770d 100644 --- a/plugins/network/Makefile +++ b/plugins/network/Makefile @@ -31,3 +31,4 @@ triggers: $(TRIGGERS) triggers/%: src/triggers/*/%.go go build $(GO_ARGS) -o $@ $< + mv $@ .