Amar1729 / homebrew-libguestfs

Homebrew tap for libguestfs
BSD 2-Clause "Simplified" License
4 stars 6 forks source link

Add libguestfs current stable (1.44) as libguestfs.rb #7

Closed Amar1729 closed 8 months ago

Amar1729 commented 3 years ago

Supersedes #6

Amar1729 commented 3 years ago

Current libguestfs seems to run into an error when compiling lib/libvirt-is-version.c - build log

Relevant lines
2021-04-19T22:29:22.5647280Z Making all in lib
2021-04-19T22:29:22.5648180Z /Applications/Xcode_12.4.app/Contents/Developer/usr/bin/make  all-am
2021-04-19T22:29:22.5657710Z clang -DHAVE_CONFIG_H -I. -I..  -DLOCALEBASEDIR=\""/usr/local/Cellar/libguestfs/1.44.1/share/locale"\"  -fno-common -Wall -Warith-conversion -Wbad-function-cast -Wcast-align=strict -Wdate-time -Wdisabled-optimization -Wdouble-promotion -Wduplicated-branches -Wduplicated-cond -Wextra -Wformat-signedness -Winit-self -Winvalid-pch -Wlogical-op -Wmissing-declarations -Wmissing-include-dirs -Wmissing-prototypes -Wnested-externs -Wnull-dereference -Wold-style-definition -Wopenmp-simd -Wpointer-arith -Wstrict-overflow -Wstrict-prototypes -Wsuggest-attribute=cold -Wsuggest-attribute=format -Wsuggest-attribute=noreturn -Wsuggest-final-methods -Wsuggest-final-types -Wsync-nand -Wtrampolines -Wuninitialized -Wunknown-pragmas -Wunused-macros -Wvariadic-macros -Wvector-operation-performance -Wwrite-strings -Warray-bounds=2 -Wattribute-alias=2 -Wformat-overflow=2 -Wformat=2 -Wformat-truncation=2 -Wimplicit-fallthrough=5 -Wshift-overflow=2 -Wunused-const-variable=2 -Wno-analyzer-double-free -Wno-analyzer-malloc-leak -Wno-analyzer-null-dereference -Wno-analyzer-use-after-free -Wno-unused-parameter -Wno-missing-field-initializers -fdiagnostics-show-option -Wframe-larger-than=6000 -Wstack-usage=10000 -Wimplicit-fallthrough=4 -Wformat-truncation=1 -Wformat-overflow=1 -Wno-pragmas  -I/usr/local/Cellar/libvirt/7.2.0/include -g -O2 -fno-strict-overflow -Wno-strict-overflow -c -o libvirt_is_version-libvirt-is-version.o `test -f 'libvirt-is-version.c' || echo './'`libvirt-is-version.c
2021-04-19T22:29:22.5676350Z bash ../libtool-kill-dependency_libs.sh ../libtool  --tag=CC   --mode=compile clang -DHAVE_CONFIG_H -I. -I..  -DGUESTFS_PRIVATE=1 -I../common/errnostring -I../common/errnostring -I../common/protocol -I../common/protocol -I../common/qemuopts -I../common/qemuopts -I../common/utils -I../common/utils -I../common/structs -I../common/structs -I../gnulib/lib -I../gnulib/lib -I../include  -fno-common -Wall -Warith-conversion -Wbad-function-cast -Wcast-align=strict -Wdate-time -Wdisabled-optimization -Wdouble-promotion -Wduplicated-branches -Wduplicated-cond -Wextra -Wformat-signedness -Winit-self -Winvalid-pch -Wlogical-op -Wmissing-declarations -Wmissing-include-dirs -Wmissing-prototypes -Wnested-externs -Wnull-dereference -Wold-style-definition -Wopenmp-simd -Wpointer-arith -Wstrict-overflow -Wstrict-prototypes -Wsuggest-attribute=cold -Wsuggest-attribute=format -Wsuggest-attribute=noreturn -Wsuggest-final-methods -Wsuggest-final-types -Wsync-nand -Wtrampolines -Wuninitialized -Wunknown-pragmas -Wunused-macros -Wvariadic-macros -Wvector-operation-performance -Wwrite-strings -Warray-bounds=2 -Wattribute-alias=2 -Wformat-overflow=2 -Wformat=2 -Wformat-truncation=2 -Wimplicit-fallthrough=5 -Wshift-overflow=2 -Wunused-const-variable=2 -Wno-analyzer-double-free -Wno-analyzer-malloc-leak -Wno-analyzer-null-dereference -Wno-analyzer-use-after-free -Wno-unused-parameter -Wno-missing-field-initializers -fdiagnostics-show-option -Wframe-larger-than=6000 -Wstack-usage=10000 -Wimplicit-fallthrough=4 -Wformat-truncation=1 -Wformat-overflow=1 -Wno-pragmas   -fvisibility=hidden -I/usr/local/Cellar/pcre/8.44/include -I/usr/local/Cellar/libvirt/7.2.0/include  -I/usr/local/Cellar/jansson/2.13.1/include -D_FILE_OFFSET_BITS=64 -D_DARWIN_USE_64_BIT_INODE -I/usr/local/include/osxfuse/fuse -g -O2 -fno-strict-overflow -Wno-strict-overflow -c -o libguestfs_la-actions-0.lo `test -f 'actions-0.c' || echo './'`actions-0.c
2021-04-19T22:29:22.5695980Z bash ../libtool-kill-dependency_libs.sh ../libtool  --tag=CC   --mode=compile clang -DHAVE_CONFIG_H -I. -I..  -DGUESTFS_PRIVATE=1 -I../common/errnostring -I../common/errnostring -I../common/protocol -I../common/protocol -I../common/qemuopts -I../common/qemuopts -I../common/utils -I../common/utils -I../common/structs -I../common/structs -I../gnulib/lib -I../gnulib/lib -I../include  -fno-common -Wall -Warith-conversion -Wbad-function-cast -Wcast-align=strict -Wdate-time -Wdisabled-optimization -Wdouble-promotion -Wduplicated-branches -Wduplicated-cond -Wextra -Wformat-signedness -Winit-self -Winvalid-pch -Wlogical-op -Wmissing-declarations -Wmissing-include-dirs -Wmissing-prototypes -Wnested-externs -Wnull-dereference -Wold-style-definition -Wopenmp-simd -Wpointer-arith -Wstrict-overflow -Wstrict-prototypes -Wsuggest-attribute=cold -Wsuggest-attribute=format -Wsuggest-attribute=noreturn -Wsuggest-final-methods -Wsuggest-final-types -Wsync-nand -Wtrampolines -Wuninitialized -Wunknown-pragmas -Wunused-macros -Wvariadic-macros -Wvector-operation-performance -Wwrite-strings -Warray-bounds=2 -Wattribute-alias=2 -Wformat-overflow=2 -Wformat=2 -Wformat-truncation=2 -Wimplicit-fallthrough=5 -Wshift-overflow=2 -Wunused-const-variable=2 -Wno-analyzer-double-free -Wno-analyzer-malloc-leak -Wno-analyzer-null-dereference -Wno-analyzer-use-after-free -Wno-unused-parameter -Wno-missing-field-initializers -fdiagnostics-show-option -Wframe-larger-than=6000 -Wstack-usage=10000 -Wimplicit-fallthrough=4 -Wformat-truncation=1 -Wformat-overflow=1 -Wno-pragmas   -fvisibility=hidden -I/usr/local/Cellar/pcre/8.44/include -I/usr/local/Cellar/libvirt/7.2.0/include  -I/usr/local/Cellar/jansson/2.13.1/include -D_FILE_OFFSET_BITS=64 -D_DARWIN_USE_64_BIT_INODE -I/usr/local/include/osxfuse/fuse -g -O2 -fno-strict-overflow -Wno-strict-overflow -c -o libguestfs_la-actions-1.lo `test -f 'actions-1.c' || echo './'`actions-1.c
2021-04-19T22:29:22.5705760Z libvirt-is-version.c:26:10: fatal error: 'error.h' file not found
2021-04-19T22:29:22.5706400Z #include 
2021-04-19T22:29:22.5706770Z          ^~~~~~~~~
2021-04-19T22:29:22.5707110Z 1 error generated.
2021-04-19T22:29:22.5708120Z make[3]: *** [libvirt_is_version-libvirt-is-version.o] Error 1
2021-04-19T22:29:22.5708800Z make[3]: *** Waiting for unfinished jobs....
2021-04-19T22:29:22.5719440Z libtool: compile:  clang -DHAVE_CONFIG_H -I. -I.. -DGUESTFS_PRIVATE=1 -I../common/errnostring -I../common/errnostring -I../common/protocol -I../common/protocol -I../common/qemuopts -I../common/qemuopts -I../common/utils -I../common/utils -I../common/structs -I../common/structs -I../gnulib/lib -I../gnulib/lib -I../include -fno-common -Wall -Warith-conversion -Wbad-function-cast -Wcast-align=strict -Wdate-time -Wdisabled-optimization -Wdouble-promotion -Wduplicated-branches -Wduplicated-cond -Wextra -Wformat-signedness -Winit-self -Winvalid-pch -Wlogical-op -Wmissing-declarations -Wmissing-include-dirs -Wmissing-prototypes -Wnested-externs -Wnull-dereference -Wold-style-definition -Wopenmp-simd -Wpointer-arith -Wstrict-overflow -Wstrict-prototypes -Wsuggest-attribute=cold -Wsuggest-attribute=format -Wsuggest-attribute=noreturn -Wsuggest-final-methods -Wsuggest-final-types -Wsync-nand -Wtrampolines -Wuninitialized -Wunknown-pragmas -Wunused-macros -Wvariadic-macros -Wvector-operation-performance -Wwrite-strings -Warray-bounds=2 -Wattribute-alias=2 -Wformat-overflow=2 -Wformat=2 -Wformat-truncation=2 -Wimplicit-fallthrough=5 -Wshift-overflow=2 -Wunused-const-variable=2 -Wno-analyzer-double-free -Wno-analyzer-malloc-leak -Wno-analyzer-null-dereference -Wno-analyzer-use-after-free -Wno-unused-parameter -Wno-missing-field-initializers -fdiagnostics-show-option -Wframe-larger-than=6000 -Wstack-usage=10000 -Wimplicit-fallthrough=4 -Wformat-truncation=1 -Wformat-overflow=1 -Wno-pragmas -fvisibility=hidden -I/usr/local/Cellar/pcre/8.44/include -I/usr/local/Cellar/libvirt/7.2.0/include -I/usr/local/Cellar/jansson/2.13.1/include -D_FILE_OFFSET_BITS=64 -D_DARWIN_USE_64_BIT_INODE -I/usr/local/include/osxfuse/fuse -g -O2 -fno-strict-overflow -Wno-strict-overflow -c actions-0.c  -fno-common -DPIC -o .libs/libguestfs_la-actions-0.o
2021-04-19T22:29:22.5738430Z libtool: compile:  clang -DHAVE_CONFIG_H -I. -I.. -DGUESTFS_PRIVATE=1 -I../common/errnostring -I../common/errnostring -I../common/protocol -I../common/protocol -I../common/qemuopts -I../common/qemuopts -I../common/utils -I../common/utils -I../common/structs -I../common/structs -I../gnulib/lib -I../gnulib/lib -I../include -fno-common -Wall -Warith-conversion -Wbad-function-cast -Wcast-align=strict -Wdate-time -Wdisabled-optimization -Wdouble-promotion -Wduplicated-branches -Wduplicated-cond -Wextra -Wformat-signedness -Winit-self -Winvalid-pch -Wlogical-op -Wmissing-declarations -Wmissing-include-dirs -Wmissing-prototypes -Wnested-externs -Wnull-dereference -Wold-style-definition -Wopenmp-simd -Wpointer-arith -Wstrict-overflow -Wstrict-prototypes -Wsuggest-attribute=cold -Wsuggest-attribute=format -Wsuggest-attribute=noreturn -Wsuggest-final-methods -Wsuggest-final-types -Wsync-nand -Wtrampolines -Wuninitialized -Wunknown-pragmas -Wunused-macros -Wvariadic-macros -Wvector-operation-performance -Wwrite-strings -Warray-bounds=2 -Wattribute-alias=2 -Wformat-overflow=2 -Wformat=2 -Wformat-truncation=2 -Wimplicit-fallthrough=5 -Wshift-overflow=2 -Wunused-const-variable=2 -Wno-analyzer-double-free -Wno-analyzer-malloc-leak -Wno-analyzer-null-dereference -Wno-analyzer-use-after-free -Wno-unused-parameter -Wno-missing-field-initializers -fdiagnostics-show-option -Wframe-larger-than=6000 -Wstack-usage=10000 -Wimplicit-fallthrough=4 -Wformat-truncation=1 -Wformat-overflow=1 -Wno-pragmas -fvisibility=hidden -I/usr/local/Cellar/pcre/8.44/include -I/usr/local/Cellar/libvirt/7.2.0/include -I/usr/local/Cellar/jansson/2.13.1/include -D_FILE_OFFSET_BITS=64 -D_DARWIN_USE_64_BIT_INODE -I/usr/local/include/osxfuse/fuse -g -O2 -fno-strict-overflow -Wno-strict-overflow -c actions-1.c  -fno-common -DPIC -o .libs/libguestfs_la-actions-1.o
2021-04-19T22:29:22.5757980Z libtool: compile:  clang -DHAVE_CONFIG_H -I. -I.. -DGUESTFS_PRIVATE=1 -I../common/errnostring -I../common/errnostring -I../common/protocol -I../common/protocol -I../common/qemuopts -I../common/qemuopts -I../common/utils -I../common/utils -I../common/structs -I../common/structs -I../gnulib/lib -I../gnulib/lib -I../include -fno-common -Wall -Warith-conversion -Wbad-function-cast -Wcast-align=strict -Wdate-time -Wdisabled-optimization -Wdouble-promotion -Wduplicated-branches -Wduplicated-cond -Wextra -Wformat-signedness -Winit-self -Winvalid-pch -Wlogical-op -Wmissing-declarations -Wmissing-include-dirs -Wmissing-prototypes -Wnested-externs -Wnull-dereference -Wold-style-definition -Wopenmp-simd -Wpointer-arith -Wstrict-overflow -Wstrict-prototypes -Wsuggest-attribute=cold -Wsuggest-attribute=format -Wsuggest-attribute=noreturn -Wsuggest-final-methods -Wsuggest-final-types -Wsync-nand -Wtrampolines -Wuninitialized -Wunknown-pragmas -Wunused-macros -Wvariadic-macros -Wvector-operation-performance -Wwrite-strings -Warray-bounds=2 -Wattribute-alias=2 -Wformat-overflow=2 -Wformat=2 -Wformat-truncation=2 -Wimplicit-fallthrough=5 -Wshift-overflow=2 -Wunused-const-variable=2 -Wno-analyzer-double-free -Wno-analyzer-malloc-leak -Wno-analyzer-null-dereference -Wno-analyzer-use-after-free -Wno-unused-parameter -Wno-missing-field-initializers -fdiagnostics-show-option -Wframe-larger-than=6000 -Wstack-usage=10000 -Wimplicit-fallthrough=4 -Wformat-truncation=1 -Wformat-overflow=1 -Wno-pragmas -fvisibility=hidden -I/usr/local/Cellar/pcre/8.44/include -I/usr/local/Cellar/libvirt/7.2.0/include -I/usr/local/Cellar/jansson/2.13.1/include -D_FILE_OFFSET_BITS=64 -D_DARWIN_USE_64_BIT_INODE -I/usr/local/include/osxfuse/fuse -g -O2 -fno-strict-overflow -Wno-strict-overflow -c actions-0.c -o libguestfs_la-actions-0.o >/dev/null 2>&1
2021-04-19T22:29:22.5776830Z libtool: compile:  clang -DHAVE_CONFIG_H -I. -I.. -DGUESTFS_PRIVATE=1 -I../common/errnostring -I../common/errnostring -I../common/protocol -I../common/protocol -I../common/qemuopts -I../common/qemuopts -I../common/utils -I../common/utils -I../common/structs -I../common/structs -I../gnulib/lib -I../gnulib/lib -I../include -fno-common -Wall -Warith-conversion -Wbad-function-cast -Wcast-align=strict -Wdate-time -Wdisabled-optimization -Wdouble-promotion -Wduplicated-branches -Wduplicated-cond -Wextra -Wformat-signedness -Winit-self -Winvalid-pch -Wlogical-op -Wmissing-declarations -Wmissing-include-dirs -Wmissing-prototypes -Wnested-externs -Wnull-dereference -Wold-style-definition -Wopenmp-simd -Wpointer-arith -Wstrict-overflow -Wstrict-prototypes -Wsuggest-attribute=cold -Wsuggest-attribute=format -Wsuggest-attribute=noreturn -Wsuggest-final-methods -Wsuggest-final-types -Wsync-nand -Wtrampolines -Wuninitialized -Wunknown-pragmas -Wunused-macros -Wvariadic-macros -Wvector-operation-performance -Wwrite-strings -Warray-bounds=2 -Wattribute-alias=2 -Wformat-overflow=2 -Wformat=2 -Wformat-truncation=2 -Wimplicit-fallthrough=5 -Wshift-overflow=2 -Wunused-const-variable=2 -Wno-analyzer-double-free -Wno-analyzer-malloc-leak -Wno-analyzer-null-dereference -Wno-analyzer-use-after-free -Wno-unused-parameter -Wno-missing-field-initializers -fdiagnostics-show-option -Wframe-larger-than=6000 -Wstack-usage=10000 -Wimplicit-fallthrough=4 -Wformat-truncation=1 -Wformat-overflow=1 -Wno-pragmas -fvisibility=hidden -I/usr/local/Cellar/pcre/8.44/include -I/usr/local/Cellar/libvirt/7.2.0/include -I/usr/local/Cellar/jansson/2.13.1/include -D_FILE_OFFSET_BITS=64 -D_DARWIN_USE_64_BIT_INODE -I/usr/local/include/osxfuse/fuse -g -O2 -fno-strict-overflow -Wno-strict-overflow -c actions-1.c -o libguestfs_la-actions-1.o >/dev/null 2>&1
2021-04-19T22:29:22.5785700Z make[2]: *** [all] Error 2
2021-04-19T22:29:22.5786570Z make[1]: *** [all-recursive] Error 1
2021-04-19T22:29:22.5787000Z make: *** [all] Error 2

The issue is that error.h isn't found, while error.h exists under gnulib/lib. That include flag doesn't seem to be properly added to the compilation for lib/libvirt-is-version.c. However, even when I edit the Makefile and add that include flag manually, it still fails because _error is not defined. I tried manually adding the local gnulib/lib/libgnu.la to the LDFLAGS while running make -C lib, but that didn't change the failure at all.

timmattison commented 3 years ago

libguestfs is really amazing but quite a beast to build. I really appreciate your efforts into making this available on Mac OS. I tried and failed a few times and I'm now delegating my libguestfs work to a Linux system but it would be tremendously convenient to have it in Mac OS.

If you ever need someone to test out your work please ping me!

Amar1729 commented 3 years ago

Thanks @timmattison ! Yup, ferreting out patches to make certain versions compile on macOS has been a bit of an adventure. Glad to hear somebody appreciates it though, I honestly figured I'd be the only one using this tap.

timmattison commented 3 years ago

No way, I think a lot of people are in the same boat as me. Tried, failed, gave up. I've been looking at libguestfs on and off for years and just found your project today. It's likely just a lack of visibility, not a lack of interest. When I tell people what libguestfs does they don't even believe me. It is pretty magical.

nallux-dozryl commented 1 year ago

I know it's been a while, is this still being worked on? Thanks for your efforts!

Amar1729 commented 1 year ago

@nallux-dozryl unfortunately, not working on this actively right now, I ran into a few daed ends with the effort and haven't kept up. Might need to look into the mailing lists to see if there's been anymore recent progress on expanding support to macOS (although I somewhat doubt it, especially given the arm architecture switchover).