Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build fails when adding YoJson as a dependency using esy Linux Manjaro #666

Closed
srsholmes opened this issue Dec 9, 2019 · 14 comments · Fixed by #671
Closed

Build fails when adding YoJson as a dependency using esy Linux Manjaro #666

srsholmes opened this issue Dec 9, 2019 · 14 comments · Fixed by #671
Labels
A-infrastructure Area: Project infrastructure, build system, Ci, website etc. bug Something isn't working platform-linux Platform: Linux

Comments

@srsholmes
Copy link

  • Operating System: OS: Manjaro Linux x86_64 , Kernel: 5.3.12-1-MANJARO
  • Revery Version: 0.28
  • OCaml version: 4.09.0
  • Native

Clone revery quick start repo

esy install
esy add @opam/yojson
esy build

I also tried to add the same 'resolutions' key int he package.json as the one in onivim 2, but no luck unfortunately.

"@opam/yojson": "github:onivim/yojson:yojson.opam#f480aef",

  • Actual Result:
    build error
nfo esy build 0.5.8 (using package.json)
info building [email protected]@d41d8cd9
error: build failed with exit code: 1
  build log:
    # esy-build-package: building: [email protected]
    # esy-build-package: pwd: /home/srsholmes/.esy/source/i/revery__0.28.0__e7301688
    # esy-build-package: running: 'dune' 'build' '-p' 'Revery' '-j4'
        ocamlopt examples/Examples.exe (exit 2)
    (cd /home/srsholmes/.esy/3________________________________________________________________/b/revery-0.28.0-6d8948a5/default && /home/srsholmes/.esy/3________________________________________________________________/i/ocaml-4.7.1004-a6ae015e/bin/ocamlopt.opt -w -40 -g -o examples/Examples.exe -I /home/srsholmes/.esy/3________________________________________________________________/i/brisk_reconciler-0.0.2-92155748/lib/brisk-reconciler -I /home/srsholmes/.esy/3________________________________________________________________/i/flex-1.2.2-6fc5a923/lib/flex -I /home/srsholmes/.esy/3________________________________________________________________/i/ocaml-4.7.1004-a6ae015e/lib/ocaml/threads -I /home/srsholmes/.esy/3________________________________________________________________/i/opam__s__astring-opam__c__0.8.3-bfc1ac86/lib/astring -I /home/srsholmes/.esy/3________________________________________________________________/i/opam__s__fpath-opam__c__0.7.2-2bc1e664/lib/fpath -I /home/srsholmes/.esy/3________________________________________________________________/i/opam__s__js__of__ocaml-f60dd089/lib/js_of_ocaml -I /home/srsholmes/.esy/3________________________________________________________________/i/opam__s__lwt-opam__c__4.4.0-95c1d9f6/lib/lwt -I /home/srsholmes/.esy/3________________________________________________________________/i/opam__s__lwt-opam__c__4.4.0-95c1d9f6/lib/lwt/unix -I /home/srsholmes/.esy/3________________________________________________________________/i/opam__s__mmap-opam__c__1.1.0-1f10b1c1/lib/mmap -I /home/srsholmes/.esy/3________________________________________________________________/i/opam__s__ocamlfind-opam__c__1.8.1-3176721a/lib/bytes -I /home/srsholmes/.esy/3________________________________________________________________/i/opam__s__ocplib_endian-opam__c__1.0-0a05cbb7/lib/ocplib-endian -I /home/srsholmes/.esy/3________________________________________________________________/i/opam__s__re-opam__c__1.9.0-092c55b9/lib/re -I /home/srsholmes/.esy/3________________________________________________________________/i/opam__s__result-opam__c__1.4-aec9ebe2/lib/result -I /home/srsholmes/.esy/3________________________________________________________________/i/opam__s__seq-opam__c__base-37652505/lib/seq -I /home/srsholmes/.esy/3________________________________________________________________/i/opam__s__uchar-opam__c__0.0.2-761d274b/lib/uchar -I /home/srsholmes/.esy/3________________________________________________________________/i/reason_font_manager-2.0.1-430df502/lib/reason-font-manager -I /home/srsholmes/.esy/3________________________________________________________________/i/reason_fontkit-2.8.2-aa1df32f/lib/fontkit -I /home/srsholmes/.esy/3________________________________________________________________/i/reason_gl_matrix-0.9.9305-981139e8/lib/reglm -I /home/srsholmes/.esy/3________________________________________________________________/i/reason_native__s__console-0.0.3-61b6f8c7/lib/console/lib -I /home/srsholmes/.esy/3________________________________________________________________/i/reason_sdl2-2.10.3011-a31b072e/lib/sdl2 -I /home/srsholmes/.esy/3________________________________________________________________/i/rebez-8d204351/lib/rebez/lib -I /home/srsholmes/.esy/3________________________________________________________________/i/rench-1.9.1-f13efdee/lib/Rench -I examples/stubs -I src -I src/Core -I src/Draw -I src/Font -I src/Geometry -I src/Math -I src/Native -I src/Shaders -I src/UI -I src/UI_Components -I src/UI_Hooks -I src/UI_Primitives /home/srsholmes/.esy/3________________________________________________________________/i/opam__s__result-opam__c__1.4-aec9ebe2/lib/result/result.cmxa /home/srsholmes/.esy/3________________________________________________________________/i/opam__s__lwt-opam__c__4.4.0-95c1d9f6/lib/lwt/lwt.cmxa /home/srsholmes/.esy/3________________________________________________________________/i/opam__s__js__of__ocaml-f60dd089/lib/js_of_ocaml/js_of_ocaml.cmxa examples/stubs/ExampleStubs.cmxa /home/srsholmes/.esy/3________________________________________________________________/i/ocaml-4.7.1004-a6ae015e/lib/ocaml/str.cmxa /home/srsholmes/.esy/3________________________________________________________________/i/reason_native__s__console-0.0.3-61b6f8c7/lib/console/lib/Console.cmxa /home/srsholmes/.esy/3________________________________________________________________/i/ocaml-4.7.1004-a6ae015e/lib/ocaml/unix.cmxa /home/srsholmes/.esy/3________________________________________________________________/i/ocaml-4.7.1004-a6ae015e/lib/ocaml/bigarray.cmxa /home/srsholmes/.esy/3________________________________________________________________/i/opam__s__mmap-opam__c__1.1.0-1f10b1c1/lib/mmap/mmap.cmxa /home/srsholmes/.esy/3________________________________________________________________/i/opam__s__ocplib_endian-opam__c__1.0-0a05cbb7/lib/ocplib-endian/bigstring.cmxa /home/srsholmes/.esy/3________________________________________________________________/i/ocaml-4.7.1004-a6ae015e/lib/ocaml/threads/threads.cmxa /home/srsholmes/.esy/3________________________________________________________________/i/opam__s__lwt-opam__c__4.4.0-95c1d9f6/lib/lwt/unix/lwt_unix.cmxa /home/srsholmes/.esy/3________________________________________________________________/i/reason_gl_matrix-0.9.9305-981139e8/lib/reglm/reglm.cmxa /home/srsholmes/.esy/3________________________________________________________________/i/reason_sdl2-2.10.3011-a31b072e/lib/sdl2/sdl2.cmxa /home/srsholmes/.esy/3________________________________________________________________/i/flex-1.2.2-6fc5a923/lib/flex/Flex.cmxa /home/srsholmes/.esy/3________________________________________________________________/i/reason_fontkit-2.8.2-aa1df32f/lib/fontkit/fontkit.cmxa /home/srsholmes/.esy/3________________________________________________________________/i/opam__s__astring-opam__c__0.8.3-bfc1ac86/lib/astring/astring.cmxa /home/srsholmes/.esy/3________________________________________________________________/i/opam__s__fpath-opam__c__0.7.2-2bc1e664/lib/fpath/fpath.cmxa /home/srsholmes/.esy/3________________________________________________________________/i/rench-1.9.1-f13efdee/lib/Rench/Rench.cmxa /home/srsholmes/.esy/3________________________________________________________________/i/opam__s__re-opam__c__1.9.0-092c55b9/lib/re/re.cmxa src/Core/Revery_Core.cmxa /home/srsholmes/.esy/3________________________________________________________________/i/reason_font_manager-2.0.1-430df502/lib/reason-font-manager/FontManager.cmxa /home/srsholmes/.esy/3________________________________________________________________/i/rebez-8d204351/lib/rebez/lib/Rebez.cmxa src/Shaders/Revery_Shaders.cmxa src/Geometry/Revery_Geometry.cmxa src/Math/Revery_Math.cmxa src/Font/Revery_Font.cmxa /home/srsholmes/.esy/3________________________________________________________________/i/brisk_reconciler-0.0.2-92155748/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/Native/Revery_Native.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/CheckboxExample.cmx examples/.Examples.eobjs/native/DefaultButton.cmx examples/.Examples.eobjs/native/DropdownExample.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/Native.cmx examples/.Examples.eobjs/native/OpenGLExample.cmx examples/.Examples.eobjs/native/RadioButtonExample.cmx examples/.Examples.eobjs/native/ScreenCapture.cmx examples/.Examples.eobjs/native/ScrollView.cmx examples/.Examples.eobjs/native/Slider.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/ZoomExample.cmx examples/.Examples.eobjs/native/Examples.cmx)
    /usr/bin/ld: /usr/lib/libpangoft2-1.0.so.0: undefined reference to `hb_ot_layout_script_select_language'
    /usr/bin/ld: /usr/lib/libpangoft2-1.0.so.0: undefined reference to `hb_ot_var_named_instance_get_design_coords'
    /usr/bin/ld: /usr/lib/libpangoft2-1.0.so.0: undefined reference to `hb_ot_tags_from_script_and_language'
    /usr/bin/ld: /usr/lib/libpangoft2-1.0.so.0: undefined reference to `hb_ot_var_get_axis_infos'
    /usr/bin/ld: /usr/lib/libpango-1.0.so: undefined reference to `hb_buffer_set_invisible_glyph'
    /usr/bin/ld: /usr/lib/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...
    
  building [email protected]
esy: exiting due to errors above

  • Expected Result:
    A successful build

  • Additional Information:
    No source code was changed, and the lib was not added to any dune files. I have successfully managed to add the dependency in the esy hello-reason project.

  • Search terms used:

Linux
Build failed
libpangoft2
undefined reference to hb_ot_layout_script_select_language' undefined reference to hb_ot_var_named_instance_get_design_coords'
undefined reference to hb_ot_tags_from_script_and_language' undefined reference to hb_ot_var_get_axis_infos'
undefined reference to `hb_buffer_set_invisible_glyph'

@Et7f3
Copy link
Member

Et7f3 commented Dec 9, 2019

@srsholmes Can you give the harfbuzz version.

As mentioned here we need native harfbuzz > 1.7.7

Can you add the content of pacman -Qv harfbuzz

@srsholmes
Copy link
Author

Root      : /
Conf File : /etc/pacman.conf
DB Path   : /var/lib/pacman/
Cache Dirs: /var/cache/pacman/pkg/  
Hook Dirs : /usr/share/libalpm/hooks/  /etc/pacman.d/hooks/  
Lock File : /var/lib/pacman/db.lck
Log File  : /var/log/pacman.log
GPG Dir   : /etc/pacman.d/gnupg/
Targets   : harfbuzz
harfbuzz 2.6.4-1

Thanks very much for your quick reply, and thanks for your work on revery, i'm really excited to use the project.

@Et7f3 Et7f3 added A-infrastructure Area: Project infrastructure, build system, Ci, website etc. bug Something isn't working platform-linux Platform: Linux labels Dec 9, 2019
@Et7f3
Copy link
Member

Et7f3 commented Dec 9, 2019

Thanks for the repro I get the same build err it is strange because I can build fine revery 🤔. Can you build revery from source ? esy install; esy build; esy run

Also note revery is in 0.29.0 now.

@Et7f3
Copy link
Member

Et7f3 commented Dec 9, 2019

Ok this commit build 640885e (HEAD^)
but this don't 7558f7c (HEAD^)

What changed between 2.8.0 and 2.8.2 https://github.com/revery-ui/reason-fontkit/tree/9b9a9bdffcaf0e953fd4362953404b342f11ea1a + https://github.com/revery-ui/reason-fontkit/tree/9b9a9bdffcaf0e953fd4362953404b342f11ea1a

The first one shouldn't break (because it keep the flags if folder exist)

@Et7f3
Copy link
Member

Et7f3 commented Dec 10, 2019

One fix I can suggest is to run esy add "[email protected]" and it build fine. I keep this open because we shouldn't need this hack. cc @bryphe we might reverse last commit or fix in reason-fontkit.

@Et7f3
Copy link
Member

Et7f3 commented Dec 10, 2019

Seem to be fixed with this esy-packages/esy-harfbuzz#12

@Et7f3
Copy link
Member

Et7f3 commented Dec 10, 2019

I was able to compile the laster HEAD commit with "esy-harfbuzz": "github:Et7f3/esy-harfbuzz#4309597b403374fe65868e8971c114555c96c6e4", in my resolutions field.

@Et7f3
Copy link
Member

Et7f3 commented Dec 10, 2019

I have tested on arch linux and got the same error. I haven't the issue so I assume this will fix on manjaro can you test(If it success I will PR).

@srsholmes
Copy link
Author

I am not able to currently build 0.29 (master) from source, with the same error described above.

I was able to build revery 0.29 from source with the "esy-harfbuzz": "github:Et7f3/esy-harfbuzz#4309597b403374fe65868e8971c114555c96c6e4", in my resolutions field.

I was also able to build my test repo and my project repo using the esy add "[email protected]" tip you gave earlier.

Thanks for your help and quick responses. I'll wait for the PR and then try and update revery in my project and let you know how it goes.

@Et7f3
Copy link
Member

Et7f3 commented Dec 11, 2019

@bryphe has done the PR so just wait the new release and enjoy revery. When the new version is released can you confirm it is ok so we can close this issue :)

@srsholmes
Copy link
Author

Will do, thanks

@Et7f3
Copy link
Member

Et7f3 commented Dec 18, 2019

@srsholmes It is merged and released just do esy install && esy run in fresh clone. And esy add "opam/yojson" && esy build. It should be fine.

@koekaverna
Copy link

koekaverna commented Jul 7, 2020

  "resolutions": {
   "esy-harfbuzz": "github:Et7f3/esy-harfbuzz#4309597b403374fe65868e8971c114555c96c6e4"
  },

The solution above fixes the issue.

But I have another one:

error: build failed with exit code: 1
  build log:
    # esy-build-package: building: @opam/dune-configurator@opam:2.5.1
    # esy-build-package: pwd: /home/koe/.esy/3/b/opam__s__dune_configurator-opam__c__2.5.1-6bdd99ab
    # esy-build-package: running: 'dune' 'build' '-p' 'dune-configurator' '-j' '4' '@install'
          ocamlc otherlibs/configurator/src/.configurator.objs/byte/configurator__V1.{cmo,cmt} (exit 2)
    (cd _build/default && /home/koe/.esy/3______________________________________________________________________/i/ocaml-4.9.1000-ffe51dac/bin/ocamlc.opt -w -40 -safe-string -g -bin-annot -I otherlibs/configurator/src/.configurator.objs/byte -I /home/koe/.esy/3______________________________________________________________________/i/opam__s__dune_private_libs-opam__c__2.6.1-f50c0557/lib/dune-private-libs/dune-lang -I /home/koe/.esy/3______________________________________________________________________/i/opam__s__dune_private_libs-opam__c__2.6.1-f50c0557/lib/dune-private-libs/ocaml-config -I /home/koe/.esy/3______________________________________________________________________/i/opam__s__dune_private_libs-opam__c__2.6.1-f50c0557/lib/dune-private-libs/stdune -intf-suffix .ml -no-alias-deps -open Configurator__ -o otherlibs/configurator/src/.configurator.objs/byte/configurator__V1.cmo -c -impl otherlibs/configurator/src/v1.ml)
    File "otherlibs/configurator/src/v1.ml", line 379, characters 58-71:
    379 |     fill_in_fields_that_depends_on_ocamlc_config { t with ocamlc_config }
                                                                    ^^^^^^^^^^^^^
    Error: This expression has type Ocaml_config.Vars.t
           but an expression was expected of type string Stdune.String.Map.t
        ocamlopt otherlibs/configurator/src/.configurator.objs/native/configurator__V1.{cmx,o} (exit 2)
    (cd _build/default && /home/koe/.esy/3______________________________________________________________________/i/ocaml-4.9.1000-ffe51dac/bin/ocamlopt.opt -w -40 -safe-string -g -I otherlibs/configurator/src/.configurator.objs/byte -I otherlibs/configurator/src/.configurator.objs/native -I /home/koe/.esy/3______________________________________________________________________/i/opam__s__dune_private_libs-opam__c__2.6.1-f50c0557/lib/dune-private-libs/dune-lang -I /home/koe/.esy/3______________________________________________________________________/i/opam__s__dune_private_libs-opam__c__2.6.1-f50c0557/lib/dune-private-libs/ocaml-config -I /home/koe/.esy/3______________________________________________________________________/i/opam__s__dune_private_libs-opam__c__2.6.1-f50c0557/lib/dune-private-libs/stdune -intf-suffix .ml -no-alias-deps -open Configurator__ -o otherlibs/configurator/src/.configurator.objs/native/configurator__V1.cmx -c -impl otherlibs/configurator/src/v1.ml)
    File "otherlibs/configurator/src/v1.ml", line 379, characters 58-71:
    379 |     fill_in_fields_that_depends_on_ocamlc_config { t with ocamlc_config }
                                                                    ^^^^^^^^^^^^^
    Error: This expression has type Ocaml_config.Vars.t
           but an expression was expected of type string Stdune.String.Map.t
    error: command failed: 'dune' 'build' '-p' 'dune-configurator' '-j' '4' '@install' (exited with 1)
    esy-build-package: exiting with errors above...
    
  building @opam/dune-configurator@opam:2.5.1
esy: exiting due to errors above

Ubuntu 20.04 Gnome/Cinnamon

@arnarthor
Copy link

@koekaverna if you happened to use the revery-quick-start like I did, turns out I had to update @opam/dune to 2.6.0 since there seems to have been some issues with 2.5.0 in this setup.

I figured this out after a full night of updating random packages to try to fix this issue with adding yojson as well, and realising it didn't matter what I changed, if I changed anything this error would pop up 😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-infrastructure Area: Project infrastructure, build system, Ci, website etc. bug Something isn't working platform-linux Platform: Linux
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants