All of lore.kernel.org
 help / color / mirror / Atom feed
From: Olaf Hering <olaf@aepfle.de>
To: xen-devel@lists.xen.org
Subject: ocaml libxl bindings and KeyedUnion
Date: Fri, 20 Mar 2015 09:10:27 +0100	[thread overview]
Message-ID: <20150320081027.GA20008@aepfle.de> (raw)


Some change commited to staging earlier this week breaks ocaml bindings,
as shown below. I think it was introduced between
a68d1b65bb1bbb9b8db2d82695d32ac09c52a2d7..d4ea77c9d7b314001ff4e2eb7618b45f11551371:

NotImplementedError: Cannot handle KeyedUnion fields which are not Structs

But now that I look at it, may it be my pvscsi change by any chance?
https://github.com/olafhering/xen/commit/f0de53755f628efe64cd60d4511a9667485eba62

diff --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl
index 48cd9af..2bd050d 100644
--- a/tools/libxl/libxl_types.idl
+++ b/tools/libxl/libxl_types.idl
@@ -556,12 +556,21 @@ libxl_vscsi_hctl = Struct("vscsi_hctl", [
     ("lun", uint32),
     ])
 
+libxl_vscsi_pdev = Struct("vscsi_pdev", [
+    ("p_devname",        string),
+    ("u", KeyedUnion(None, libxl_vscsi_pdev_type, "type",
+        [
+         ("invalid", None),
+         ("dev", libxl_vscsi_hctl),
+         ("wwn", string),
+         ("hctl", libxl_vscsi_hctl),
+        ])),
+    ])
+
 libxl_vscsi_dev = Struct("vscsi_dev", [
     ("vscsi_dev_id",     libxl_devid),
     ("remove",           bool),
-    ("p_devname",        string),
-    ("pdev_type",        libxl_vscsi_pdev_type),
-    ("pdev",             libxl_vscsi_hctl),
+    ("pdev",             libxl_vscsi_pdev),
     ("vdev",             libxl_vscsi_hctl),
     ])
 
@@ -624,8 +633,7 @@ libxl_vscsiinfo = Struct("vscsiinfo", [
     ("frontend", string),
     ("frontend_id", uint32),
     ("devid", libxl_devid),
-    ("p_devname", string),
-    ("pdev", libxl_vscsi_hctl),
+    ("pdev", libxl_vscsi_pdev),
     ("vdev", libxl_vscsi_hctl),
     ("vscsi_dev_id", libxl_devid),
     ("feature_host", bool),

Olaf

....
ocamlc -g -I ../xb/ -w F -warn-error F -c -o xsraw.cmi xsraw.mli
ocamlc -g -I ../xb/ -w F -warn-error F -c -o xsraw.cmo xsraw.ml
ocamlc -g -I ../xb/ -w F -warn-error F -c -o xst.cmi xst.mli
ocamlc -g -I ../xb/ -w F -warn-error F -c -o xst.cmo xst.ml
ocamlc -g -I ../xb/ -w F -warn-error F -c -o xs.cmi xs.mli
ocamlc -g -I ../xb/ -w F -warn-error F -c -o xs.cmo xs.ml
ocamlc -pack -o xenstore.cmo queueop.cmo xsraw.cmo xst.cmo xs.cmo
ocamlc -g -I ../xb/ -w F -warn-error F -a -o xenstore.cma    xenstore.cmo
ocamlopt -g -ccopt "   -Wl,-rpath,/opt/xen/upstream/staging-wip/lib64" -dtypes -I ../xb/ -cc gcc -w F -warn-error F -for-pack Xenstore -c -o queueop.cmx queueop.ml
ocamlopt -g -ccopt "   -Wl,-rpath,/opt/xen/upstream/staging-wip/lib64" -dtypes -I ../xb/ -cc gcc -w F -warn-error F -for-pack Xenstore -c -o xsraw.cmx xsraw.ml
ocamlopt -g -ccopt "   -Wl,-rpath,/opt/xen/upstream/staging-wip/lib64" -dtypes -I ../xb/ -cc gcc -w F -warn-error F -for-pack Xenstore -c -o xst.cmx xst.ml
ocamlopt -g -ccopt "   -Wl,-rpath,/opt/xen/upstream/staging-wip/lib64" -dtypes -I ../xb/ -cc gcc -w F -warn-error F -for-pack Xenstore -c -o xs.cmx xs.ml
ocamlopt -pack -o xenstore.cmx queueop.cmx xsraw.cmx xst.cmx xs.cmx
ocamlopt -g -ccopt "   -Wl,-rpath,/opt/xen/upstream/staging-wip/lib64" -dtypes -I ../xb/ -cc gcc -w F -warn-error F -for-pack Xenstore -a -o xenstore.cmxa    xenstore.cmx
sed 's/@VERSION@/4.1/g' < META.in >META.new && mv -f META.new META
mkdir -p /work/olaf/13.1/github/olafhering/xen.git/dist/install//opt/xen/upstream/staging-wip/lib64/ocaml
ocamlfind remove -destdir /work/olaf/13.1/github/olafhering/xen.git/dist/install//opt/xen/upstream/staging-wip/lib64/ocaml xenstore
ocamlfind: [WARNING] No such directory: /work/olaf/13.1/github/olafhering/xen.git/dist/install//opt/xen/upstream/staging-wip/lib64/ocaml/xenstore
ocamlfind install -destdir /work/olaf/13.1/github/olafhering/xen.git/dist/install//opt/xen/upstream/staging-wip/lib64/ocaml -ldconf ignore xenstore META xenstore.cma xenstore.cmxa xenstore.cmo xenstore.cmi xenstore.cmx *.a
Installed /work/olaf/13.1/github/olafhering/xen.git/dist/install//opt/xen/upstream/staging-wip/lib64/ocaml/xenstore/xenstore.a
Installed /work/olaf/13.1/github/olafhering/xen.git/dist/install//opt/xen/upstream/staging-wip/lib64/ocaml/xenstore/xenstore.cmx
Installed /work/olaf/13.1/github/olafhering/xen.git/dist/install//opt/xen/upstream/staging-wip/lib64/ocaml/xenstore/xenstore.cmi
Installed /work/olaf/13.1/github/olafhering/xen.git/dist/install//opt/xen/upstream/staging-wip/lib64/ocaml/xenstore/xenstore.cmo
Installed /work/olaf/13.1/github/olafhering/xen.git/dist/install//opt/xen/upstream/staging-wip/lib64/ocaml/xenstore/xenstore.cmxa
Installed /work/olaf/13.1/github/olafhering/xen.git/dist/install//opt/xen/upstream/staging-wip/lib64/ocaml/xenstore/xenstore.cma
Installed /work/olaf/13.1/github/olafhering/xen.git/dist/install//opt/xen/upstream/staging-wip/lib64/ocaml/xenstore/META
make[7]: Leaving directory `/work/olaf/13.1/github/olafhering/xen.git/tools/ocaml/libs/xs'
make[6]: Leaving directory `/work/olaf/13.1/github/olafhering/xen.git/tools/ocaml/libs'
make[6]: Entering directory `/work/olaf/13.1/github/olafhering/xen.git/tools/ocaml/libs'
make -C xl install
make[7]: Entering directory `/work/olaf/13.1/github/olafhering/xen.git/tools/ocaml/libs/xl'
PYTHONPATH=/work/olaf/13.1/github/olafhering/xen.git/tools/ocaml/libs/xl/../../../../tools/libxl python genwrap.py \
        /work/olaf/13.1/github/olafhering/xen.git/tools/ocaml/libs/xl/../../../../tools/libxl/libxl_types.idl \
        _libxl_types.mli.in _libxl_types.ml.in _libxl_types.inc
Parsing /work/olaf/13.1/github/olafhering/xen.git/tools/ocaml/libs/xl/../../../../tools/libxl/libxl_types.idl
Traceback (most recent call last):
  File "genwrap.py", line 529, in <module>
    ml.write(gen_ocaml_ml(ty, False))
  File "genwrap.py", line 208, in gen_ocaml_ml
    ku, union_type = gen_ocaml_keyedunions(f.type, interface, "\t")
  File "genwrap.py", line 161, in gen_ocaml_keyedunions
    raise NotImplementedError("Cannot handle KeyedUnion fields which are not Structs")
NotImplementedError: Cannot handle KeyedUnion fields which are not Structs
make[7]: *** No rule to make target `_libxl_types.ml.in', needed by `xenlight.ml'.  Stop.
make[7]: Leaving directory `/work/olaf/13.1/github/olafhering/xen.git/tools/ocaml/libs/xl'
make[6]: *** [subdir-install-xl] Error 2
make[6]: Leaving directory `/work/olaf/13.1/github/olafhering/xen.git/tools/ocaml/libs'
make[5]: *** [subdirs-install] Error 2
make[5]: Leaving directory `/work/olaf/13.1/github/olafhering/xen.git/tools/ocaml/libs'
make[4]: *** [subdir-install-libs] Error 2
make[4]: Leaving directory `/work/olaf/13.1/github/olafhering/xen.git/tools/ocaml'
make[3]: *** [subdirs-install] Error 2
make[3]: Leaving directory `/work/olaf/13.1/github/olafhering/xen.git/tools/ocaml'
make[2]: *** [subdir-install-ocaml] Error 2
make[2]: Leaving directory `/work/olaf/13.1/github/olafhering/xen.git/tools'
make[1]: *** [subdirs-install] Error 2
make[1]: Leaving directory `/work/olaf/13.1/github/olafhering/xen.git/tools'
make: *** [install-tools] Error 2

real    4m44.888s
user    11m19.208s
sys     1m50.444s
root@optiplex:/work/olaf/13.1/github/olafhering/xen.git #

             reply	other threads:[~2015-03-20  8:10 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-20  8:10 Olaf Hering [this message]
2015-03-20  9:25 ` ocaml libxl bindings and KeyedUnion Ian Campbell
2015-03-20 16:44   ` Olaf Hering
2015-03-20 17:01     ` Ian Campbell
2015-03-24 12:18       ` Olaf Hering

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150320081027.GA20008@aepfle.de \
    --to=olaf@aepfle.de \
    --cc=xen-devel@lists.xen.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.