Hi there!
I’ve been working on a small project to port my personal website over to a Mirage Unikernel. So far, it’s been a lot of fun and the project continues to amaze me!
My app is largely a fork of the mirage-www project, with a few tweaks. While I’ve been able to get everything working under MacOS and Unix, I’m having some issues building the final image for deployment on GCE using virtio.
Using Travis under Ubuntu 14.04, I’m getting the following build error, which shows up regardless of what OCaml version I use (tested on 4.04.2 through 4.06.1). I can also replicate the issue on an Ubuntu 16.04 local VM.
ocamlfind ocamlopt -g -dontlink unix -dontlink str -dontlink num -dontlink threads -linkpkg -output-obj -package tcpip.udp -package tcpip.tcp -package tcpip.stack-direct -package tcpip.icmpv4 -package tcpip.ethif -package tcpip.arpv4 -package tcpip -package sexplib -package re -package ptime -package nocrypto.mirage -package nocrypto -package mirage-types-lwt -package mirage-types -package mirage-solo5 -package mirage-runtime -package mirage-random -package mirage-net-solo5 -package mirage-logs -package mirage-conduit -package mirage-clock-freestanding -package mirage-bootvar-solo5 -package lwt -package io-page -package functoria-runtime -package ezjsonm -package duration -package cowabloga -package cow -package core_kernel -package cohttp-mirage -package charrua-client-mirage -package astring -predicates mirage_solo5 site_config.cmx pages.cmx blog.cmx data.cmx key_gen.cmx dispatch.cmx static1.cmx static2.cmx main.cmx -o main.native.o _build/main.native.o: In function `camlBase__Import0__entry': /home/travis/.opam/4.06.1/build/base.v0.10.0/_build/default/src/import0.ml:249: undefined reference to `Base_am_testing' _build/main.native.o: In function `camlBase__Hash__fun_4411': (.text+0x6ce08): undefined reference to `Base_internalhash_get_hash_value' _build/main.native.o: In function `camlBase__Hash__fun_4413': (.text+0x6ce2b): undefined reference to `Base_internalhash_fold_string' _build/main.native.o: In function `camlBase__Hash__fun_4415': (.text+0x6ce4b): undefined reference to `Base_internalhash_fold_float' _build/main.native.o: In function `camlBase__Hash__fun_4417': (.text+0x6ce6b): undefined reference to `Base_internalhash_fold_int64' _build/main.native.o: In function `camlBase__Hash__fun_4419': (.text+0x6ce8b): undefined reference to `Base_internalhash_fold_int' _build/main.native.o: In function `camlBase__Hash__fun_4546': /home/travis/.opam/4.06.1/build/base.v0.10.0/_build/default/src/hash.ml:142: undefined reference to `Base_internalhash_fold_int64' _build/main.native.o: In function `camlBase__Hash__fun_4544': /home/travis/.opam/4.06.1/build/base.v0.10.0/_build/default/src/hash.ml:143: undefined reference to `Base_internalhash_fold_int' _build/main.native.o: In function `camlBase__Hash__fun_4548': /home/travis/.opam/4.06.1/build/base.v0.10.0/_build/default/src/hash.ml:144: undefined reference to `Base_internalhash_fold_float' _build/main.native.o: In function `camlBase__Hash__fun_4550': /home/travis/.opam/4.06.1/build/base.v0.10.0/_build/default/src/hash.ml:145: undefined reference to `Base_internalhash_fold_string' _build/main.native.o: In function `camlBase__Hash__fun_4552': /home/travis/.opam/4.06.1/build/base.v0.10.0/_build/default/src/hash.ml:146: undefined reference to `Base_internalhash_get_hash_value' _build/main.native.o: In function `camlBase__Hash__run_3960': /home/travis/.opam/4.06.1/build/base.v0.10.0/_build/default/src/hash.ml:178: undefined reference to `Base_internalhash_get_hash_value' _build/main.native.o: In function `camlBase__Hash__of_fold_3964': /home/travis/.opam/4.06.1/build/base.v0.10.0/_build/default/src/hash.ml:180: undefined reference to `Base_internalhash_get_hash_value' _build/main.native.o: In function `camlBase__Hash__fun_4569': /home/travis/.opam/4.06.1/build/base.v0.10.0/_build/default/src/hash.ml:223: undefined reference to `Base_hash_double' _build/main.native.o: In function `camlBase__Sexp__hash_fold_t_1195': /home/travis/.opam/4.06.1/build/base.v0.10.0/_build/default/src/sexp.ml:28: undefined reference to `Base_internalhash_fold_int' /home/travis/.opam/4.06.1/build/base.v0.10.0/_build/default/src/sexp.ml:25: undefined reference to `Base_internalhash_fold_int' _build/main.native.o: In function `camlBase__Sexp__func_1205': /home/travis/.opam/4.06.1/build/base.v0.10.0/_build/default/src/sexp.ml:36: undefined reference to `Base_internalhash_get_hash_value' _build/main.native.o: In function `camlBase__Exn__raise_without_backtrace_2167': /home/travis/.opam/4.06.1/build/base.v0.10.0/_build/default/src/exn.ml:142: undefined reference to `Base_clear_caml_backtrace_pos' _build/main.native.o: In function `camlBase__Exn__clear_backtrace_2173': /home/travis/.opam/4.06.1/build/base.v0.10.0/_build/default/src/exn.ml:151: undefined reference to `Base_clear_caml_backtrace_pos' _build/main.native.o: In function `camlBase__With_return__return_1527': /home/travis/.opam/4.06.1/build/base.v0.10.0/_build/default/src/exn.ml:142: undefined reference to `Base_clear_caml_backtrace_pos' _build/main.native.o: In function `camlBase__Result__hash_fold_t_1754': /home/travis/.opam/4.06.1/build/base.v0.10.0/_build/default/src/result.ml:80: undefined reference to `Base_internalhash_fold_int' /home/travis/.opam/4.06.1/build/base.v0.10.0/_build/default/src/result.ml:77: undefined reference to `Base_internalhash_fold_int' _build/main.native.o: In function `camlBase__Ordering__hash_fold_t_1437': /home/travis/.opam/4.06.1/build/base.v0.10.0/_build/default/src/ordering.ml:24: undefined reference to `Base_internalhash_fold_int' /home/travis/.opam/4.06.1/build/base.v0.10.0/_build/default/src/ordering.ml:25: undefined reference to `Base_internalhash_fold_int' /home/travis/.opam/4.06.1/build/base.v0.10.0/_build/default/src/ordering.ml:26: undefined reference to `Base_internalhash_fold_int' _build/main.native.o: In function `camlBase__Ordering__func_1441': /home/travis/.opam/4.06.1/build/base.v0.10.0/_build/default/src/ordering.ml:33: undefined reference to `Base_internalhash_get_hash_value' _build/main.native.o: In function `camlBase__Source_code_position0__func_1690': /home/travis/.opam/4.06.1/build/base.v0.10.0/_build/default/src/source_code_position0.ml:40: undefined reference to `Base_internalhash_get_hash_value' _build/main.native.o: In function `camlBase__Maybe_bound__hash_fold_interval_comparison_1748': /home/travis/.opam/4.06.1/build/base.v0.10.0/_build/default/src/maybe_bound.ml:113: undefined reference to `Base_internalhash_fold_int' /home/travis/.opam/4.06.1/build/base.v0.10.0/_build/default/src/maybe_bound.ml:114: undefined reference to `Base_internalhash_fold_int' /home/travis/.opam/4.06.1/build/base.v0.10.0/_build/default/src/maybe_bound.ml:115: undefined reference to `Base_internalhash_fold_int' _build/main.native.o: In function `camlBase__Maybe_bound__func_1752': /home/travis/.opam/4.06.1/build/base.v0.10.0/_build/default/src/maybe_bound.ml:122: undefined reference to `Base_internalhash_get_hash_value' _build/main.native.o: In function `camlBase__Sign0__hash_fold_t_1533': /home/travis/.opam/4.06.1/build/base.v0.10.0/_build/default/src/sign0.ml:48: undefined reference to `Base_internalhash_fold_int' /home/travis/.opam/4.06.1/build/base.v0.10.0/_build/default/src/sign0.ml:49: undefined reference to `Base_internalhash_fold_int' /home/travis/.opam/4.06.1/build/base.v0.10.0/_build/default/src/sign0.ml:50: undefined reference to `Base_internalhash_fold_int' _build/main.native.o: In function `camlBase__Sign0__func_1537': /home/travis/.opam/4.06.1/build/base.v0.10.0/_build/default/src/sign0.ml:57: undefined reference to `Base_internalhash_get_hash_value' _build/main.native.o: In function `camlBase__Sequence__hash_fold_t_13554': /home/travis/.opam/4.06.1/build/base.v0.10.0/_build/default/src/sequence.ml:461: undefined reference to `Base_internalhash_fold_int' /home/travis/.opam/4.06.1/build/base.v0.10.0/_build/default/src/sequence.ml:464: undefined reference to `Base_internalhash_fold_int' /home/travis/.opam/4.06.1/build/base.v0.10.0/_build/default/src/sequence.ml:467: undefined reference to `Base_internalhash_fold_int' _build/main.native.o: In function `camlBase__Int_math__int_pow_1359': /home/travis/.opam/4.06.1/build/base.v0.10.0/_build/default/src/int_math.ml:23: undefined reference to `Base_int_math_int_pow_stub' _build/main.native.o: In function `camlBase__Int_math__int64_pow_2030': /home/travis/.opam/4.06.1/build/base.v0.10.0/_build/default/src/int_math.ml:47: undefined reference to `Base_int_math_int64_pow_stub' _build/main.native.o: In function `camlBase__Int_math__int63_pow_on_int64_2033': /home/travis/.opam/4.06.1/build/base.v0.10.0/_build/default/src/int_math.ml:59: undefined reference to `Base_int_math_int64_pow_stub' _build/main.native.o: In function `camlBase__Int_pow2__floor_log2_1471': /home/travis/.opam/4.06.1/build/base.v0.10.0/_build/default/src/int_pow2.ml:53: undefined reference to `Base_int_math_int_clz' _build/main.native.o: In function `camlBase__Popcount__fun_3919': (.text+0xae048): undefined reference to `Base_int_math_int_popcount' _build/main.native.o: In function `camlBase__Float__fun_7014': /home/travis/.opam/4.06.1/build/base.v0.10.0/_build/default/src/hash.ml:223: undefined reference to `Base_hash_double' _build/main.native.o: In function `camlBase__fun_110197': /home/travis/.opam/4.06.1/build/base.v0.10.0/_build/default/src/hash.ml:223: undefined reference to `Base_hash_double' _build/main.native.o: In function `camlBase__func_102964': /home/travis/.opam/4.06.1/build/base.v0.10.0/_build/default/src/base.ml:300: undefined reference to `Base_hash_string' _build/main.native.o: In function `camlBase__fun_110217': /home/travis/.opam/4.06.1/build/base.v0.10.0/_build/default/src/base.ml:300: undefined reference to `Base_hash_string' _build/main.native.o: In function `camlBase__Import0__47': :(.data+0x322e90): undefined reference to `Base_am_testing' _build/main.native.o: In function `camlBase__Hash__22': :(.data+0x3241c0): undefined reference to `Base_hash_double' :(.data+0x3241c8): undefined reference to `Base_internalhash_get_hash_value' :(.data+0x3241d0): undefined reference to `Base_internalhash_fold_string' :(.data+0x3241d8): undefined reference to `Base_internalhash_fold_float' :(.data+0x3241e0): undefined reference to `Base_internalhash_fold_int' :(.data+0x3241e8): undefined reference to `Base_internalhash_fold_int64' _build/main.native.o: In function `camlBase__Exn__62': :(.data+0x3264a8): undefined reference to `Base_clear_caml_backtrace_pos' _build/main.native.o: In function `camlBase__String__217': :(.data+0x34b9c8): undefined reference to `Base_hash_string' _build/main.native.o: In function `camlBase__Int_math__57': :(.data+0x353590): undefined reference to `Base_int_math_int64_pow_stub' :(.data+0x353598): undefined reference to `Base_int_math_int_pow_stub' _build/main.native.o: In function `camlBase__Int_pow2__12': :(.data+0x353fb8): undefined reference to `Base_int_math_int_clz' _build/main.native.o: In function `camlBase__Popcount__14': :(.data+0x354310): undefined reference to `Base_int_math_int_popcount' run ['ld' '-nostdlib' '-z' 'max-page-size=0x1000' '-static' '-T' '/home/travis/.opam/4.06.1/lib/pkgconfig/../../lib/solo5-kernel-virtio/solo5.lds' '/home/travis/.opam/4.06.1/lib/pkgconfig/../../lib/solo5-kernel-virtio/solo5.o' '_build/main.native.o' '-L/home/travis/.opam/4.06.1/lib/zarith' '-L/home/travis/.opam/4.06.1/lib/gmp-freestanding' '-lgmp-freestanding' '-L/home/travis/.opam/4.06.1/lib/nocrypto' '-lnocrypto_stubs+mirage-freestanding' '-L/home/travis/.opam/4.06.1/lib/mirage-entropy' '-lmirage-entropy_stubs+mirage-freestanding' '/home/travis/.opam/4.06.1/share/pkgconfig/../../lib/mirage-solo5/libmirage-solo5_bindings.a' '/home/travis/.opam/4.06.1/lib/pkgconfig/../../lib/ocaml-freestanding/libasmrun.a' '/home/travis/.opam/4.06.1/lib/pkgconfig/../../lib/ocaml-freestanding/libotherlibs.a' '/home/travis/.opam/4.06.1/lib/pkgconfig/../../lib/ocaml-freestanding/libnolibc.a' '/home/travis/.opam/4.06.1/lib/pkgconfig/../../lib/ocaml-freestanding/libopenlibm.a' '-o' 'nickrobison_www.virtio']: exited with 1 make[1]: *** [build] Error 1 make[1]: Leaving directory `/home/travis/build/nickrobison/nickrobison-www/src' make: *** [build] Error 2
It seems related to using the Base library, which I pulled via core_kernel for a couple of list functions that I need. When running ‘make depends’ I can see the following output, which shows that base is being downgraded, but only to the prior release, so seems odd it would be missing symbols. Unless I’m miss-reading the error?
The following actions will be performed: ↘ downgrade jane-street-headers v0.11.0 to v0.10.0 ∗ install ppx_traverse_builtins v0.10.0 [required by ppx_core] ∗ install ppx_tools_versioned 5.1 ∗ install mirage-flow 1.3.0 ∗ install ocaml-src 4.06.1 ∗ install conf-pkg-config 1.0 ∗ install menhir 20171222 ↘ downgrade spawn v0.12.0 to v0.10.1 ∗ install cppo_ocamlbuild 1.6.0 ∗ install mirage-no-xen 1 ⊘ remove sexplib0 v0.11.0 [conflicts with sexplib] ⊘ remove ppxlib 0.3.0 [conflicts with ocaml-compiler-libs] ∗ install parse-argv 0.1.0 ∗ install ocplib-endian 1.0 ∗ install ocb-stubblr 0.1.1 ⊘ remove splittable_random v0.11.0 [conflicts with base] ∗ install mirage-device 1.1.0 ∗ install ppx_tools 5.1+4.06.0 ∗ install mirage-channel 3.1.0 ∗ install solo5-kernel-virtio 0.2.2-1 ∗ install conf-autoconf 0.1 ↘ downgrade sexplib v0.11.0 to v0.10.0 ↘ downgrade ocaml-compiler-libs v0.11.0 to v0.10.0 ∗ install mirage-time 1.1.0 ∗ install mirage-net 1.1.1 ∗ install mirage-kv 1.1.1 ∗ install mirage-fs 1.1.1 ∗ install mirage-console 2.3.5 ∗ install mirage-clock 1.3.0 ∗ install mirage-block 1.1.0 ∗ install mirage-protocols 1.3.0 ∗ install ppx_deriving 4.2.1 ∗ install ocaml-freestanding 0.2.3 ↘ downgrade base v0.11.0 to v0.10.0 [uses sexplib] ↻ recompile cstruct 3.2.1 [uses sexplib] ∗ install ppx_ast v0.10.0 [required by ppx_core] ∗ install mirage-time-lwt 1.1.0 ∗ install mirage-clock-lwt 1.3.0 ∗ install mirage-stack 1.2.0 ∗ install gmp-freestanding 6.1.2 ↘ downgrade typerep v0.11.0 to v0.10.0 [required by core_kernel] ↘ downgrade stdio v0.11.0 to v0.10.0 [uses sexplib] ∗ install randomconv 0.1.0 ∗ install ppx_cstruct 3.2.1 ∗ install mirage-solo5 0.2.1 ∗ install mirage-random 1.1.0 ∗ install mirage-kv-lwt 1.1.0 ∗ install mirage-flow-lwt 1.4.0 ∗ install cstruct-lwt 3.2.1 ∗ install asn1-combinators 0.2.0 ↻ recompile hex 1.2.0 [uses cstruct] ∗ install mirage-clock-freestanding 1.3.0 ∗ install zarith-freestanding 1.7 ∗ install ppx_core v0.10.0 [required by ppx_assert] ↘ downgrade configurator v0.11.0 to v0.10.0 [required by core_kernel] ∗ install mirage-profile 0.8.2 ∗ install mirage-bootvar-solo5 0.2.0 ↻ recompile mirage-os-shim 3.0.0* ∗ install mirage-types 3.0.7 ∗ install mirage-fs-lwt 1.1.1 ∗ install mirage-console-lwt 2.3.5 ↻ recompile ezjsonm 0.5.0 [uses sexplib] ↘ downgrade ppx_optcomp v0.11.0 to v0.10.0 [uses ppx_core] ∗ install xenstore_transport 1.0.0 ∗ install mirage-logs 0.3.0 ∗ install mirage-entropy 0.4.0 ∗ install ppx_driver v0.10.0 [required by core_kernel] ∗ install mirage-channel-lwt 3.1.0 ∗ install mirage-block-lwt 1.1.0 ∗ install io-page-unix 2.0.1 ↘ downgrade variantslib v0.11.0 to v0.10.0 [required by core_kernel] ∗ install ppx_metaquot v0.10.0 [required by ppx_assert] ↘ downgrade ppx_let v0.11.0 to v0.10.0 [uses ppx_core] ↘ downgrade ppx_here v0.11.0 to v0.10.0 [required by ppx_assert] ↘ downgrade fieldslib v0.11.0 to v0.10.0 [required by core_kernel] ∗ install ppx_type_conv v0.10.0 [required by ppx_assert] ↘ downgrade ppx_pipebang v0.11.0 to v0.10.0 [uses ppx_core] ↘ downgrade ppx_optional v0.11.0 to v0.10.0 [uses ppx_core] ↘ downgrade ppx_js_style v0.11.0 to v0.10.0 [uses ppx_core] ↘ downgrade ppx_inline_test v0.11.0 to v0.10.0 [required by core_kernel] ↘ downgrade ppx_fail v0.11.0 to v0.10.0 [uses ppx_core] ↘ downgrade ppx_variants_conv v0.11.1 to v0.10.0 [uses ppx_core] ↘ downgrade ppx_typerep_conv v0.11.1 to v0.10.0 [uses ppx_core] ∗ install ppx_traverse v0.10.0 [required by ppx_custom_printf] ↘ downgrade ppx_sexp_conv v0.11.2 to v0.10.0 [uses sexplib] ↘ downgrade ppx_fields_conv v0.11.0 to v0.10.0 [uses ppx_core] ↘ downgrade ppx_enumerate v0.11.1 to v0.10.0 [uses ppx_core] ↘ downgrade ppx_compare v0.11.1 to v0.10.0 [uses base] ↘ downgrade ppx_bench v0.11.0 to v0.10.0 [uses ppx_core] ↘ downgrade ppx_sexp_value v0.11.0 to v0.10.0 [uses sexplib] ↘ downgrade ppx_sexp_message v0.11.0 to v0.10.0 [uses sexplib] ↘ downgrade ppx_custom_printf v0.11.0 to v0.10.0 [uses ppx_core] ↻ recompile uri 1.9.6 [uses sexplib] ↻ recompile ipaddr 2.8.0 [uses sexplib] ↘ downgrade ppx_hash v0.11.1 to v0.10.0 [required by core_kernel] ↘ downgrade ppx_assert v0.11.0 to v0.10.0 [uses sexplib] ↘ downgrade parsexp v0.11.0 to v0.10.0 [uses base] ↘ downgrade bin_prot v0.11.0 to v0.10.0 [uses sexplib] ↻ recompile cow 2.3.0 [uses ezjsonm] ∗ install mirage-stack-lwt 1.2.0 ∗ install mirage-protocols-lwt 1.3.0 ∗ install mirage-net-lwt 1.1.0 ↻ recompile mirage-runtime 3.0.7 [uses ipaddr] ↘ downgrade ppx_base v0.11.0 to v0.10.0 [required by core_kernel] ↘ downgrade ppx_expect v0.11.0 to v0.10.0 [uses base] ↘ downgrade ppx_bin_prot v0.11.1 to v0.10.0 [uses ppx_core] ∗ install cohttp-lwt 1.0.2 ↻ recompile cowabloga 0.4.0* [uses cstruct] ∗ install mirage-types-lwt 3.0.7 ∗ install mirage-net-solo5 0.2.0 ∗ install conduit-lwt 1.1.0 ↻ recompile mirage 3.0.8 [uses ipaddr] ↘ downgrade ppx_jane v0.11.0 to v0.10.0 [required by core_kernel] ∗ install charrua-core 0.9 ∗ install mirage-dns 3.0.1 ↘ downgrade core_kernel v0.11.0 to v0.10.0 [uses jane-street-headers, sexplib] ∗ install charrua-client 0.9 ∗ install mirage-conduit 3.0.1 ↘ downgrade core v0.11.1 to v0.10.0 [uses sexplib, spawn] ∗ install charrua-client-lwt 0.9 ∗ install cohttp-mirage 1.1.0 ∗ install charrua-client-mirage 0.9 ===== ∗ 92 ↻ 10 ↘ 38 ⊘ 3 =====
I’m sure my issue is related to my lack of knowledge around mirage and OCaml, so apologies if this is the wrong place to post this question. I’m not sure where the underlying issue is coming from (my code, mirage, or mirage-virtio), nor how to start debugging it. Happy to open an issue in the appropriate repo if necessary.
Thanks for your time!
Nick Robison
|