diff mbox series

[4/5] buildman: Use out-env for environment output

Message ID 20200417235134.226223-5-sjg@chromium.org
State Accepted
Commit 166a98a426616aa3e9c35d94ea3aaf8e67994e33
Headers show
Series buildman: A few more tweaks | expand

Commit Message

Simon Glass April 17, 2020, 11:51 p.m. UTC
At present the environment used by U-Boot is written to the 'env'
directory. This is fine when the output directory is not the same as the
source directory, but when it is (as with -w) it conflicts with the source
directory of the same name.

Rename 'env' to 'out-env' to fix this.

Signed-off-by: Simon Glass <sjg at chromium.org>
---

 tools/buildman/builderthread.py | 2 +-
 tools/buildman/func_test.py     | 7 +++++++
 2 files changed, 8 insertions(+), 1 deletion(-)

Comments

Simon Glass April 27, 2020, 3:07 a.m. UTC | #1
At present the environment used by U-Boot is written to the 'env'
directory. This is fine when the output directory is not the same as the
source directory, but when it is (as with -w) it conflicts with the source
directory of the same name.

Rename 'env' to 'out-env' to fix this.

Signed-off-by: Simon Glass <sjg at chromium.org>
---

 tools/buildman/builderthread.py | 2 +-
 tools/buildman/func_test.py     | 7 +++++++
 2 files changed, 8 insertions(+), 1 deletion(-)

Applied to u-boot-dm, thanks!
diff mbox series

Patch

diff --git a/tools/buildman/builderthread.py b/tools/buildman/builderthread.py
index fc6e1ab25d..063bbc0145 100644
--- a/tools/buildman/builderthread.py
+++ b/tools/buildman/builderthread.py
@@ -333,7 +333,7 @@  class BuilderThread(threading.Thread):
 
             # Write out the image and function size information and an objdump
             env = result.toolchain.MakeEnvironment(self.builder.full_path)
-            with open(os.path.join(build_dir, 'env'), 'w') as fd:
+            with open(os.path.join(build_dir, 'out-env'), 'w') as fd:
                 for var in sorted(env.keys()):
                     print('%s="%s"' % (var, env[var]), file=fd)
             lines = []
diff --git a/tools/buildman/func_test.py b/tools/buildman/func_test.py
index 8d3325d66f..e11dc8f899 100644
--- a/tools/buildman/func_test.py
+++ b/tools/buildman/func_test.py
@@ -546,6 +546,13 @@  class TestFunctional(unittest.TestCase):
         self.assertEqual(self._builder.count, self._total_builds)
         self.assertEqual(self._builder.fail, 0)
 
+    def testEnvironment(self):
+        """Test that the done and environment files are written to out-env"""
+        self._RunControl('-o', self._output_dir)
+        board0_dir = os.path.join(self._output_dir, 'current', 'board0')
+        self.assertTrue(os.path.exists(os.path.join(board0_dir, 'done')))
+        self.assertTrue(os.path.exists(os.path.join(board0_dir, 'out-env')))
+
     def testWorkInOutput(self):
         """Test the -w option which should write directly to the output dir"""
         board_list = board.Boards()