From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by sympa.inria.fr (Postfix) with ESMTPS id 2166C7EE89 for ; Fri, 28 Oct 2016 15:06:16 +0200 (CEST) Authentication-Results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=ivg@ieee.org; spf=Pass smtp.mailfrom=ivg@ieee.org; spf=None smtp.helo=postmaster@mail-lf0-f49.google.com Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of ivg@ieee.org) identity=pra; client-ip=209.85.215.49; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="ivg@ieee.org"; x-sender="ivg@ieee.org"; x-conformance=sidf_compatible Received-SPF: Pass (mail3-smtp-sop.national.inria.fr: domain of ivg@ieee.org designates 209.85.215.49 as permitted sender) identity=mailfrom; client-ip=209.85.215.49; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="ivg@ieee.org"; x-sender="ivg@ieee.org"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of postmaster@mail-lf0-f49.google.com) identity=helo; client-ip=209.85.215.49; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="ivg@ieee.org"; x-sender="postmaster@mail-lf0-f49.google.com"; x-conformance=sidf_compatible IronPort-PHdr: =?us-ascii?q?9a23=3AYTpSIROgZ36xLAaZV4gl6mtUPXoX/o7sNwtQ0KIM?= =?us-ascii?q?zox0KPv+rarrMEGX3/hxlliBBdydsKMezbWN+P2+EUU7or+5+EgYd5JNUxJXwe?= =?us-ascii?q?43pCcHRPC/NEvgMfTxZDY7FskRHHVs/nW8LFQHUJ2mPw6anHS+4HYoFwnlMkIt?= =?us-ascii?q?f6KuS9SU0J/8ir760qaQSj0AvCC6b7J2IUf+hiTqne5Sv7FfLL0swADCuHpCdr?= =?us-ascii?q?ce72ppIVWOg0S0vZ/or9ZLuh5dsPM59sNGTb6yP+FhFeQZX3waNDUX48viqRnK?= =?us-ascii?q?S0Oj518bSGgQgB0AVwTE6BbgU5HjtQPxrax23zOcMMnyC704RGLxwb1sTUrJli?= =?us-ascii?q?4BfxE+7GbJgcxxkLkT9BO/qDR+zoPZJoaPO6wtLevmYdoGSD8ZDY5qXCtbD9b5?= =?us-ascii?q?NtNXAg=3D=3D?= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A0B/AAD4SxNYfzHXVdFcDgwBAQEBAgEBA?= =?us-ascii?q?QEIAQEBARUBAQEBAgEBAQEIAQEBAYJ/AQEBAQF3fQeNL5Z/gleRaIIHKIV7AoF?= =?us-ascii?q?6Bz8UAQEBAQEBAQEBAQESAQEJCwsJGzKCMwQBFQEEghABAQEDARIRBBkBATcBB?= =?us-ascii?q?AsJAgsNIAoCAiISAQUBHAYTGweIKggOk2CPTYEyPzKKX2eESQEBBYghAQEBAQY?= =?us-ascii?q?BAQEBAQEBGAgQhi2DUIEFhHSCV4JbAY5QhW6FXoYtgwiGcoFuToQfiSmND4I/E?= =?us-ascii?q?x6BER6BFYMMDxyBGFciNAGGKIFKAQEB?= X-IPAS-Result: =?us-ascii?q?A0B/AAD4SxNYfzHXVdFcDgwBAQEBAgEBAQEIAQEBARUBAQE?= =?us-ascii?q?BAgEBAQEIAQEBAYJ/AQEBAQF3fQeNL5Z/gleRaIIHKIV7AoF6Bz8UAQEBAQEBA?= =?us-ascii?q?QEBAQESAQEJCwsJGzKCMwQBFQEEghABAQEDARIRBBkBATcBBAsJAgsNIAoCAiI?= =?us-ascii?q?SAQUBHAYTGweIKggOk2CPTYEyPzKKX2eESQEBBYghAQEBAQYBAQEBAQEBGAgQh?= =?us-ascii?q?i2DUIEFhHSCV4JbAY5QhW6FXoYtgwiGcoFuToQfiSmND4I/Ex6BER6BFYMMDxy?= =?us-ascii?q?BGFciNAGGKIFKAQEB?= X-IronPort-AV: E=Sophos;i="5.31,410,1473112800"; d="scan'208,217";a="198512263" Received: from mail-lf0-f49.google.com ([209.85.215.49]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/AES128-GCM-SHA256; 28 Oct 2016 15:06:13 +0200 Received: by mail-lf0-f49.google.com with SMTP id f134so51393483lfg.2 for ; Fri, 28 Oct 2016 06:06:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ieee-org.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=hyUu1Gp27GxdUkh7NTZs3Y08Ft0msGw3nAFx745DWjE=; b=vYlSjtFhDtsDv7w0wd7Rvsb/5MPZAbgO3QYfVcoO5DqDw9O9+5Y2UC4tmSawaoujOv /b+o3bdPj5wuv/GtYfAohJ/0B9YG+Pt0LE1DMpw9PCFBLBIQmwqaw3G7sLnPWZBwRBId gPaDdYiShC8OT2pQDTRvHevzG+D8YVuHpVzfNuB4+XU01Pm6hGd94h5IWQ2Q7MuVCM1x HM/dwgvOQY/MoSQUZ1AB4fCsF3VyXVdZYDV6y1+PDqORXlMeu+e071+p4rtY0/xW06WX Qz77yzwRetjWfkv1T+cCd+kAFwu7nOl7HhuSTT6iN0ppQvF73K7bK3gmStk5TmkDBLhx mzyw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=hyUu1Gp27GxdUkh7NTZs3Y08Ft0msGw3nAFx745DWjE=; b=kle7g1igBn5R0yeLbkEe1Zbq3bpqudMvj9ORCaSCijMxEOWhBWakkAVUZZCfYZsfLD azQuSK1Jnr/5LskNzgFoCSFECLakn8o8bofsLPzIHDLIro/5e3k4P/Q0s9vQcwfPmlGw ONlXPv5lQzJ44EdMZ6I6upAsY7VT1VYzOFrs0wE/2Ukeyn3EslgyEv+1OAguWWR2kmg7 9UrL9OiPpy6a4x03uOE8y41UNeZGcWOJ6r5woyxW8AathzV1W6LOGyt80gQX9iYBcA+d SqVyKuzGM39GkNXBhibwt2g+G96kSiKfvstSCj3l0NvfrYLa4UemktiSu04for3HsKrI /tvw== X-Gm-Message-State: ABUngvevkUi8MPAb7VQ2MwJOPMo4Rg/CxNu+TN5K4UYI28bothxqqefDw6bFinUkwkK8AKHs9VdmP7eNrJLyOqou X-Received: by 10.25.135.130 with SMTP id j124mr9528972lfd.44.1477659971723; Fri, 28 Oct 2016 06:06:11 -0700 (PDT) MIME-Version: 1.0 Received: by 10.114.28.34 with HTTP; Fri, 28 Oct 2016 06:06:10 -0700 (PDT) In-Reply-To: References: From: Ivan Gotovchits Date: Fri, 28 Oct 2016 09:06:10 -0400 Message-ID: To: Jonathan DiLorenzo Cc: caml-list Content-Type: multipart/alternative; boundary=001a113fbc44b6c997053fec8534 Subject: Re: [Caml-list] Providing module implementations for Oasis --001a113fbc44b6c997053fec8534 Content-Type: text/plain; charset=UTF-8 The problem is that executable `ppx_forest` and library `forest_ppx` both refer to the same compilation unit `ppx_forest`. So the solution is easy, just remove the `Ppx_forest` module from the library (indeed, it is not part of the library, it is the executable implementation). Here is the PR with the fix: https://github.com/padsproj/oforest/pull/9. # Details Just in case if you're interested why the resulting error was so confusing :) The error message came from the following compilation command: ocamlfind ocamlopt -linkpkg -g -linkpkg -thread -package threads -package str -package re.str -package re.glob -package re -package ppx_tools.metaquot -package ppx_let -package ppx_deriving.show -package pads.ppx -package pads -package core -package compiler-libs.common ppx/forest_ppx.cmxa parsing/forest_parser.cmxa lib/forest.cmxa ppx/ppx_forest.cmx -o ppx/ppx_forest.native It is obvious that the command is incorrect (pun intended). Let's, actually, remove all the packages so that we can see the libraries: ocamlfind ocamlopt -linkpkg ppx/forest_ppx.cmxa parsing/forest_parser.cmxa lib/forest.cmxa ppx/ppx_forest.cmx -o ppx/ppx_forest.native In fact, the problem is in library ordering. Modules and libraries must be sorted in topological order, so the first should be `lib/forest.cmxa`, then `parsing/forest_parser.cmxa` and finally `forest_ppx.cmxa`. And, yes, this is how this command looks after the fix: ocamlfind ocamlopt -linkpkg lib/forest.cmxa parsing/forest_parser.cmxa ppx/forest_ppx.cmxa ppx/ppx_forest.cmx -o ppx/ppx_forest.native So how the toposort can be broken? My assumption, that this was because you introduced a loop into a dependency graph, when you added ppx_forest to both: the library and the executable. If my assumption is true, then probably we should add to ocamlbuild toposort routine an easy check that will detect loops and output a proper diagnostic message if a dependency graph contains cycles. Regards, Ivan Gotovchits On Fri, Oct 28, 2016 at 2:14 AM, Jonathan DiLorenzo < dilorenzo@cs.cornell.edu> wrote: > Hmm, sadly this seems to still produce the same error after cleaning up > all the oasis generated files and everything: > > File "_none_", line 1: > Error: No implementations provided for the following modules: > Forest_parser_helper referenced from ppx/forest_ppx.cmxa(Skins) > Command exited with code 2. > > Maybe notable (or maybe obvious) that if I switch oasis to use ocamlc > instead of ocamlopt, I instead get: > > File "_none_", line 1: > Error: Error while linking ppx/forest_ppx.cma(Skins): > Reference to undefined global `Forest_parser_helper' > Command exited with code 2. > > New _oasis file (not with best -> byte change): > > Library forest_parser > Path: parsing > BuildTools: ocamlbuild, menhir, ocamllex > Findlibparent: forest > Findlibname: forest_parser > BuildDepends: forest, ppx_deriving.show, compiler-libs.common > CompiledObject: best > Modules: Forest_parser_helper, Forest_types > InternalModules: Forest_lexer, Forest_parser > > Library forest_ppx > Path: ppx > BuildTools: ocamlbuild > Findlibparent: forest > Findlibname: forest_ppx > BuildDepends: re, re.str, forest.forest_parser, forest, > ppx_tools.metaquot > CompiledObject: best > Modules: Ppx_forest > InternalModules: Ppx_forest_lib, Utility, Skins > XMETAEnable: true > XMETADescription: Syntax extension library for OCaml Forest > XMETARequires: str re core threads ppx_tools.metaquot > XMETAExtraLines: ppx = "ppx_forest" > > Executable ppx_forest > Path: ppx > MainIs: ppx_forest.ml > BuildDepends: forest, forest.forest_parser, forest.forest_ppx, > pads.ppx, ppx_tools.metaquot > CompiledObject: best > > > On Thu, Oct 27, 2016 at 2:24 PM, Ivan Gotovchits wrote: > >> The problem is in a name clashing between `$opam-switch/lib/ocaml/compiler-libs/parser` >> and the `parser` library that is compiled from your internal library named >> `parser.cmxa`. >> The compiler-lib is added to the search path by the `ppx_tools` library, >> and when you're trying to link your final executable, it takes the wrong >> archive, that definitely doesn't have >> `Forest_parser_helper` module. >> >> The reason, why it is still able to see that there is no `bad_func` in >> `Forest_parser_helper` is because the interfaces are not contained in the >> `cmxa` file, but are looked up directly in >> the `cmi`. Compiler is looking for a file named >> `forest_parser_helper.cmi` and can see that there are not `bad_func` there. >> >> The solution is to rename your library, e.g., use `Library forest_parser` >> instead of `Library parser` >> >> On Thu, Oct 27, 2016 at 1:44 PM, Jonathan DiLorenzo < >> dilorenzo@cs.cornell.edu> wrote: >> >>> Hey, >>> >>> Ok, now the next step would be the following. Carefully check that all >>>> modules, that you're using in libraries are included in `Modules` or >>>> `InternalModules`. It is the case >>>> that sometimes when you forgot to include a module, oasis (actually >>>> `ocamlbuild`), may produce a strange, and on a first glance, irrelevant >>>> error message. >>>> >>> >>> I checked and sadly the modules I'm trying to access are all in >>> `Modules`. Perhaps interestingly, it can still clearly detect statically if >>> the function exists or not because if I try to use a function that doesn't >>> exist it instead gives me this error (which is what I would normally >>> expect): >>> >>> File "ppx/skins.ml", line 39, characters 8-37: >>> Error: Unbound value Forest_parser_helper.bad_func >>> Command exited with code 2. >>> >>> >>>> If it doesn't help then the `_build/_log` file might help us to debug >>>> the issue. >>>> >>> >>> Attached. Thanks so much for helping with this again. I'm at a total >>> loss. >>> >>> >>>> >>>> On Thu, Oct 27, 2016 at 10:59 AM, Jonathan DiLorenzo < >>>> dilorenzo@cs.cornell.edu> wrote: >>>> >>>>> Hey Ivan, >>>>> >>>>> Thanks for your response. >>>>> >>>>> The first one is that you didn't run `oasis setup` after you made the >>>>>> changes, so I would suggest cleaning current state >>>>>> and starting from scratch. (I usually just do `git clean -idx` just >>>>>> to be sure that I got rid of any generated files, like setup.data, et alas, >>>>>> but be careful, >>>>>> don't delete something that you need). >>>>>> >>>>> >>>>> I tried cleaning up all the generated files. Same error unfortunately >>>>> >>>>> >>>>>> Another idea is that you're using oasis 0.4.7 with >>>>>> ocaml-4.03.0+flambda, they are currently incompatible, and can produce >>>>>> weird bugs. If that so, then consider switching >>>>>> either a compiler or oasis to different versions. >>>>>> >>>>> >>>>> I am using oasis 0.4.7 and ocaml-4.03.0, but I don't appear to be >>>>> using flambda. I tried passing in -config and it said that flambda was >>>>> false at least, but I admit, I'm not especially familiar with it, so if >>>>> there's some other way I should be checking for this please let me know. >>>>> Hopefully, they're compatible sans flambda? >>>>> >>>>> >>>>> On Thu, Oct 27, 2016 at 1:01 AM, Jonathan DiLorenzo < >>>>>> dilorenzo@cs.cornell.edu> wrote: >>>>>> >>>>>>> Hey all, >>>>>>> >>>>>>> I'm trying to build my system using Oasis and OCamlbuild. I have 3 >>>>>>> different libraries and for some reason I seem to only be able to refer >>>>>>> from one to the other in seemingly random files. For example, I want my >>>>>>> 'ppx' library to be able to use functions from my 'parser' library. One >>>>>>> file (ppx_forest.ml) can use functions from it, while another in >>>>>>> the same library (skins.ml) cannot, giving me this error: >>>>>>> >>>>>>> File "_none_", line 1: >>>>>>> Error: No implementations provided for the following modules: >>>>>>> Forest_parser_helper referenced from ppx/ppx.cmxa(Skins) >>>>>>> Command exited with code 2. >>>>>>> >>>>>>> They can all refer to types I've defined therein though. >>>>>>> >>>>>>> I'm not fantastic at Oasis so maybe I'm just missing something >>>>>>> basic? Any ideas? Any more information I can gather to give more context >>>>>>> otherwise? >>>>>>> >>>>>>> Thanks in advance, >>>>>>> Jonathan >>>>>>> >>>>>>> Excerpt of my Oasis file that may possibly be relevant: >>>>>>> >>>>>>> Library forest >>>>>>> Path: lib >>>>>>> BuildTools: ocamlbuild >>>>>>> BuildDepends: pads, str, re, re.glob, core, threads, ppx_let >>>>>>> CompiledObject: best >>>>>>> Modules: Forest, PadsInterface >>>>>>> >>>>>>> Library parser >>>>>>> Path: parsing >>>>>>> BuildTools: ocamlbuild, menhir, ocamllex >>>>>>> Findlibparent: forest >>>>>>> Findlibname: parser >>>>>>> BuildDepends: forest, ppx_deriving.show, compiler-libs.common >>>>>>> CompiledObject: best >>>>>>> Modules: Forest_parser_helper >>>>>>> InternalModules: Forest_lexer, Forest_parser, Forest_types >>>>>>> >>>>>>> Library ppx >>>>>>> Path: ppx >>>>>>> BuildTools: ocamlbuild >>>>>>> Findlibparent: forest >>>>>>> Findlibname: ppx >>>>>>> BuildDepends: re, re.str, forest.parser, forest, >>>>>>> ppx_tools.metaquot >>>>>>> CompiledObject: best >>>>>>> Modules: Ppx_forest >>>>>>> InternalModules: Ppx_forest_lib, Utility, Skins >>>>>>> XMETAEnable: true >>>>>>> XMETARequires: str re core threads ppx_tools.metaquot >>>>>>> XMETAExtraLines: ppx = "ppx_forest" >>>>>>> >>>>>>> Executable ppx_forest >>>>>>> Path: ppx >>>>>>> MainIs: ppx_forest.ml >>>>>>> BuildDepends: forest, forest.parser, forest.ppx, pads.ppx, >>>>>>> ppx_tools.metaquot >>>>>>> CompiledObject: best >>>>>>> >>>>>>> >>>>>> >>>>> >>>> >>> >> > --001a113fbc44b6c997053fec8534 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
The problem is that executable `ppx_forest` and library `f= orest_ppx` both refer to the same compilation
unit `ppx_forest`.=C2=A0 = So the solution is easy, just remove the `Ppx_forest` module from the libra= ry (indeed, it is not part of the library, it is the executable implementat= ion).
Here is the PR with the fix: https://github.com/padsproj/oforest/pull/9.

# Details

Just in case if y= ou're interested why the resulting error was so confusing :)
=
The error message came from the following compilation comman= d:

=C2=A0 =C2=A0 ocamlfind ocamlopt -linkpkg -g -l= inkpkg -thread -package threads -package str -package re.str -package re.gl= ob -package re -package ppx_tools.metaquot -package ppx_let -package ppx_de= riving.show -package pads.ppx -package pads -package core -package compiler= -libs.common ppx/forest_ppx.cmxa parsing/forest_parser.cmxa lib/forest.cmxa= ppx/ppx_forest.cmx -o ppx/ppx_forest.native

<= br>
It is obvious that the command is incorrect (pun intended). L= et's, actually, remove all the packages so that we can see the librarie= s:

=C2=A0 =C2=A0 ocamlfind ocamlopt -linkpkg = ppx/forest_ppx.cmxa parsing/forest_parser.cmxa lib/forest.cmxa ppx/ppx_fore= st.cmx -o ppx/ppx_forest.native

In fact= , the problem is in library ordering. Modules and libraries must be sorted = in topological order, so the first should be `lib/forest.cmxa`, then `parsi= ng/forest_parser.cmxa` and finally `forest_ppx.cmxa`.=C2=A0
And, yes, this is how this command looks after the fix:

=C2=A0 =C2=A0 ocamlfind ocamlopt -linkpkg lib/forest.cmxa parsing/fo= rest_parser.cmxa ppx/forest_ppx.cmxa ppx/ppx_forest.cmx -o ppx/ppx_forest.n= ative

So how the toposort=C2=A0can be broken? = My assumption, that this was because you introduced a loop into a dependenc= y graph, when you added ppx_forest to both: the library and the executable.= =C2=A0
If my assumption is true, then probably we should add to o= camlbuild toposort routine an easy check that will detect loops and output = =C2=A0a proper diagnostic message if a dependency graph contains cycles.

Regards,
Ivan Gotovchits


On Fri, = Oct 28, 2016 at 2:14 AM, Jonathan DiLorenzo <dilorenzo@cs.cornell= .edu> wrote:
Hmm, sadly this seems to still produce the same error after cleaning up = all the oasis generated files and everything:

File "_none_", line 1:
Error: No implementa= tions provided for the following modules:
=C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0Forest_parser_helper referenced from ppx/forest_ppx.cmx= a(Skins)
Command exited with code 2.
<= br>
Maybe notable (or maybe obvious) that if I switch oasi= s to use ocamlc instead of ocamlopt, I instead get:

File "_none_", line 1:
E= rror: Error while linking ppx/forest_ppx.cma(Skins):
Reference to= undefined global `Forest_parser_helper'
Com= mand exited with code 2.

New _oasis f= ile (not with best -> byte change):

Librar= y forest_parser
=C2=A0 Path: =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 parsing
=C2=A0 BuildTools: =C2=A0 =C2=A0 ocamlb= uild, menhir, ocamllex
=C2=A0 Findlibparent: =C2=A0forest
=C2=A0 Findlibname: =C2=A0 =C2=A0forest_parser
=C2=A0 BuildDepends: =C2=A0 forest, ppx_deriving.show, compiler-= libs.common=C2=A0
=C2=A0 CompiledObject: best
= =C2=A0 Modules: =C2=A0Forest_parser_helper, Forest_t= ypes
=C2=A0 InternalModules: Forest_lexer, Forest_parser

Library forest_ppx
=C2=A0 Path:= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ppx
=C2=A0 BuildTools: =C2=A0= =C2=A0 ocamlbuild
=C2=A0 Findlibparent: =C2=A0forest
=C2=A0 Findlibname: =C2=A0 =C2=A0forest_ppx
=C2=A0 BuildDep= ends: =C2=A0 re, re.str, forest.forest_parser, forest, ppx_tools.metaquot
=C2=A0 CompiledObject: best
=C2=A0 Modu= les: =C2=A0 =C2=A0 =C2=A0 =C2=A0Ppx_forest
=C2=A0 InternalModules= : Ppx_forest_lib, Utility, Skins
=C2=A0 XMETAEnable: =C2=A0 =C2= =A0true
=C2=A0 XMETADescription: Syntax extension library = for OCaml Forest
=C2=A0 XMETARequires: =C2=A0 st= r re core threads ppx_tools.metaquot
=C2=A0 XMETAExtraLines: =C2= =A0ppx =3D "ppx_forest"

Executable ppx_f= orest
=C2=A0 Path: =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ppx
=C2=A0 MainIs: =C2=A0 =C2=A0 =C2=A0 =C2=A0 ppx_forest.ml
=C2=A0 BuildDepend= s: =C2=A0 forest, forest.forest_parser, forest.forest_ppx, pads.ppx, ppx_to= ols.metaquot
=C2=A0 CompiledObject: best


On Thu, Oct 27, 2016 at 2:24 PM, Ivan = Gotovchits <ivg@ieee.org> wrote:
The problem is =C2=A0in a name clashing between `$opam-s= witch/lib/ocaml/compiler-libs/parser` and the `parser` library that is= compiled from your internal library named `parser.cmxa`.
The compiler-= lib is added to the search path by the `ppx_tools` library, and when you= 9;re trying to link your final executable, it takes the wrong archive, that= definitely doesn't have=C2=A0
`Forest_parser_helper` module.=

The reason, why it is still able to see that ther= e is no `bad_func` in `Forest_parser_helper` is because the interfaces are = not contained in the `cmxa` file, but are looked up directly in=C2=A0
=
the `cmi`. Compiler is looking for a file named `forest_parser_helper.= cmi` and can see that there are not `bad_func` there.=C2=A0

<= /div>
The solution is to rename your library, e.g., use `Library forest= _parser` instead of `Library parser`

On Thu, Oct 27, 2016 at 1:44 PM, Jo= nathan DiLorenzo <dilorenzo@cs.cornell.edu> wrote:
Hey,

=
Ok, now = the next step would be the following. Carefully check that all modules, tha= t you're using in libraries are included in `Modules` or `InternalModul= es`. It is the case
that sometimes=C2=A0when you forgot to include a mo= dule, oasis (actually `ocamlbuild`), may produce a strange, and on a first = glance, irrelevant error message.=C2=A0

I checked and sadly the modules I'm trying to access ar= e all in `Modules`. Perhaps interestingly, it can still clearly detect stat= ically if the function exists or not because if I try to use a function tha= t doesn't exist it instead gives me this error (which is what I would n= ormally expect):

File "ppx/skins.ml", line 39, characters 8-= 37:
Error: Unbound value Forest_parser_helper.bad_func
Command exited with code 2.
=C2=A0
If it= doesn't help then the `_build/_log` file might help us to debug the is= sue.=C2=A0

Attached. Thanks= so much for helping with this again. I'm at a total loss.
=C2=A0

On Thu, Oct 27, 2016 at 10:59 AM, Jonathan DiLorenzo <= span dir=3D"ltr"><dilorenzo@cs.cornell.edu> wrote:
Hey Ivan,

<= div>Thanks for your response.

The first one is that you didn't run `= oasis setup` after you made the changes, so I would suggest cleaning curren= t state
and starting from scratch. (I usually just do `git cl= ean -idx` just to be sure that I got rid of any generated files, like setup= .data, et alas, but be careful,=C2=A0
don't delete something = that you need).=C2=A0

I = tried cleaning up all the generated files. Same error unfortunately
=C2=A0
Another idea=C2=A0is that you're using oasis 0.4.7 wi= th ocaml-4.03.0+flambda, they are currently incompatible, and can produce w= eird bugs. If that so, then consider switching=C2=A0
either a= compiler or oasis to different versions.=C2=A0

I am using oasis 0.4.7 and ocaml-4.03.0, but I don&= #39;t appear to be using flambda. I tried passing in -config and it said th= at flambda was false at least, but I admit, I'm not especially familiar= with it, so if there's some other way I should be checking for this pl= ease let me know. Hopefully, they're compatible sans flambda?


On Thu, Oct 27, 2= 016 at 1:01 AM, Jonathan DiLorenzo <dilorenzo@cs.cornell.edu>= ; wrote:
Hey all,

I'm trying to build my system us= ing Oasis and OCamlbuild. I have 3 different libraries and for some reason = I seem to only be able to refer from one to the other in seemingly random f= iles. For example, I want my 'ppx' library to be able to use functi= ons from my 'parser' library. One file (ppx_forest.ml) can use functions from it, while= another in the same library (skins.ml) cannot, giving me this error:

= File "_none_", line 1:
Error: No implementations provid= ed for the following modules:
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0F= orest_parser_helper referenced from ppx/ppx.cmxa(Skins)
Command e= xited with code 2.

They can all refer to typ= es I've defined therein though.

I'm not fa= ntastic at Oasis so maybe I'm just missing something basic? Any ideas? = Any more information I can gather to give more context otherwise?

Thanks in advance,
Jonathan

<= div>Excerpt of my Oasis file that may possibly be relevant:
=
Library forest=C2=A0
=C2=A0 Path: =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0lib
=C2=A0 BuildTools: =C2=A0 =C2=A0ocamlbuil= d
=C2=A0 BuildDepends: =C2=A0 pads, str, re, re.glob, core, threa= ds, ppx_let
=C2=A0 CompiledObject: best
=C2=A0 Modules:= =C2=A0 =C2=A0 =C2=A0 Forest, PadsInterface

Librar= y parser
=C2=A0 Path: =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 parsing<= /div>
=C2=A0 BuildTools: =C2=A0 =C2=A0 ocamlbuild, menhir, ocamllex
=C2=A0 Findlibparent: =C2=A0forest
=C2=A0 Findlibname: =C2= =A0 =C2=A0parser
=C2=A0 BuildDepends: =C2=A0 forest, ppx_deriving= .show, compiler-libs.common=C2=A0
=C2=A0 CompiledObject: best
=C2=A0 Modules: =C2=A0Forest_parser_helper
=C2=A0 Int= ernalModules: Forest_lexer, Forest_parser, Forest_types

Library ppx
=C2=A0 Path: =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= ppx
=C2=A0 BuildTools: =C2=A0 =C2=A0 ocamlbuild
=C2=A0= Findlibparent: =C2=A0forest
=C2=A0 Findlibname: =C2=A0 =C2=A0ppx=
=C2=A0 BuildDepends: =C2=A0 re, re.str, forest.parser, forest, p= px_tools.metaquot
=C2=A0 CompiledObject: best
=C2=A0 Mo= dules: =C2=A0 =C2=A0 =C2=A0 =C2=A0Ppx_forest
=C2=A0 InternalModul= es: Ppx_forest_lib, Utility, Skins
=C2=A0 XMETAEnable: =C2=A0 =C2= =A0true
=C2=A0 XMETARequires: =C2=A0 str re core threads ppx_tool= s.metaquot
=C2=A0 XMETAExtraLines: =C2=A0ppx =3D "ppx_forest= "

Executable ppx_forest
=C2=A0 Path= : =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ppx
=C2=A0 MainIs: =C2=A0 = =C2=A0 =C2=A0 =C2=A0 ppx= _forest.ml
=C2=A0 BuildDepends: =C2=A0 forest, forest.parser,= forest.ppx, pads.ppx, ppx_tools.metaquot
=C2=A0 CompiledObject: = best








--001a113fbc44b6c997053fec8534--