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

Dune installs latest yojson; tools require yojson 1.7.0 #644

Closed
hmedina opened this issue Oct 10, 2022 · 4 comments
Closed

Dune installs latest yojson; tools require yojson 1.7.0 #644

hmedina opened this issue Oct 10, 2022 · 4 comments

Comments

@hmedina
Copy link
Collaborator

hmedina commented Oct 10, 2022

Trying to install the latest commit that's passing per the CI tasks (b4fd715), I get the following compilation error:

$ opam pin add kappa-library git+https://github.com/Kappa-Dev/KappaTools.git#b4fd71520d42cbcc052fa5d15e57f2371a8a7710
[...]
$ opam pin add kappa-binaries git+https://github.com/Kappa-Dev/KappaTools.git#b4fd71520d42cbcc052fa5d15e57f2371a8a7710
[...]
$ opam pin add kappa-agents git+https://github.com/Kappa-Dev/KappaTools.git#b4fd71520d42cbcc052fa5d15e57f2371a8a7710
[...]
$ opam pin add kappa-server git+https://github.com/Kappa-Dev/KappaTools.git#b4fd71520d42cbcc052fa5d15e57f2371a8a7710
[NOTE] Package kappa-server is currently pinned to git+https://github.com/Kappa-Dev/KappaTools.git (version 4.1~dev).
[kappa-server.4.1~dev] synchronised (git+https://github.com/Kappa-Dev/KappaTools.git#b4fd71520d42cbcc052fa5d15e57f2371a8a7710)
kappa-server is now pinned to git+https://github.com/Kappa-Dev/KappaTools.git#b4fd71520d42cbcc052fa5d15e57f2371a8a7710 (version 4.1~dev)

The following actions will be performed:
  ∗ install kappa-library  4.1~dev* [required by kappa-agents, kappa-binaries]
  ∗ install kappa-binaries 4.1~dev* [required by kappa-server]
  ∗ install kappa-agents   4.1~dev* [required by kappa-server]
  ∗ install kappa-server   4.1~dev*
===== ∗ 4 =====
Do you want to continue? [Y/n] y

<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><>
[ERROR] The compilation of kappa-library.4.1~dev failed at "dune build -p kappa-library -j 11".

#=== ERROR while compiling kappa-library.4.1~dev ==============================#
# context     2.1.2 | linux/x86_64 | ocaml.4.14.0 | pinned(git+https://github.com/Kappa-Dev/KappaTools.git#b4fd71520d42cbcc052fa5d15e57f2371a8a7710#b4fd7152)
# path        ~/.opam/default/.opam-switch/build/kappa-library.4.1~dev
# command     ~/.opam/opam-init/hooks/sandbox.sh build dune build -p kappa-library -j 11
# exit-code   1
# env-file    ~/.opam/log/kappa-library-2906-215c19.env
# output-file ~/.opam/log/kappa-library-2906-215c19.out
### output ###
# 11 | val write_to_channel: (Bi_outbuf.t -> 'a -> unit) -> out_channel -> 'a -> unit
# [...]
# Error: Unbound module Bi_outbuf
# (cd _build/default && /home/hmedina/.opam/default/bin/ocamlc.opt -w -40 -w @a -g -bin-annot -I core/dataStructures/.kappa_generic_toolset.objs/byte -I /home/hmedina/.opam/default/lib/camlp-streams -I /home/hmedina/.opam/default/lib/logs -I /home/hmedina/.opam/default/lib/result -I /home/hmedina/.opam/default/lib/seq -I /home/hmedina/.opam/default/lib/stdlib-shims -I /home/hmedina/.opam/defaul[...]
# File "core/dataStructures/nbr.mli", line 65, characters 14-25:
# 65 | val write_t : Bi_outbuf.t -> t -> unit
#                    ^^^^^^^^^^^
# Error: Unbound module Bi_outbuf
# (cd _build/default && /home/hmedina/.opam/default/bin/ocamlc.opt -w -40 -w @a -g -bin-annot -I core/dataStructures/.kappa_generic_toolset.objs/byte -I /home/hmedina/.opam/default/lib/camlp-streams -I /home/hmedina/.opam/default/lib/logs -I /home/hmedina/.opam/default/lib/result -I /home/hmedina/.opam/default/lib/seq -I /home/hmedina/.opam/default/lib/stdlib-shims -I /home/hmedina/.opam/defaul[...]
# File "core/dataStructures/locality.mli", line 44, characters 21-32:
# 44 | val write_position : Bi_outbuf.t -> position -> unit
#                           ^^^^^^^^^^^
# Error: Unbound module Bi_outbuf



<><> Error report <><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
┌─ The following actions failed
│ λ build kappa-library 4.1~dev
└─
╶─ No changes have been performed
[NOTE] Pinning command successful, but your installed packages may be out of sync.
@hmedina hmedina changed the title Comilation error on build Compilation error on commit that's passing in tasks Oct 10, 2022
@hmedina
Copy link
Collaborator Author

hmedina commented Oct 10, 2022

Ubuntu 20.04

Why is this commit passing on the GitHub tasks, but failing for me?

@hmedina
Copy link
Collaborator Author

hmedina commented Oct 12, 2022

Moreover, the Bi_outbuf call seem to request the biniou module, which is not declared in the core/dataStructures/dune file. Including it after the other libraries throws a litany of other type errors, apparently out of a mismatch between the Buffer.t and the Bi_outbuf.t types.

Is biniou a required package?

@feret
Copy link
Contributor

feret commented Oct 17, 2022

Hi Hector,

Biniou used to be included in Json.
This is why it was not required.

Now the packages are separated.
I need to figure out out to fix this (this is not enough to change the dependences).
Either I replace Biniou element by simple buffers, or I have to implement many thing to rewrite the JsonUtil module to work with Biniou.

I will try.

Best.
Jérôme.

@hmedina
Copy link
Collaborator Author

hmedina commented Oct 18, 2022

Hi Jerome, from YoJson's release log, the last release that still had biniou was 1.7.0; is there a way of telling Dune to use a specific library version? I'm not seeing that in the library stanza reference which seems very odd to me.

In any case, downgrading to yojson 1.7.0 via $ opam install "yojson<2.0", allowed the tools to compile.

Since this is an issue of dependency versioning, I'll update the issue's title to reflect this.

@hmedina hmedina changed the title Compilation error on commit that's passing in tasks Dune installs latest yojson; tools require yojson 1.7.0 Oct 18, 2022
thierry-martinez added a commit to thierry-martinez/KappaTools that referenced this issue Oct 19, 2022
This should make Kappa compatible with the latest version of yojson.

Since ocaml-community/yojson#74, yojson does
not rely on biniou buffers.

The main drawback seems to be that `JsonUtil.write_to_channel` now
writes everything to the memory (in a `Buffer.t`) before dumping the
buffer to the channel.
thierry-martinez added a commit to thierry-martinez/KappaTools that referenced this issue Oct 19, 2022
This should make Kappa compatible with the latest version of yojson.

Since ocaml-community/yojson#74, yojson does
not rely on biniou buffers.

The main drawback seems to be that `JsonUtil.write_to_channel` now
writes everything to the memory (in a `Buffer.t`) before dumping the
buffer to the channel.
thierry-martinez added a commit to thierry-martinez/KappaTools that referenced this issue Oct 19, 2022
This should make Kappa compatible with the latest version of yojson.

Since ocaml-community/yojson#74, yojson does
not rely on biniou buffers.

The main drawback seems to be that `JsonUtil.write_to_channel` now
writes everything to the memory (in a `Buffer.t`) before dumping the
buffer to the channel.
@feret feret closed this as completed in 0bd8ec9 Oct 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants