`opam publish` now works with OCaml 4.06

I am happy to announce that since https://github.com/ocaml/opam-repository/pull/11416 has been merged, opam publish will now work with 4.06.

Happy opam publishing!

5 Likes

Hum actually there are still more problems (related to opam-lib 1.2.2), so this is not ready yet. Sorry for the noise.

Any progress on this? We currently can’t install opam-publish on 4.06.0.

1 Like

The only missing steps is porting opam-lib 1.3 to 4.06 (contributions are welcome).

A workaround is to install opam-publish in a different switch using 4.05. As it is a plugin, it will automatically be exposed in other switches as well.

Actually it seems like opam-lib 1.3 is working fine on 4.06. So you can install opam-publish by doing:

$ opam pin add opam-lib.1.3.1 https://github.com/ocaml/opam.git#1.3.1
$ opam install opam-publish

I have submitted a PR to remove the constraint, not sure why it was set in the first place.

1 Like

Indeed, works great for me. Thanks a lot Thomas!

I’m getting a build error:

#=== ERROR while installing opam-publish.0.3.5 ================================#
# opam-version 1.2.2
# os           darwin
# command      make
# path         /Users/ashish/.opam/4.06.0/build/opam-publish.0.3.5
# compiler     4.06.0
# exit-code    2
# env-file     /Users/ashish/.opam/4.06.0/build/opam-publish.0.3.5/opam-publish-19362-8415c4.env
# stdout-file  /Users/ashish/.opam/4.06.0/build/opam-publish.0.3.5/opam-publish-19362-8415c4.out
# stderr-file  /Users/ashish/.opam/4.06.0/build/opam-publish.0.3.5/opam-publish-19362-8415c4.err
### stdout ###
# Hint: Recursive traversal of subdirectories was not enabled for this build,
# [...]
#   '_tags' or 'myocamlbuild.ml' file). If you have modules in subdirectories,
#   you should add the option "-r" or create an empty '_tags' file.
#   
#   To enable recursive traversal for some subdirectories only, you can use the
#   following '_tags' file:
#   
#       true: -traverse
#       <dir1> or <dir2>: traverse
#       
### stderr ###
# make: *** [_build/src/opam_publish.native] Error 10

That trace is too small; could you try to enable verbose mode (or to look at the stdout/stderr files) to get the real error?

$ opam install -v opam-publish
The following actions will be performed:
  βˆ—  install opam-publish 0.3.5

=-=- Gathering sources =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=  🐫 
[opam-publish] Archive in cache

=-=- Processing actions -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=  🐫 
[opam-publish: make] Command started
+ make  (CWD=/Users/ashish/.opam/4.06.0/build/opam-publish.0.3.5)
- ocamlbuild -use-ocamlfind -pkgs opam-lib,opam-lib.format,opam-lib.repository,opam-lib.state,cmdliner,github.unix src/opam_publish.native
- ocamlfind ocamldep -package github.unix -package cmdliner -package opam-lib.state -package opam-lib.repository -package opam-lib.format -package opam-lib -modules src/opam_publish.ml > src/opam_publish.ml.depends
- ocamlfind ocamldep -package github.unix -package cmdliner -package opam-lib.state -package opam-lib.repository -package opam-lib.format -package opam-lib -modules src/version.mli > src/version.mli.depends
- ocamlfind ocamlc -c -package github.unix -package cmdliner -package opam-lib.state -package opam-lib.repository -package opam-lib.format -package opam-lib -I src -o src/version.cmi src/version.mli
- ocamlfind ocamlc -c -package github.unix -package cmdliner -package opam-lib.state -package opam-lib.repository -package opam-lib.format -package opam-lib -I src -o src/opam_publish.cmo src/opam_publish.ml
- ocamlfind ocamldep -package github.unix -package cmdliner -package opam-lib.state -package opam-lib.repository -package opam-lib.format -package opam-lib -modules src/version.ml > src/version.ml.depends
- ocamlfind ocamlopt -c -package github.unix -package cmdliner -package opam-lib.state -package opam-lib.repository -package opam-lib.format -package opam-lib -I src -o src/version.cmx src/version.ml
- ocamlfind ocamlopt -c -package github.unix -package cmdliner -package opam-lib.state -package opam-lib.repository -package opam-lib.format -package opam-lib -I src -o src/opam_publish.cmx src/opam_publish.ml
- ocamlfind ocamlopt -linkpkg -package github.unix -package cmdliner -package opam-lib.state -package opam-lib.repository -package opam-lib.format -package opam-lib -I src src/version.cmx src/opam_publish.cmx -o src/opam_publish.native
- + ocamlfind ocamlopt -linkpkg -package github.unix -package cmdliner -package opam-lib.state -package opam-lib.repository -package opam-lib.format -package opam-lib -I src src/version.cmx src/opam_publish.cmx -o src/opam_publish.native
- File "_none_", line 1:
- Error: No implementations provided for the following modules:
-          Cohttp__ referenced from src/opam_publish.cmx
- Command exited with code 2.
- Hint: Recursive traversal of subdirectories was not enabled for this build,
-   as the working directory does not look like an ocamlbuild project (no
-   '_tags' or 'myocamlbuild.ml' file). If you have modules in subdirectories,
-   you should add the option "-r" or create an empty '_tags' file.
-   
-   To enable recursive traversal for some subdirectories only, you can use the
-   following '_tags' file:
-   
-       true: -traverse
-       <dir1> or <dir2>: traverse
-       
- make: *** [_build/src/opam_publish.native] Error 10
[ERROR] The compilation of opam-publish failed at "make".

#=== ERROR while installing opam-publish.0.3.5 ================================#
# opam-version 1.2.2
# os           darwin
# command      make
# path         /Users/ashish/.opam/4.06.0/build/opam-publish.0.3.5
# compiler     4.06.0
# exit-code    2
# env-file     /Users/ashish/.opam/4.06.0/build/opam-publish.0.3.5/opam-publish-77429-1872ec.env
# stdout-file  /Users/ashish/.opam/4.06.0/build/opam-publish.0.3.5/opam-publish-77429-1872ec.out
# stderr-file  /Users/ashish/.opam/4.06.0/build/opam-publish.0.3.5/opam-publish-77429-1872ec.err
### stdout ###
# Hint: Recursive traversal of subdirectories was not enabled for this build,
# [...]
#   '_tags' or 'myocamlbuild.ml' file). If you have modules in subdirectories,
#   you should add the option "-r" or create an empty '_tags' file.
#   
#   To enable recursive traversal for some subdirectories only, you can use the
#   following '_tags' file:
#   
#       true: -traverse
#       <dir1> or <dir2>: traverse
#       
### stderr ###
# make: *** [_build/src/opam_publish.native] Error 10



=-=- Error report -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=  🐫 
The following actions failed
  βˆ—  install opam-publish 0.3.5
No changes have been performed
'opam install -v opam-publish' failed.

Which version of jbuilder do you have? This looks like an issue which was present in beta17.

I was on jbuilder beta18. Upgrading to beta20 fixed the problem. Thanks for the help.

1 Like