osmith has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/40378?usp=email )
Change subject: testenv: deduplicate make_dir ...................................................................... testenv: deduplicate make_dir Generate the osmo-dev make dir path in one location, in testenv.cmd which gets imported by testenv.osmo_dev instead of doing it in both. This makes it easier to bump make_dir_version when necessary. Change-Id: Id3cb30e1ea126daf04dac227a2bf39b746549ec9 --- M _testenv/testenv/cmd.py M _testenv/testenv/osmo_dev.py 2 files changed, 12 insertions(+), 14 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/78/40378/1 diff --git a/_testenv/testenv/cmd.py b/_testenv/testenv/cmd.py index 9a81e30..5da27fe 100644 --- a/_testenv/testenv/cmd.py +++ b/_testenv/testenv/cmd.py @@ -9,6 +9,9 @@ env_extra = {} install_dir = None +make_dir = None +# osmo-dev make dir version, bump when making incompatible changes +make_dir_version = 2 def init_env(): @@ -16,6 +19,7 @@ changes here.""" global env_extra global install_dir + global make_dir if testenv.args.podman: if testenv.args.binary_repo: @@ -48,9 +52,11 @@ if not testenv.args.binary_repo: if testenv.args.podman: - env_extra["OSMO_DEV_MAKE_DIR"] = os.path.join(testenv.args.cache, "podman", "make2") + make_dir = os.path.join(testenv.args.cache, "podman", "make") else: - env_extra["OSMO_DEV_MAKE_DIR"] = os.path.join(testenv.args.cache, "host", "make2") + make_dir = os.path.join(testenv.args.cache, "host", "make") + make_dir += str(make_dir_version) + env_extra["OSMO_DEV_MAKE_DIR"] = make_dir if testenv.args.kernel == "debian": env_extra["TESTENV_QEMU_KERNEL"] = "debian" diff --git a/_testenv/testenv/osmo_dev.py b/_testenv/testenv/osmo_dev.py index 02fe2e8..8b83367 100644 --- a/_testenv/testenv/osmo_dev.py +++ b/_testenv/testenv/osmo_dev.py @@ -7,7 +7,6 @@ import testenv import testenv.cmd -make_dir = None init_done = False @@ -54,20 +53,17 @@ def init(): global init_done - global make_dir if init_done: return extra_opts = [] if testenv.args.podman: - make_dir = os.path.join(testenv.args.cache, "podman", "make") extra_opts = [ "--install-prefix", os.path.join(testenv.args.cache, "podman/usr"), ] else: - make_dir = os.path.join(testenv.args.cache, "host", "make") extra_opts = [ "--install-prefix", os.path.join(testenv.args.cache, "host/usr"), @@ -76,17 +72,13 @@ if testenv.args.jobs: extra_opts += [f"-j{testenv.args.jobs}"] - # Make dirs created without passing --autoreconf-in-src-copy to - # gen_makefile.py (as previous versions of testenv did) are incompatible. - # Add the "2" to avoid potential conflicts. - make_dir += "2" - + # Bump testenv.cmd.make_dir_version when making incompatible changes cmd = [ "./gen_makefile.py", "--build-debug", "--no-make-check", "--make-dir", - make_dir, + testenv.cmd.make_dir, "--no-ldconfig", "--src-dir", testenv.src_dir, @@ -135,7 +127,7 @@ logging.debug("No osmo-dev make targets found in testenv.cfg") return - makefile_path = os.path.join(make_dir, "Makefile") + makefile_path = os.path.join(testenv.cmd.make_dir, "Makefile") with open(makefile_path) as f: makefile = f.read() @@ -152,4 +144,4 @@ sys.exit(1) logging.info("Building test components") - testenv.cmd.run(["make"] + targets, cwd=make_dir) + testenv.cmd.run(["make"] + targets, cwd=testenv.cmd.make_dir) -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/40378?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newchange Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: Id3cb30e1ea126daf04dac227a2bf39b746549ec9 Gerrit-Change-Number: 40378 Gerrit-PatchSet: 1 Gerrit-Owner: osmith <osm...@sysmocom.de>