rgrinberg / opium

Sinatra like web toolkit for OCaml

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Master is uninstallable?

bbenne10 opened this issue Β· comments

Okay - I admit a general lack of knowledge about anything more than the basics of OCaml packaging, but I seem unable to install opium from master.

$ opam pin add opium "https://github.com/rgrinberg/opium.git"
[NOTE] Package opium is currently pinned to git+https://github.com/rgrinberg/opium.git#f7c75d30cb776811aac74a86dac26b3582111e21 (version 0.18.0).
[opium.0.18.0] no changes from git+https://github.com/rgrinberg/opium.git
opium is now pinned to git+https://github.com/rgrinberg/opium.git (version 0.18.0)

The following actions will be performed:
  βˆ— install opium 0.18.0*
Do you want to continue? [Y/n] y
[opium.0.18.0] synchronised from git+https://github.com/rgrinberg/opium.git

<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><>  🐫
[ERROR] The compilation of opium failed at "/Users/bbennett37/.opam/opam-init/hooks/sandbox.sh build dune build -p opium -j 7 @install".

#=== ERROR while compiling opium.0.18.0 =======================================#
# context     2.0.6 | macos/x86_64 | ocaml-base-compiler.4.09.0 | pinned(git+https://github.com/rgrinberg/opium.git#f7c75d30)
# path        ~/code/bap_embed/_opam/.opam-switch/build/opium.0.18.0
# command     ~/.opam/opam-init/hooks/sandbox.sh build dune build -p opium -j 7 @install
# exit-code   1
# env-file    ~/.opam/log/opium-2118-d4902a.env
# output-file ~/.opam/log/opium-2118-d4902a.out
### output ###
# Error: Unbound module Opium_kernel.Middleware
# [...]
# (cd _build/default && /Users/bbennett37/code/bap_embed/_opam/bin/ocamlc.opt -w -40 -g -bin-annot -I opium/.opium.objs/byte -I /Users/bbennett37/code/bap_embed/_opam/lib/angstrom -I /Users/bbennett37/code/bap_embed/_opam/lib/base -I /Users/bbennett37/code/bap_embed/_opam/lib/base/caml -I /Users/bbennett37/code/bap_embed/_opam/lib/base/shadow_stdlib -I /Users/bbennett37/code/bap_embed/_opam/lib[...]
# File "opium/static_serve.ml", line 78, characters 17-31:
# 78 |       let body = Body.of_stream ~length:size stream in
#                       ^^^^^^^^^^^^^^
# Error: Unbound module Body
#     ocamlopt opium/.opium.objs/native/opium__Static_serve.{cmx,o} (exit 2)
# (cd _build/default && /Users/bbennett37/code/bap_embed/_opam/bin/ocamlopt.opt -w -40 -g -I opium/.opium.objs/byte -I opium/.opium.objs/native -I /Users/bbennett37/code/bap_embed/_opam/lib/angstrom -I /Users/bbennett37/code/bap_embed/_opam/lib/base -I /Users/bbennett37/code/bap_embed/_opam/lib/base/caml -I /Users/bbennett37/code/bap_embed/_opam/lib/base/shadow_stdlib -I /Users/bbennett37/code/[...]
# File "opium/static_serve.ml", line 78, characters 17-31:
# 78 |       let body = Body.of_stream ~length:size stream in
#                       ^^^^^^^^^^^^^^
# Error: Unbound module Body



<><> Error report <><><><><><><><><><><><><><><><><><><><><><><><><><><><><>  🐫
β”Œβ”€ The following actions failed
β”‚ Ξ» build opium 0.18.0
└─
╢─ No changes have been performed
[NOTE] Pinning command successful, but your installed packages may be out of sync.

I have not investigated further, so I'm unsure where Body went, but in prior head this was Opium_kernel.Body and that module is not opened in this file...

In short: help? Thanks, y'all. This has been one of the most understanding communities I have had the pleasure of interacting with lately.

Hi @bbenne10 as mentioned in the README the order in which you pin items makes a difference here. Opium is comprised of two libraries, opium_kernel and opium you'd need to pin them both to get a working install from the trunk.

$ opam pin add opium_kernel --dev-repo
$ opam pin add opium --dev-repo

Without the pin to opium_kernel when you install just opium it tries to use the opium_kernel that's available on opam which is older and doesn't work with the in-development version in the git repository.

Let me know if this helps.

Best,
Anurag

It is right there in the readme, isn't it?
Man I'm dumb. I'll blame a long Friday and short weekend.
I'll try that and close if (...when) it resolves the problem.

As predicted: This worked perfectly. Thanks for the help. -_-

As predicted: This worked perfectly. Thanks for the help. -_-

No problem! Glad to hear it worked!