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 8F2FC7EE89 for ; Fri, 28 Oct 2016 16:28:06 +0200 (CEST) Authentication-Results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=jonathan.dilorenzo@gmail.com; spf=Pass smtp.mailfrom=jonathan.dilorenzo@gmail.com; spf=None smtp.helo=postmaster@mail-oi0-f54.google.com Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of jonathan.dilorenzo@gmail.com) identity=pra; client-ip=209.85.218.54; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="jonathan.dilorenzo@gmail.com"; x-sender="jonathan.dilorenzo@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail3-smtp-sop.national.inria.fr: domain of jonathan.dilorenzo@gmail.com designates 209.85.218.54 as permitted sender) identity=mailfrom; client-ip=209.85.218.54; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="jonathan.dilorenzo@gmail.com"; x-sender="jonathan.dilorenzo@gmail.com"; 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-oi0-f54.google.com) identity=helo; client-ip=209.85.218.54; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="jonathan.dilorenzo@gmail.com"; x-sender="postmaster@mail-oi0-f54.google.com"; x-conformance=sidf_compatible IronPort-PHdr: =?us-ascii?q?9a23=3AA1Zzih1A9bsueI0jsmDT+DRfVm0co7zxezQtwd8Z?= =?us-ascii?q?segRL/ad9pjvdHbS+e9qxAeQG96KsbQb0KGL7ejJYi8p2d65qncMcZhBBVcuqP?= =?us-ascii?q?49uEgeOvODElDxN/XwbiY3T4xoXV5h+GynYwAOQJ6tL2PbrnD61zMOABK3bVMz?= =?us-ascii?q?fbWvXNGJxJnpn8mJuLTrKz1SgzS8Zb4gZD6Xli728vcsvI15N6wqwQHIqHYbM8?= =?us-ascii?q?5fxGdvOE7B102kvpT41NdZ/i9Ro/Ms8dJbGeW/JvxgDO8QMDNzEn484oXEsgXE?= =?us-ascii?q?UwCP52cHGjEXjBVgAgXI4Vf9RJin4QXgse8o+i6cNNH2RLZ8dTWG6L1mTg3vwH?= =?us-ascii?q?MLNjo+6mzRmMtYh7kdqxW7oRF7x8jZbJzDZ6k2Rb/UYd5PHTkJZc1WTSEUR9rk?= =?us-ascii?q?N4Y=3D?= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A0B9AAAHYBNYhjbaVdFbGgEBAQECAQEBA?= =?us-ascii?q?QgBAQEBFQEBAQECAQEBAQgBAQEBgn8BAQEBAXd9B40vln+CMiWRaIIIJ4V7gXQ?= =?us-ascii?q?HPxQBAQEBAQEBAQEBARIBAQEICwsJHTCCMwQBFQEEghABAQEDARIRBBkBOAEDA?= =?us-ascii?q?QsBBQMCCwMKIAoCAiISAQUBHAYTGweIGAMPCA6TfY9NgTI/MotGhEoFhAEnDUQ?= =?us-ascii?q?GgyUBAQEHAQEBAQEBGQIGEIl9gQWEdIJXglsBBI5MhW6FXoYtgwiGcoFuToQfi?= =?us-ascii?q?SmND4I/Ex6BER6CV4EeLA8cgW8iNIYpgUoBAQE?= X-IPAS-Result: =?us-ascii?q?A0B9AAAHYBNYhjbaVdFbGgEBAQECAQEBAQgBAQEBFQEBAQE?= =?us-ascii?q?CAQEBAQgBAQEBgn8BAQEBAXd9B40vln+CMiWRaIIIJ4V7gXQHPxQBAQEBAQEBA?= =?us-ascii?q?QEBARIBAQEICwsJHTCCMwQBFQEEghABAQEDARIRBBkBOAEDAQsBBQMCCwMKIAo?= =?us-ascii?q?CAiISAQUBHAYTGweIGAMPCA6TfY9NgTI/MotGhEoFhAEnDUQGgyUBAQEHAQEBA?= =?us-ascii?q?QEBGQIGEIl9gQWEdIJXglsBBI5MhW6FXoYtgwiGcoFuToQfiSmND4I/Ex6BER6?= =?us-ascii?q?CV4EeLA8cgW8iNIYpgUoBAQE?= X-IronPort-AV: E=Sophos;i="5.31,410,1473112800"; d="scan'208,217";a="198522719" Received: from mail-oi0-f54.google.com ([209.85.218.54]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/AES128-GCM-SHA256; 28 Oct 2016 16:28:04 +0200 Received: by mail-oi0-f54.google.com with SMTP id n202so116690790oig.3 for ; Fri, 28 Oct 2016 07:28:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=fPoTl/EfY5Nx27fRaG7hTRPr5jzvTFa/yAfFjsrIUMw=; b=oIiK0Jddkm6hNlLTb1DduiFf1K9ztAChy0Z8l/YWxteRwvY9bQwpN/srxwW1Bx61Zz Wm6nU8ZGsw+QYm4W6KOyqlwuAq3+f86bGLnF26pBPILBtG11ks5qKsom/jw2aYtzd1K6 DVMHCMhSVjG/MMu2h++Jssu5Ec1uL1Fjaj+qTd3e77uLAhzY9o96AOKKbL+9HLACEkSt MwVVPEbcC7uR8abMcxUwABTj6fcfR+IroV/WYeq0gGMl7kOZXqdqkP6h+zvkMxkV5vOh VPlwYS1vWc3jQy65vvMlq+Hp+wEBwbzewnyCKsZPRppusUnMywkTsAb8wUQWY5M05O/D 9qtw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=fPoTl/EfY5Nx27fRaG7hTRPr5jzvTFa/yAfFjsrIUMw=; b=g8Qg4uggnkFww2s8o3hRCr4RqAerZEayvCJOdtJw5RUohBZ9Qnm7izzEPjN6kL4WSv yUBD7f8r8CGdSIC9a2YUzsGtkAfPS5pBvu2U/SX0PtzYHCA6VR7mbym+80YCEGe92XeK Uk6o6SAizNghLsM784IgUpXGdacMFqvb7cIDl0Nbw3G6UUNVtQ5bgGLs4Nee8EmM5FDR Zoi6i8/VNF12sbzWVyDOeGQ3OABvBhuY+1+5k+QKH5R3N6tH4UJxxJSmhHsZ7qppHBPF uKZvoz64+q0qY3uR59ODQjo3LMxfgZKNM/0erSsTphTiCt6nTYpnMU8hziS84STyV2/J fL8w== X-Gm-Message-State: ABUngvejp2YJ2kLxvC1xjtnjz79etVeqfz28SsP7dYPU8SXI8SVvetdYZ3KEc/OQytxhUoKlt52iRR+gQXfiyA== X-Received: by 10.107.62.11 with SMTP id l11mr10902551ioa.181.1477664882930; Fri, 28 Oct 2016 07:28:02 -0700 (PDT) MIME-Version: 1.0 Sender: jonathan.dilorenzo@gmail.com Received: by 10.36.193.67 with HTTP; Fri, 28 Oct 2016 07:28:01 -0700 (PDT) Received: by 10.36.193.67 with HTTP; Fri, 28 Oct 2016 07:28:01 -0700 (PDT) In-Reply-To: References: From: Jonathan DiLorenzo Date: Fri, 28 Oct 2016 10:28:01 -0400 X-Google-Sender-Auth: VWI1rL3bZmU0o7XQI6f-YU39P_o Message-ID: To: Ivan Gotovchits Cc: caml-list Content-Type: multipart/alternative; boundary=94eb2c06aec071bbcc053fedaac6 X-Validation-by: dilorenzo@cs.cornell.edu Subject: Re: [Caml-list] Providing module implementations for Oasis --94eb2c06aec071bbcc053fedaac6 Content-Type: text/plain; charset=UTF-8 Thank you so much. That makes a lot of sense in hindsight, but I can't quite imagine the situation that leads to me figuring it out. On Oct 28, 2016 09:06, "Ivan Gotovchits" wrote: > 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 >>>>>>>> >>>>>>>> >>>>>>> >>>>>> >>>>> >>>> >>> >> > --94eb2c06aec071bbcc053fedaac6 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

Thank you so much. That makes a lot of sense in hindsight, b= ut I can't quite imagine the situation that leads to me figuring it out= .


On Oct 28, 2016 0= 9:06, "Ivan Gotovchits" <ivg@i= eee.org> wrote:
The problem is that executable `ppx_forest` and library= `forest_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 l= ibrary (indeed, it is not part of the library, it is the executable impleme= ntation).
Here is the PR with the fix: https://github.com/padsproj/= oforest/pull/9.

# Details

<= /div>
Just in case if you're interested why the resulting error was= so confusing :)

The error message came from the f= ollowing compilation command:

=C2=A0 =C2=A0 ocamlf= ind ocamlopt -linkpkg -g -linkpkg -thread -package threads -package str -pa= ckage re.str -package re.glob -package re -package ppx_tools.metaquot -pack= age ppx_let -package ppx_deriving.show -package pads.ppx -package pads -pac= kage 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 t= hat we can see the libraries:

=C2=A0 =C2=A0 o= camlfind ocamlopt -linkpkg ppx/forest_ppx.cmxa parsing/forest_parser.cmxa l= ib/forest.cmxa ppx/ppx_forest.cmx -o ppx/ppx_forest.native
=
In fact, the problem is in library ordering. Modules an= d libraries must be sorted in topological order, so the first should be `li= b/forest.cmxa`, then `parsing/forest_parser.cmxa` and finally `forest_ppx.c= mxa`.=C2=A0
And, yes, this is how this command looks after = the fix:

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

So how the to= posort=C2=A0can be broken? My assumption, that this was because you introdu= ced a loop into a dependency 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 ocamlbuild toposort routine an easy check that wi= ll detect loops and output =C2=A0a proper diagnostic message if a dependenc= y graph contains cycles.

Regards,
Ivan G= otovchits


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:
= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Forest_parser_helper referenced from ppx/= forest_ppx.cmxa(Skins)
Command exited with code 2.

Maybe notable (or maybe obvious) that if I switch o= asis to use ocamlc instead of ocamlopt, I instead get:

=
File "_none_", line 1:
Error: Er= ror while linking ppx/forest_ppx.cma(Skins):
Reference to undefin= ed global `Forest_parser_helper'
Command exited with co= de 2.

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

Library forest_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=A0forest_parser
=C2=A0 BuildDepends: =C2=A0 fore= st, ppx_deriving.show, compiler-libs.common=C2=A0
=C2=A0 Compiled= Object: best
=C2=A0 Modules: =C2=A0Forest_parser_helper, Forest_types
=C2=A0 I= nternalModules: Forest_lexer, Forest_parser

Librar= y 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 BuildDepends: =C2=A0 re, re.str, forest.= forest_parser, forest, ppx_tools.metaquot
=C2=A0 CompiledOb= ject: best
=C2=A0 Modules: =C2=A0 =C2=A0 =C2=A0 =C2=A0Ppx_forest<= /div>
=C2=A0 InternalModules: Ppx_forest_lib, Utility, Skins
= =C2=A0 XMETAEnable: =C2=A0 =C2=A0true
=C2=A0 XMETADescript= ion: Syntax extension library for OCaml Forest
=C2=A0 XMETA= Requires: =C2=A0 str re core threads ppx_tools.metaquot
=C2=A0 XM= ETAExtraLines: =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.forest_parser, forest.forest_ppx= , pads.ppx, ppx_tools.metaquot
=C2=A0 CompiledObject: best
<= /div>


On Thu, Oct 27, 2016 at 2:24 PM, Ivan Gotovchits <ivg@i= eee.org> wrote:
The problem is =C2=A0in a name clashing between `$opam-switch/lib/oca= ml/compiler-libs/parser` and the `parser` library that is compiled fro= m 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 t= o link your final executable, it takes the wrong archive, that definitely d= oesn't have=C2=A0
`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=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

The= solution is to rename your library, e.g., use `Library forest_parser` inst= ead of `Library parser`

On T= hu, Oct 27, 2016 at 1:44 PM, Jonathan DiLorenzo <dilorenzo@cs.corne= ll.edu> wrote:
Hey,

Ok, now the next step would be the following. Carefu= lly check that all modules, that you're using in libraries are included= in `Modules` or `InternalModules`. It is the case
that sometimes=C2=A0= when you forgot to include a module, oasis (actually `ocamlbuild`), may pro= duce a strange, and on a first glance, irrelevant error message.=C2=A0

I checked and sadly the modu= les I'm trying to access are all in `Modules`. Perhaps interestingly, i= t 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):

Command exited with code 2.

On Thu, Oct 27, 2016 at 10:59 = AM, Jonathan DiLorenzo <dilorenzo@cs.cornell.edu> wro= te:
H= ey Ivan,

Thanks for your response.

<= div class=3D"gmail_extra">
The first one is th= at 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 gene= rated files, like setup.data, et alas, but be careful,=C2=A0
don&= #39;t delete something that you need).=C2=A0
<= br>
I tried cleaning up all the generated files. Same erro= r unfortunately
=C2=A0
Another idea=C2=A0is that you'= re using oasis 0.4.7 with ocaml-4.03.0+flambda, they are currently incompat= ible, and can produce weird 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 o= caml-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.cor= nell.edu> wrote:
Hey all,

I'm trying to b= uild 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 s= eemingly random files. For example, I want my 'ppx' library to be a= ble to use functions from my 'parser' library. One file (ppx_forest.ml) can use functio= ns from it, while another in the same library (skins.ml) cannot, giving me this error:
File "_none_", line 1:
Error: No imple= mentations provided for the following modules:
=C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0Forest_parser_helper referenced from ppx/ppx.cmxa(Skins)
Command exited with code 2.

They ca= n all refer to types I've defined therein though.

<= div>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 ot= herwise?

Thanks in advance,
Jonathan

Excerpt of my Oasis file that may possibly be relevan= t:

Library forest=C2=A0
=C2=A0 Path= : =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0lib
=C2=A0 BuildTools: =C2=A0= =C2=A0ocamlbuild
=C2=A0 BuildDepends: =C2=A0 pads, str, re, re.g= lob, core, threads, ppx_let
=C2=A0 CompiledObject: best
=C2=A0 Modules: =C2=A0 =C2=A0 =C2=A0 Forest, PadsInterface

<= /div>
Library parser
=C2=A0 Path: =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 parsing
=C2=A0 BuildTools: =C2=A0 =C2=A0 ocamlbuild, menh= ir, ocamllex
=C2=A0 Findlibparent: =C2=A0forest
=C2=A0 = Findlibname: =C2=A0 =C2=A0parser
=C2=A0 BuildDepends: =C2=A0 fore= st, ppx_deriving.show, compiler-libs.common=C2=A0
=C2=A0 Compiled= Object: best
=C2=A0 Modules: =C2=A0For= est_parser_helper
=C2=A0 InternalModules: Forest_lexer, Forest_pa= rser, Forest_types

Library ppx
=C2=A0 Pa= th: =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, ppx_tools.metaquot
=C2=A0 = CompiledObject: best
=C2=A0 Modules: =C2=A0 =C2=A0 =C2=A0 =C2=A0P= px_forest
=C2=A0 InternalModules: Ppx_forest_lib, Utility, Skins<= /div>
=C2=A0 XMETAEnable: =C2=A0 =C2=A0true
=C2=A0 XMETARequi= res: =C2=A0 str re core threads ppx_tools.metaquot
=C2=A0 XMETAEx= traLines: =C2=A0ppx =3D "ppx_forest"

Exe= cutable 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 Bui= ldDepends: =C2=A0 forest, forest.parser, forest.ppx, pads.ppx, ppx_tools.me= taquot
=C2=A0 CompiledObject: best








--94eb2c06aec071bbcc053fedaac6--