ocaml-community / zed

Abstract engine for text edition in OCaml
Other
121 stars 16 forks source link

can't install utop using opam #34

Closed invad0r closed 4 years ago

invad0r commented 4 years ago

Hello, I'm new to ocaml and was trying to install utop using opam on macos, but I can't figure out why I am getting ERROR while compiling zed.2.0.5

similar to https://github.com/ocaml-community/utop/issues/302

uname -a
Darwin MacBook-164.local 18.7.0 Darwin Kernel Version 18.7.0: Tue Aug 20 16:57:14 PDT 2019; root:xnu-4903.271.2~2/RELEASE_X86_64 x86_64
ocaml --version
The OCaml toplevel, version 4.10.0
opam config report
# opam config report
# opam-version      2.0.6
# self-upgrade      no
# system            arch=x86_64 os=macos os-distribution=homebrew os-version=10.14.6
# solver            builtin-mccs+glpk
# install-criteria  -removed,-count[version-lag,request],-count[version-lag,changed],-changed
# upgrade-criteria  -removed,-count[version-lag,solution],-new
# jobs              7
# repositories      1 (http) (default repo at 65eb41e7)
# pinned            0
# current-switch    default
opam list
# Packages matching: installed
# Name              # Installed # Synopsis
base-bigarray       base
base-bytes          base        Bytes library distributed with the OCaml compiler
base-threads        base
base-unix           base
camomile            1.0.2       A Unicode library
charInfo_width      1.1.0       Determine column width for a character
conf-m4             1           Virtual package relying on m4
cppo                1.6.6       Code preprocessor like cpp for OCaml
dune                2.3.1       Fast, portable, and opinionated build system
dune-configurator   2.3.1       Helper library for gathering system configuration
dune-private-libs   2.3.1       Private libraries of Dune
lwt                 5.1.2       Promises and event-driven I/O
lwt_log             1.1.1       Lwt logging library (deprecated)
lwt_react           1.1.3       Helpers for using React with Lwt
mmap                1.1.0       File mapping functionality
ocaml               4.10.0      The OCaml compiler (virtual package)
ocaml-base-compiler 4.10.0      Official release 4.10.0
ocaml-config        1           OCaml Switch Configuration
ocamlbuild          0.14.0      OCamlbuild is a build system with builtin rules to easily build most OCaml projects.
ocamlfind           1.8.1       A library manager for OCaml
ocplib-endian       1.0         Optimised functions to read and write int16/32/64 from strings and bigarrays, based on new primitives added in version 4.01.
react               1.2.1       Declarative events and signals for OCaml
result              1.5         Compatibility Result module
seq                 base        Compatibility package for OCaml's standard iterator type starting from 4.07.
topkg               1.0.1       The transitory OCaml software packager
opam install utop -vv --debug
...
<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><>
00:07.198  PARALLEL               Iterate over 6 task(s) with 7 process(es)
00:07.199  PARALLEL               Starting job 815124986 (worker 1/7): build zed.2.0.5
00:07.199  SYSTEM                 rmdir /Users/USER/.opam/default/.opam-switch/build/zed.2.0.5
00:07.248  SYSTEM                 [log-70244-d0f245] (in 0.028s) cp -PRp /Users/USER/.opam/default/.opam-switch/sources/zed.2.0.5 /Users/USER/.opam/default/.opam-switch/build/zed.2.0.5
00:07.248  ACTION                 prepare_package_source: zed.2.0.5 at /Users/USER/.opam/default/.opam-switch/build/zed.2.0.5
00:07.252  PARALLEL               Next task in job 815124986: /Users/USER/.opam/opam-init/hooks/sandbox.sh build dune build -p zed -j 7
Processing  1/6: [zed: dune build]
+ /Users/USER/.opam/opam-init/hooks/sandbox.sh "build" "dune" "build" "-p" "zed" "-j" "7" (CWD=/Users/USER/.opam/default/.opam-switch/build/zed.2.0.5)
-       ocamlc src/.zed.objs/byte/zed_string.{cmo,cmt} (exit 2)
- (cd _build/default && /Users/USER/.opam/default/bin/ocamlc.opt -w -40 -safe-string -g -bin-annot -I src/.zed.objs/byte -I /Users/USER/.opam/default/lib/bytes -I /Users/USER/.opam/default/lib/camomile
-I /Users/USER/.opam/default/lib/camomile/default_config -I /Users/USER/.opam/default/lib/camomile/dyn -I /Users/USER/.opam/default/lib/camomile/lib_default -I /Users/USER/.opam/default/lib/camomile/l
ibrary -I /Users/USER/.opam/default/lib/charInfo_width -I /Users/USER/.opam/default/lib/react -I /Users/USER/.opam/default/lib/result -intf-suffix .ml -no-alias-deps -o src/.zed.objs/byte/zed_string.cmo
 -c -impl src/zed_string.ml)
- File "src/zed_string.ml", line 1:
- Error: The implementation src/zed_string.ml
-        does not match the interface src/.zed.objs/byte/zed_string.cmi:
-        Values do not match:
-          val compare_index :
-            t ->
-            ('a, 'b) result ->
-            ('a, 'b) result ->
-            ok:('a -> 'a -> int) -> error:('b -> 'b -> int) -> int
-        is not included in
-          val compare_index : t -> index -> index -> int
-        File "src/zed_string.mli", line 184, characters 0-46:
-          Expected declaration
-        File "src/zed_string.ml", line 454, characters 6-19:
-          Actual declaration
-     ocamlopt src/.zed.objs/native/zed_string.{cmx,o} (exit 2)
- (cd _build/default && /Users/USER/.opam/default/bin/ocamlopt.opt -w -40 -safe-string -g -I src/.zed.objs/byte -I src/.zed.objs/native -I /Users/USER/.opam/default/lib/bytes -I /Users/USER/.opam/defaul
t/lib/camomile -I /Users/USER/.opam/default/lib/camomile/default_config -I /Users/USER/.opam/default/lib/camomile/dyn -I /Users/USER/.opam/default/lib/camomile/lib_default -I /Users/USER/.opam/default
/lib/camomile/library -I /Users/USER/.opam/default/lib/charInfo_width -I /Users/USER/.opam/default/lib/react -I /Users/USER/.opam/default/lib/result -intf-suffix .ml -no-alias-deps -o src/.zed.objs/nati
ve/zed_string.cmx -c -impl src/zed_string.ml)
- File "src/zed_string.ml", line 1:
- Error: The implementation src/zed_string.ml
-        does not match the interface src/.zed.objs/byte/zed_string.cmi:
-        Values do not match:
-          val compare_index :
-            t ->
-            ('a, 'b) result ->
-            ('a, 'b) result ->
-            ok:('a -> 'a -> int) -> error:('b -> 'b -> int) -> int
-        is not included in
-          val compare_index : t -> index -> index -> int
-        File "src/zed_string.mli", line 184, characters 0-46:
-          Expected declaration
-        File "src/zed_string.ml", line 454, characters 6-19:
-          Actual declaration
00:08.081  PARALLEL               Collected task for job 815124986 (ret:1)
[ERROR] The compilation of zed failed at "/Users/USER/.opam/opam-init/hooks/sandbox.sh build dune build -p zed -j 7".
00:08.081  PARALLEL               Job 815124986 finished
00:08.081  PARALLEL               Starting job 618496260 (worker 1/7): install zed.2.0.5
00:08.081  PARALLEL               Job 618496260 finished
00:08.081  PARALLEL               Starting job 710717809 (worker 1/7): build lambda-term.2.0.3
00:08.081  PARALLEL               Job 710717809 finished
00:08.081  PARALLEL               Starting job 1057204656 (worker 1/7): install lambda-term.2.0.3
00:08.081  PARALLEL               Job 1057204656 finished
00:08.081  PARALLEL               Starting job 876866274 (worker 1/7): build utop.2.4.3
00:08.081  PARALLEL               Job 876866274 finished
00:08.081  PARALLEL               Starting job 938759213 (worker 1/7): install utop.2.4.3
00:08.081  PARALLEL               Job 938759213 finished

#=== ERROR while compiling zed.2.0.5 ==========================================#
# context     2.0.6 | macos/x86_64 | ocaml-base-compiler.4.10.0 | https://opam.ocaml.org#65eb41e7
# path        ~/.opam/default/.opam-switch/build/zed.2.0.5
# command     ~/.opam/opam-init/hooks/sandbox.sh build dune build -p zed -j 7
# exit-code   1
# env-file    ~/.opam/log/zed-70244-865888.env
# output-file ~/.opam/log/zed-70244-865888.out
### output ###
# Error: The implementation src/zed_string.ml
# [...]
#          val compare_index :
#            t ->
#            ('a, 'b) result ->
#            ('a, 'b) result ->
#            ok:('a -> 'a -> int) -> error:('b -> 'b -> int) -> int
#        is not included in
#          val compare_index : t -> index -> index -> int
#        File "src/zed_string.mli", line 184, characters 0-46:
#          Expected declaration
#        File "src/zed_string.ml", line 454, characters 6-19:
#          Actual declaration

<><> Error report <><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
+- The following actions were aborted
| - install lambda-term 2.0.3
| - install utop        2.4.3
+-
+- The following actions failed
| - build zed 2.0.5
+-
- No changes have been performed
00:08.091  SYSTEM                 rm /Users/USER/.opam/default/.opam-switch/backup/state-20200228080913.export
'opam install utop -vv --debug' failed.

I've already tried opam update && opam upgrade to no avail. Everything as up-to-date as possible..

Any help or pointers in the right direction would be appreciated.

kandu commented 4 years ago

Hi, @invad0r This is a known bug and will be resolved by the upcoming release 2.0.6 ocaml/opam-repository/pull/15914

invad0r commented 4 years ago

@kandu ok thanks - I'll look out for the next release 👍

shiyangzhaoa commented 4 years ago

@kandu Hi, I'm new to ocaml, when i try to install

~ opam install zed.2.0.6
[ERROR] Package zed has no version 2.0.6.
kandu commented 4 years ago

@shiyangzhaoa, 你好!

Since you are new to ocaml, I suppose what you want is a working utop environment. see https://github.com/ocaml-community/zed/issues/33#issuecomment-592929149

Periodically, you may update the opam repository info by opam update. As you've pasted, there is no package info in your opam setup, so opam update is a must before you do anything else.

In case you want the zed library, just opam install zed, this will install zed.3.x.x for you.

And in rare case you really want zed.2.x.x, you can install the latest 2.x.x version 2.0.7, which fixed the irritating undo issue, by opam install zed.2.0.7

shiyangzhaoa commented 4 years ago

@kandu Thanks~