osmith has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/40842?usp=email )
Change subject: testenv: pass targets to osmo-dev's gen_makefile ......................................................................
testenv: pass targets to osmo-dev's gen_makefile
Pass the targets we are about to build to osmo-dev's gen_makefile script. This has two advantages:
1) Check early if a target isn't known by the current osmo-dev version, displaying a useful error to the user instead of just failing during make later on:
ERROR: filter_projects_deps_targets: can't find project osmo-new-project in projects_deps!
[testenv] gen_makefile.py from osmo-dev failed! [testenv] Your osmo-dev.git clone might be outdated, try: [testenv] $ git -C /home/user/code/osmo-dev pull
2) Parsing the generated Makefile when running "make" after generating it doesn't cause a noticable delay anymore. On my machine (with many Osmocom git repos cloned in osmo-dev's src dir) it went from several seconds to instantly.
Depends: osmo-dev I89bb60e94dd03606dbba5a3609d5e1a95993af5b Change-Id: Ib2d8802b305f145d27aab3c1cc3129709b93d93d --- M _testenv/testenv.py M _testenv/testenv/osmo_dev.py 2 files changed, 4 insertions(+), 12 deletions(-)
Approvals: Jenkins Builder: Verified laforge: Looks good to me, approved fixeria: Looks good to me, but someone else must approve
diff --git a/_testenv/testenv.py b/_testenv/testenv.py index ebc625e..9e33e37 100755 --- a/_testenv/testenv.py +++ b/_testenv/testenv.py @@ -45,9 +45,6 @@ testenv.podman.start() testenv.podman.check_titan_version()
- if not testenv.args.binary_repo: - testenv.osmo_dev.init() - testenv.testsuite.init() testenv.testsuite.build()
@@ -55,6 +52,7 @@ if not testenv.args.binary_repo: for cfg_name, cfg in testenv.testenv_cfg.cfgs.items(): testenv.testenv_cfg.set_current(cfg_name) + testenv.osmo_dev.init(cfg) testenv.osmo_dev.make(cfg)
# Run the components + testsuite diff --git a/_testenv/testenv/osmo_dev.py b/_testenv/testenv/osmo_dev.py index 8f9667e..0b6bdf0 100644 --- a/_testenv/testenv/osmo_dev.py +++ b/_testenv/testenv/osmo_dev.py @@ -7,8 +7,6 @@ import testenv import testenv.cmd
-init_done = False -
def get_osmo_dev_dir(): # Users may have used osmo-dev to clone osmo-ttcn3-hacks: @@ -66,12 +64,7 @@ return ret
-def init(): - global init_done - - if init_done: - return - +def init(cfg): extra_opts = [] if testenv.args.asan: extra_opts += ["sanitize.opts"] @@ -91,6 +84,8 @@ "--src-dir", testenv.src_dir, "--autoreconf-in-src-copy", + "--targets", + ",".join(get_targets(cfg)), "default.opts", "ccache.opts", "gtp_linux.opts", @@ -111,7 +106,6 @@ logging.critical("Your osmo-dev.git clone might be outdated, try:") logging.critical(f"$ git -C {shlex.quote(cwd)} pull") sys.exit(1) - init_done = True
def make(cfg):