summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/tests/setup.py
diff options
context:
space:
mode:
authorAlexander Kanavin <alex@linutronix.de>2025-09-29 14:56:09 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2025-10-04 11:16:43 +0100
commite6a1d91e64ab539c1025d5ae3dbe66b5f8ae6aa6 (patch)
tree73d2b5d6d3a87bc5ee90fedb8d63ccd0088cf317 /bitbake/lib/bb/tests/setup.py
parentec7c31497d261f0b8973e8d8aee876775b89b153 (diff)
downloadpoky-e6a1d91e64ab539c1025d5ae3dbe66b5f8ae6aa6.tar.gz
bitbake: bitbake-setup: add 'install-buildtools' command
This basically calls install-buildtools from oe-core/poky, but it ensures via command line parameters that the installation location is stable and the downloads are preserved for reproducibility: $ bin/bitbake-setup install-buildtools Loading settings from /home/alex/bitbake-builds/bitbake-setup.conf ====== Buildtools archive is downloaded into /home/alex/bitbake-builds/yocto-master-testing/buildtools-downloads/20250319141333 and its content installed into /home/alex/bitbake-builds/yocto-master-testing/buildtools ... (output from install-buildtools script) ====== It also detects when buildtools are already installed, and will direct users what to do: ====== alex@Zen2:/srv/work/alex/bitbake$ bin/bitbake-setup install-buildtools Loading settings from /home/alex/bitbake-builds/bitbake-setup.conf Buildtools are already installed in /home/alex/bitbake-builds/yocto-master-testing/buildtools. If you wish to use them, you need to source the the environment setup script e.g. $ . /home/alex/bitbake-builds/yocto-master-testing/buildtools/environment-setup-x86_64-pokysdk-linux You can also re-run bitbake-setup install-buildtools with --force option to force a reinstallation ====== This commits includes fixes by Gyorgy Sarvari <skandigraun@gmail.com> https://github.com/kanavin/bitbake/pull/2 (Bitbake rev: 9fb564b720ff5d29a245ec900c8996da7f5f24a6) Signed-off-by: Alexander Kanavin <alex@linutronix.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/tests/setup.py')
-rw-r--r--bitbake/lib/bb/tests/setup.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/bitbake/lib/bb/tests/setup.py b/bitbake/lib/bb/tests/setup.py
index ab4dbf7621..fb2c15f545 100644
--- a/bitbake/lib/bb/tests/setup.py
+++ b/bitbake/lib/bb/tests/setup.py
@@ -49,6 +49,21 @@ with open(os.path.join(builddir, 'init-build-env'), 'w') as f:
49""" 49"""
50 self.add_file_to_testrepo('scripts/oe-setup-build', oesetupbuild, script=True) 50 self.add_file_to_testrepo('scripts/oe-setup-build', oesetupbuild, script=True)
51 51
52 installbuildtools = """#!/usr/bin/env python3
53import getopt
54import sys
55import os
56
57opts, args = getopt.getopt(sys.argv[1:], "d:", ["downloads-directory="])
58for option, value in opts:
59 if option == '-d':
60 installdir = value
61
62print("Buildtools installed into {}".format(installdir))
63os.makedirs(installdir)
64"""
65 self.add_file_to_testrepo('scripts/install-buildtools', installbuildtools, script=True)
66
52 bitbakeconfigbuild = """#!/usr/bin/env python3 67 bitbakeconfigbuild = """#!/usr/bin/env python3
53import os 68import os
54import sys 69import sys
@@ -224,6 +239,11 @@ print("BBPATH is {{}}".format(os.environ["BBPATH"]))
224 out = self.runbbsetup("update") 239 out = self.runbbsetup("update")
225 self.assertIn("Configuration in {} has not changed".format(buildpath), out[0]) 240 self.assertIn("Configuration in {} has not changed".format(buildpath), out[0])
226 241
242 # install buildtools
243 out = self.runbbsetup("install-buildtools")
244 self.assertIn("Buildtools installed into", out[0])
245 self.assertTrue(os.path.exists(os.path.join(buildpath, 'buildtools')))
246
227 # change a file in the test layer repo, make a new commit and 247 # change a file in the test layer repo, make a new commit and
228 # test that status/update correctly report the change and update the config 248 # test that status/update correctly report the change and update the config
229 prev_test_file_content = test_file_content 249 prev_test_file_content = test_file_content