Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] `make inconsistent assumptions` error on my ebuild
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
toku
n00b
n00b


Joined: 12 Jan 2019
Posts: 43
Location: Kanagawa, Japan

PostPosted: Wed Jul 31, 2024 12:10 pm    Post subject: [SOLVED] `make inconsistent assumptions` error on my ebuild Reply with quote

Hi. I'm writing an ebuild for OCaml LSP server, and want to push it to the GURU repository, but not going well.

Here is the ebuild (ocaml-lsp-1.18.0.ebuild).

Code:
# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

inherit dune

DESCRIPTION="LSP Server for OCaml"
HOMEPAGE="
   https://opam.ocaml.org/packages/ocaml-lsp-server/
   https://github.com/ocaml/ocaml-lsp/
"
SRC_URI="https://github.com/ocaml/ocaml-lsp/archive/${PV}.tar.gz -> ${P}.tar.gz"

LICENSE="ISC"

SLOT="0/${PV}"

KEYWORDS="~amd64"
IUSE="ocamlopt test"

RESTRICT="!test? ( test )"

RDEPEND="
   >=dev-lang/ocaml-4.14:= <dev-lang/ocaml-5.2:=
   dev-ml/yojson:=
   dev-ml/base:=
   ~dev-ml/lsp-${PV}:=
   ~dev-ml/jsonrpc-${PV}:=
   >=dev-ml/re-1.5.0:=
   >=dev-ml/ppx_yojson_conv_lib-0.14:=
   >=dev-ml/dune-rpc-3.4.0:=
   >=dev-ml/chrome-trace-3.3.0:=
   dev-ml/dyn:=
   dev-ml/stdune:=
   >=dev-ml/fiber-3.1.1:= <dev-ml/fiber-4.0.0
   dev-ml/xdg:=
   dev-ml/ordering:=
   dev-ml/dune-build-info:=
   dev-ml/spawn:=
   dev-ml/astring:=
   dev-ml/camlp-streams:=
   >=dev-ml/ocamlc-loc-3.7.0:=
   >=dev-ml/pp-1.1.2:=
   >=dev-ml/csexp-1.5:=
   >=dev-ml/ocamlformat-rpc-lib-0.21.0:=
   >=dev-ml/merlin-lib-4.16:= <dev-ml/merlin-lib-5.0
"

DEPEND="
   ${RDEPEND}
   >=dev-ml/dune-3.0:=
"

# Includes testing dependencies of `lsp`.
BDEPEND="
   test? (
      >=dev-ml/ppx_expect-0.15:=
      ~dev-ml/ocamlformat-0.26.2:=

      dev-ml/cinaps:=
   )
"

src_compile() {
   dune-compile ocaml-lsp-server
}


Enabling the GURU repository, creating a local ebuild repository by `sudo eselect repository create local`, copying the ebuild at `/var/db/repos/local/dev-util/ocaml-lsp`, and running `sudo ACCEPT_KEYWORDS='~amd64' emerge -1avt dev-util/ocaml-lsp` raises a few errors like this.

Code:
File "ocaml-lsp-server/vendor/lev-fiber-csexp/lev_fiber_csexp.ml", line 1:
Error: The files /usr/lib64/ocaml/csexp/csexp.cmi
       and /usr/lib64/ocaml/stdune/stdune__Sexp.cmi
       make inconsistent assumptions over interface Csexp


I thought this error occurred because the files had been compiled with inconsistent versions of compilers, and thus I tried `emerge -1 @rebuild-ocaml`, `emerge -1 dev-ml/stdune`, `emerge -1 dev-ml/csexp`, `emerge -1 dev-ml/stdune dev-ml/csexp`, etc., but none of them resolved the error.

How can I fix the errors? Thanks!

Full log and `emerge --info`

EDIT: Seems like there are two versions of `Csexp` on my machine.

Code:
❯ fd '.cmi$' /usr/lib64/ocaml/ --exec sh -c 'if [[ -n $(ocamlobjinfo {}|grep Csexp) ]]; then echo {}; fi'|sort|xargs -I {} sh -c 'echo -n {}:; ocamlobjinfo {}|grep Csexp|grep -v unit|grep -v Unit|head -1'|sort -k2|column -t
/usr/lib64/ocaml/dune-configurator/csexp/csexp.cmi:                        bc8f054cfa6a0f14778de9ed6c063580  Csexp
/usr/lib64/ocaml/dune-rpc/dune_rpc.cmi:                                    bc8f054cfa6a0f14778de9ed6c063580  Csexp
/usr/lib64/ocaml/dune-rpc/private/dune_rpc_private.cmi:                    bc8f054cfa6a0f14778de9ed6c063580  Csexp
/usr/lib64/ocaml/dune-rpc/private/dune_rpc_private__Conv.cmi:              bc8f054cfa6a0f14778de9ed6c063580  Csexp
/usr/lib64/ocaml/dune-rpc/private/dune_rpc_private__Diagnostics_v1.cmi:    bc8f054cfa6a0f14778de9ed6c063580  Csexp
/usr/lib64/ocaml/dune-rpc/private/dune_rpc_private__Exported_types.cmi:    bc8f054cfa6a0f14778de9ed6c063580  Csexp
/usr/lib64/ocaml/dune-rpc/private/dune_rpc_private__Menu.cmi:              bc8f054cfa6a0f14778de9ed6c063580  Csexp
/usr/lib64/ocaml/dune-rpc/private/dune_rpc_private__Procedures.cmi:        bc8f054cfa6a0f14778de9ed6c063580  Csexp
/usr/lib64/ocaml/dune-rpc/private/dune_rpc_private__Registry.cmi:          bc8f054cfa6a0f14778de9ed6c063580  Csexp
/usr/lib64/ocaml/dune-rpc/private/dune_rpc_private__Sub.cmi:               bc8f054cfa6a0f14778de9ed6c063580  Csexp
/usr/lib64/ocaml/dune-rpc/private/dune_rpc_private__Types.cmi:             bc8f054cfa6a0f14778de9ed6c063580  Csexp
/usr/lib64/ocaml/dune-rpc/private/dune_rpc_private__Versioned.cmi:         bc8f054cfa6a0f14778de9ed6c063580  Csexp
/usr/lib64/ocaml/dune-rpc/private/dune_rpc_private__Where.cmi:             bc8f054cfa6a0f14778de9ed6c063580  Csexp
/usr/lib64/ocaml/stdune/csexp/csexp.cmi:                                   bc8f054cfa6a0f14778de9ed6c063580  Csexp
/usr/lib64/ocaml/stdune/stdune__Sexp.cmi:                                  bc8f054cfa6a0f14778de9ed6c063580  Csexp
/usr/lib64/ocaml/csexp/csexp.cmi:                                          cc5d229dd1a5a491e4771ccfbb440f9f  Csexp
/usr/lib64/ocaml/merlin-lib/analysis/merlin_analysis__Completion.cmi:      cc5d229dd1a5a491e4771ccfbb440f9f  Csexp
/usr/lib64/ocaml/merlin-lib/analysis/merlin_analysis__Construct.cmi:       cc5d229dd1a5a491e4771ccfbb440f9f  Csexp
/usr/lib64/ocaml/merlin-lib/analysis/merlin_analysis__Destruct.cmi:        cc5d229dd1a5a491e4771ccfbb440f9f  Csexp
/usr/lib64/ocaml/merlin-lib/analysis/merlin_analysis__Jump.cmi:            cc5d229dd1a5a491e4771ccfbb440f9f  Csexp
/usr/lib64/ocaml/merlin-lib/analysis/merlin_analysis__Locate.cmi:          cc5d229dd1a5a491e4771ccfbb440f9f  Csexp
/usr/lib64/ocaml/merlin-lib/analysis/merlin_analysis__Refactor_open.cmi:   cc5d229dd1a5a491e4771ccfbb440f9f  Csexp
/usr/lib64/ocaml/merlin-lib/analysis/merlin_analysis__Type_enclosing.cmi:  cc5d229dd1a5a491e4771ccfbb440f9f  Csexp
/usr/lib64/ocaml/merlin-lib/analysis/merlin_analysis__Type_utils.cmi:      cc5d229dd1a5a491e4771ccfbb440f9f  Csexp
/usr/lib64/ocaml/merlin-lib/commands/merlin_commands__New_commands.cmi:    cc5d229dd1a5a491e4771ccfbb440f9f  Csexp
/usr/lib64/ocaml/merlin-lib/dot_protocol/merlin_dot_protocol.cmi:          cc5d229dd1a5a491e4771ccfbb440f9f  Csexp
/usr/lib64/ocaml/merlin-lib/kernel/merlin_kernel__Mconfig.cmi:             cc5d229dd1a5a491e4771ccfbb440f9f  Csexp
/usr/lib64/ocaml/merlin-lib/kernel/merlin_kernel__Mconfig_dot.cmi:         cc5d229dd1a5a491e4771ccfbb440f9f  Csexp
/usr/lib64/ocaml/merlin-lib/kernel/merlin_kernel__Mocaml.cmi:              cc5d229dd1a5a491e4771ccfbb440f9f  Csexp
/usr/lib64/ocaml/merlin-lib/kernel/merlin_kernel__Mpipeline.cmi:           cc5d229dd1a5a491e4771ccfbb440f9f  Csexp
/usr/lib64/ocaml/merlin-lib/kernel/merlin_kernel__Mppx.cmi:                cc5d229dd1a5a491e4771ccfbb440f9f  Csexp
/usr/lib64/ocaml/merlin-lib/kernel/merlin_kernel__Mreader.cmi:             cc5d229dd1a5a491e4771ccfbb440f9f  Csexp
/usr/lib64/ocaml/merlin-lib/kernel/merlin_kernel__Mreader_extend.cmi:      cc5d229dd1a5a491e4771ccfbb440f9f  Csexp
/usr/lib64/ocaml/merlin-lib/kernel/merlin_kernel__Mreader_lexer.cmi:       cc5d229dd1a5a491e4771ccfbb440f9f  Csexp
/usr/lib64/ocaml/merlin-lib/kernel/merlin_kernel__Mreader_parser.cmi:      cc5d229dd1a5a491e4771ccfbb440f9f  Csexp
/usr/lib64/ocaml/merlin-lib/kernel/merlin_kernel__Mtyper.cmi:              cc5d229dd1a5a491e4771ccfbb440f9f  Csexp
/usr/lib64/ocaml/merlin-lib/kernel/merlin_kernel__Pparse.cmi:              cc5d229dd1a5a491e4771ccfbb440f9f  Csexp
/usr/lib64/ocaml/merlin-lib/query_commands/query_commands.cmi:             cc5d229dd1a5a491e4771ccfbb440f9f  Csexp
/usr/lib64/ocaml/ocamlformat-rpc-lib/ocamlformat_rpc_lib.cmi:              cc5d229dd1a5a491e4771ccfbb440f9f  Csexp
/usr/lib64/ocaml/ocamlformat-rpc-lib/ocamlformat_rpc_lib__IO.cmi:          cc5d229dd1a5a491e4771ccfbb440f9f  Csexp
/usr/lib64/ocaml/ocamlformat-rpc-lib/ocamlformat_rpc_lib__Protocol.cmi:    cc5d229dd1a5a491e4771ccfbb440f9f  Csexp


Last edited by toku on Sat Sep 28, 2024 3:13 am; edited 1 time in total
Back to top
View user's profile Send private message
toku
n00b
n00b


Joined: 12 Jan 2019
Posts: 43
Location: Kanagawa, Japan

PostPosted: Sat Sep 28, 2024 3:13 am    Post subject: Reply with quote

Finally, I found out what was going on. There were two `csexp`s: one from `dev-ml/csexp` and the other vendored by Dune. In the `.opam` file of dune's libraries, there were lines to remove the vendored `csexp` and `pp` before the actual build (source). However, Gentoo's ebuilds for `dev-ml/dune-private-libs`, etc. only used Dune and did not remove them. I believe this is a bug, and I will send a PR to fix it.

EDIT: I created a bug report before the PR
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum