* [Caml-list] ocamlbuild generates .annot files in _build @ 2012-07-17 5:12 Francois Berenger 2012-07-17 5:25 ` Francois Berenger ` (2 more replies) 0 siblings, 3 replies; 12+ messages in thread From: Francois Berenger @ 2012-07-17 5:12 UTC (permalink / raw) To: OCaml List Hello, Shouldn't it generate theses files where the source files are? The emacs plugin can no more find the types in case the .annot files are not where the source file is. Thanks, F. ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [Caml-list] ocamlbuild generates .annot files in _build 2012-07-17 5:12 [Caml-list] ocamlbuild generates .annot files in _build Francois Berenger @ 2012-07-17 5:25 ` Francois Berenger 2012-07-17 7:00 ` Xavier Clerc 2012-07-17 6:55 ` Xavier Clerc 2012-07-17 11:05 ` Daniel Bünzli 2 siblings, 1 reply; 12+ messages in thread From: Francois Berenger @ 2012-07-17 5:25 UTC (permalink / raw) To: caml-list On 07/17/2012 02:12 PM, Francois Berenger wrote: > Hello, > > Shouldn't it generate theses files where the source files > are? > > The emacs plugin can no more find the types in case > the .annot files are not where the source file is. Also, the preprocessor INCLUDE directives don't work anymore because ocamlbuild did not copy the .ml file to include in _build. You have to use INCLUDE "../[your_file]" instead, which is dirty. > Thanks, > F. ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [Caml-list] ocamlbuild generates .annot files in _build 2012-07-17 5:25 ` Francois Berenger @ 2012-07-17 7:00 ` Xavier Clerc 2012-07-17 7:35 ` Francois Berenger 2012-07-17 14:46 ` Romain Bardou 0 siblings, 2 replies; 12+ messages in thread From: Xavier Clerc @ 2012-07-17 7:00 UTC (permalink / raw) To: Francois Berenger, caml-list; +Cc: xavier clerc ----- Mail original ----- > On 07/17/2012 02:12 PM, Francois Berenger wrote: > > Hello, > > > > Shouldn't it generate theses files where the source files > > are? > > > > The emacs plugin can no more find the types in case > > the .annot files are not where the source file is. > > Also, the preprocessor INCLUDE directives don't work anymore because > ocamlbuild did not copy the .ml file to include in _build. > > You have to use INCLUDE "../[your_file]" instead, which is dirty. I don't know if you will find my suggestion clean, but when I encounter a similar problem I design an ocamlbuild plugin that just copies the file to the build directory. This will avoid relying upon a relative path, and fits ocamlbuild structure by just declaring a dependency and a rule to barely copy the file from its original place to the build directory. Notice that this is akin to what ocamlbuild actually does for source file, the only difference is that ocamlbuild cannot determine the dependency in your case. Hence, you have to declare it manually. Hope this helps, Xavier Clerc ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [Caml-list] ocamlbuild generates .annot files in _build 2012-07-17 7:00 ` Xavier Clerc @ 2012-07-17 7:35 ` Francois Berenger 2012-07-17 14:46 ` Romain Bardou 1 sibling, 0 replies; 12+ messages in thread From: Francois Berenger @ 2012-07-17 7:35 UTC (permalink / raw) To: caml-list On 07/17/2012 04:00 PM, Xavier Clerc wrote: > > > ----- Mail original ----- >> On 07/17/2012 02:12 PM, Francois Berenger wrote: >>> Hello, >>> >>> Shouldn't it generate theses files where the source files >>> are? >>> >>> The emacs plugin can no more find the types in case >>> the .annot files are not where the source file is. >> >> Also, the preprocessor INCLUDE directives don't work anymore because >> ocamlbuild did not copy the .ml file to include in _build. >> >> You have to use INCLUDE "../[your_file]" instead, which is dirty. > > I don't know if you will find my suggestion clean, > but when I encounter a similar problem I design an > ocamlbuild plugin that just copies the file to the > build directory. Any hacking related to ocamlbuild is out of the question for me. In a perfect world, I would no more be using ocamlbuild. I only "use" it because oasis does as the default build engine; which is not my choice. Thanks for the suggestion, F. > This will avoid relying upon a relative path, and > fits ocamlbuild structure by just declaring a dependency > and a rule to barely copy the file from its original > place to the build directory. Notice that this is akin > to what ocamlbuild actually does for source file, the > only difference is that ocamlbuild cannot determine the > dependency in your case. Hence, you have to declare it > manually. > > > Hope this helps, > > Xavier Clerc > ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [Caml-list] ocamlbuild generates .annot files in _build 2012-07-17 7:00 ` Xavier Clerc 2012-07-17 7:35 ` Francois Berenger @ 2012-07-17 14:46 ` Romain Bardou 1 sibling, 0 replies; 12+ messages in thread From: Romain Bardou @ 2012-07-17 14:46 UTC (permalink / raw) To: caml-list On 17/07/2012 09:00, Xavier Clerc wrote: > > > ----- Mail original ----- >> On 07/17/2012 02:12 PM, Francois Berenger wrote: >>> Hello, >>> >>> Shouldn't it generate theses files where the source files >>> are? >>> >>> The emacs plugin can no more find the types in case >>> the .annot files are not where the source file is. >> >> Also, the preprocessor INCLUDE directives don't work anymore because >> ocamlbuild did not copy the .ml file to include in _build. >> >> You have to use INCLUDE "../[your_file]" instead, which is dirty. > > I don't know if you will find my suggestion clean, > but when I encounter a similar problem I design an > ocamlbuild plugin that just copies the file to the > build directory. > > This will avoid relying upon a relative path, and > fits ocamlbuild structure by just declaring a dependency > and a rule to barely copy the file from its original > place to the build directory. Notice that this is akin > to what ocamlbuild actually does for source file, the > only difference is that ocamlbuild cannot determine the > dependency in your case. Hence, you have to declare it > manually. It feels very odd, at first, that the "dep" function of the Ocamlbuild API declares a dependency for tags rather than for a given file. I understand the rationale, it is strictly more general as this allows to add a dependency to a file only in some specific context, i.e. for specific rules. But we have to tag the file first (unless all files are tagged with their own name? I don't remember). Tagging a file to be able to declare a dependency does not feel very intuitive to me. I'm not even sure this works with every rules, I'm a little blurry on how tags are added to commands. Are all tags of the file names which appear in the command added automatically? Cheers, -- Romain Bardou ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [Caml-list] ocamlbuild generates .annot files in _build 2012-07-17 5:12 [Caml-list] ocamlbuild generates .annot files in _build Francois Berenger 2012-07-17 5:25 ` Francois Berenger @ 2012-07-17 6:55 ` Xavier Clerc 2012-07-17 7:24 ` Francois Berenger 2012-07-17 8:49 ` Anil Madhavapeddy 2012-07-17 11:05 ` Daniel Bünzli 2 siblings, 2 replies; 12+ messages in thread From: Xavier Clerc @ 2012-07-17 6:55 UTC (permalink / raw) To: Francois Berenger, OCaml List; +Cc: xavier clerc ----- Mail original ----- > Hello, > > Shouldn't it generate theses files where the source files > are? > > The emacs plugin can no more find the types in case > the .annot files are not where the source file is. For the record, we already have a PR related to this problem: http://caml.inria.fr/mantis/view.php?id=5226 As you can see there, we have not reached consensus about what to do. However, following the ocamlbuild philosophy of leaving the source directories untouched and thus to produce all files in a build directory, we incline to think that the problem should be handled in the tools accessing annotation files. Regards, Xavier Clerc ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [Caml-list] ocamlbuild generates .annot files in _build 2012-07-17 6:55 ` Xavier Clerc @ 2012-07-17 7:24 ` Francois Berenger 2012-07-17 7:27 ` Francois Berenger 2012-07-17 7:31 ` Xavier Clerc 2012-07-17 8:49 ` Anil Madhavapeddy 1 sibling, 2 replies; 12+ messages in thread From: Francois Berenger @ 2012-07-17 7:24 UTC (permalink / raw) To: caml-list On 07/17/2012 03:55 PM, Xavier Clerc wrote: > > > ----- Mail original ----- >> Hello, >> >> Shouldn't it generate theses files where the source files >> are? >> >> The emacs plugin can no more find the types in case >> the .annot files are not where the source file is. > > For the record, we already have a PR related to this problem: > http://caml.inria.fr/mantis/view.php?id=5226 > > > As you can see there, we have not reached consensus about > what to do. However, following the ocamlbuild philosophy > of leaving the source directories untouched ocamlbuild already creates symbolic links to the created executables. Maybe links to the .annot files could be created as well. Regards, F. > and thus to > produce all files in a build directory, we incline to think > that the problem should be handled in the tools accessing > annotation files. > > Regards, > > Xavier Clerc > ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [Caml-list] ocamlbuild generates .annot files in _build 2012-07-17 7:24 ` Francois Berenger @ 2012-07-17 7:27 ` Francois Berenger 2012-07-17 7:31 ` Xavier Clerc 1 sibling, 0 replies; 12+ messages in thread From: Francois Berenger @ 2012-07-17 7:27 UTC (permalink / raw) To: caml-list On 07/17/2012 04:24 PM, Francois Berenger wrote: > On 07/17/2012 03:55 PM, Xavier Clerc wrote: >> >> >> ----- Mail original ----- >>> Hello, >>> >>> Shouldn't it generate theses files where the source files >>> are? >>> >>> The emacs plugin can no more find the types in case >>> the .annot files are not where the source file is. >> >> For the record, we already have a PR related to this problem: >> http://caml.inria.fr/mantis/view.php?id=5226 >> >> >> As you can see there, we have not reached consensus about >> what to do. However, following the ocamlbuild philosophy >> of leaving the source directories untouched > > ocamlbuild already creates symbolic links to the created executables. > Maybe links to the .annot files could be created as well. I just did this locally in fact, as a dirty quick fix. Then, I added in my _tags file lines like: "[my_file].annot": not_hygienic > Regards, > F. > > > and thus to >> produce all files in a build directory, we incline to think >> that the problem should be handled in the tools accessing >> annotation files. > > >> Regards, >> >> Xavier Clerc >> > > > ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [Caml-list] ocamlbuild generates .annot files in _build 2012-07-17 7:24 ` Francois Berenger 2012-07-17 7:27 ` Francois Berenger @ 2012-07-17 7:31 ` Xavier Clerc 2012-07-17 14:28 ` Romain Bardou 1 sibling, 1 reply; 12+ messages in thread From: Xavier Clerc @ 2012-07-17 7:31 UTC (permalink / raw) To: Francois Berenger, caml-list; +Cc: xavier clerc ----- Mail original ----- > On 07/17/2012 03:55 PM, Xavier Clerc wrote: > > > > > > ----- Mail original ----- > >> Hello, > >> > >> Shouldn't it generate theses files where the source files > >> are? > >> > >> The emacs plugin can no more find the types in case > >> the .annot files are not where the source file is. > > > > For the record, we already have a PR related to this problem: > > http://caml.inria.fr/mantis/view.php?id=5226 > > > > > > As you can see there, we have not reached consensus about > > what to do. However, following the ocamlbuild philosophy > > of leaving the source directories untouched > > ocamlbuild already creates symbolic links to the created executables. > Maybe links to the .annot files could be created as well. Yes, this is perfectly right, and also already discussed in the aforementioned PR. However, such links are scarce while links to annot files (or annot files themselves, for the matter) would really clutter the source directories. At least, it is how I see things, but I am very interested to gather input on the subject in order to reach consensus on how to settle the issue. Regards, Xavier ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [Caml-list] ocamlbuild generates .annot files in _build 2012-07-17 7:31 ` Xavier Clerc @ 2012-07-17 14:28 ` Romain Bardou 0 siblings, 0 replies; 12+ messages in thread From: Romain Bardou @ 2012-07-17 14:28 UTC (permalink / raw) To: caml-list On 17/07/2012 09:31, Xavier Clerc wrote: > ----- Mail original ----- >> On 07/17/2012 03:55 PM, Xavier Clerc wrote: >>> >>> >>> ----- Mail original ----- >>>> Hello, >>>> >>>> Shouldn't it generate theses files where the source files >>>> are? >>>> >>>> The emacs plugin can no more find the types in case >>>> the .annot files are not where the source file is. >>> >>> For the record, we already have a PR related to this problem: >>> http://caml.inria.fr/mantis/view.php?id=5226 >>> >>> >>> As you can see there, we have not reached consensus about >>> what to do. However, following the ocamlbuild philosophy >>> of leaving the source directories untouched >> >> ocamlbuild already creates symbolic links to the created executables. >> Maybe links to the .annot files could be created as well. > > Yes, this is perfectly right, and also already discussed > in the aforementioned PR. However, such links are scarce > while links to annot files (or annot files themselves, for > the matter) would really clutter the source directories. > > At least, it is how I see things, but I am very interested > to gather input on the subject in order to reach consensus > on how to settle the issue. The fact that Ocamlbuild does not pollute my working directory is a key feature to me and I would frown at everything which would compromise it. I don't even like the links to the executables and I call Ocamlbuild with the -no-links option. Tuareg has been able to find the .annot files in the _build directory for some time now. Cheers, -- Romain Bardou ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [Caml-list] ocamlbuild generates .annot files in _build 2012-07-17 6:55 ` Xavier Clerc 2012-07-17 7:24 ` Francois Berenger @ 2012-07-17 8:49 ` Anil Madhavapeddy 1 sibling, 0 replies; 12+ messages in thread From: Anil Madhavapeddy @ 2012-07-17 8:49 UTC (permalink / raw) To: Xavier Clerc; +Cc: Francois Berenger, OCaml List On 17 Jul 2012, at 07:55, Xavier Clerc wrote: > > For the record, we already have a PR related to this problem: > http://caml.inria.fr/mantis/view.php?id=5226 > > As you can see there, we have not reached consensus about > what to do. However, following the ocamlbuild philosophy > of leaving the source directories untouched and thus to > produce all files in a build directory, we incline to think > that the problem should be handled in the tools accessing > annotation files. The ocaml-annot tool is an external command that integrates with pretty much any editor, and looks in multiple locations for the .annot file (pwd, _build, among others). https://github.com/avsm/ocaml-annot Works great for me, as it's pretty much the only fancy editor thing I use (although that's likely to change with the forthcoming binannot feature in 4.00!). -anil ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [Caml-list] ocamlbuild generates .annot files in _build 2012-07-17 5:12 [Caml-list] ocamlbuild generates .annot files in _build Francois Berenger 2012-07-17 5:25 ` Francois Berenger 2012-07-17 6:55 ` Xavier Clerc @ 2012-07-17 11:05 ` Daniel Bünzli 2 siblings, 0 replies; 12+ messages in thread From: Daniel Bünzli @ 2012-07-17 11:05 UTC (permalink / raw) To: Francois Berenger; +Cc: OCaml List Le mardi, 17 juillet 2012 à 07:12, Francois Berenger a écrit : > Hello, > > Shouldn't it generate theses files where the source files > are? That would be rather inconsistant with the mode of operation of the tool. > The emacs plugin can no more find the types in case > the .annot files are not where the source file is. What do you mean by emacs plugin ? The emacs-mode of the distribution finds them. typerex does finds them and apparently tuareg-mode is also able to find them. Best, Daniel ^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2012-07-17 14:46 UTC | newest] Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2012-07-17 5:12 [Caml-list] ocamlbuild generates .annot files in _build Francois Berenger 2012-07-17 5:25 ` Francois Berenger 2012-07-17 7:00 ` Xavier Clerc 2012-07-17 7:35 ` Francois Berenger 2012-07-17 14:46 ` Romain Bardou 2012-07-17 6:55 ` Xavier Clerc 2012-07-17 7:24 ` Francois Berenger 2012-07-17 7:27 ` Francois Berenger 2012-07-17 7:31 ` Xavier Clerc 2012-07-17 14:28 ` Romain Bardou 2012-07-17 8:49 ` Anil Madhavapeddy 2012-07-17 11:05 ` Daniel Bünzli
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox