summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/selftest/cases/gotoolchain.py
diff options
context:
space:
mode:
authorRoss Burton <ross.burton@arm.com>2022-07-25 16:53:43 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-07-25 22:59:01 +0100
commite857abbfcba5ce375235505f139f279bea8c8ef8 (patch)
tree1858e37bd5ce080c3e3a84131922384b3cbeba32 /meta/lib/oeqa/selftest/cases/gotoolchain.py
parent2ace04c8f3ff35aa052d57a771f120529b863f3a (diff)
downloadpoky-e857abbfcba5ce375235505f139f279bea8c8ef8.tar.gz
oeqa/gotoolchain: put writable files in the Go module cache
By default 'go mod' creates read-only files, but that just complicates things. Add -modcacherw to make the cache read/write, so it can be cleaned up without needing to chmod. (From OE-Core rev: 7ff30e0d9fe8527cbc2f8ca84e0300fdc84663b6) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oeqa/selftest/cases/gotoolchain.py')
-rw-r--r--meta/lib/oeqa/selftest/cases/gotoolchain.py7
1 files changed, 1 insertions, 6 deletions
diff --git a/meta/lib/oeqa/selftest/cases/gotoolchain.py b/meta/lib/oeqa/selftest/cases/gotoolchain.py
index c809d7c9b1..345f533379 100644
--- a/meta/lib/oeqa/selftest/cases/gotoolchain.py
+++ b/meta/lib/oeqa/selftest/cases/gotoolchain.py
@@ -43,12 +43,6 @@ class oeGoToolchainSelfTest(OESelftestTestCase):
43 43
44 @classmethod 44 @classmethod
45 def tearDownClass(cls): 45 def tearDownClass(cls):
46 # Go creates file which are readonly
47 for dirpath, dirnames, filenames in os.walk(cls.tmpdir_SDKQA):
48 for filename in filenames + dirnames:
49 f = os.path.join(dirpath, filename)
50 if not os.path.islink(f):
51 os.chmod(f, 0o775)
52 shutil.rmtree(cls.tmpdir_SDKQA, ignore_errors=True) 46 shutil.rmtree(cls.tmpdir_SDKQA, ignore_errors=True)
53 super(oeGoToolchainSelfTest, cls).tearDownClass() 47 super(oeGoToolchainSelfTest, cls).tearDownClass()
54 48
@@ -56,6 +50,7 @@ class oeGoToolchainSelfTest(OESelftestTestCase):
56 cmd = "cd %s/src/%s/%s; " % (self.go_path, proj, name) 50 cmd = "cd %s/src/%s/%s; " % (self.go_path, proj, name)
57 cmd = cmd + ". %s; " % self.env_SDK 51 cmd = cmd + ". %s; " % self.env_SDK
58 cmd = cmd + "export GOPATH=%s; " % self.go_path 52 cmd = cmd + "export GOPATH=%s; " % self.go_path
53 cmd = cmd + "export GOFLAGS=-modcacherw; "
59 cmd = cmd + "${CROSS_COMPILE}go %s" % gocmd 54 cmd = cmd + "${CROSS_COMPILE}go %s" % gocmd
60 return runCmd(cmd).status 55 return runCmd(cmd).status
61 56