Bug 1493048 - Unbound constructor Hivex.OPEN_UNSAFE
Summary: Unbound constructor Hivex.OPEN_UNSAFE
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Virtualization Tools
Classification: Community
Component: libguestfs
Version: unspecified
Hardware: x86_64
OS: Linux
unspecified
high
Target Milestone: ---
Assignee: Richard W.M. Jones
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-09-19 09:02 UTC by jean-christophe manciot
Modified: 2018-02-07 16:00 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-02-07 16:00:56 UTC
Embargoed:


Attachments (Terms of Use)
Build log (384.74 KB, text/x-vhdl)
2017-09-19 09:02 UTC, jean-christophe manciot
no flags Details

Description jean-christophe manciot 2017-09-19 09:02:01 UTC
Created attachment 1327838 [details]
Build log

Description of problem:
----------------------
I can't build libguestfs anymore due to the following recent change in ./daemon/inspect_utils.ml:

* cb7696a5d - daemon: Implement inspection types and utility functions. (2 days ago) <Richard W.M. Jones>n--abbrev-commit
 
Version-Release number of selected component (if applicable):
------------------------------------------------------------
1.37.26.

Steps to Reproduce:
------------------
        export NOCONFIGURE=yes
        ./autogen.sh
        ./configure   --build=x86_64-pc-linux-gnu \
                      --enable-fuse \
                      --enable-golang \
                      --prefix=/usr --sysconfdir=/etc --localstatedir=/var

        make
...
  OCAMLOPT inspect_utils.cmx
File "inspect_utils.ml", line 184, characters 16-33:
Error: Unbound constructor Hivex.OPEN_UNSAFE
Makefile:4801: recipe for target 'inspect_utils.cmx' failed

Additional info:
---------------
Ubuntu 17.04
sources: https://github.com/libguestfs/libguestfs

Whole build log is attached.

Comment 1 Richard W.M. Jones 2017-09-19 09:09:01 UTC
You need the newer version of hivex which adds this.
hivex >= 1.3.14

It's basically required because without this libguestfs cannot
inspect certain corrupted-but-not-broken Windows machines
(upstream commit was 8ee7da48c54e4baafa90dd787cd3708834205b52
but I can't find the BZ right now).

Comment 3 Pino Toscano 2018-01-30 17:25:37 UTC
Patch posted:
https://www.redhat.com/archives/libguestfs/2018-January/msg00283.html

Comment 4 jean-christophe manciot 2018-01-31 10:37:41 UTC
I've applied the patch to v1.37.36 before the autogen.sh/configure process.
Now I have some make errors:
...
make[2]: Entering directory '/media/actionmystique/SAMSUNG5-Shared/home/actionmystique/src/Libguestfs/git-libguestfs/daemon'
../ocaml-dep.sh chroot.mli file.mli inspect.mli inspect_fs.mli is.mli findfs.mli inspect_fs_unix.mli devsparts.mli inspect_fs_windows.mli lvm.mli daemon.mli optgroups.mli config_daemon.mli md.mli inspect_types.mli ldm.mli structs.mli utils.mli mountable.mli listfs.mli blkid.mli sysroot.mli realpath.mli parted.mli filearch.mli mount.mli link.mli statvfs.mli inspect_utils.mli callbacks.mli btrfs.mli inspect_fs_unix_fstab.mli chroot.ml file.ml optgroups.ml is.ml mount.ml inspect.ml findfs.ml inspect_fs_unix.ml inspect_utils.ml devsparts.ml lvm.ml daemon.ml filearch.ml config_daemon.ml md.ml inspect_types.ml ldm.ml structs.ml utils.ml mountable.ml listfs.ml sysroot.ml realpath.ml blkid.ml parted.ml inspect_fs.ml link.ml inspect_fs_unix_fstab.ml inspect_fs_windows.ml daemon_utils_tests.ml statvfs.ml btrfs.ml callbacks.ml
File "config_daemon.ml", line 20, characters 49-50:
Error: Syntax error
make  all-am
make[3]: Entering directory '/media/actionmystique/SAMSUNG5-Shared/home/actionmystique/src/Libguestfs/git-libguestfs/daemon'
../ocaml-dep.sh chroot.mli file.mli inspect.mli inspect_fs.mli is.mli findfs.mli inspect_fs_unix.mli devsparts.mli inspect_fs_windows.mli lvm.mli daemon.mli optgroups.mli config_daemon.mli md.mli inspect_types.mli ldm.mli structs.mli utils.mli mountable.mli listfs.mli blkid.mli sysroot.mli realpath.mli parted.mli filearch.mli mount.mli link.mli statvfs.mli inspect_utils.mli callbacks.mli btrfs.mli inspect_fs_unix_fstab.mli chroot.ml file.ml optgroups.ml is.ml mount.ml inspect.ml findfs.ml inspect_fs_unix.ml inspect_utils.ml devsparts.ml lvm.ml daemon.ml filearch.ml config_daemon.ml md.ml inspect_types.ml ldm.ml structs.ml utils.ml mountable.ml listfs.ml sysroot.ml realpath.ml blkid.ml parted.ml inspect_fs.ml link.ml inspect_fs_unix_fstab.ml inspect_fs_windows.ml daemon_utils_tests.ml statvfs.ml btrfs.ml callbacks.ml
File "config_daemon.ml", line 20, characters 49-50:
Error: Syntax error
  OCAMLOPT config_daemon.cmx
File "config_daemon.ml", line 20, characters 49-50:
Error: Syntax error

Comment 5 Pino Toscano 2018-01-31 11:15:34 UTC
(In reply to jean-christophe manciot from comment #4)
> I've applied the patch to v1.37.36 before the autogen.sh/configure process.
> Now I have some make errors:
> ...
> File "config_daemon.ml", line 20, characters 49-50:
> Error: Syntax error

Please provide the content of daemon/config_daemon.ml.

Comment 6 jean-christophe manciot 2018-02-02 11:02:03 UTC
let hivex_flag_unsafe = [ HIVEX_OPEN_UNSAFE_FLAG@]

Comment 7 Pino Toscano 2018-02-06 11:46:08 UTC
(In reply to jean-christophe manciot from comment #6)
> let hivex_flag_unsafe = [ HIVEX_OPEN_UNSAFE_FLAG@]

This means my patch was not applied correctly.  It looks like the patch was extracted by copying&pasting its text from the web page of the mailing list archive.

Comment 8 jean-christophe manciot 2018-02-06 15:05:15 UTC
I don"t see any link for the patch other than the html document in https://bugzilla.redhat.com/show_bug.cgi?id=1493048#c3.

I have extracted all the lines below and including --- into the patch which has been applied on a checkout of the tag v1.37.36 with:
git-libguestfs# git apply "../without Hivex.OPEN_UNSAFE.patch"

If there is another way to extract it, I'd be glad to read it.

Comment 9 Richard W.M. Jones 2018-02-06 15:41:38 UTC
Pino is respinning the patch and going to submit it upstream so
you'll be able to pull it from the git repo in a little while.

Comment 10 Pino Toscano 2018-02-07 16:00:56 UTC
Fixed upstream with
https://github.com/libguestfs/libguestfs/commit/82fbf294fd48e9bf31f8dd534ba5ea1f5bfce117
which is in libguestfs >= 1.37.38.


Note You need to log in before you can comment on or make changes to this bug.