rust: bindgen requires rustfmt

Bindgen will use rustfmt after generating the bindings, but this will
fail if rustfmt is not installed. Only run bindgen if rustfmt is
installed.
pull/13797/head
Jason Ish 3 months ago committed by Victor Julien
parent 5379b52af2
commit db945aec83

@ -2178,6 +2178,9 @@ fi
AC_SUBST(rust_vendor_comment)
AM_CONDITIONAL([HAVE_RUST_VENDOR], [test "x$have_rust_vendor" = "xyes"])
# Bindgen requires rustfmt.
AC_PATH_PROG([RUSTFMT], [rustfmt], [no])
# Check for bindgen
AC_PATH_PROG([BINDGEN], [bindgen], [no])
if test "x$BINDGEN" != "xno"; then
@ -2194,7 +2197,7 @@ fi
BINDGEN="no"
fi
fi
AM_CONDITIONAL([HAVE_BINDGEN], [test "x$BINDGEN" != "xno"])
AM_CONDITIONAL([HAVE_BINDGEN], [test "x$BINDGEN" != "xno" -a "x$RUSTFMT" != "xno"])
have_rust_headers="no"
AC_MSG_CHECKING(for $srcdir/rust/dist/rust-bindings.h)

@ -119,7 +119,7 @@ if HAVE_BINDGEN
echo "Not checking bindings for out of tree build"; \
fi
else
@echo "Unable to check bindgen bindings: bindgen not found"
@echo "Unable to check bindgen bindings: bindgen or rustfmt not found"
endif
check:
@ -165,7 +165,7 @@ if HAVE_BINDGEN
cat sys/src/jsonbuilder.rs.tmp >> sys/src/jsonbuilder.rs
rm -f sys/src/jsonbuilder.rs.tmp
else
@echo "error: bindgen not installed, can't update bindings"
@echo "error: bindgen or rustfmt not installed, can't update bindings"
exit 1
endif

Loading…
Cancel
Save