Skip to content

Conversation

@leostera
Copy link

Hello!

I found myself trying to build documentation for Belt and other BuckleScript libraries using odoc, which requires compiler artifacts of the same version it was compiled with to be able to read them.

I'm opening this PR to use this compiler as a direct dependency within an esy project.

@leostera
Copy link
Author

Current error is:

esy @docs x odoc compile -I runtime -I others --pkg=Belt others/js_option.cmti info building @opam/dune@opam:1.7.1@6f40bfee info building @opam/ocamlfind@opam:1.8.0@96572762 info building @opam/ocamlbuild@opam:0.12.0@6c616094 info building @opam/cmdliner@opam:1.0.3@96d31520 error: build failed with exit code: 1 build log: # esy-build-package: building: @opam/dune@opam:1.7.1 # esy-build-package: pwd: /Users/ostera/repos/github.com/BuckleScript/bucklescript/_esy/docs/store/b/opam__s__dune-opam__c__1.7.1-1200f3d2 # esy-build-package: running: 'ocaml' 'bootstrap.ml' '/Users/ostera/repos/github.com/BuckleScript/bucklescript/_esy/docs/store/i/ocaml-d4422908/bin/ocamllex.opt' -q src/ocamlobjinfo.mll '/Users/ostera/repos/github.com/BuckleScript/bucklescript/_esy/docs/store/i/ocaml-d4422908/bin/ocamllex.opt' -q src/meta_lexer.mll '/Users/ostera/repos/github.com/BuckleScript/bucklescript/_esy/docs/store/i/ocaml-d4422908/bin/ocamllex.opt' -q src/dune_lexer.mll '/Users/ostera/repos/github.com/BuckleScript/bucklescript/_esy/docs/store/i/ocaml-d4422908/bin/ocamllex.opt' -q src/dune_lang/dune_lexer.mll '/Users/ostera/repos/github.com/BuckleScript/bucklescript/_esy/docs/store/i/ocaml-d4422908/bin/ocamldep.opt' -modules src/action.ml src/action_ast.ml src/action_dune_lang.ml src/act ion_exec.ml src/action_intf.ml src/action_to_sh.boot.ml src/action_unexpanded.ml src/arg_spec.ml src/artifacts.ml src/binary_kind.ml src/bindings.ml src/blang.ml src/bootstrap.boot.ml s rc/build.ml src/build_interpret.ml src/build_system.ml src/c.ml src/c_sources.ml src/check_rules.ml src/clflags.ml src/cm_kind.ml src/colors.ml src/compilation_context.ml src/config.ml src/context.ml src/dep_graph.ml src/dep_path.ml src/deps.ml src/dir_contents.ml src/dir_status.ml src/dir_with_dune.ml src/dune_env.ml src/dune_file.ml src/dune_lexer.ml src/dune_load.m l src/dune_package.ml src/dune_project.ml vendor/boot/dune_re.ml src/dynlink_supported.ml src/env_node.ml src/errors.ml src/exe.ml src/exe_rules.ml src/expander.ml src/file_bindings.ml src/file_tree.ml src/findlib.ml src/format_dune_lang.ml src/format_rules.ml src/gen_meta.ml src/gen_rules.ml src/glob.ml src/glob_lexer.boot.ml src/hooks.ml src/import.ml src/inline_tes ts.boot.ml src/install.ml src/install_rules.ml src/installed_dune_file.ml src/js_of_ocaml_rules.boot.ml src/lib.ml src/lib_archives.ml src/lib_deps_info.ml src/lib_file_deps.ml src/lib_ info.ml src/lib_kind.ml src/lib_modules.ml src/lib_name.ml src/lib_rules.ml src/link_time_code_gen.ml src/local_package.ml src/log.ml src/main.ml src/menhir.boot.ml src/merlin.ml src/me ta.ml src/meta_lexer.ml src/ml_kind.ml src/mode.ml src/module.ml src/module_compilation.ml src/modules_field_evaluator.ml src/obj_dir.ml src/ocaml_flags.ml src/ocaml_version.ml src/ocam ldep.ml src/ocamlobjinfo.ml src/odoc.boot.ml vendor/boot/opamBaseParser.ml vendor/boot/opamLexer.ml vendor/boot/opamParserTypes.ml src/opam_file.ml src/ordered_set_lang.ml src/package.m l src/path_dune_lang.ml src/per_item.ml src/pform.ml src/predicate_lang.ml src/preprocessing.ml src/print_diff.ml src/process.ml src/promotion.ml src/report_error.ml src/response_file.m l src/scheduler.ml src/scope.ml src/setup.boot.ml src/simple_rules.ml src/spawn.ml src/stanza.ml src/static_deps.ml src/stats.boot.ml src/string_with_vars.ml src/sub_dirs.ml src/sub_sys tem.ml src/sub_system_info.ml src/sub_system_intf.ml src/sub_system_name.ml src/super_context.ml src/syntax.ml src/test_rules.ml src/top_closure.ml src/toplevel.ml src/upgrader.boot.ml src/utils.ml src/utop.ml src/value.ml src/variant.ml src/versioned_file.ml src/vfile_kind.ml src/vimpl.ml src/virtual_rules.ml src/watermarks.ml src/workspace.ml src/wrapped.ml > boot-d epends.txt '/Users/ostera/repos/github.com/BuckleScript/bucklescript/_esy/docs/store/i/ocaml-d4422908/bin/ocamldep.opt' -modules src/dag/dag.ml src/dag/dag_intf.ml > boot-depends.txt '/Users/ostera/repos/github.com/BuckleScript/bucklescript/_esy/docs/store/i/ocaml-d4422908/bin/ocamldep.opt' -modules src/stdune/caml/dune_caml.ml src/stdune/caml/result.ml src/stdu ne/caml/result_compat.ml > boot-depends.txt '/Users/ostera/repos/github.com/BuckleScript/bucklescript/_esy/docs/store/i/ocaml-d4422908/bin/ocamldep.opt' -modules src/dune_lang/dune_lang.ml src/dune_lang/atom.ml src/dune_lang/ dune_lexer.ml src/dune_lang/escape.ml src/dune_lang/jbuild_lexer.boot.ml src/dune_lang/lexer.ml src/dune_lang/lexer_shared.ml src/dune_lang/syntax.ml src/dune_lang/template.ml src/dune_ lang/types.ml > boot-depends.txt '/Users/ostera/repos/github.com/BuckleScript/bucklescript/_esy/docs/store/i/ocaml-d4422908/bin/ocamldep.opt' -modules src/fiber/fiber.ml > boot-depends.txt '/Users/ostera/repos/github.com/BuckleScript/bucklescript/_esy/docs/store/i/ocaml-d4422908/bin/ocamldep.opt' -modules src/memo/memo.ml src/memo/memo_intf.ml > boot-depends.txt '/Users/ostera/repos/github.com/BuckleScript/bucklescript/_esy/docs/store/i/ocaml-d4422908/bin/ocamldep.opt' -modules src/ocaml-config/ocaml_config.ml > boot-depends.txt '/Users/ostera/repos/github.com/BuckleScript/bucklescript/_esy/docs/store/i/ocaml-d4422908/bin/ocamldep.opt' -modules src/stdune/stdune.ml src/stdune/ansi_color.ml src/stdune/array. ml src/stdune/bin.ml src/stdune/bool.ml src/stdune/bytes.ml src/stdune/char.ml src/stdune/common.ml src/stdune/comparable.ml src/stdune/digest.ml src/stdune/dyn.ml src/stdune/either.ml src/stdune/env.ml src/stdune/escape.ml src/stdune/exn.ml src/stdune/fdecl.ml src/stdune/filename.ml src/stdune/float.ml src/stdune/fmt.ml src/stdune/fn.ml src/stdune/hashable.ml src/std une/hashtbl.ml src/stdune/hashtbl_intf.ml src/stdune/id.ml src/stdune/import.ml src/stdune/int.ml src/stdune/interned.ml src/stdune/io.ml src/stdune/list.ml src/stdune/loc.ml src/stdune /loc0.ml src/stdune/map.ml src/stdune/map_intf.ml src/stdune/monad.ml src/stdune/nothing.ml src/stdune/option.ml src/stdune/or_exn.ml src/stdune/ordering.ml src/stdune/path.ml src/stdun e/pp.ml src/stdune/proc.ml src/stdune/result.ml src/stdune/set.ml src/stdune/set_intf.ml src/stdune/sexp.ml src/stdune/sexp_intf.ml src/stdune/staged.ml src/stdune/string.ml src/stdune/ string_split.ml src/stdune/type_eq.ml src/stdune/unit.ml src/stdune/univ_map.ml > boot-depends.txt '/Users/ostera/repos/github.com/BuckleScript/bucklescript/_esy/docs/store/i/ocaml-d4422908/bin/ocamldep.opt' -modules src/wp/wp.boot.ml > boot-depends.txt '/Users/ostera/repos/github.com/BuckleScript/bucklescript/_esy/docs/store/i/ocaml-d4422908/bin/ocamldep.opt' -modules src/xdg/xdg.ml > boot-depends.txt '/Users/ostera/repos/github.com/BuckleScript/bucklescript/_esy/docs/store/i/ocaml-d4422908/bin/ocamllex.opt' -q src/let-syntax/lexer.mll File "src/let-syntax/lexer.mll", line 25, characters 10-19: Warning 40: pos_fname was selected from type Lexing.position. It is not visible in the current scope, and will not be selected if the type becomes unknown. File "src/let-syntax/lexer.mll", line 25, characters 26-34: Warning 40: pos_lnum was selected from type Lexing.position. It is not visible in the current scope, and will not be selected if the type becomes unknown. File "src/let-syntax/lexer.mll", line 25, characters 42-50: Warning 40: pos_cnum was selected from type Lexing.position. It is not visible in the current scope, and will not be selected if the type becomes unknown. File "src/let-syntax/lexer.mll", line 25, characters 59-66: Warning 40: pos_bol was selected from type Lexing.position. It is not visible in the current scope, and will not be selected if the type becomes unknown. File "src/let-syntax/lexer.mll", line 26, characters 10-18: Warning 40: pos_cnum was selected from type Lexing.position. It is not visible in the current scope, and will not be selected if the type becomes unknown. File "src/let-syntax/lexer.mll", line 26, characters 27-34: Warning 40: pos_bol was selected from type Lexing.position. It is not visible in the current scope, and will not be selected if the type becomes unknown. File "src/let-syntax/lexer.mll", line 58, characters 23-31: Warning 40: pos_lnum was selected from type Lexing.position. It is not visible in the current scope, and will not be selected if the type becomes unknown. File "src/let-syntax/lexer.mll", line 58, characters 36-45: Warning 40: pos_fname was selected from type Lexing.position. It is not visible in the current scope, and will not be selected if the type becomes unknown. File "src/let-syntax/lexer.mll", line 59, characters 16-24: Warning 40: pos_cnum was selected from type Lexing.position. It is not visible in the current scope, and will not be selected if the type becomes unknown. File "src/let-syntax/lexer.mll", line 59, characters 31-38: Warning 40: pos_bol was selected from type Lexing.position. It is not visible in the current scope, and will not be selected if the type becomes unknown. File "src/let-syntax/lexer.mll", line 222, characters 7-17: Warning 40: lex_curr_p was selected from type Lexing.lexbuf. It is not visible in the current scope, and will not be selected if the type becomes unknown. File "src/let-syntax/lexer.mll", line 223, characters 6-99: Warning 40: this record of type Lexing.position contains fields that are not visible in the current scope: pos_fname pos_lnum pos_bol pos_cnum. They will not be selected if the type becomes unknown. '/Users/ostera/repos/github.com/BuckleScript/bucklescript/_esy/docs/store/i/ocaml-d4422908/bin/ocamlc.opt' -g -w -40 -o boot.exe unix.cma threads.cma -I +threads boot.ml # esy-build-package: running: './boot.exe' '--release' '-j' '4' Fatal error: cannot load shared library dllunix Reason: dlopen(dllunix.so, 138): image not found error: command failed: './boot.exe' '--release' '-j' '4' (exited with 2) esy-build-package: exiting with errors above... building @opam/dune@opam:1.7.1 esy: exiting due to errors above 
@leostera
Copy link
Author

Current error is:

esy @docs x odoc compile -I runtime -I others --pkg=Belt others/js_option.cmti info building @opam/ocamlbuild@opam:0.12.0@6c616094 info building @opam/cmdliner@opam:1.0.3@96d31520 info building @opam/jbuilder@opam:transition@58bdfe0a info building @opam/jbuilder@opam:transition@58bdfe0a: done info building @opam/cppo@opam:1.6.5@bec3dbd9 info building @opam/ppx_derivers@opam:1.0@78655ff8 info building @opam/result@opam:1.3@bee8bf2e info building @opam/ppx_derivers@opam:1.0@78655ff8: done info building @opam/easy-format@opam:1.3.1@9abfd4ed info building @opam/re@opam:1.8.0@7baac1a7 error: build failed with exit code: 1 build log: # esy-build-package: building: @opam/ocamlbuild@opam:0.12.0 # esy-build-package: pwd: /Users/ostera/repos/github.com/BuckleScript/bucklescript/_esy/docs/store/b/opam__s__ocamlbuild-opam__c__0.12.0-130e332f # esy-build-package: running: 'bash' '-c' 'true' # esy-build-package: running: 'make' '-f' 'configure.make' 'all' 'OCAMLBUILD_PREFIX=/Users/ostera/repos/github.com/BuckleScript/bucklescript/_esy/docs/store/s/opam__s__ocamlbuild-op am__c__0.12.0-130e332f' 'OCAMLBUILD_BINDIR=/Users/ostera/repos/github.com/BuckleScript/bucklescript/_esy/docs/store/s/opam__s__ocamlbuild-opam__c__0.12.0-130e332f/bin' 'OCAMLBUILD_LIBDI R=/Users/ostera/repos/github.com/BuckleScript/bucklescript/_esy/docs/store/s/opam__s__ocamlbuild-opam__c__0.12.0-130e332f/lib' 'OCAMLBUILD_MANDIR=/Users/ostera/repos/github.com/BuckleSc ript/bucklescript/_esy/docs/store/s/opam__s__ocamlbuild-opam__c__0.12.0-130e332f/man' 'OCAMLBUILD_NATIVE=true' 'OCAMLBUILD_NATIVE_TOOLS=true' (echo "# This file was generated from configure.make"; \ echo ;\ echo "OCAML_PREFIX=/Users/ostera/repos/github.com/BuckleScript/bucklescript/_esy/docs/store/i/ocaml-24c72d44"; \ echo "OCAML_BINDIR=/Users/ostera/repos/github.com/BuckleScript/bucklescript/_esy/docs/store/i/ocaml-24c72d44/bin"; \ echo "OCAML_LIBDIR=/Users/ostera/repos/github.com/BuckleScript/bucklescript/_esy/docs/store/i/ocaml-24c72d44/lib/ocaml"; \ echo "OCAML_MANDIR=/Users/ostera/repos/github.com/BuckleScript/bucklescript/_esy/docs/store/i/ocaml-24c72d44/man"; \ echo ;\ echo "EXT_OBJ=.o"; \ echo "EXT_ASM=.s"; \ echo "EXT_LIB=.a"; \ echo "EXT_DLL=.so"; \ echo "EXE="; \ echo ;\ echo "OCAML_NATIVE=true"; \ echo "OCAML_NATIVE_TOOLS=true"; \ echo "NATDYNLINK=true"; \ echo "SUPPORT_SHARED_LIBRARIES=true"; \ echo ;\ echo "PREFIX=/Users/ostera/repos/github.com/BuckleScript/bucklescript/_esy/docs/store/s/opam__s__ocamlbuild-opam__c__0.12.0-130e332f"; \ echo "BINDIR=/Users/ostera/repos/github.com/BuckleScript/bucklescript/_esy/docs/store/s/opam__s__ocamlbuild-opam__c__0.12.0-130e332f/bin"; \ echo "LIBDIR=/Users/ostera/repos/github.com/BuckleScript/bucklescript/_esy/docs/store/s/opam__s__ocamlbuild-opam__c__0.12.0-130e332f/lib"; \ echo "MANDIR=/Users/ostera/repos/github.com/BuckleScript/bucklescript/_esy/docs/store/s/opam__s__ocamlbuild-opam__c__0.12.0-130e332f/man"; \ ) > Makefile.config (echo "(* This file was generated from ../configure.make *)"; \ echo ;\ echo 'let bindir = "/Users/ostera/repos/github.com/BuckleScript/bucklescript/_esy/docs/store/s/opam__s__ocamlbuild-opam__c__0.12.0-130e332f/bin"'; \ echo 'let libdir = "/Users/ostera/repos/github.com/BuckleScript/bucklescript/_esy/docs/store/s/opam__s__ocamlbuild-opam__c__0.12.0-130e332f/lib"'; \ echo 'let ocaml_libdir = "/Users/ostera/repos/github.com/BuckleScript/bucklescript/_esy/docs/store/i/ocaml-24c72d44/lib/ocaml"'; \ echo 'let libdir_abs = "/Users/ostera/repos/github.com/BuckleScript/bucklescript/_esy/docs/store/s/opam__s__ocamlbuild-opam__c__0.12.0-130e332f/lib"'; \ echo 'let ocaml_native = true'; \ echo 'let ocaml_native_tools = true'; \ echo 'let supports_shared_libraries = true';\ echo 'let a = "a"'; \ echo 'let o = "o"'; \ echo 'let so = "so"'; \ echo 'let ext_dll = ".so"'; \ echo 'let exe = ""'; \ echo 'let version = "0.12.0"'; \ ) > src/ocamlbuild_config.ml # esy-build-package: running: 'make' 'check-if-preinstalled' 'all' 'opam-install' if test -d /Users/ostera/repos/github.com/BuckleScript/bucklescript/_esy/docs/store/i/ocaml-24c72d44/lib/ocaml/ocamlbuild; then\ >&2 echo "ERROR: Preinstalled ocamlbuild detected at"\ "/Users/ostera/repos/github.com/BuckleScript/bucklescript/_esy/docs/store/i/ocaml-24c72d44/lib/ocaml/ocamlbuild";\ >&2 echo "Installation aborted; if you want to bypass this"\ "safety check, pass CHECK_IF_PREINSTALLED=false to make";\ exit 2;\ fi ERROR: Preinstalled ocamlbuild detected at /Users/ostera/repos/github.com/BuckleScript/bucklescript/_esy/docs/store/i/ocaml-24c72d44/lib/ocaml/ocamlbuild Installation aborted; if you want to bypass this safety check, pass CHECK_IF_PREINSTALLED=false to make make: *** [check-if-preinstalled] Error 2 error: command failed: 'make' 'check-if-preinstalled' 'all' 'opam-install' (exited with 2) esy-build-package: exiting with errors above... building @opam/ocamlbuild@opam:0.12.0 esy: exiting due to errors above 
@leostera
Copy link
Author

According to @andreypopp there might a bug with esy's picking up ocaml versions from custom ocaml forks — a solution to that last error is to make the downstream consumer of this package set @opam/ocamlbuild: "0" in their resolutions.

@leostera
Copy link
Author

leostera commented Feb 18, 2019

Todo:

  • Add build to CI
@leostera
Copy link
Author

Gotta wait for Travis to pick things up but given the results of rescript-lang/rescript#3379 I'd say this is good to review — I might add more commits to fix CI if it breaks

@chenglou @bobzhang

@leostera leostera changed the title [wip] Package with esy for downstream consumption Package with esy for downstream consumption Feb 18, 2019
@leostera
Copy link
Author

Alright, building with esy on macOS and Linux works. The C bits are broken, but apparently they've been broken for a while.

@leostera leostera changed the title Package with esy for downstream consumption Package 4.02.3+bs with esy for downstream consumption Feb 19, 2019
@bobzhang
Copy link
Member

hi @Ostera Sorry I missed your PR, is this good to merge, any way I can test it?

@bobzhang bobzhang closed this Mar 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants