Cargo does not play nicely with VPATH (at least, that's what my quick
google search found:
https://github.com/rust-lang/cargo/issues/5457#issuecomment-451695299).
Easiest is to just disable it when we detect a VPATH build.
---
 configure.ac | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index 000a7d67..9541b591 100644
--- a/configure.ac
+++ b/configure.ac
@@ -942,11 +942,16 @@ EOF
 ])

 dnl For developing plugins in Rust, optional.
+dnl Rust does not play nicely with VPATH builds
 AC_CHECK_PROG([CARGO],[cargo],[cargo],[no])
 AC_ARG_ENABLE([rust],
     [AS_HELP_STRING([--disable-rust], [disable Rust plugin])],
     [],
-    [enable_rust=yes])
+    [if test "x$(realpath $srcdir)" = "x$(realpath .)"; then
+       enable_rust=yes
+     else
+       enable_rust=no
+     fi])
 AM_CONDITIONAL([HAVE_RUST],
                [test "x$CARGO" != "xno" && test "x$enable_rust" != "xno"])

-- 
2.37.3

_______________________________________________
Libguestfs mailing list
Libguestfs@redhat.com
https://listman.redhat.com/mailman/listinfo/libguestfs

Reply via email to