osmith has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/40379?usp=email )
Change subject: testenv: fix TESTENV_INSTALL_DIR ......................................................................
testenv: fix TESTENV_INSTALL_DIR
When osmo-dev is used (no --binary-repo arg is set), then set TESTENV_INSTALL_DIR and --install-prefix for osmo-dev to: <cache dir>/osmo-ttcn3-testenv/{podman,host}/install Old --install-prefix: <cache dir>/osmo-ttcn3-testenv/{podman,host}/usr Old TESTENV_INSTALL_DIR: <cache dir>/osmo-ttcn3-testenv/{podman,host}
The old behavior was misleading, because: * It resulted in configs getting installed into: <cache dir>/osmo-ttcn3-testenv/{podman,host}/usr/etc/... * TESTENV_INSTALL_DIR looked like it would point at the install dir (because there is usr inside that directory), but it was actually pointing at the top dir of the install dir.
Fixes: 143b1000 ("testenv: add TESTENV_INSTALL_DIR") Change-Id: Id94936338a6eb74dee0b3f4668cbaca309b269e4 --- M _testenv/README.md M _testenv/testenv/cmd.py M _testenv/testenv/osmo_dev.py 3 files changed, 14 insertions(+), 23 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/79/40379/1
diff --git a/_testenv/README.md b/_testenv/README.md index 53d3440..a1ba73d 100644 --- a/_testenv/README.md +++ b/_testenv/README.md @@ -232,8 +232,8 @@ * `TESTENV_INSTALL_DIR`: The directory into which the SUT binaries and other files are installed. It is set to `/` for `--podman --binary-repo`, - `~/.cache/osmo-ttcn3-testenv/podman` for `--podman` and - `~/.cache/osmo-ttcn3-testenv/host` otherwise. The + `~/.cache/osmo-ttcn3-testenv/podman/install` for `--podman` and + `~/.cache/osmo-ttcn3-testenv/host/install` otherwise. The `~/.cache/osmo-ttcn3-testenv` part can be changed with the `--cache` argument. Different cache directories for podman and for the host are used as it is very likely that the binary objects from both are incompatible. @@ -245,10 +245,10 @@
* `OSMO_DEV_MAKE_DIR`: This variable is unset if `--binary-repo` is used as argument. Otherwise it - is set to `~/.cache/osmo-ttcn3-testenv/host/make2` or - `~/.cache/osmo-ttcn3-testenv/podman/make2` (with `--podman`) by default. The - `~/.cache/osmo-ttcn3-testenv` part can be changed with the `--cache` - argument. + is set to `~/.cache/osmo-ttcn3-testenv/host/make<version>` or + `~/.cache/osmo-ttcn3-testenv/podman/make<version>` (with `--podman`) by + default. The `~/.cache/osmo-ttcn3-testenv` part can be changed with the + `--cache` argument.
* `TESTENV_QEMU_KERNEL`: Is only set if `-C`/`--custom-kernel` or `-D`/`--debian-kernel` parameters diff --git a/_testenv/testenv/cmd.py b/_testenv/testenv/cmd.py index 5da27fe..e65f777 100644 --- a/_testenv/testenv/cmd.py +++ b/_testenv/testenv/cmd.py @@ -11,7 +11,7 @@ install_dir = None make_dir = None # osmo-dev make dir version, bump when making incompatible changes -make_dir_version = 2 +make_dir_version = 3
def init_env(): @@ -25,17 +25,17 @@ if testenv.args.binary_repo: install_dir = "/" else: - install_dir = os.path.join(testenv.args.cache, "podman") + install_dir = os.path.join(testenv.args.cache, "podman/install") else: - install_dir = os.path.join(testenv.args.cache, "host") + install_dir = os.path.join(testenv.args.cache, "host/install")
if not testenv.args.binary_repo: - pkg_config_path = os.path.join(install_dir, "usr/lib/pkgconfig") + pkg_config_path = os.path.join(install_dir, "lib/pkgconfig") if "PKG_CONFIG_PATH" in os.environ: pkg_config_path += f":{os.environ.get('PKG_CONFIG_PATH')}" pkg_config_path += ":/usr/lib/pkgconfig"
- ld_library_path = os.path.join(install_dir, "usr/lib") + ld_library_path = os.path.join(install_dir, "lib") if "LD_LIBRARY_PATH" in os.environ: ld_library_path += f":{os.environ.get('LD_LIBRARY_PATH')}" ld_library_path += ":/usr/lib" @@ -83,7 +83,7 @@ path += f":{os.path.join(testenv.testsuite.ttcn3_hacks_dir, testenv.args.testsuite)}"
if install_dir and install_dir != "/": - path += f":{os.path.join(install_dir, 'usr/bin')}" + path += f":{os.path.join(install_dir, 'bin')}"
if podman: path += ":/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" diff --git a/_testenv/testenv/osmo_dev.py b/_testenv/testenv/osmo_dev.py index 8b83367..45912ae 100644 --- a/_testenv/testenv/osmo_dev.py +++ b/_testenv/testenv/osmo_dev.py @@ -58,17 +58,6 @@ return
extra_opts = [] - if testenv.args.podman: - extra_opts = [ - "--install-prefix", - os.path.join(testenv.args.cache, "podman/usr"), - ] - else: - extra_opts = [ - "--install-prefix", - os.path.join(testenv.args.cache, "host/usr"), - ] - if testenv.args.jobs: extra_opts += [f"-j{testenv.args.jobs}"]
@@ -77,6 +66,8 @@ "./gen_makefile.py", "--build-debug", "--no-make-check", + "--install-prefix", + testenv.cmd.install_dir, "--make-dir", testenv.cmd.make_dir, "--no-ldconfig",