summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2021-11-10 10:33:33 +0200
committerLars Wirzenius <liw@liw.fi>2021-11-10 10:33:33 +0200
commit96c3606757750dadfcf31ec5ccd7787292da9273 (patch)
treebaddf2d763cd523cbcf5e2cbe1a2f74ee514d9f4
parent73d9542edf54dd05bcdc0a6096c8cb224b6f51c9 (diff)
downloadvmadm-96c3606757750dadfcf31ec5ccd7787292da9273.tar.gz
fix: prepend Cargo target directory to PATH
Sponsored-by: author
-rw-r--r--subplot/vmadm.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/subplot/vmadm.py b/subplot/vmadm.py
index 473a673..e6cd234 100644
--- a/subplot/vmadm.py
+++ b/subplot/vmadm.py
@@ -9,7 +9,11 @@ import yaml
def install_vmadm(ctx):
runcmd_prepend_to_path = globals()["runcmd_prepend_to_path"]
srcdir = globals()["srcdir"]
- runcmd_prepend_to_path(ctx, os.path.join(srcdir, "target", "debug"))
+
+ # Add the directory with built Rust binaries to the path.
+ default_target = os.path.join(srcdir, "target")
+ target = os.environ.get("CARGO_TARGET_DIR", default_target)
+ runcmd_prepend_to_path(ctx, dirname=os.path.join(target, "debug"))
# Set permissions on the datadir and its parent. They are 0o700 by default,
# which means that the libvirt daemon can't access the virtual machine