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 mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by sympa.inria.fr (Postfix) with ESMTPS id 4A9A57F61D for ; Thu, 27 Oct 2016 20:24:59 +0200 (CEST) Authentication-Results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=ivg@ieee.org; spf=Pass smtp.mailfrom=ivg@ieee.org; spf=None smtp.helo=postmaster@mail-lf0-f42.google.com Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of ivg@ieee.org) identity=pra; client-ip=209.85.215.42; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="ivg@ieee.org"; x-sender="ivg@ieee.org"; x-conformance=sidf_compatible Received-SPF: Pass (mail2-smtp-roc.national.inria.fr: domain of ivg@ieee.org designates 209.85.215.42 as permitted sender) identity=mailfrom; client-ip=209.85.215.42; receiver=mail2-smtp-roc.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 (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@mail-lf0-f42.google.com) identity=helo; client-ip=209.85.215.42; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="ivg@ieee.org"; x-sender="postmaster@mail-lf0-f42.google.com"; x-conformance=sidf_compatible IronPort-PHdr: =?us-ascii?q?9a23=3A5TvNXBXtVxK/q4ekEO32cjIKd+7V8LGtZVwlr6E/?= =?us-ascii?q?grcLSJyIuqrYZhWAt8tkgFKBZ4jH8fUM07OQ6PG6HzNZqs/Y7DhCKMUKDEBVz5?= =?us-ascii?q?1O3kQJO42sNw7SFLbSdSs0HcBPBhdO3kqQFgxrIvv4fEDYuXao7DQfSV3VPAtx?= =?us-ascii?q?IfnpSMaJ15zkn8j7wZDYYh1JiTyhevsyaUzu9USC/vUR1KllLK8tyhLP6ldJX+?= =?us-ascii?q?NMyGV6IhrHkxf44d29+oxk2y9L/fkm7chNVaG8cqglG+92FjMjZkEr7cujmh7f?= =?us-ascii?q?ShWE5noASS1CkwRHKwnI4Ry8WY3+5Hip/tFh0TWXaJWlBYs/Xi6vuuIyEEfl?= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A0CzAQAvRhJYfyrXVdFcDg0BAQEDAQEBC?= =?us-ascii?q?QEBARYBAQEDAQEBCQEBAYJ/AQEBAQF1fQekLoJXjFKFFoIHIIYDAoF+B0ATAQE?= =?us-ascii?q?BAQEBAQEBAQESAQEJCwsJGzKCMwQBFQEEghABAQEDARIRHQEBNwEECwkCCw0qA?= =?us-ascii?q?gIiEgEFARwGExsHiCoIliiPTYEyPzKKX2eESQEBBYgmAQEBBwEBAQEBGggQhi2?= =?us-ascii?q?DUIEFh0uCWwGOToVuhV6GLYl2gW5OhB+JKY0Lgj8THoERHwGBE4MMDxyBF1ciN?= =?us-ascii?q?AGHFIFKAQEB?= X-IPAS-Result: =?us-ascii?q?A0CzAQAvRhJYfyrXVdFcDg0BAQEDAQEBCQEBARYBAQEDAQE?= =?us-ascii?q?BCQEBAYJ/AQEBAQF1fQekLoJXjFKFFoIHIIYDAoF+B0ATAQEBAQEBAQEBAQESA?= =?us-ascii?q?QEJCwsJGzKCMwQBFQEEghABAQEDARIRHQEBNwEECwkCCw0qAgIiEgEFARwGExs?= =?us-ascii?q?HiCoIliiPTYEyPzKKX2eESQEBBYgmAQEBBwEBAQEBGggQhi2DUIEFh0uCWwGOT?= =?us-ascii?q?oVuhV6GLYl2gW5OhB+JKY0Lgj8THoERHwGBE4MMDxyBF1ciNAGHFIFKAQEB?= X-IronPort-AV: E=Sophos;i="5.31,553,1473112800"; d="scan'208,217";a="242647777" Received: from mail-lf0-f42.google.com ([209.85.215.42]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/AES128-GCM-SHA256; 27 Oct 2016 20:24:37 +0200 Received: by mail-lf0-f42.google.com with SMTP id f134so34123466lfg.2 for ; Thu, 27 Oct 2016 11:24:37 -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=mpGDqpqyNe2VxP0IFguanzxtA/rlC50621aGzJ8Gpf4=; b=b/A3IziYhb6TNFH2RPnsSiefnhBNXxAZTzVbrdthWRW4U7X4DuGduuaVwijUSh4+JU m0xylN7pFXemlsLz5T2EX7euG/1sC5bVzPBGC9x8MNy+1qywLqNBt9NyHk3xSTCnd+fu s5NgCa/MG5FAxqSKeiYHM1ujfUCr6e14zvcR5ThomsNi4ir1McJUztkF7qGz5VTzsYSi GikgsqvoW95UeeZADuQ9a0+49m7V1Z3LPj7BrcE/yHZ3YBtku5cPw94kiGyFOHTsItNF agxAaV7f2BhgqoK6BZN0HqShES0pdnIpPdFWNd6qVH2Pp8JWvgbiZCszBXDIzpg+/SFv DBhA== 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=mpGDqpqyNe2VxP0IFguanzxtA/rlC50621aGzJ8Gpf4=; b=UDDCSzcBUIC6MxUluhQPPkT3iZGrSYQh7DW12xyK/+31Yoditjsv22JbzK8snU1Vuz t/7Genc1L6UUVlJJeZ7f7EA52JaxuXC1/aq9SBMEEQOSn79S0gpyQUNjQ58hmrjZRzB1 51HqHjwZaJmKLSSzh4ctf5rF8WDcX4Q7OSysq1/HGxW7D0sN8M/v1WLqjmezP00Po5f1 9/GKmf6S5HG/vIn/4ialJDSjrTPdlCRAy4xmQVKtsfdWWztUvbbxqLkokisyHIDV3TU7 9QV8k3BdUQQO30cqmrqSs1+vITfu5xytbM+urm5Grr6us/6k9LV6BfX47gME5cXbiDht imHw== X-Gm-Message-State: ABUngvfFXcdGSVjehuHELttpCN32fbW3chBg7pLbsWktDHC68jJjLFZpufQWcg6Zr4p0hGEEgoMSQNxsHLXRO37l X-Received: by 10.25.215.88 with SMTP id o85mr7438652lfg.98.1477592676224; Thu, 27 Oct 2016 11:24:36 -0700 (PDT) MIME-Version: 1.0 Received: by 10.114.28.34 with HTTP; Thu, 27 Oct 2016 11:24:35 -0700 (PDT) In-Reply-To: References: From: Ivan Gotovchits Date: Thu, 27 Oct 2016 14:24:35 -0400 Message-ID: To: Jonathan DiLorenzo Cc: caml-list Content-Type: multipart/alternative; boundary=001a114121c696fd59053fdcda45 Subject: Re: [Caml-list] Providing module implementations for Oasis --001a114121c696fd59053fdcda45 Content-Type: text/plain; charset=UTF-8 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 >>>>> >>>>> >>>> >>> >> > --001a114121c696fd59053fdcda45 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
The problem is =C2=A0in a name clashing between `$opam-swi= tch/lib/ocaml/compiler-libs/parser` and the `parser` library that is compil= ed 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 tr= ying to link your final executable, it takes the wrong archive, that defini= tely doesn't have=C2=A0
`Forest_parser_helper` module.
<= div>
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 con= tained in the `cmxa` file, but are looked up directly in=C2=A0
th= e `cmi`. Compiler is looking for a file named `forest_parser_helper.cmi` an= d can see that there are not `bad_func` there.=C2=A0

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 y= ou're using in libraries are included in `Modules` or `InternalModules`= . It is the case
that sometimes=C2=A0when you forgot to include a modul= e, oasis (actually `ocamlbuild`), may produce a strange, and on a first gla= nce, irrelevant error message.=C2=A0

I checked and sadly the modules I'm trying to access are a= ll in `Modules`. Perhaps interestingly, it can still clearly detect statica= lly if the function exists or not because if I try to use a function that d= oesn't exist it instead gives me this error (which is what I would norm= ally 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 debu= g the issue.=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 1= 0: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 w= ould 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,=C2=A0
don't delete something that you need).=C2=A0
<= div>
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 with ocaml-4.03.0+flambda, they are currently inc= ompatible, 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 ocaml-4.03.0, but I don't appear to be using flambda. I tried pa= ssing 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 com= patible sans flambda?


On Thu, Oct 27, 2016 at 1:01 AM, Jonatha= n DiLorenzo <dilorenzo@cs.cornell.edu> wrote:
Hey all,
I'm trying to build my system using Oasis and OCamlbuil= d. 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 wa= nt 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 li= brary (skins.ml) cannot, = giving me this error:

File "_none_"= , line 1:
Error: No implementations provided for the following mo= dules:
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Forest_parser_helper ref= erenced from ppx/ppx.cmxa(Skins)
Command exited with code 2.

They can all refer to types I've defined the= rein though.

I'm not fantastic at Oasis so may= be 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=C2=A0
=C2=A0 Path: =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0lib
=C2=A0 BuildTools: =C2=A0 =C2=A0ocamlbuild
=C2=A0 BuildD= epends: =C2=A0 pads, str, re, re.glob, core, threads, ppx_let
=C2= =A0 CompiledObject: best
=C2=A0 Modules: =C2=A0 =C2=A0 =C2=A0 For= est, PadsInterface

Library parser
=C2=A0= Path: =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 parsing
=C2=A0 BuildToo= ls: =C2=A0 =C2=A0 ocamlbuild, menhir, ocamllex
=C2=A0 Findlibpare= nt: =C2=A0forest
=C2=A0 Findlibname: =C2=A0 =C2=A0parser
=C2=A0 BuildDepends: =C2=A0 forest, ppx_deriving.show, compiler-libs.comm= on=C2=A0
=C2=A0 CompiledObject: best
=C2=A0 Modules: =C2=A0Forest_parser_helper
=C2= =A0 InternalModules: 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, ppx_tools.metaquot
=C2=A0 CompiledObject: best
= =C2=A0 Modules: =C2=A0 =C2=A0 =C2=A0 =C2=A0Ppx_forest
=C2=A0 Inte= rnalModules: Ppx_forest_lib, Utility, Skins
=C2=A0 XMETAEnable: = =C2=A0 =C2=A0true
=C2=A0 XMETARequires: =C2=A0 str re core thread= s ppx_tools.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, fores= t.parser, forest.ppx, pads.ppx, ppx_tools.metaquot
=C2=A0 Compile= dObject: best






--001a114121c696fd59053fdcda45--