[Buildroot] [PATCH 1/1] package/mender-artifact: fix module permissions

aduskett at gmail.com aduskett at gmail.com
Thu Aug 13 18:49:47 UTC 2020


From: Adam Duskett <Aduskett at gmail.com>

Modules downloaded with "go mod" are downloaded as read-only, which the Go
maintainers have intentionally done.
https://github.com/golang/go/issues/27161

As mender-artifact now uses go modules, when cleaning, a user will receive
permission-denied errors due to the above issue.

The fix, however, is relatively straight forward. Setting the "-mod=vendor"
flag in the GO_ENV will set go modules to read/write, which allows
"make clean" to work correctly.

Signed-off-by: Mirza Krak <mirza.krak at northern.tech>
Signed-off-by: Adam Duskett <Aduskett at gmail.com>
---
 package/mender-artifact/mender-artifact.mk | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/package/mender-artifact/mender-artifact.mk b/package/mender-artifact/mender-artifact.mk
index c81ec9ba53..b3869518ed 100644
--- a/package/mender-artifact/mender-artifact.mk
+++ b/package/mender-artifact/mender-artifact.mk
@@ -31,6 +31,8 @@ HOST_MENDER_ARTIFACT_LICENSE_FILES = \
 
 HOST_MENDER_ARTIFACT_DEPENDENCIES = host-xz
 
+HOST_MENDER_ARTIFACT_GO_ENV = GOFLAGS="-mod=vendor"
+
 HOST_MENDER_ARTIFACT_LDFLAGS = -X main.Version=$(HOST_MENDER_ARTIFACT_VERSION)
 
 HOST_MENDER_ARTIFACT_BUILD_TARGETS = cli/mender-artifact
-- 
2.26.2



More information about the buildroot mailing list