fixes for building guestfs-tools and virt-v2v against a fresh libguestfs
Hi, I'll post two small patch sets as followups to this "higher order" cover letter. The goal is to build guestfs-tools and virt-v2v against a freshly built libguestfs (git checkout), using libguestfs's "run" script. The modifications affect two projects, libguestfs-common and guestfs-tools, hence the two (upcoming) patch series. libguestfs-common is tricky because it is consumed as a submodule by three git superprojects (libguestfs itself, then guestfs-tools and virt-v2v). Yet more trickily, the three superprojects don't all seem to consume libguestfs-common at the same submodule git commit, at the moment. (libguestfs and guestfs-tools consume the submodule at older commit 74bc5c5c5cb4, while virt-v2v consumes the submodule at current HEAD commit 6d26b6eac9da.) For verifying the libguestfs-common updates, I first attempted various git-pushes into the submodule checkouts of the superprojects. That proved super unwieldy, as it would require a whole lot of git massaging just to (incrementally) rebuild all three superprojects after each libguestfs-common update. Instead, in each superproject, I created a development branch, and as first commit on that branch, I removed the submodule altogether, and replaced it with a directory tree of symbolic links into my stand-alone libguestfs-common worktree -- refer to the "lndir" command. I didn't expect creating new files in libguestfs-common, so once established, the symlink set could be considered final. Furthermore, "lndir" was required for symlinking individual regular files: symlinking subdirectories from libguestfs-common into the superprojects' "common" directories doesn't work, as the "common" content refers back to the superproject, via relative pathnames such as "../blah". For such pathnames to work, the deep "common" directory structure actually needs to exist within each superproject, only the leaves (the regular files) can be replaced with symlinks. Thankfully, "lndir" implements just that. This effectively bumped libguestfs and guestfs-tools to libguestfs-common HEAD commit 6d26b6eac9da, as a basis for the needed libguestfs-common fixes. With the "libguestfs-common" patch set applied (on top of commit 6d26b6eac9da), libguestfs can be built and checked without regressions. Furthermore, virt-v2v too can be built and checked against the just-built libguestfs (using the latter's "run" script) without regressions. The same applies to "guestfs-tools", assuming the other patch set is applied to it (on top of commit 9ba463545fa0). Once these patch sets are up-stream, the three superprojects should advance their submodule references to the new libguestfs-common head commit. Thanks! Laszlo
This series lets (a) virt-v2v, and (b) in combination with the sibling series for guestfs-tools, guestfs-tools, be built against a just-built libguestfs (e.g. with the libguest-devel package absent), using the commands $ git submodule update --init --force $ autoreconf -i $ ../libguestfs/run ./configure CFLAGS=-fPIC $ ../libguestfs/run make -j $(getconf _NPROCESSORS_ONLN) $ ../libguestfs/run make -j $(getconf _NPROCESSORS_ONLN) check Thanks, Laszlo Laszlo Ersek (2): Makefile.am: supply missing $(LIBGUESTFS_CFLAGS) Makefile.am: use $(LIBGUESTFS_LIBS) for linking OCaml test programs edit/Makefile.am | 3 ++- mltools/Makefile.am | 24 ++++++++++++++++++------ mlvisit/Makefile.am | 10 +++++++++- parallel/Makefile.am | 1 + progress/Makefile.am | 1 + structs/Makefile.am | 1 + visit/Makefile.am | 1 + windows/Makefile.am | 3 ++- 8 files changed, 35 insertions(+), 9 deletions(-) base-commit: 6d26b6eac9dab6bc8fddf9f6564a13f39c51defe -- 2.19.1.3.g30247aa5d201
C source code in the "edit", "mlvisit", "parallel", "progress", "structs", "visit", and "windows" modules includes "guestfs.h", but the makefiles of those modules do not add $(LIBGUESTFS_CFLAGS) to the respective module CFLAGS macros. This is a problem when these modules are built as a part of guestfs-tools, against a just-built libguestfs tree, as follows:
guestfs-tools$ ../libguestfs/run ./configure guestfs-tools$ ../libguestfs/run make
Example error:
CC libmlvisit_a-visit-c.o visit-c.c:33:10: fatal error: guestfs.h: No such file or directory 33 | #include "guestfs.h" | ^~~~~~~~~~~
Add the missing $(LIBGUESTFS_CFLAGS) instances. Signed-off-by: Laszlo Ersek <lersek@redhat.com> --- edit/Makefile.am | 3 ++- mlvisit/Makefile.am | 1 + parallel/Makefile.am | 1 + progress/Makefile.am | 1 + structs/Makefile.am | 1 + visit/Makefile.am | 1 + windows/Makefile.am | 3 ++- 7 files changed, 9 insertions(+), 2 deletions(-) diff --git a/edit/Makefile.am b/edit/Makefile.am index e45c9bacead8..dff8b8e8c709 100644 --- a/edit/Makefile.am +++ b/edit/Makefile.am @@ -30,6 +30,7 @@ libedit_la_CPPFLAGS = \ -I$(top_srcdir)/lib -I$(top_builddir)/lib \ $(INCLUDE_DIRECTORY) libedit_la_CFLAGS = \ - $(WARN_CFLAGS) $(WERROR_CFLAGS) + $(WARN_CFLAGS) $(WERROR_CFLAGS) \ + $(LIBGUESTFS_CFLAGS) libedit_la_LIBADD = \ $(top_builddir)/common/utils/libutils.la diff --git a/mlvisit/Makefile.am b/mlvisit/Makefile.am index a727f4fe0459..64108ebfbbc7 100644 --- a/mlvisit/Makefile.am +++ b/mlvisit/Makefile.am @@ -60,6 +60,7 @@ libmlvisit_a_CPPFLAGS = \ -I$(top_srcdir)/common/visit libmlvisit_a_CFLAGS = \ $(WARN_CFLAGS) $(WERROR_CFLAGS) \ + $(LIBGUESTFS_CFLAGS) \ $(LIBVIRT_CFLAGS) $(LIBXML2_CFLAGS) \ -fPIC diff --git a/parallel/Makefile.am b/parallel/Makefile.am index 73d31494f4ee..8cf35424c1ef 100644 --- a/parallel/Makefile.am +++ b/parallel/Makefile.am @@ -39,6 +39,7 @@ libparallel_la_CPPFLAGS = \ libparallel_la_CFLAGS = \ -pthread \ $(WARN_CFLAGS) $(WERROR_CFLAGS) \ + $(LIBGUESTFS_CFLAGS) \ $(LIBXML2_CFLAGS) \ $(LIBVIRT_CFLAGS) libparallel_la_LIBADD = \ diff --git a/progress/Makefile.am b/progress/Makefile.am index 1a5d11996483..beea95a5e655 100644 --- a/progress/Makefile.am +++ b/progress/Makefile.am @@ -31,6 +31,7 @@ libprogress_la_CPPFLAGS = \ $(INCLUDE_DIRECTORY) libprogress_la_CFLAGS = \ $(WARN_CFLAGS) $(WERROR_CFLAGS) \ + $(LIBGUESTFS_CFLAGS) \ $(LIBTINFO_CFLAGS) libprogress_la_LIBADD = \ $(top_builddir)/common/utils/libutils.la \ diff --git a/structs/Makefile.am b/structs/Makefile.am index 32fd91c36bc8..5881a1c9bd32 100644 --- a/structs/Makefile.am +++ b/structs/Makefile.am @@ -40,4 +40,5 @@ libstructs_la_CPPFLAGS = \ $(INCLUDE_DIRECTORY) libstructs_la_CFLAGS = \ $(WARN_CFLAGS) $(WERROR_CFLAGS) \ + $(LIBGUESTFS_CFLAGS) \ $(GCC_VISIBILITY_HIDDEN) diff --git a/visit/Makefile.am b/visit/Makefile.am index e57cdfa5be86..7a4be2978e60 100644 --- a/visit/Makefile.am +++ b/visit/Makefile.am @@ -32,4 +32,5 @@ libvisit_la_CPPFLAGS = \ -I$(top_srcdir)/common/structs -I$(top_builddir)/common/structs libvisit_la_CFLAGS = \ $(WARN_CFLAGS) $(WERROR_CFLAGS) \ + $(LIBGUESTFS_CFLAGS) \ $(GCC_VISIBILITY_HIDDEN) diff --git a/windows/Makefile.am b/windows/Makefile.am index 3f38ca67ddfb..7bdb7b862162 100644 --- a/windows/Makefile.am +++ b/windows/Makefile.am @@ -31,7 +31,8 @@ libwindows_la_CPPFLAGS = \ -I$(top_srcdir)/lib -I$(top_builddir)/lib \ $(INCLUDE_DIRECTORY) libwindows_la_CFLAGS = \ - $(WARN_CFLAGS) $(WERROR_CFLAGS) + $(WARN_CFLAGS) $(WERROR_CFLAGS) \ + $(LIBGUESTFS_CFLAGS) libwindows_la_LIBADD = \ $(top_builddir)/common/utils/libutils.la \ $(LTLIBINTL) -- 2.19.1.3.g30247aa5d201
Otherwise
guestfs-tools$ ../libguestfs/run make check
produces errors like
GEN tools_utils_tests /usr/bin/ld: cannot find -lguestfs /usr/bin/ld: cannot find -lguestfs collect2: error: ld returned 1 exit status File "caml_startup", line 1: Error: Error during linking (exit code 1)
in the "mltools" and "mlvisit" modules. Signed-off-by: Laszlo Ersek <lersek@redhat.com> --- mltools/Makefile.am | 24 ++++++++++++++++++------ mlvisit/Makefile.am | 9 ++++++++- 2 files changed, 26 insertions(+), 7 deletions(-) diff --git a/mltools/Makefile.am b/mltools/Makefile.am index 5cec178e4a78..26e466835732 100644 --- a/mltools/Makefile.am +++ b/mltools/Makefile.am @@ -262,9 +262,15 @@ tools_utils_tests_DEPENDENCIES = \ ../mlpcre/mlpcre.$(MLARCHIVE) \ $(MLTOOLS_CMA) \ $(top_srcdir)/ocaml-link.sh +tools_utils_tests_OCAMLCLIBS = \ + -pthread -lpthread \ + -lutils \ + $(LIBXML2_LIBS) \ + -lgnu \ + $(LIBGUESTFS_LIBS) tools_utils_tests_LINK = \ $(top_srcdir)/ocaml-link.sh \ - -cclib '-pthread -lpthread -lutils $(LIBXML2_LIBS) -lgnu' -- \ + -cclib '$(tools_utils_tests_OCAMLCLIBS)' -- \ $(OCAMLFIND) $(BEST) $(OCAMLFLAGS) $(OCAMLLINKFLAGS) \ $(OCAMLPACKAGES) $(OCAMLPACKAGES_TESTS) \ $(tools_utils_tests_THEOBJECTS) -o $@ @@ -276,9 +282,15 @@ getopt_tests_DEPENDENCIES = \ ../mlpcre/mlpcre.$(MLARCHIVE) \ $(MLTOOLS_CMA) \ $(top_srcdir)/ocaml-link.sh +getopt_tests_OCAMLCLIBS = \ + -pthread -lpthread \ + -lutils \ + $(LIBXML2_LIBS) \ + -lgnu \ + $(LIBGUESTFS_LIBS) getopt_tests_LINK = \ $(top_srcdir)/ocaml-link.sh \ - -cclib '-pthread -lpthread -lutils $(LIBXML2_LIBS) -lgnu' -- \ + -cclib '$(getopt_tests_OCAMLCLIBS)' -- \ $(OCAMLFIND) $(BEST) $(OCAMLFLAGS) $(OCAMLLINKFLAGS) \ $(OCAMLPACKAGES) $(OCAMLPACKAGES_TESTS) \ $(getopt_tests_THEOBJECTS) -o $@ @@ -292,7 +304,7 @@ JSON_tests_DEPENDENCIES = \ $(top_srcdir)/ocaml-link.sh JSON_tests_LINK = \ $(top_srcdir)/ocaml-link.sh \ - -cclib '-pthread -lpthread' -- \ + -cclib '-pthread -lpthread $(LIBGUESTFS_LIBS)' -- \ $(OCAMLFIND) $(BEST) $(OCAMLFLAGS) $(OCAMLLINKFLAGS) \ $(OCAMLPACKAGES) $(OCAMLPACKAGES_TESTS) \ $(JSON_tests_THEOBJECTS) -o $@ @@ -306,7 +318,7 @@ JSON_parser_tests_DEPENDENCIES = \ $(top_srcdir)/ocaml-link.sh JSON_parser_tests_LINK = \ $(top_srcdir)/ocaml-link.sh \ - -cclib '-pthread -lpthread $(OCAMLCLIBS)' -- \ + -cclib '-pthread -lpthread $(OCAMLCLIBS) $(LIBGUESTFS_LIBS)' -- \ $(OCAMLFIND) $(BEST) $(OCAMLFLAGS) $(OCAMLLINKFLAGS) \ $(OCAMLPACKAGES) $(OCAMLPACKAGES_TESTS) \ $(JSON_parser_tests_THEOBJECTS) -o $@ @@ -320,7 +332,7 @@ machine_readable_tests_DEPENDENCIES = \ $(top_srcdir)/ocaml-link.sh machine_readable_tests_LINK = \ $(top_srcdir)/ocaml-link.sh \ - -cclib '-pthread -lpthread -lutils -lgnu' -- \ + -cclib '-pthread -lpthread -lutils -lgnu $(LIBGUESTFS_LIBS)' -- \ $(OCAMLFIND) $(BEST) $(OCAMLFLAGS) $(OCAMLLINKFLAGS) \ $(OCAMLPACKAGES) $(OCAMLPACKAGES_TESTS) \ $(machine_readable_tests_THEOBJECTS) -o $@ @@ -334,7 +346,7 @@ tools_messages_tests_DEPENDENCIES = \ $(top_srcdir)/ocaml-link.sh tools_messages_tests_LINK = \ $(top_srcdir)/ocaml-link.sh \ - -cclib '-pthread -lpthread -lutils -lgnu' -- \ + -cclib '-pthread -lpthread -lutils -lgnu $(LIBGUESTFS_LIBS)' -- \ $(OCAMLFIND) $(BEST) $(OCAMLFLAGS) $(OCAMLLINKFLAGS) \ $(OCAMLPACKAGES) $(OCAMLPACKAGES_TESTS) \ $(tools_messages_tests_THEOBJECTS) -o $@ diff --git a/mlvisit/Makefile.am b/mlvisit/Makefile.am index 64108ebfbbc7..beff0bc64cdc 100644 --- a/mlvisit/Makefile.am +++ b/mlvisit/Makefile.am @@ -115,9 +115,16 @@ visit_tests_DEPENDENCIES = \ ../mlutils/mlcutils.$(MLARCHIVE) \ $(MLVISIT_CMA) \ $(top_srcdir)/ocaml-link.sh +visit_tests_OCAMLCLIBS = \ + -pthread -lpthread \ + -lvisit \ + -lstructs \ + -lutils \ + $(LIBXML2_LIBS) \ + $(LIBGUESTFS_LIBS) visit_tests_LINK = \ $(top_srcdir)/ocaml-link.sh \ - -cclib '-pthread -lpthread -lvisit -lstructs -lutils $(LIBXML2_LIBS)' -- \ + -cclib '$(visit_tests_OCAMLCLIBS)' -- \ $(OCAMLFIND) $(BEST) $(OCAMLFLAGS) $(OCAMLLINKFLAGS) \ $(OCAMLPACKAGES) $(OCAMLPACKAGES_TESTS) \ $(visit_tests_THEOBJECTS) -o $@ -- 2.19.1.3.g30247aa5d201
This series (in combination with the sibling series for libguestfs-common) allows guestfs-tools to be built against a just-built libguestfs (e.g. with the libguest-devel package absent), using the commands $ git submodule update --init --force $ autoreconf -i $ ../libguestfs/run ./configure CFLAGS=-fPIC $ ../libguestfs/run make -j $(getconf _NPROCESSORS_ONLN) $ ../libguestfs/run make -j $(getconf _NPROCESSORS_ONLN) check Thanks, Laszlo Laszlo Ersek (3): Makefile.am: fix $(LIBGUESTFS_CFLAGS) typo for virt-ls Makefile.am: supply missing $(LIBGUESTFS_CFLAGS) Makefile.am: use $(LIBGUESTFS_LIBS) for linking OCaml programs builder/Makefile.am | 5 ++++- cat/Makefile.am | 2 +- customize/Makefile.am | 2 ++ dib/Makefile.am | 1 + get-kernel/Makefile.am | 1 + resize/Makefile.am | 1 + sparsify/Makefile.am | 1 + sysprep/Makefile.am | 1 + 8 files changed, 12 insertions(+), 2 deletions(-) base-commit: 9ba463545fa017910a5077434f87ae67e146c9e0 -- 2.19.1.3.g30247aa5d201
Commit 4354a3126152 ("Add build system.", 2021-03-11) added $(LIBGUESTFS_LIBS) to "virt_ls_CFLAGS" and "virt_ls_LDADD" both. Correct the former; it should carry $(LIBGUESTFS_CFLAGS). Currently, the command
$ ../libguestfs/run make
produces the error
CC virt_ls-ls.o ls.c:47:10: fatal error: guestfs.h: No such file or directory 47 | #include "guestfs.h" | ^~~~~~~~~~~
Fixes: 4354a3126152a2748cc9097cba139b3908ccc342 Signed-off-by: Laszlo Ersek <lersek@redhat.com> --- cat/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cat/Makefile.am b/cat/Makefile.am index 39d0d25576eb..f1de5c866987 100644 --- a/cat/Makefile.am +++ b/cat/Makefile.am @@ -138,9 +138,9 @@ virt_ls_CPPFLAGS = \ virt_ls_CFLAGS = \ $(WARN_CFLAGS) $(WERROR_CFLAGS) \ $(LIBXML2_CFLAGS) \ - $(LIBGUESTFS_LIBS) + $(LIBGUESTFS_CFLAGS) virt_ls_LDADD = \ $(top_builddir)/common/options/liboptions.la \ $(top_builddir)/common/visit/libvisit.la \ -- 2.19.1.3.g30247aa5d201
Common C source code pulled into virt-builder, virt-index-validate and virt-customize #includes "guestfs.h", but the guestfs-tools makefiles of those modules do not add $(LIBGUESTFS_CFLAGS) to the respective module CFLAGS macros. The command
$ ../libguestfs/run make
produces errors such as
CC ../common/edit/libcustomize_a-file-edit.o In file included from ../common/edit/file-edit.c:46: ../common/edit/file-edit.h:22:10: fatal error: guestfs.h: No such file or directory 22 | #include <guestfs.h> | ^~~~~~~~~~~
Add the missing $(LIBGUESTFS_CFLAGS) instances. Signed-off-by: Laszlo Ersek <lersek@redhat.com> --- builder/Makefile.am | 4 +++- customize/Makefile.am | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/builder/Makefile.am b/builder/Makefile.am index f49a3b0aaa12..9c155c7f29ef 100644 --- a/builder/Makefile.am +++ b/builder/Makefile.am @@ -148,8 +148,9 @@ virt_builder_CPPFLAGS = \ virt_builder_CFLAGS = \ -pthread \ $(WARN_CFLAGS) $(WERROR_CFLAGS) \ -Wno-unused-macros \ + $(LIBGUESTFS_CFLAGS) \ $(LIBLZMA_CFLAGS) \ $(LIBTINFO_CFLAGS) \ $(LIBXML2_CFLAGS) @@ -446,9 +447,10 @@ virt_index_validate_CPPFLAGS = \ -I$(top_srcdir)/lib \ -I$(top_srcdir)/include virt_index_validate_CFLAGS = \ $(WARN_CFLAGS) $(WERROR_CFLAGS) \ - -Wno-unused-macros + -Wno-unused-macros \ + $(LIBGUESTFS_CFLAGS) virt_index_validate_LDADD = \ $(LTLIBINTL) \ ../gnulib/lib/libgnu.la diff --git a/customize/Makefile.am b/customize/Makefile.am index d3f07d723c4a..7bf6af444b67 100644 --- a/customize/Makefile.am +++ b/customize/Makefile.am @@ -102,8 +102,9 @@ libcustomize_a_CPPFLAGS = \ -I$(top_srcdir)/include \ -I$(top_srcdir)/common/edit libcustomize_a_CFLAGS = \ $(WARN_CFLAGS) $(WERROR_CFLAGS) \ + $(LIBGUESTFS_CFLAGS) \ $(LIBCRYPT_CFLAGS) \ $(LIBVIRT_CFLAGS) \ $(LIBXML2_CFLAGS) \ -fPIC -- 2.19.1.3.g30247aa5d201
Otherwise the command
$ ../libguestfs/run make
produces errors like
GEN virt-customize /usr/bin/ld: cannot find -lguestfs /usr/bin/ld: cannot find -lguestfs collect2: error: ld returned 1 exit status File "caml_startup", line 1: Error: Error during linking (exit code 1)
in the "builder", "customize", "dib", "get-kernel", "resize", "sparsify" and "sysprep" modules. Signed-off-by: Laszlo Ersek <lersek@redhat.com> --- builder/Makefile.am | 1 + customize/Makefile.am | 1 + dib/Makefile.am | 1 + get-kernel/Makefile.am | 1 + resize/Makefile.am | 1 + sparsify/Makefile.am | 1 + sysprep/Makefile.am | 1 + 7 files changed, 7 insertions(+) diff --git a/builder/Makefile.am b/builder/Makefile.am index 9c155c7f29ef..78274426aec5 100644 --- a/builder/Makefile.am +++ b/builder/Makefile.am @@ -200,8 +200,9 @@ OCAMLCLIBS = \ -pthread -lpthread \ -lutils \ $(LIBTINFO_LIBS) \ $(LIBCRYPT_LIBS) \ + $(LIBGUESTFS_LIBS) \ $(LIBLZMA_LIBS) \ $(LIBXML2_LIBS) \ $(JANSSON_LIBS) \ $(LIBINTL) \ diff --git a/customize/Makefile.am b/customize/Makefile.am index 7bf6af444b67..6bdd5fae91e6 100644 --- a/customize/Makefile.am +++ b/customize/Makefile.am @@ -168,8 +168,9 @@ OCAMLLINKFLAGS = \ OCAMLCLIBS = \ -pthread -lpthread \ -lutils \ $(LIBTINFO_LIBS) \ + $(LIBGUESTFS_LIBS) \ $(LIBCRYPT_LIBS) \ $(LIBVIRT_LIBS) \ $(LIBXML2_LIBS) \ $(LIBINTL) \ diff --git a/dib/Makefile.am b/dib/Makefile.am index f607449f249a..7581feb787ec 100644 --- a/dib/Makefile.am +++ b/dib/Makefile.am @@ -91,8 +91,9 @@ endif OCAMLCLIBS = \ -pthread -lpthread \ -lutils \ $(LIBXML2_LIBS) \ + $(LIBGUESTFS_LIBS) \ $(LIBINTL) \ -lgnu OCAMLFLAGS = $(OCAML_FLAGS) $(OCAML_WARN_ERROR) -ccopt '$(CFLAGS)' diff --git a/get-kernel/Makefile.am b/get-kernel/Makefile.am index e0df00ec06a7..c81cb8ba8cb4 100644 --- a/get-kernel/Makefile.am +++ b/get-kernel/Makefile.am @@ -73,8 +73,9 @@ endif OCAMLCLIBS = \ -pthread -lpthread \ -lutils \ $(LIBXML2_LIBS) \ + $(LIBGUESTFS_LIBS) \ $(LIBINTL) \ -lgnu OCAMLFLAGS = $(OCAML_FLAGS) $(OCAML_WARN_ERROR) -ccopt '$(CFLAGS)' diff --git a/resize/Makefile.am b/resize/Makefile.am index 606fcecb6ebc..f8aa4c46bfcf 100644 --- a/resize/Makefile.am +++ b/resize/Makefile.am @@ -73,8 +73,9 @@ OCAMLCLIBS = \ -lprogress \ -lutils \ $(LIBTINFO_LIBS) \ $(LIBXML2_LIBS) \ + $(LIBGUESTFS_LIBS) \ $(LIBINTL) \ -lgnu OCAMLFLAGS = $(OCAML_FLAGS) $(OCAML_WARN_ERROR) -ccopt '$(CFLAGS)' diff --git a/sparsify/Makefile.am b/sparsify/Makefile.am index d5c8cd3367ae..0eca849da46b 100644 --- a/sparsify/Makefile.am +++ b/sparsify/Makefile.am @@ -80,8 +80,9 @@ OCAMLCLIBS = \ -lprogress \ -lutils \ $(LIBTINFO_LIBS) \ $(LIBXML2_LIBS) \ + $(LIBGUESTFS_LIBS) \ $(LIBINTL) \ -lgnu OCAMLFLAGS = $(OCAML_FLAGS) $(OCAML_WARN_ERROR) -ccopt '$(CFLAGS)' diff --git a/sysprep/Makefile.am b/sysprep/Makefile.am index d32ab20e57e9..e213244bc17a 100644 --- a/sysprep/Makefile.am +++ b/sysprep/Makefile.am @@ -131,8 +131,9 @@ OCAMLCLIBS = \ -lutils \ $(LIBTINFO_LIBS) \ $(LIBCRYPT_LIBS) \ $(LIBXML2_LIBS) \ + $(LIBGUESTFS_LIBS) \ $(LIBINTL) \ -lgnu OCAMLFLAGS = $(OCAML_FLAGS) $(OCAML_WARN_ERROR) -ccopt '$(CFLAGS)' -- 2.19.1.3.g30247aa5d201
Yes this all seems like obvious stuff. ACK both series + the update commits to bring the common submodules up to date. Thanks Laszlo, Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-df lists disk usage of guests without needing to install any software inside the virtual machine. Supports Linux and Windows. http://people.redhat.com/~rjones/virt-df/
On 09/06/21 16:40, Richard W.M. Jones wrote:
Yes this all seems like obvious stuff. ACK both series + the update commits to bring the common submodules up to date.
Thank you for the quick review! - libguestfs-common: commit range 6d26b6eac9da..19302b64c5f1 - guestfs-tools: commit range 9ba463545fa0..9b0f2e2d5893 - libguestfs: commit 81ad309d47e2 - virt-v2v: commit 10af3dee6a45 Thanks! Laszlo
On Mon, Sep 06, 2021 at 12:57:56PM +0200, Laszlo Ersek wrote:
Hi,
I'll post two small patch sets as followups to this "higher order" cover letter. The goal is to build guestfs-tools and virt-v2v against a freshly built libguestfs (git checkout), using libguestfs's "run" script. The modifications affect two projects, libguestfs-common and guestfs-tools, hence the two (upcoming) patch series.
libguestfs-common is tricky because it is consumed as a submodule by three git superprojects (libguestfs itself, then guestfs-tools and virt-v2v). Yet more trickily, the three superprojects don't all seem to consume libguestfs-common at the same submodule git commit, at the moment. (libguestfs and guestfs-tools consume the submodule at older commit 74bc5c5c5cb4, while virt-v2v consumes the submodule at current HEAD commit 6d26b6eac9da.)
This is because I ad-hoc update the common submodule when I need to. In theory all the projects should work against the latest common submodule, and a commit against any of them which just bumps the common submodule to the latest version should always be valid.
For verifying the libguestfs-common updates, I first attempted various git-pushes into the submodule checkouts of the superprojects. That proved super unwieldy, as it would require a whole lot of git massaging just to (incrementally) rebuild all three superprojects after each libguestfs-common update. Instead, in each superproject, I created a development branch, and as first commit on that branch, I removed the submodule altogether, and replaced it with a directory tree of symbolic links into my stand-alone libguestfs-common worktree -- refer to the "lndir" command. I didn't expect creating new files in libguestfs-common, so once established, the symlink set could be considered final. Furthermore, "lndir" was required for symlinking individual regular files: symlinking subdirectories from libguestfs-common into the superprojects' "common" directories doesn't work, as the "common" content refers back to the superproject, via relative pathnames such as "../blah". For such pathnames to work, the deep "common" directory structure actually needs to exist within each superproject, only the leaves (the regular files) can be replaced with symlinks. Thankfully, "lndir" implements just that.
This effectively bumped libguestfs and guestfs-tools to libguestfs-common HEAD commit 6d26b6eac9da, as a basis for the needed libguestfs-common fixes.
With the "libguestfs-common" patch set applied (on top of commit 6d26b6eac9da), libguestfs can be built and checked without regressions. Furthermore, virt-v2v too can be built and checked against the just-built libguestfs (using the latter's "run" script) without regressions.
The same applies to "guestfs-tools", assuming the other patch set is applied to it (on top of commit 9ba463545fa0).
Once these patch sets are up-stream, the three superprojects should advance their submodule references to the new libguestfs-common head commit.
Yup, submodules are horrible. But a bit better than code duplication. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-p2v converts physical machines to virtual machines. Boot with a live CD or over the network (PXE) and turn machines into KVM guests. http://libguestfs.org/virt-v2v
participants (2)
-
Laszlo Ersek -
Richard W.M. Jones