]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
oeqa/gotoolchain: put writable files in the Go module cache
authorRoss Burton <ross.burton@arm.com>
Mon, 25 Jul 2022 15:53:43 +0000 (16:53 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 25 Jul 2022 21:57:54 +0000 (22:57 +0100)
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.

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/lib/oeqa/selftest/cases/gotoolchain.py

index c809d7c9b140434d6cd38ec3da15694e72c77b03..345f533379cc8ca812baecdffcd00fec0f6423d2 100644 (file)
@@ -43,12 +43,6 @@ class oeGoToolchainSelfTest(OESelftestTestCase):
 
     @classmethod
     def tearDownClass(cls):
-        # Go creates file which are readonly
-        for dirpath, dirnames, filenames in os.walk(cls.tmpdir_SDKQA):
-            for filename in filenames + dirnames:
-                f = os.path.join(dirpath, filename)
-                if not os.path.islink(f):
-                    os.chmod(f, 0o775)
         shutil.rmtree(cls.tmpdir_SDKQA, ignore_errors=True)
         super(oeGoToolchainSelfTest, cls).tearDownClass()
 
@@ -56,6 +50,7 @@ class oeGoToolchainSelfTest(OESelftestTestCase):
         cmd = "cd %s/src/%s/%s; " % (self.go_path, proj, name)
         cmd = cmd + ". %s; " % self.env_SDK
         cmd = cmd + "export GOPATH=%s; " % self.go_path
+        cmd = cmd + "export GOFLAGS=-modcacherw; "
         cmd = cmd + "${CROSS_COMPILE}go %s" % gocmd
         return runCmd(cmd).status