xapi-project / xen-api

The Xapi Project's XenAPI Server
http://xenproject.org/developers/teams/xapi.html
Other
345 stars 285 forks source link

Compiling with ppx_variants_conv "Error: Unbound value Lexer.keyword_table" #4548

Closed Cameronsplaze closed 3 years ago

Cameronsplaze commented 3 years ago

Fresh install of Ubuntu Desktop 20.04, I'm trying to run xe with the xen hypervisor. I can't find a way to download it directly, so I think you build it from source? I haven't used opam before this attempt, so hopefully it's an easy fix.

Commands from my notes:

# Setup opam
sudo apt install opam
opam init --yes

# Get the source
git clone git@github.com:xapi-project/xen-api.git
cd xen-api

opam switch create ocaml-base-compiler
eval $(opam env) # Refresh your shell with the new switch
opam repo add xs-opam --all-switches https://github.com/xapi-project/xs-opam.git
opam pin --yes add . --no-action
PACKAGES="xapi-cli-protocol xapi-client xapi-consts xapi-database xapi-datamodel xapi-types xapi xe xen-api-sdk xen-api-client xen-api-client-lwt xen-api-client-async xapi-rrdd xapi-rrdd-plugin xapi-rrd-transport xapi-rrd-transport-utils rrd-transport rrdd-plugin rrdd-plugins rrddump gzip http-svr pciutil safe-resources sexpr stunnel uuid xapi-compression xml-light2 zstd vhd-tool"

# Resolve any dependencies
opam --yes depext --yes -u $PACKAGES
opam install $PACKAGES --yes --deps-only --with-test -v

This last command always fails with "Error: Unbound value Lexer.keyword_table"

Output of opam install. Some packages are cached ``` <><> Synchronising pinned packages ><><><><><><><><><><><><><><><><><><><><><><> [http-svr.master] no changes from git+file:///home/victor/Documents/xen-api#master [gzip.master] no changes from git+file:///home/victor/Documents/xen-api#master [pciutil.master] no changes from git+file:///home/victor/Documents/xen-api#master [rrd-transport.master] no changes from git+file:///home/victor/Documents/xen-api#master [rrdd-plugin.master] no changes from git+file:///home/victor/Documents/xen-api#master [rrdd-plugins.master] no changes from git+file:///home/victor/Documents/xen-api#master [rrddump.master] no changes from git+file:///home/victor/Documents/xen-api#master [stunnel.master] no changes from git+file:///home/victor/Documents/xen-api#master [safe-resources.master] no changes from git+file:///home/victor/Documents/xen-api#master [sexpr.master] no changes from git+file:///home/victor/Documents/xen-api#master [uuid.master] no changes from git+file:///home/victor/Documents/xen-api#master [vhd-tool.master] no changes from git+file:///home/victor/Documents/xen-api#master [xapi.master] no changes from git+file:///home/victor/Documents/xen-api#master [xapi-cli-protocol.master] no changes from git+file:///home/victor/Documents/xen-api#master [xapi-client.master] no changes from git+file:///home/victor/Documents/xen-api#master [xapi-compression.master] no changes from git+file:///home/victor/Documents/xen-api#master [xapi-consts.master] no changes from git+file:///home/victor/Documents/xen-api#master [xapi-database.master] no changes from git+file:///home/victor/Documents/xen-api#master [xapi-datamodel.master] no changes from git+file:///home/victor/Documents/xen-api#master [xapi-rrd-transport.master] no changes from git+file:///home/victor/Documents/xen-api#master [xapi-rrd-transport-utils.master] no changes from git+file:///home/victor/Documents/xen-api#master [xapi-rrdd.master] no changes from git+file:///home/victor/Documents/xen-api#master [xapi-rrdd-plugin.master] no changes from git+file:///home/victor/Documents/xen-api#master [xapi-types.master] no changes from git+file:///home/victor/Documents/xen-api#master [xe.master] no changes from git+file:///home/victor/Documents/xen-api#master [xen-api-client.master] no changes from git+file:///home/victor/Documents/xen-api#master [xen-api-client-async.master] no changes from git+file:///home/victor/Documents/xen-api#master [xen-api-client-lwt.master] no changes from git+file:///home/victor/Documents/xen-api#master [xen-api-sdk.master] no changes from git+file:///home/victor/Documents/xen-api#master [xml-light2.master] no changes from git+file:///home/victor/Documents/xen-api#master [zstd.master] no changes from git+file:///home/victor/Documents/xen-api#master The following actions will be performed: ∗ install ppx_variants_conv v0.14.1 ∗ install bin_prot v0.14.0 ∗ install ppx_bin_prot v0.14.0 ∗ install ppx_jane v0.14.0 ∗ install base_bigstring v0.14.0 ∗ install core_kernel v0.14.2 ∗ install timezone v0.14.0 ∗ install protocol_version_header v0.14.0 ∗ install async_kernel v0.14.0 ∗ install core v0.14.1 ∗ install async_rpc_kernel v0.14.0 ∗ install textutils v0.14.0 ∗ install async_unix v0.14.0 ∗ install async v0.14.0 ===== ∗ 14 ===== <><> Gathering sources ><><><><><><><><><><><><><><><><><><><><><><><><><><><><> [async.v0.14.0] found in cache [async_kernel.v0.14.0] found in cache [async_rpc_kernel.v0.14.0] found in cache [async_unix.v0.14.0] found in cache [base_bigstring.v0.14.0] found in cache [bin_prot.v0.14.0] found in cache [core.v0.14.1] found in cache [core_kernel.v0.14.2] found in cache [ppx_bin_prot.v0.14.0] found in cache [ppx_jane.v0.14.0] found in cache [ppx_variants_conv.v0.14.1] found in cache [protocol_version_header.v0.14.0] found in cache [textutils.v0.14.0] found in cache [timezone.v0.14.0] found in cache <><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><> + /home/victor/.opam/opam-init/hooks/sandbox.sh "build" "dune" "build" "-p" "ppx_variants_conv" "-j" "3" (CWD=/home/victor/.opam/ocaml-base-compiler/.opam-switch/build/ppx_variants_conv.v0.14.1) - ocamlc src/.ppx_variants_conv.objs/byte/ppx_variants_conv.{cmo,cmt} (exit 2) - (cd _build/default && /home/victor/.opam/ocaml-base-compiler/bin/ocamlc.opt -w -40 -g -bin-annot -I src/.ppx_variants_conv.objs/byte -I /home/victor/.opam/ocaml-base-compiler/lib/base -I /home/victor/.opam/ocaml-base-compiler/lib/base/base_internalhash_types -I /home/victor/.opam/ocaml-base-compiler/lib/base/caml -I /home/victor/.opam/ocaml-base-compiler/lib/base/shadow_stdlib -I /home/victor/.opam/ocaml-base-compiler/lib/ocaml-compiler-libs/common -I /home/victor/.opam/ocaml-base-compiler/lib/ocaml-compiler-libs/shadow -I /home/victor/.opam/ocaml-base-compiler/lib/ocaml/compiler-libs -I /home/victor/.opam/ocaml-base-compiler/lib/ppx_derivers -I /home/victor/.opam/ocaml-base-compiler/lib/ppxlib -I /home/victor/.opam/ocaml-base-compiler/lib/ppxlib/ast -I /home/victor/.opam/ocaml-base-compiler/lib/ppxlib/astlib -I /home/victor/.opam/ocaml-base-compiler/lib/ppxlib/print_diff -I /home/victor/.opam/ocaml-base-compiler/lib/ppxlib/stdppx -I /home/victor/.opam/ocaml-base-compiler/lib/ppxlib/traverse_builtins -I /home/victor/.opam/ocaml-base-compiler/lib/sexplib0 -I /home/victor/.opam/ocaml-base-compiler/lib/stdlib-shims -intf-suffix .ml -no-alias-deps -o src/.ppx_variants_conv.objs/byte/ppx_variants_conv.cmo -c -impl src/ppx_variants_conv.pp.ml) - File "src/ppx_variants_conv.ml", line 69, characters 22-41: - 69 | if Caml.Hashtbl.mem Lexer.keyword_table s - ^^^^^^^^^^^^^^^^^^^ - Error: Unbound value Lexer.keyword_table - ocamlopt src/.ppx_variants_conv.objs/native/ppx_variants_conv.{cmx,o} (exit 2) - (cd _build/default && /home/victor/.opam/ocaml-base-compiler/bin/ocamlopt.opt -w -40 -g -I src/.ppx_variants_conv.objs/byte -I src/.ppx_variants_conv.objs/native -I /home/victor/.opam/ocaml-base-compiler/lib/base -I /home/victor/.opam/ocaml-base-compiler/lib/base/base_internalhash_types -I /home/victor/.opam/ocaml-base-compiler/lib/base/caml -I /home/victor/.opam/ocaml-base-compiler/lib/base/shadow_stdlib -I /home/victor/.opam/ocaml-base-compiler/lib/ocaml-compiler-libs/common -I /home/victor/.opam/ocaml-base-compiler/lib/ocaml-compiler-libs/shadow -I /home/victor/.opam/ocaml-base-compiler/lib/ocaml/compiler-libs -I /home/victor/.opam/ocaml-base-compiler/lib/ppx_derivers -I /home/victor/.opam/ocaml-base-compiler/lib/ppxlib -I /home/victor/.opam/ocaml-base-compiler/lib/ppxlib/ast -I /home/victor/.opam/ocaml-base-compiler/lib/ppxlib/astlib -I /home/victor/.opam/ocaml-base-compiler/lib/ppxlib/print_diff -I /home/victor/.opam/ocaml-base-compiler/lib/ppxlib/stdppx -I /home/victor/.opam/ocaml-base-compiler/lib/ppxlib/traverse_builtins -I /home/victor/.opam/ocaml-base-compiler/lib/sexplib0 -I /home/victor/.opam/ocaml-base-compiler/lib/stdlib-shims -intf-suffix .ml -no-alias-deps -o src/.ppx_variants_conv.objs/native/ppx_variants_conv.cmx -c -impl src/ppx_variants_conv.pp.ml) - File "src/ppx_variants_conv.ml", line 69, characters 22-41: - 69 | if Caml.Hashtbl.mem Lexer.keyword_table s - ^^^^^^^^^^^^^^^^^^^ - Error: Unbound value Lexer.keyword_table [ERROR] The compilation of ppx_variants_conv failed at "/home/victor/.opam/opam-init/hooks/sandbox.sh build dune build -p ppx_variants_conv -j 3". #=== ERROR while compiling ppx_variants_conv.v0.14.1 ==========================# # context 2.0.5 | linux/x86_64 | ocaml-base-compiler.4.13.1 | git+https://github.com/xapi-project/xs-opam.git # path ~/.opam/ocaml-base-compiler/.opam-switch/build/ppx_variants_conv.v0.14.1 # command ~/.opam/opam-init/hooks/sandbox.sh build dune build -p ppx_variants_conv -j 3 # exit-code 1 # env-file ~/.opam/log/ppx_variants_conv-104834-e1fae6.env # output-file ~/.opam/log/ppx_variants_conv-104834-e1fae6.out ### output ### # [...] # ocamlc src/.ppx_variants_conv.objs/byte/ppx_variants_conv.{cmo,cmt} (exit 2) # (cd _build/default && /home/victor/.opam/ocaml-base-compiler/bin/ocamlc.opt -w -40 -g -bin-annot -I src/.ppx_variants_conv.objs/byte -I /home/victor/.opam/ocaml-base-compiler/lib/base -I /home/victor/.opam/ocaml-base-compiler/lib/base/base_internalhash_types -I /home/victor/.opam/ocaml-base-compiler/lib/base/caml -I /home/victor/.opam/ocaml-base-compiler/lib/base/shadow_stdlib -I /home/victor[...] # File "src/ppx_variants_conv.ml", line 69, characters 22-41: # 69 | if Caml.Hashtbl.mem Lexer.keyword_table s # ^^^^^^^^^^^^^^^^^^^ # Error: Unbound value Lexer.keyword_table # ocamlopt src/.ppx_variants_conv.objs/native/ppx_variants_conv.{cmx,o} (exit 2) # (cd _build/default && /home/victor/.opam/ocaml-base-compiler/bin/ocamlopt.opt -w -40 -g -I src/.ppx_variants_conv.objs/byte -I src/.ppx_variants_conv.objs/native -I /home/victor/.opam/ocaml-base-compiler/lib/base -I /home/victor/.opam/ocaml-base-compiler/lib/base/base_internalhash_types -I /home/victor/.opam/ocaml-base-compiler/lib/base/caml -I /home/victor/.opam/ocaml-base-compiler/lib/base/[...] # File "src/ppx_variants_conv.ml", line 69, characters 22-41: # 69 | if Caml.Hashtbl.mem Lexer.keyword_table s # ^^^^^^^^^^^^^^^^^^^ # Error: Unbound value Lexer.keyword_table <><> Error report <><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><> ┌─ The following actions were aborted │ ∗ install async v0.14.0 │ ∗ install async_kernel v0.14.0 │ ∗ install async_rpc_kernel v0.14.0 │ ∗ install async_unix v0.14.0 │ ∗ install base_bigstring v0.14.0 │ ∗ install bin_prot v0.14.0 │ ∗ install core v0.14.1 │ ∗ install core_kernel v0.14.2 │ ∗ install ppx_bin_prot v0.14.0 │ ∗ install ppx_jane v0.14.0 │ ∗ install protocol_version_header v0.14.0 │ ∗ install textutils v0.14.0 │ ∗ install timezone v0.14.0 └─ ┌─ The following actions failed │ λ build ppx_variants_conv v0.14.1 └─ ╶─ No changes have been performed # Run eval $(opam env) to update the current shell environment 'opam install xapi-cli-protocol xapi-client xapi-consts xapi-database xapi-datamodel xapi-types xapi xe xen-api-sdk xen-api-client xen-api-client-lwt xen-api-client-async xapi-rrdd xapi-rrdd-plugin xapi-rrd-transport xapi-rrd-transport-utils rrd-transport rrdd-plugin rrdd-plugins rrddump gzip http-svr pciutil safe-resources sexpr stunnel uuid xapi-compression xml-light2 zstd vhd-tool --yes --deps-only --with-test -v' failed. ```
`opam list` ``` # Packages matching: installed # Name # Installed # Synopsis alcotest 1.4.0 Alcotest is a lightweight and colourful test framework angstrom 0.15.0 Parser combinators built for speed and memory-efficiency asn1-combinators 0.2.6 Embed typed ASN.1 grammars in OCaml astring 0.8.5 Alternative String module for OCaml base v0.14.1 Full standard library replacement for OCaml base-bigarray base base-bytes base Bytes library distributed with the OCaml compiler base-threads base base-unix base base64 3.5.0 Base64 encoding for OCaml base_quickcheck v0.14.1 Randomized testing framework, designed for compatibility with Base bigarray-compat 1.0.0 Compatibility library to use Stdlib.Bigarray when possible bigstringaf 0.8.0 Bigstring intrinsics and fast blits based on memcpy/memmove biniou 1.2.1 Binary data format designed for speed, safety, ease of use and backward compatibility as pr bos 0.2.1 Basic OS interaction for OCaml ca-certs 0.2.1 Detect root CA certificates from the operating system cdrom 0.9.4 Query the state and contents of CDROM devices under Linux cmdliner 1.0.4 Declarative definition of command line interfaces for OCaml cohttp 4.0.0 An OCaml library for HTTP clients and servers cohttp-lwt 4.0.0 CoHTTP implementation using the Lwt concurrency library cohttp-lwt-unix 4.0.0 CoHTTP implementation for Unix and Windows using Lwt conduit 4.0.1 A network connection establishment library conduit-lwt 4.0.1 A portable network connection establishment library using Lwt conduit-lwt-unix 4.0.1 A network connection establishment library for Lwt_unix conf-gmp 3 Virtual package relying on a GMP lib system installation conf-gmp-powm-sec 3 Virtual package relying on a GMP lib with constant-time modular exponentiation conf-libffi 2.0.0 Virtual package relying on libffi system installation conf-libssl 3 Virtual package relying on an OpenSSL library system installation conf-linux-libc-dev 0 Virtual package relying on the installation of the Linux kernel headers files conf-pam 1 Virtual package relying on a system installation of PAM conf-pkg-config 2 Check if pkg-config is installed and create an opam switch local pkgconfig folder conf-xen 1 Virtual package relying on Xen headers cppo 1.6.8 Code preprocessor like cpp for OCaml crc 2.1.0 CRC implementation supporting strings and cstructs csexp 1.5.1 Parsing and printing of S-expressions in Canonical form cstruct 6.0.1 Access C-like structures directly from OCaml cstruct-lwt 6.0.1 Access C-like structures directly from OCaml cstruct-unix 6.0.1 Access C-like structures directly from OCaml ctypes 0.19.1 Combinators for binding to C libraries without writing any C ctypes-foreign 0.18.0 Virtual package for enabling the ctypes.foreign subpackage. domain-name 0.3.0 RFC 1035 Internet domain names dune 2.9.1 Fast, portable, and opinionated build system dune-build-info 2.9.1 Embed build informations inside executable dune-configurator 2.9.1 Helper library for gathering system configuration duration 0.2.0 Conversions to various time units easy-format 1.3.2 High-level and functional interface to the Format module of the OCaml standard library eqaf 0.8 Constant-time equal function on string ezjsonm 1.2.0 Simple interface on top of the Jsonm JSON library ezxenstore 0.4.1 An easy-to-use interface to xenstore fd-send-recv 2.0.1 Bindings for sendmsg/recvmsg that allow Unix.file_descrs to be sent and received over Unix fieldslib v0.14.0 Syntax extension to define first class values representing record fields, to get and set re fmt 0.8.10 OCaml Format pretty-printer combinators forkexec master Sub-process control service for xapi fpath 0.7.3 File system paths for OCaml gmap 0.3.0 Heterogenous maps over a GADT gzip master pinned to version master at git+file:///home/victor/Documents/xen-api#master hex 1.4.0 Library providing hexadecimal converters http-svr master pinned to version master at git+file:///home/victor/Documents/xen-api#master inotify 2.3 Inotify bindings for ocaml. integers 0.5.1 Various signed and unsigned integer types for OCaml io-page 2.3.0 Support for efficient handling of I/O memory pages io-page-unix 2.3.0 Support for efficient handling of I/O memory pages on Unix ipaddr 5.2.0 A library for manipulation of IP (and MAC) address representations ipaddr-sexp 5.2.0 A library for manipulation of IP address representations using sexp jane-street-headers v0.14.0 Jane Street C header files jsonm 1.0.1 Non-blocking streaming JSON codec for OCaml jst-config v0.14.1 Compile-time configuration for Jane Street libraries logs 0.7.0 Logging infrastructure for OCaml lwt 5.4.2 Promises and event-driven I/O lwt-dllist 1.0.1 Mutable doubly-linked list with Lwt iterators lwt_log 1.1.1 Lwt logging library (deprecated) lwt_ssl 1.1.3 OpenSSL binding with concurrent I/O macaddr 5.2.0 A library for manipulation of MAC address representations magic-mime 1.2.0 Map filenames to common MIME types menhir 20210929 An LR(1) parser generator menhirLib 20210929 Runtime support library for parsers generated by Menhir menhirSdk 20210929 Compile-time library for auxiliary tools related to Menhir message-switch-core master A simple store-and-forward message switch message-switch-unix master A simple store-and-forward message switch mirage-block 2.0.1 Block signatures and implementations for MirageOS mirage-block-unix 2.12.1 MirageOS disk block driver for Unix mirage-crypto 0.10.3 Simple symmetric cryptography for the modern age mirage-crypto-ec 0.10.3 Elliptic Curve Cryptography with primitives taken from Fiat mirage-crypto-pk 0.10.3 Simple public-key cryptography for the modern age mirage-crypto-rng 0.10.3 A cryptographically secure PRNG mirage-device 2.0.0 Abstract devices for MirageOS mirage-no-solo5 1 Virtual package conflicting with mirage-solo5 mirage-no-xen 1 Virtual package conflicting with mirage-xen mirage-profile 0.9.1 Collect runtime profiling information in CTF format mmap 1.1.0 File mapping functionality mtime 1.2.0 Monotonic wall-clock time for OCaml mustache 3.1.0 Mustache logic-less templates in OCaml nbd 5.0.0 Network Block Device (NBD) protocol implementation nbd-unix 5.0.0 Network Block Device (NBD) protocol implementation num 1.4 The legacy Num library for arbitrary-precision integer and rational arithmetic ocaml 4.13.1 The OCaml compiler (virtual package) ocaml-base-compiler 4.13.1 Official release 4.13.1 ocaml-compiler-libs v0.12.4 OCaml compiler libraries repackaged ocaml-config 2 OCaml Switch Configuration ocaml-migrate-parsetree 2.2.0 Convert OCaml parsetrees between different versions ocaml-options-vanilla 1 Ensure that OCaml is compiled with no special options enabled ocaml-syntax-shims 1.0.0 Backport new syntax to older OCaml versions ocamlbuild 0.14.0 OCamlbuild is a build system with builtin rules to easily build most OCaml projects. ocamlfind 1.9.1 A library manager for OCaml ocplib-endian 1.1 Optimised functions to read and write int16/32/64 from strings and bigarrays octavius 1.2.2 Ocamldoc comment syntax parser ounit 2.2.4 This is a transition package, ounit is now ounit2 ounit2 2.2.4 OUnit testing framework parsexp v0.14.1 S-expression parsing library pbkdf 1.2.0 Password based key derivation functions (PBKDF) from PKCS#5 pci v1.0.4 Ctypes bindings to libpci for OCaml pciutil master pinned to version master at git+file:///home/victor/Documents/xen-api#master ppx_assert v0.14.0 Assert-like extension nodes that raise useful errors on failure ppx_base v0.14.0 Base set of ppx rewriters ppx_bench v0.14.1 Syntax extension for writing in-line benchmarks in ocaml code ppx_cold v0.14.0 Expands [@cold] into [@inline never][@specialise never][@local never] ppx_compare v0.14.0 Generation of comparison functions from types ppx_cstruct 6.0.1 Access C-like structures directly from OCaml ppx_custom_printf v0.14.1 Printf-style format-strings for user-defined string conversion ppx_derivers 1.2.1 Shared [@@deriving] plugin registry ppx_deriving_rpc 8.1.0 Ppx deriver for ocaml-rpc, a library to deal with RPCs in OCaml ppx_enumerate v0.14.0 Generate a list containing all values of a finite type ppx_expect v0.14.1 Cram like framework for OCaml ppx_fields_conv v0.14.2 Generation of accessor and iteration functions for ocaml records ppx_fixed_literal v0.14.0 Simpler notation for fixed point literals ppx_hash v0.14.0 A ppx rewriter that generates hash functions from type expressions and definitions ppx_here v0.14.0 Expands [%here] into its location ppx_inline_test v0.14.1 Syntax extension for writing in-line tests in ocaml code ppx_js_style v0.14.1 Code style checker for Jane Street Packages ppx_let v0.14.0 Monadic let-bindings ppx_module_timer v0.14.0 Ppx rewriter that records top-level module startup times ppx_optcomp v0.14.3 Optional compilation for OCaml ppx_optional v0.14.0 Pattern matching on flat options ppx_pipebang v0.14.0 A ppx rewriter that inlines reverse application operators `|>` and `|!` ppx_sexp_conv v0.14.3 [@@deriving] plugin to generate S-expression conversion functions ppx_sexp_message v0.14.1 A ppx rewriter for easy construction of s-expressions ppx_sexp_value v0.14.0 A ppx rewriter that simplifies building s-expressions from ocaml values ppx_stable v0.14.1 Stable types conversions generator ppx_string v0.14.1 Ppx extension for string interpolation ppx_tools 6.4 Tools for authors of ppx rewriters and other syntactic tools ppx_typerep_conv v0.14.2 Generation of runtime types from type declarations ppxlib 0.23.0 Standard library for ppx rewriters ptime 0.8.5 POSIX time for OCaml re 1.10.3 RE is a regular expression library for OCaml result 1.5 Compatibility Result module rpclib 8.1.0 A library to deal with RPCs in OCaml rrd-transport master pinned to version master at git+file:///home/victor/Documents/xen-api#master rrdd-plugin master pinned to version master at git+file:///home/victor/Documents/xen-api#master rrdd-plugins master pinned to version master at git+file:///home/victor/Documents/xen-api#master rrddump master pinned to version master at git+file:///home/victor/Documents/xen-api#master rresult 0.7.0 Result value combinators for OCaml safe-resources master pinned to version master at git+file:///home/victor/Documents/xen-api#master seq base Compatibility package for OCaml's standard iterator type starting from 4.07. sexplib v0.14.0 Library for serializing OCaml values to and from S-expressions sexplib0 v0.14.0 Library containing the definition of S-expressions and some base converters sexpr master pinned to version master at git+file:///home/victor/Documents/xen-api#master sha 1.15.1 Binding to the SHA cryptographic functions spawn v0.14.0 Spawning sub-processes splittable_random v0.14.0 PRNG that can be split into independent streams ssl 0.5.10 Bindings for OpenSSL stdio v0.14.0 Standard IO library for OCaml stdlib-shims 0.3.0 Backport some of the new stdlib features to older compiler stringext 1.6.0 Extra string functions for OCaml stunnel master pinned to version master at git+file:///home/victor/Documents/xen-api#master systemd 1.2 OCaml module for native access to the systemd facilities tar 1.1.0 Decode and encode tar format files in pure OCaml tar-unix 1.1.0 Decode and encode tar format files from Unix time_now v0.14.0 Reports the current time topkg 1.0.4 The transitory OCaml software packager typerep v0.14.0 Typerep is a library for runtime types uchar 0.0.2 Compatibility library for OCaml's Uchar module uri 4.2.0 An RFC3986 URI/URL parsing library uri-sexp 4.2.0 An RFC3986 URI/URL parsing library uuid master pinned to version master at git+file:///home/victor/Documents/xen-api#master uuidm 0.9.7 Universally unique identifiers (UUIDs) for OCaml uutf 1.0.2 Non-blocking streaming Unicode codec for OCaml variantslib v0.14.0 Part of Jane Street's Core library vhd-format 0.12.2 Pure OCaml library to read/write VHD format data vhd-format-lwt 0.12.2 Lwt interface to read/write VHD format data vhd-tool master pinned to version master at git+file:///home/victor/Documents/xen-api#master x509 0.15.0 Public Key Infrastructure (RFC 5280, PKCS) purely in OCaml xapi-backtrace 0.7 A simple library for recording and managing backtraces xapi-cli-protocol master pinned to version master at git+file:///home/victor/Documents/xen-api#master xapi-client master pinned to version master at git+file:///home/victor/Documents/xen-api#master xapi-compression master pinned to version master at git+file:///home/victor/Documents/xen-api#master xapi-consts master pinned to version master at git+file:///home/victor/Documents/xen-api#master xapi-database master pinned to version master at git+file:///home/victor/Documents/xen-api#master xapi-datamodel master pinned to version master at git+file:///home/victor/Documents/xen-api#master xapi-forkexecd master Sub-process control service for xapi xapi-idl master Interface descriptions and common boilerplate for xapi services xapi-inventory 1.2.2 Library for accessing the xapi toolstack inventory file xapi-rrd 1.8.2 RRD library for use with xapi xapi-rrd-transport master pinned to version master at git+file:///home/victor/Documents/xen-api#master xapi-rrd-transport-utils master pinned to version master at git+file:///home/victor/Documents/xen-api#master xapi-rrdd master pinned to version master at git+file:///home/victor/Documents/xen-api#master xapi-rrdd-plugin master pinned to version master at git+file:///home/victor/Documents/xen-api#master xapi-stdext-date 4.18.0 A deprecated collection of utility functions - Date module xapi-stdext-encodings 4.18.0 A deprecated collection of utility functions - Encodings module xapi-stdext-pervasives 4.18.0 A deprecated collection of utility functions - Pervasives extension xapi-stdext-std 4.18.0 A deprecated collection of utility functions - Standard library extensions xapi-stdext-threads 4.18.0 A deprecated collection of utility functions - Threads extensions and Semaphore xapi-stdext-unix 4.18.0 A deprecated collection of utility functions - Unix module extensions xapi-stdext-zerocheck 4.18.0 A deprecated collection of utility functions - Zerocheck module xapi-test-utils 1.4.0 An OCaml package with modules for easy unit testing xapi-types master pinned to version master at git+file:///home/victor/Documents/xen-api#master xapi-xenopsd master A single-host domain/VM manager for the Xen hypervisor xe master pinned to version master at git+file:///home/victor/Documents/xen-api#master xen-api-client master pinned to version master at git+file:///home/victor/Documents/xen-api#master xen-api-client-lwt master pinned to version master at git+file:///home/victor/Documents/xen-api#master xen-api-sdk master pinned to version master at git+file:///home/victor/Documents/xen-api#master xen-gnt 4.0.0 Xen grant table bindings for OCaml xen-gnt-unix 4.0.0 Xen grant table bindings for OCaml xenctrl master Mock OCaml bindings for the Xen Hypervisor xenstore 2.1.1 Xenstore protocol in pure OCaml xenstore_transport 1.3.0 Low-level libraries for connecting to a xenstore service on a xen host xml-light2 master pinned to version master at git+file:///home/victor/Documents/xen-api#master xmlm 1.3.0 Streaming XML codec for OCaml yojson 1.7.0 Yojson is an optimized parsing and printing library for the JSON format zarith 1.12 Implements arithmetic and logical operations over arbitrary-precision integers zstd master pinned to version master at git+file:///home/victor/Documents/xen-api#master ```

I cannot get ppx_variants_conv to compile. I just sudo apt install libppx-variants-conv-ocaml in case it was a missing requirement, and that didn't let it build either. My main goal is to be able to use xe, so maybe I'm too far in the weeds and there's a simpilar path. Any help/advice on how to get there would be amazing! Awesome work you're all doing here!

psafont commented 3 years ago

ppx_variants_conv is not compatible with the ocaml version installed (4.13.1) Currently xen-api is compatible with ocaml 4.10 and 4.11.

When creating the switch, please use ocaml-base-compiler.4.10.1, the rest of your notes follow the ci which is quite convoluted, but should work. Let us know if you have other issues

Cameronsplaze commented 3 years ago

Thanks for the fast reply psafont!

I missed that, thanks! I should definitely be using 4.10.1 regardless, but I'm still hitting the issue. Here's the recent trace back:

Traceback of the install ``` victor@victor-Latitude-3340:~/Documents/xen-api$ opam install $PACKAGES --yes --deps-only --with-test -v <><> Synchronising pinned packages ><><><><><><><><><><><><><><><><><><><><><><> [gzip.master] no changes from git+file:///home/victor/Documents/xen-api#master [http-svr.master] no changes from git+file:///home/victor/Documents/xen-api#master [pciutil.master] no changes from git+file:///home/victor/Documents/xen-api#master [rrd-transport.master] no changes from git+file:///home/victor/Documents/xen-api#master [rrdd-plugin.master] no changes from git+file:///home/victor/Documents/xen-api#master [rrdd-plugins.master] no changes from git+file:///home/victor/Documents/xen-api#master [rrddump.master] no changes from git+file:///home/victor/Documents/xen-api#master [safe-resources.master] no changes from git+file:///home/victor/Documents/xen-api#master [sexpr.master] no changes from git+file:///home/victor/Documents/xen-api#master [stunnel.master] no changes from git+file:///home/victor/Documents/xen-api#master [uuid.master] no changes from git+file:///home/victor/Documents/xen-api#master [vhd-tool.master] no changes from git+file:///home/victor/Documents/xen-api#master [xapi.master] no changes from git+file:///home/victor/Documents/xen-api#master [xapi-cli-protocol.master] no changes from git+file:///home/victor/Documents/xen-api#master [xapi-client.master] no changes from git+file:///home/victor/Documents/xen-api#master [xapi-compression.master] no changes from git+file:///home/victor/Documents/xen-api#master [xapi-consts.master] no changes from git+file:///home/victor/Documents/xen-api#master [xapi-database.master] no changes from git+file:///home/victor/Documents/xen-api#master [xapi-datamodel.master] no changes from git+file:///home/victor/Documents/xen-api#master [xapi-rrd-transport.master] no changes from git+file:///home/victor/Documents/xen-api#master [xapi-rrd-transport-utils.master] no changes from git+file:///home/victor/Documents/xen-api#master [xapi-rrdd.master] no changes from git+file:///home/victor/Documents/xen-api#master [xapi-rrdd-plugin.master] no changes from git+file:///home/victor/Documents/xen-api#master [xapi-types.master] no changes from git+file:///home/victor/Documents/xen-api#master [xe.master] no changes from git+file:///home/victor/Documents/xen-api#master [xen-api-client.master] no changes from git+file:///home/victor/Documents/xen-api#master [xen-api-client-async.master] no changes from git+file:///home/victor/Documents/xen-api#master [xen-api-client-lwt.master] no changes from git+file:///home/victor/Documents/xen-api#master [xen-api-sdk.master] no changes from git+file:///home/victor/Documents/xen-api#master [xml-light2.master] no changes from git+file:///home/victor/Documents/xen-api#master [zstd.master] no changes from git+file:///home/victor/Documents/xen-api#master The following actions will be performed: ∗ install ppx_variants_conv v0.14.1 ∗ install bin_prot v0.14.0 ∗ install ppx_bin_prot v0.14.0 ∗ install ppx_jane v0.14.0 ∗ install base_bigstring v0.14.0 ∗ install core_kernel v0.14.2 ∗ install timezone v0.14.0 ∗ install protocol_version_header v0.14.0 ∗ install async_kernel v0.14.0 ∗ install core v0.14.1 ∗ install async_rpc_kernel v0.14.0 ∗ install textutils v0.14.0 ∗ install async_unix v0.14.0 ∗ install async v0.14.0 ===== ∗ 14 ===== <><> Gathering sources ><><><><><><><><><><><><><><><><><><><><><><><><><><><><> [async.v0.14.0] found in cache [async_kernel.v0.14.0] found in cache [async_rpc_kernel.v0.14.0] found in cache [async_unix.v0.14.0] found in cache [base_bigstring.v0.14.0] found in cache [bin_prot.v0.14.0] found in cache [core.v0.14.1] found in cache [core_kernel.v0.14.2] found in cache [ppx_bin_prot.v0.14.0] found in cache [ppx_jane.v0.14.0] found in cache [ppx_variants_conv.v0.14.1] found in cache [protocol_version_header.v0.14.0] found in cache [textutils.v0.14.0] found in cache [timezone.v0.14.0] found in cache <><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><> + /home/victor/.opam/opam-init/hooks/sandbox.sh "build" "dune" "build" "-p" "ppx_variants_conv" "-j" "3" (CWD=/home/victor/.opam/ocaml-base-compiler.4.10.1/.opam-switch/build/ppx_variants_conv.v0.14.1) - ocamlc src/.ppx_variants_conv.objs/byte/ppx_variants_conv.{cmo,cmt} (exit 2) - (cd _build/default && /home/victor/.opam/ocaml-base-compiler.4.10.1/bin/ocamlc.opt -w -40 -g -bin-annot -I src/.ppx_variants_conv.objs/byte -I /home/victor/.opam/ocaml-base-compiler.4.10.1/lib/base -I /home/victor/.opam/ocaml-base-compiler.4.10.1/lib/base/base_internalhash_types -I /home/victor/.opam/ocaml-base-compiler.4.10.1/lib/base/caml -I /home/victor/.opam/ocaml-base-compiler.4.10.1/lib/base/shadow_stdlib -I /home/victor/.opam/ocaml-base-compiler.4.10.1/lib/ocaml-compiler-libs/common -I /home/victor/.opam/ocaml-base-compiler.4.10.1/lib/ocaml-compiler-libs/shadow -I /home/victor/.opam/ocaml-base-compiler.4.10.1/lib/ocaml/compiler-libs -I /home/victor/.opam/ocaml-base-compiler.4.10.1/lib/ppx_derivers -I /home/victor/.opam/ocaml-base-compiler.4.10.1/lib/ppxlib -I /home/victor/.opam/ocaml-base-compiler.4.10.1/lib/ppxlib/ast -I /home/victor/.opam/ocaml-base-compiler.4.10.1/lib/ppxlib/astlib -I /home/victor/.opam/ocaml-base-compiler.4.10.1/lib/ppxlib/print_diff -I /home/victor/.opam/ocaml-base-compiler.4.10.1/lib/ppxlib/stdppx -I /home/victor/.opam/ocaml-base-compiler.4.10.1/lib/ppxlib/traverse_builtins -I /home/victor/.opam/ocaml-base-compiler.4.10.1/lib/sexplib0 -I /home/victor/.opam/ocaml-base-compiler.4.10.1/lib/stdlib-shims -intf-suffix .ml -no-alias-deps -o src/.ppx_variants_conv.objs/byte/ppx_variants_conv.cmo -c -impl src/ppx_variants_conv.pp.ml) - File "src/ppx_variants_conv.ml", line 69, characters 22-41: - 69 | if Caml.Hashtbl.mem Lexer.keyword_table s - ^^^^^^^^^^^^^^^^^^^ - Error: Unbound value Lexer.keyword_table - ocamlopt src/.ppx_variants_conv.objs/native/ppx_variants_conv.{cmx,o} (exit 2) - (cd _build/default && /home/victor/.opam/ocaml-base-compiler.4.10.1/bin/ocamlopt.opt -w -40 -g -I src/.ppx_variants_conv.objs/byte -I src/.ppx_variants_conv.objs/native -I /home/victor/.opam/ocaml-base-compiler.4.10.1/lib/base -I /home/victor/.opam/ocaml-base-compiler.4.10.1/lib/base/base_internalhash_types -I /home/victor/.opam/ocaml-base-compiler.4.10.1/lib/base/caml -I /home/victor/.opam/ocaml-base-compiler.4.10.1/lib/base/shadow_stdlib -I /home/victor/.opam/ocaml-base-compiler.4.10.1/lib/ocaml-compiler-libs/common -I /home/victor/.opam/ocaml-base-compiler.4.10.1/lib/ocaml-compiler-libs/shadow -I /home/victor/.opam/ocaml-base-compiler.4.10.1/lib/ocaml/compiler-libs -I /home/victor/.opam/ocaml-base-compiler.4.10.1/lib/ppx_derivers -I /home/victor/.opam/ocaml-base-compiler.4.10.1/lib/ppxlib -I /home/victor/.opam/ocaml-base-compiler.4.10.1/lib/ppxlib/ast -I /home/victor/.opam/ocaml-base-compiler.4.10.1/lib/ppxlib/astlib -I /home/victor/.opam/ocaml-base-compiler.4.10.1/lib/ppxlib/print_diff -I /home/victor/.opam/ocaml-base-compiler.4.10.1/lib/ppxlib/stdppx -I /home/victor/.opam/ocaml-base-compiler.4.10.1/lib/ppxlib/traverse_builtins -I /home/victor/.opam/ocaml-base-compiler.4.10.1/lib/sexplib0 -I /home/victor/.opam/ocaml-base-compiler.4.10.1/lib/stdlib-shims -intf-suffix .ml -no-alias-deps -o src/.ppx_variants_conv.objs/native/ppx_variants_conv.cmx -c -impl src/ppx_variants_conv.pp.ml) - File "src/ppx_variants_conv.ml", line 69, characters 22-41: - 69 | if Caml.Hashtbl.mem Lexer.keyword_table s - ^^^^^^^^^^^^^^^^^^^ - Error: Unbound value Lexer.keyword_table [ERROR] The compilation of ppx_variants_conv failed at "/home/victor/.opam/opam-init/hooks/sandbox.sh build dune build -p ppx_variants_conv -j 3". #=== ERROR while compiling ppx_variants_conv.v0.14.1 ==========================# # context 2.0.5 | linux/x86_64 | ocaml-base-compiler.4.10.1 | git+https://github.com/xapi-project/xs-opam.git # path ~/.opam/ocaml-base-compiler.4.10.1/.opam-switch/build/ppx_variants_conv.v0.14.1 # command ~/.opam/opam-init/hooks/sandbox.sh build dune build -p ppx_variants_conv -j 3 # exit-code 1 # env-file ~/.opam/log/ppx_variants_conv-168707-e1fae6.env # output-file ~/.opam/log/ppx_variants_conv-168707-e1fae6.out ### output ### # [...] # ocamlc src/.ppx_variants_conv.objs/byte/ppx_variants_conv.{cmo,cmt} (exit 2) # (cd _build/default && /home/victor/.opam/ocaml-base-compiler.4.10.1/bin/ocamlc.opt -w -40 -g -bin-annot -I src/.ppx_variants_conv.objs/byte -I /home/victor/.opam/ocaml-base-compiler.4.10.1/lib/base -I /home/victor/.opam/ocaml-base-compiler.4.10.1/lib/base/base_internalhash_types -I /home/victor/.opam/ocaml-base-compiler.4.10.1/lib/base/caml -I /home/victor/.opam/ocaml-base-compiler.4.10.1/lib[...] # File "src/ppx_variants_conv.ml", line 69, characters 22-41: # 69 | if Caml.Hashtbl.mem Lexer.keyword_table s # ^^^^^^^^^^^^^^^^^^^ # Error: Unbound value Lexer.keyword_table # ocamlopt src/.ppx_variants_conv.objs/native/ppx_variants_conv.{cmx,o} (exit 2) # (cd _build/default && /home/victor/.opam/ocaml-base-compiler.4.10.1/bin/ocamlopt.opt -w -40 -g -I src/.ppx_variants_conv.objs/byte -I src/.ppx_variants_conv.objs/native -I /home/victor/.opam/ocaml-base-compiler.4.10.1/lib/base -I /home/victor/.opam/ocaml-base-compiler.4.10.1/lib/base/base_internalhash_types -I /home/victor/.opam/ocaml-base-compiler.4.10.1/lib/base/caml -I /home/victor/.opam/o[...] # File "src/ppx_variants_conv.ml", line 69, characters 22-41: # 69 | if Caml.Hashtbl.mem Lexer.keyword_table s # ^^^^^^^^^^^^^^^^^^^ # Error: Unbound value Lexer.keyword_table <><> Error report <><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><> ┌─ The following actions were aborted │ ∗ install async v0.14.0 │ ∗ install async_kernel v0.14.0 │ ∗ install async_rpc_kernel v0.14.0 │ ∗ install async_unix v0.14.0 │ ∗ install base_bigstring v0.14.0 │ ∗ install bin_prot v0.14.0 │ ∗ install core v0.14.1 │ ∗ install core_kernel v0.14.2 │ ∗ install ppx_bin_prot v0.14.0 │ ∗ install ppx_jane v0.14.0 │ ∗ install protocol_version_header v0.14.0 │ ∗ install textutils v0.14.0 │ ∗ install timezone v0.14.0 └─ ┌─ The following actions failed │ λ build ppx_variants_conv v0.14.1 └─ ╶─ No changes have been performed 'opam install xapi-cli-protocol xapi-client xapi-consts xapi-database xapi-datamodel xapi-types xapi xe xen-api-sdk xen-api-client xen-api-client-lwt xen-api-client-async xapi-rrdd xapi-rrdd-plugin xapi-rrd-transport xapi-rrd-transport-utils rrd-transport rrdd-plugin rrdd-plugins rrddump gzip http-svr pciutil safe-resources sexpr stunnel uuid xapi-compression xml-light2 zstd vhd-tool --yes --deps-only --with-test -v' failed. ```

I see the path /home/victor/.opam/ocaml-base-compiler.4.10.1/ a lot in there, so I think I'm using the right compiler now.

Here's some extra debug info, hopefully it helps.


opam switch list

#  switch                                                                     compiler                    description
   /home/victor/Documents/xen-api/https:/github.com/xapi-project/xs-opam.git                              /home/victor/Documents/xen-api/https:/github.com/xapi-project/xs-opam.git
   ocaml-base-compiler                                                        ocaml-base-compiler.4.13.1  ocaml-base-compiler
→  ocaml-base-compiler.4.10.1                                                 ocaml-base-compiler.4.10.1  ocaml-base-compiler.4.10.1
   ocaml-system                                                               ocaml-system.4.08.1         ocaml-system

ocaml --version

The OCaml toplevel, version 4.10.1

opam --version

2.0.5

opam repo

[NOTE] These are the repositories in use by the current switch. Use '--all' to see all configured repositories.

<><> Repository configuration for switch ocaml-base-compiler.4.10.1 <><><><><><>
 1 xs-opam git+https://github.com/xapi-project/xs-opam.git
 2 default https://opam.ocaml.org

If there's a better way to be able to use the xe package, I'm definitely open to change directions with this. The only reason I went this route, was I was following your guy's GitHub Action for building this.

Cameronsplaze commented 3 years ago

I also just tried with both ocaml-base-compiler.4.10.2 and ocaml-base-compiler.4.11.2, and they gave the same error. I'm switching like so:

opam switch create ocaml-base-compiler.$VERSION
eval $(opam env --switch=ocaml-base-compiler.$VERSION --set-switch)
opam pin --yes add . --no-action
opam --yes depext --yes -u $PACKAGES
opam install $PACKAGES --yes --deps-only --with-test -v

Also one thing I noticed, when I run opam update && opam upgrade, I see this output:

The following packages are not being upgraded because the new versions conflict with other installed packages:
  - io-page.2.4.0
    ∗ io-page-unix.2.3.0 is installed and requires io-page = 2.3.0
However, you may "opam upgrade" these packages explicitly, which will ask permission to downgrade or uninstall the conflicting
packages.

Could it maybe be my conflicts are getting handled differently than expected?

psafont commented 3 years ago

So one details that's not evident from the github action is that before trying to install packages into the opam switch, the default repository must be removed for the version resolution to work.

Adding the step

opam repo remove default

after adding the xs-opam repository should work.

If there's a better way to be able to use the xe package, I'm definitely open to change directions with this.

I don't think so, we don't provide a statically packaged xe binary

Cameronsplaze commented 3 years ago

Yep that did it! Thanks for your help! It took me a bit to figure out I was forgetting to pin, and jumped straight to running depext, but it's working now. I have the program at ./_build/install/default/bin/xe.

Now that I have a minimal command list to build, I'd be down to (heavily) clean it up and open a PR to your README here. Is this something you guy's would consider accepting? Or do the steps change too drastically between OS's?

psafont commented 3 years ago

Now that I have a minimal command list to build, I'd be down to (heavily) clean it up and open a PR to your README here. Is this something you guy's would consider accepting? Or do the steps change too drastically between OS's?

Yeah, I'd love to get the readme in a better shape, the same with https://github.com/xapi-project/xs-opam

Cameronsplaze commented 3 years ago

Just opened a PR here! I have no clue what to add for the xs-opam side of things, but hopefully the instructions are useful for xen-api at least. Thanks again for your help @psafont!