Ubuntu 20.04 native esy build failure (libpangoft2 undefined reference)
mitchdz opened this issue · 6 comments
This is the same exact issue that @expe showed in #316 (comment) , however the provided solution of deleting ~/.esy or ./_esy does not solve the issue for me.
I am following the guide located here - https://github.com/revery-ui/revery/wiki/Building-&-Installing and I have installed all of the additional packages for Ubuntu.
Attempted commands:
git clone https://github.com/revery-ui/revery
cd revery
esy install
esy build
All commands work other than esy build. More information below.
- Operating System: Ubuntu 20.04 with 5.4.0-29-generic
mitch@light: ~/git/revery (master) $ esy build
info esy build 0.6.4 (using package.json)
ocamlopt examples/Examples.exe (exit 2)
(cd /home/mitch/git/revery/_esy/default/store/b/revery-db996cba/default && /home/mitch/.esy/3____________________________________________________________________/i/ocaml-4.8.1000-e74c5c0d/bin/ocamlopt.opt -w -40 -g -o examples/Examples.exe examples/stubs/ExampleStubs.cmxa -I examples/stubs /home/mitch/.esy/3____________________________________________________________________/i/ocaml-4.8.1000-e74c5c0d/lib/ocaml/unix.cmxa -I /home/mitch/.esy/3____________________________________________________________________/i/ocaml-4.8.1000-e74c5c0d/lib/ocaml /home/mitch/.esy/3____________________________________________________________________/i/ocaml-4.8.1000-e74c5c0d/lib/ocaml/bigarray.cmxa -I /home/mitch/.esy/3____________________________________________________________________/i/ocaml-4.8.1000-e74c5c0d/lib/ocaml /home/mitch/.esy/3____________________________________________________________________/i/opam__s__integers-opam__c__0.4.0-3f5d90ff/lib/integers/integers.cmxa -I /home/mitch/.esy/3____________________________________________________________________/i/opam__s__integers-opam__c__0.4.0-3f5d90ff/lib/integers /home/mitch/.esy/3____________________________________________________________________/i/opam__s__ctypes-opam__c__0.15.1-55b28085/lib/ctypes/ctypes.cmxa -I /home/mitch/.esy/3____________________________________________________________________/i/opam__s__ctypes-opam__c__0.15.1-55b28085/lib/ctypes /home/mitch/.esy/3____________________________________________________________________/i/reason_skia-741b0ac1/lib/skia/wrapped/types/SkiaWrappedTypes.cmxa /home/mitch/.esy/3____________________________________________________________________/i/reason_sdl2-2.10.3031-7c0234da/lib/sdl2/sdl2.cmxa -I /home/mitch/.esy/3____________________________________________________________________/i/reason_sdl2-2.10.3031-7c0234da/lib/sdl2 /home/mitch/.esy/3____________________________________________________________________/i/reason_skia-741b0ac1/lib/skia/wrapped/c/skia_wrapped_c.cmxa -I /home/mitch/.esy/3____________________________________________________________________/i/reason_skia-741b0ac1/lib/skia/wrapped/c /home/mitch/.esy/3____________________________________________________________________/i/ocaml-4.8.1000-e74c5c0d/lib/ocaml/str.cmxa -I /home/mitch/.esy/3____________________________________________________________________/i/ocaml-4.8.1000-e74c5c0d/lib/ocaml /home/mitch/.esy/3____________________________________________________________________/i/opam__s__ctypes-opam__c__0.15.1-55b28085/lib/ctypes/cstubs.cmxa -I /home/mitch/.esy/3____________________________________________________________________/i/opam__s__ctypes-opam__c__0.15.1-55b28085/lib/ctypes /home/mitch/.esy/3____________________________________________________________________/i/reason_skia-741b0ac1/lib/skia/wrapped/bindings/SkiaWrappedBindings.cmxa /home/mitch/.esy/3____________________________________________________________________/i/reason_skia-741b0ac1/lib/skia/wrapped/SkiaWrapped.cmxa -I /home/mitch/.esy/3____________________________________________________________________/i/reason_skia-741b0ac1/lib/skia/wrapped /home/mitch/.esy/3____________________________________________________________________/i/reason_skia-741b0ac1/lib/skia/skia.cmxa /home/mitch/.esy/3____________________________________________________________________/i/reason_native__s__console-0.0.3-3060cd62/lib/console/lib/Console.cmxa -I /home/mitch/.esy/3____________________________________________________________________/i/reason_native__s__console-0.0.3-3060cd62/lib/console/lib /home/mitch/.esy/3____________________________________________________________________/i/opam__s__result-opam__c__1.5-aa265883/lib/result/result.cmxa /home/mitch/.esy/3____________________________________________________________________/i/opam__s__lwt-opam__c__4.5.0-2c9aeed6/lib/lwt/lwt.cmxa /home/mitch/.esy/3____________________________________________________________________/i/opam__s__mmap-opam__c__1.1.0-2f5f39fc/lib/mmap/mmap.cmxa /home/mitch/.esy/3____________________________________________________________________/i/opam__s__ocplib_endian-opam__c__1.1-94505585/lib/ocplib-endian/ocplib_endian.cmxa /home/mitch/.esy/3____________________________________________________________________/i/opam__s__ocplib_endian-opam__c__1.1-94505585/lib/ocplib-endian/bigstring/ocplib_endian_bigstring.cmxa /home/mitch/.esy/3____________________________________________________________________/i/ocaml-4.8.1000-e74c5c0d/lib/ocaml/threads/threads.cmxa -I /home/mitch/.esy/3____________________________________________________________________/i/ocaml-4.8.1000-e74c5c0d/lib/ocaml /home/mitch/.esy/3____________________________________________________________________/i/opam__s__lwt-opam__c__4.5.0-2c9aeed6/lib/lwt/unix/lwt_unix.cmxa -I /home/mitch/.esy/3____________________________________________________________________/i/opam__s__lwt-opam__c__4.5.0-2c9aeed6/lib/lwt/unix /home/mitch/.esy/3____________________________________________________________________/i/flex-1.2.3-396e3022/lib/flex/Flex.cmxa /home/mitch/.esy/3____________________________________________________________________/i/opam__s__astring-opam__c__0.8.3-59e74530/lib/astring/astring.cmxa /home/mitch/.esy/3____________________________________________________________________/i/opam__s__fpath-opam__c__0.7.2-2177dd7f/lib/fpath/fpath.cmxa /home/mitch/.esy/3____________________________________________________________________/i/rench-1.9.1-b0d54557/lib/Rench/Rench.cmxa -I /home/mitch/.esy/3____________________________________________________________________/i/rench-1.9.1-b0d54557/lib/Rench /home/mitch/.esy/3____________________________________________________________________/i/opam__s__re-opam__c__1.9.0-1b0700f2/lib/re/re.cmxa src/Native/Revery_Native.cmxa -I src/Native /home/mitch/.esy/3____________________________________________________________________/i/revery_text_wrap-75d0d755/lib/revery-text-wrap/wrap.cmxa /home/mitch/.esy/3____________________________________________________________________/i/opam__s__stdlib_shims-opam__c__0.1.0-9fe806f1/lib/stdlib-shims/stdlib_shims.cmxa /home/mitch/.esy/3____________________________________________________________________/i/opam__s__fmt-opam__c__0.8.8-08d44054/lib/fmt/fmt.cmxa /home/mitch/.esy/3____________________________________________________________________/i/opam__s__fmt-opam__c__0.8.8-08d44054/lib/fmt/fmt_tty.cmxa /home/mitch/.esy/3____________________________________________________________________/i/opam__s__logs-opam__c__0.7.0-3dcba21d/lib/logs/logs.cmxa /home/mitch/.esy/3____________________________________________________________________/i/opam__s__logs-opam__c__0.7.0-3dcba21d/lib/logs/logs_fmt.cmxa /home/mitch/.esy/3____________________________________________________________________/i/glennsl__s__timber-1.0.0-a487a36d/lib/timber/Timber.cmxa -I /home/mitch/.esy/3____________________________________________________________________/i/glennsl__s__timber-1.0.0-a487a36d/lib/timber /home/mitch/.esy/3____________________________________________________________________/i/opam__s__ppx__deriving-opam__c__4.4.1-db7f7fea/lib/ppx_deriving/runtime/ppx_deriving_runtime.cmxa src/Core/Revery_Core.cmxa /home/mitch/.esy/3____________________________________________________________________/i/reason_harfbuzz-1.91.8001-c1705b6a/lib/harfbuzz/harfbuzz.cmxa -I /home/mitch/.esy/3____________________________________________________________________/i/reason_harfbuzz-1.91.8001-c1705b6a/lib/harfbuzz /home/mitch/.esy/3____________________________________________________________________/i/reason_font_manager-2.1.1-97524902/lib/reason-font-manager/FontManager.cmxa -I /home/mitch/.esy/3____________________________________________________________________/i/reason_font_manager-2.1.1-97524902/lib/reason-font-manager /home/mitch/.esy/3____________________________________________________________________/i/opam__s__psq-opam__c__0.2.0-83364711/lib/psq/psq.cmxa /home/mitch/.esy/3____________________________________________________________________/i/opam__s__lru-d14dc6d3/lib/lru/lru.cmxa /home/mitch/.esy/3____________________________________________________________________/i/rebez-592e9147/lib/rebez/lib/Rebez.cmxa src/Math/Revery_Math.cmxa src/Font/Revery_Font.cmxa /home/mitch/.esy/3____________________________________________________________________/i/brisk__s__brisk_reconciler-19331d97/lib/brisk-reconciler/brisk_reconciler.cmxa src/Draw/Revery_Draw.cmxa src/UI/Revery_UI.cmxa src/UI_Primitives/Revery_UI_Primitives.cmxa src/UI_Hooks/Revery_UI_Hooks.cmxa src/UI_Components/Revery_UI_Components.cmxa src/Utility/Revery_Utility.cmxa src/Revery.cmxa examples/.Examples.eobjs/native/analogClock.cmx examples/.Examples.eobjs/native/border.cmx examples/.Examples.eobjs/native/boxshadow.cmx examples/.Examples.eobjs/native/calculator.cmx examples/.Examples.eobjs/native/canQuitExample.cmx examples/.Examples.eobjs/native/canvasExample.cmx examples/.Examples.eobjs/native/checkboxExample.cmx examples/.Examples.eobjs/native/defaultButton.cmx examples/.Examples.eobjs/native/dropdownExample.cmx examples/.Examples.eobjs/native/fileDragAndDrop.cmx examples/.Examples.eobjs/native/flexbox.cmx examples/.Examples.eobjs/native/focusExample.cmx examples/.Examples.eobjs/native/fontsExample.cmx examples/.Examples.eobjs/native/gameOfLife.cmx examples/.Examples.eobjs/native/hello.cmx examples/.Examples.eobjs/native/hoverExample.cmx examples/.Examples.eobjs/native/inputExample.cmx examples/.Examples.eobjs/native/nativeFileExample.cmx examples/.Examples.eobjs/native/slider.cmx examples/.Examples.eobjs/native/nativeIconExample.cmx examples/.Examples.eobjs/native/nativeNotificationExample.cmx examples/.Examples.eobjs/native/nestedClickable.cmx examples/.Examples.eobjs/native/radioButtonExample.cmx examples/.Examples.eobjs/native/screenCapture.cmx examples/.Examples.eobjs/native/scrollView.cmx examples/.Examples.eobjs/native/springExample.cmx examples/.Examples.eobjs/native/stopwatch.cmx examples/.Examples.eobjs/native/textExample.cmx examples/.Examples.eobjs/native/todoExample.cmx examples/.Examples.eobjs/native/treeView.cmx examples/.Examples.eobjs/native/uRLFileOpen.cmx examples/.Examples.eobjs/native/zoomExample.cmx examples/.Examples.eobjs/native/examples.cmx)
/usr/bin/ld: /lib/x86_64-linux-gnu/libpangoft2-1.0.so.0: undefined reference to `hb_ot_layout_script_select_language'
/usr/bin/ld: /lib/x86_64-linux-gnu/libpangoft2-1.0.so.0: undefined reference to `hb_ot_var_named_instance_get_design_coords'
/usr/bin/ld: /lib/x86_64-linux-gnu/libpangoft2-1.0.so.0: undefined reference to `hb_ot_tags_from_script_and_language'
/usr/bin/ld: /lib/x86_64-linux-gnu/libpangoft2-1.0.so.0: undefined reference to `hb_ot_var_get_axis_infos'
/usr/bin/ld: /usr/lib/x86_64-linux-gnu/libpango-1.0.so: undefined reference to `hb_buffer_set_invisible_glyph'
/usr/bin/ld: /lib/x86_64-linux-gnu/libpangoft2-1.0.so.0: undefined reference to `hb_ot_metrics_get_position'
collect2: error: ld returned 1 exit status
File "caml_startup", line 1:
Error: Error during linking
error: command failed: 'dune' 'build' '-p' 'Revery' '-j4' (exited with 1)
esy-build-package: exiting with errors above...
error: build failed with exit code: 1
esy: exiting due to errors above
- Search terms used: libpangoft2-1.0.so.0 ubuntu20.04 hb_ot_layout_script_select_language
See #666 (comment) the issue with ubuntu platform is we have to support a wide range.
@Et7f3 Sorry, I do not understand your answer.
What do you want us to execute?
esy add "reason-fontkit@2.8.0"
and run again
esy install && esy build
did not bring me further.
Or change a resolutions field (I don't know where that is to be found) with the
"esy-harfbuzz" key added (and its value)?
BTW, a clean install of Ubuntu 20.04 also has git and python2 (probably accessible via python on your $PATH) as a requirement.
The issue with revery is we have to be compatible with lot of versions of ubuntu: this mean for newer ubuntu we need a more recent harfbuzz. And a old harfbuzz for old ubuntu. If you use revery you might have a package.json or a esy.json (it is like this in all templates).
Esy has a specific field "resolutions" https://esy.sh/docs/en/configuration.html#resolutions we put at the same level than the name key. The version I propose in this comment il a recent version of harfbuzz that allow to compile on recent ubuntu. @rogererens
So add this specific version in resolutions:
"esy-harfbuzz": "github:Et7f3/esy-harfbuzz#4309597b403374fe65868e8971c114555c96c6e4"
Then run esy install && esy build
Since there was not such a field yet in revery/package.json, I added
"resolutions": {
"esy-harfbuzz": "github:Et7f3/esy-harfbuzz#4309597b403374fe65868e8971c114555c96c6e4"
},
in between the "dependencies" and "devDependencies" fields.
Then esy build could complete and I could run the examples.
Thanks!
This is a common enough issue that I think it should be added to the Wiki/README. I'll get that in today.
I added the fix by @Et7f3 to the Wiki here: https://github.com/revery-ui/revery/wiki/Building-&-Installing#for-ubuntu-you-may-need-these-additional-packages. I'm going to close out this issue for now. Feel free to comment again if the fix doesn't work for you!