ocaml-community / zed

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

Build failed with result 1.5 #33

Closed kkirstein closed 4 years ago

kkirstein commented 4 years ago

Hi, after upgrading the result package from 1.4 -> 1.5 building zedfails:

#=== ERROR while compiling zed.2.0.5 ==========================================#
# context     2.0.6 | linux/x86_64 | ocaml-base-compiler.4.09.0 | https://opam.ocaml.org#20e0fd9d
# path        ~/.opam/default/.opam-switch/build/zed.2.0.5
# command     ~/.opam/default/bin/dune build -p zed -j 3
# exit-code   1
# env-file    ~/.opam/log/zed-1278-417725.env
# output-file ~/.opam/log/zed-1278-417725.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

According to the change notes in result type Result is now aliased to Stdlib.Result Actually, I don't see why this should fail for zed now.

kkirstein commented 4 years ago

When I pin the package to git+https://github.com/ocaml-community/zed.git#f0fbd01b I get a slightly different error message:

#=== ERROR while compiling zed.2.0.5 ==========================================#
# context     2.0.6 | linux/x86_64 | ocaml-base-compiler.4.09.0 | pinned(git+https://github.com/ocaml-community/zed.git#f0fbd01b)
# path        ~/.opam/default/.opam-switch/build/zed.2.0.5
# command     ~/.opam/default/bin/dune build -p zed -j 3
# exit-code   1
# env-file    ~/.opam/log/zed-3774-6aa130.env
# output-file ~/.opam/log/zed-3774-6aa130.out
### output ###
# Error: The implementation src/zed_string.ml
# [...]
#          val compare_index :
#            'a ->
#            ok:('b -> 'b -> int) ->
#            error:('c -> 'c -> int) ->
#            ('b, 'c) result -> ('b, 'c) result -> int
#        is not included in
#          val compare_index : t -> index -> index -> int
#        File "src/zed_string.mli", line 326, characters 2-48:
#          Expected declaration
#        File "src/zed_string.ml", line 600, characters 6-19:
#          Actual declaration
kandu commented 4 years ago

When I pin the package to git+https://github.com/ocaml-community/zed.git#f0fbd01b I get a slightly different error message

Yeah, in module Zed_stirng.US_Raw, there was a left-out compare didn't point to the Pervasives one

I've just cut a bugfix release. Thank you, @kkirstein and @mjambon :)

kkirstein commented 4 years ago

Great, is fixed by fab8052769ddf9e7e0390b31422c0f0e378e6861 now!

SimunKaracic commented 4 years ago

Sorry to comment on a closed issue, but I've hit this when trying to install utop (I'm following the real world dev ocaml guide).

Is there anything I can do to fix this, or do I have to wait for Zed to get a new release, and then utop to upgrade depencencies?

Feel free to just point me to some docs, or another place to ask this question.

kandu commented 4 years ago

Hi, @SimunKaracic

After the package PR is merged, to synchronize and publish the changes to the opam repo will take some extra time, usually several hours.

I just do opam update && opam upgrade and everthing is done and works well now.

Since you failed in this action(opam upgrade, I guess), utop was now unfortunately removed by opam to filter broken packages away. You now have to install utop manually by

opam update && opam install utop

I'm quite sure it should work now. Again, opam update is the key point.

SimunKaracic commented 4 years ago

It worked! :tada: Thanks!

Well, I guess I have to go actually learn ocaml now