aboutsummaryrefslogtreecommitdiff
path: root/lang/golang
diff options
context:
space:
mode:
authorJeffery To <jeffery.to@gmail.com>2018-12-12 04:23:47 +0800
committerJeffery To <jeffery.to@gmail.com>2018-12-12 04:23:47 +0800
commit0fa7f3c88206654ae48bcebe50ad242cc4a92277 (patch)
treec998c0bcd1d9f15ea69749ecbbe76c9bd9fb249d /lang/golang
parent8a2a06265894c131848bdcf0914f44c0a8cb8a79 (diff)
golang: fix package clean / autoremove, add output whitespace
go 1.11 added modules, which are cached locally. The go developers have decided to make this cache read-only (golang/go#27455), which causes problems with package clean / autoremove (#7635). This adds a call to clear this cache right after building, as currently there is no easy way to hook into autoremove (it may be possible to hook into package clean). This also adds whitespace (blank lines) to certain places in make output, to aid debugging. Signed-off-by: Jeffery To <jeffery.to@gmail.com>
Diffstat (limited to 'lang/golang')
-rw-r--r--lang/golang/golang-package.mk13
1 files changed, 13 insertions, 0 deletions
diff --git a/lang/golang/golang-package.mk b/lang/golang/golang-package.mk
index 11aa212e4..1df4c3fec 100644
--- a/lang/golang/golang-package.mk
+++ b/lang/golang/golang-package.mk
@@ -171,6 +171,7 @@ define GoPackage/Build/Configure
mkdir -p $$$$(dirname $$$$dest) ; \
$(CP) $$$$file $$$$dest ; \
done ; \
+ echo ; \
\
link_contents() { \
local src=$$$$1 ; \
@@ -209,6 +210,7 @@ define GoPackage/Build/Configure
else \
echo "Not building binaries, skipping symlinks" ; \
fi ; \
+ echo ; \
)
endef
@@ -224,16 +226,21 @@ define GoPackage/Build/Compile
CXX=$(TARGET_CXX) \
$(call GoPackage/Environment) ; \
\
+ echo "Finding targets" ; \
targets=$$$$(go list $(GO_PKG_BUILD_PKG)) ; \
for pattern in $(GO_PKG_EXCLUDES); do \
targets=$$$$(echo "$$$$targets" | grep -v "$$$$pattern") ; \
done ; \
+ echo ; \
\
if [ "$(GO_PKG_GO_GENERATE)" = 1 ]; then \
+ echo "Calling go generate" ; \
go generate -v $(1) $$$$targets ; \
+ echo ; \
fi ; \
\
if [ "$(GO_PKG_SOURCE_ONLY)" != 1 ]; then \
+ echo "Building targets" ; \
case $(GO_ARCH) in \
arm) installsuffix="-installsuffix v$(GO_ARM)" ;; \
mips|mipsle) installsuffix="-installsuffix $(GO_MIPS)" ;; \
@@ -250,10 +257,16 @@ define GoPackage/Build/Compile
$(1) \
$$$$targets ; \
retval=$$$$? ; \
+ echo ; \
\
if [ "$$$$retval" -eq 0 ] && [ -z "$(call GoPackage/has_binaries)" ]; then \
echo "No binaries were generated, consider adding GO_PKG_SOURCE_ONLY:=1 to Makefile" ; \
+ echo ; \
fi ; \
+ \
+ echo "Cleaning module download cache (golang/go#27455)" ; \
+ go clean -modcache ; \
+ echo ; \
fi ; \
exit $$$$retval ; \
)