diff mbox series

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

Message ID 20200813184947.4042927-1-aduskett@gmail.com
State Superseded
Headers show
Series [1/1] package/mender-artifact: fix module permissions | expand

Commit Message

Adam Duskett Aug. 13, 2020, 6:49 p.m. UTC
From: Adam Duskett <Aduskett@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@northern.tech>
Signed-off-by: Adam Duskett <Aduskett@gmail.com>
---
 package/mender-artifact/mender-artifact.mk | 2 ++
 1 file changed, 2 insertions(+)

Comments

Thomas Petazzoni Aug. 13, 2020, 7:23 p.m. UTC | #1
On Thu, 13 Aug 2020 11:49:47 -0700
aduskett@gmail.com wrote:

> From: Adam Duskett <Aduskett@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@northern.tech>
> Signed-off-by: Adam Duskett <Aduskett@gmail.com>

Thanks, but will this fix the host-mender-artifact download issues as
well ?

Best regards,

Thomas
diff mbox series

Patch

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