<div dir="ltr">> I'm not sure what editor you use, but either setting it up so that there is a<br>> '\n' in the end of the file (at least by default unless you remove it or<br>> something) would probably be favourable.<div><br></div><div>I'm sorry. I'll check the settings of my editor.</div><div><br></div><div>> I, personally, prefer the usual `--enable-rust=yes|check|no`</div>> semantics<div><br></div><div>I see. I'll fix this.</div><div><br></div><div>Thank you for your comments!</div><div><br></div><div>Regards,</div><div>Hiroyuki</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">2019年7月3日(水) 16:58 Martin Kletzander <<a href="mailto:mkletzan@redhat.com">mkletzan@redhat.com</a>>:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Tue, Jul 02, 2019 at 10:14:19PM +0900, Hiroyuki Katsura wrote:<br>
>From: Hiroyuki_Katsura <<a href="mailto:hiroyuki.katsura.0513@gmail.com" target="_blank">hiroyuki.katsura.0513@gmail.com</a>><br>
><br>
>---<br>
> Makefile.am             |  4 ++++<br>
> <a href="http://configure.ac" rel="noreferrer" target="_blank">configure.ac</a>            |  3 +++<br>
> generator/Makefile.am   |  3 +++<br>
> generator/<a href="http://bindtests.ml" rel="noreferrer" target="_blank">bindtests.ml</a>  |  3 +++<br>
> generator/bindtests.mli |  1 +<br>
> generator/<a href="http://main.ml" rel="noreferrer" target="_blank">main.ml</a>       |  5 +++++<br>
> generator/<a href="http://rust.ml" rel="noreferrer" target="_blank">rust.ml</a>       | 34 ++++++++++++++++++++++++++++++++++<br>
> generator/rust.mli      | 19 +++++++++++++++++++<br>
> m4/guestfs-rust.m4      | 30 ++++++++++++++++++++++++++++++<br>
> rust/Cargo.toml         |  6 ++++++<br>
> rust/Makefile.am        | 29 +++++++++++++++++++++++++++++<br>
> rust/src/.gitkeep       |  0<br>
> rust/tests/.gitkeep     |  0<br>
> 13 files changed, 137 insertions(+)<br>
> create mode 100644 generator/<a href="http://rust.ml" rel="noreferrer" target="_blank">rust.ml</a><br>
> create mode 100644 generator/rust.mli<br>
> create mode 100644 m4/guestfs-rust.m4<br>
> create mode 100644 rust/Cargo.toml<br>
> create mode 100644 rust/Makefile.am<br>
> create mode 100644 rust/src/.gitkeep<br>
> create mode 100644 rust/tests/.gitkeep<br>
><br>
<br>
[...]<br>
<br>
>diff --git a/generator/rust.mli b/generator/rust.mli<br>
>new file mode 100644<br>
>index 000000000..4fef55d4e<br>
>--- /dev/null<br>
>+++ b/generator/rust.mli<br>
>@@ -0,0 +1,19 @@<br>
>+(* libguestfs<br>
>+ * Copyright (C) 2009-2019 Red Hat Inc.<br>
>+ *<br>
>+ * This program is free software; you can redistribute it and/or modify<br>
>+ * it under the terms of the GNU General Public License as published by<br>
>+ * the Free Software Foundation; either version 2 of the License, or<br>
>+ * (at your option) any later version.<br>
>+ *<br>
>+ * This program is distributed in the hope that it will be useful,<br>
>+ * but WITHOUT ANY WARRANTY; without even the implied warranty of<br>
>+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the<br>
>+ * GNU General Public License for more details.<br>
>+ *<br>
>+ * You should have received a copy of the GNU General Public License<br>
>+ * along with this program; if not, write to the Free Software<br>
>+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA<br>
>+*)<br>
>+<br>
>+val generate_rust: unit -> unit<br>
>\ No newline at end of file<br>
<br>
I'm not sure what editor you use, but either setting it up so that there is a<br>
'\n' in the end of the file (at least by default unless you remove it or<br>
something) would probably be favourable.<br>
<br>
>diff --git a/m4/guestfs-rust.m4 b/m4/guestfs-rust.m4<br>
>new file mode 100644<br>
>index 000000000..f46ce960b<br>
>--- /dev/null<br>
>+++ b/m4/guestfs-rust.m4<br>
>@@ -0,0 +1,30 @@<br>
>+# libguestfs<br>
>+# Copyright (C) 2009-2019 Red Hat Inc.<br>
>+#<br>
>+# This program is free software; you can redistribute it and/or modify<br>
>+# it under the terms of the GNU General Public License as published by<br>
>+# the Free Software Foundation; either version 2 of the License, or<br>
>+# (at your option) any later version.<br>
>+#<br>
>+# This program is distributed in the hope that it will be useful,<br>
>+# but WITHOUT ANY WARRANTY; without even the implied warranty of<br>
>+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the<br>
>+# GNU General Public License for more details.<br>
>+#<br>
>+# You should have received a copy of the GNU General Public License<br>
>+# along with this program; if not, write to the Free Software<br>
>+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.<br>
>+<br>
>+dnl Rust<br>
>+AC_ARG_ENABLE([rust],<br>
>+    AS_HELP_STRING([--disable-rust], [disable Rust language bindings]),<br>
>+        [],<br>
>+        [enable_rust=yes])<br>
>+AS_IF([test "x$enable_rust" != "xno"],[<br>
>+    AC_CHECK_PROG([RUSTC],[rustc],[rustc],[no])<br>
>+    AC_CHECK_PROG([CARGO],[cargo],[cargo],[no])<br>
>+],[<br>
>+    RUSTC=no<br>
>+    CARGO=no<br>
>+    ])<br>
>+AM_CONDITIONAL([HAVE_RUST],[test "x$RUSTC" != "xno" && test "x$CARGO" != "xno"])<br>
<br>
So even if someone explicitly specifies --enable-rust without having the tools,<br>
they will not get the bindings built, but they will also not get an error nor<br>
confirmation in the configure output, so it is really hard to figure out what is<br>
happening.  I, personally, prefer the usual `--enable-rust=yes|check|no`<br>
semantics.  Of course this can be fixed later, do not let this rust<br>
bindings-unrelated review stop others from reviewing the important parts ;)<br>
<br>
[...]<br>
<br>
>diff --git a/rust/Makefile.am b/rust/Makefile.am<br>
>new file mode 100644<br>
>index 000000000..e8bf27894<br>
>--- /dev/null<br>
>+++ b/rust/Makefile.am<br>
>@@ -0,0 +1,29 @@<br>
>+# libguestfs golang bindings<br>
>+# Copyright (C) 2019 Red Hat Inc.<br>
>+#<br>
>+# This program is free software; you can redistribute it and/or modify<br>
>+# it under the terms of the GNU General Public License as published by<br>
>+# the Free Software Foundation; either version 2 of the License, or<br>
>+# (at your option) any later version.<br>
>+#<br>
>+# This program is distributed in the hope that it will be useful,<br>
>+# but WITHOUT ANY WARRANTY; without even the implied warranty of<br>
>+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the<br>
>+# GNU General Public License for more details.<br>
>+#<br>
>+# You should have received a copy of the GNU General Public License<br>
>+# along with this program; if not, write to the Free Software<br>
>+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.<br>
>+<br>
>+include $(top_srcdir)/<a href="http://subdir-rules.mk" rel="noreferrer" target="_blank">subdir-rules.mk</a><br>
>+<br>
>+generator_built = \<br>
>+      src/<a href="http://lib.rs" rel="noreferrer" target="_blank">lib.rs</a><br>
>+<br>
>+EXTRA_DIST = \<br>
>+      $(generator_built)<br>
>+<br>
>+if HAVE_RUST<br>
>+<br>
>+endif<br>
<br>
<br>
Maybe something is missing here?<br>
<br>
Martin<br>
</blockquote></div>