|Anonymous | Login | Signup for a new account||2013-12-09 13:34 CET|
|Main | My View | View Issues | Change Log | Roadmap|
|View Issue Details|
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0005851||OCaml||OCamlbuild (the tool)||public||2012-12-12 01:09||2013-07-26 18:48|
|Target Version||4.01.1+dev||Fixed in Version|
|Summary||0005851: Ocamlbuild cannot resolve dependencies when there are no _tags file (but can with an empty _tags file)|
|Description||There is a difference in behaviour between no _tags file and an empty one. Ocamlbuild succeed in building a simple project only if there is an empty _tags file in the directory.|
|Steps To Reproduce||First create a project with the following files:|
let bla = 3;;
let bli = Bla.bla;;
Try to compile:
/usr/bin/ocamlc -c -o use.cmo use.ml
+ /usr/bin/ocamlc -c -o use.cmo use.ml
File "use.ml", line 1, characters 0-11:
Error: Unbound module Plu
Command exited with code 2.
It seems that the ocamlbuild solver does
not know how to build the =.cmo= out of the =.mlpack=:
However, if you create (even an empty) =_tags= file at the root of the
project, then everything works:
/usr/bin/ocamldep -modules plu/bla.ml > plu/bla.ml.depends
/usr/bin/ocamldep -modules plu/bli.ml > plu/bli.ml.depends
/usr/bin/ocamlc -c -I plu -o plu/bla.cmo plu/bla.ml
/usr/bin/ocamlc -c -I plu -o plu/bli.cmo plu/bli.ml
/usr/bin/ocamlc -pack plu/bla.cmo plu/bli.cmo -o plu.cmo
/usr/bin/ocamlc -c -o use.cmo use.ml
/usr/bin/ocamlc plu.cmo use.cmo -o use.byte
|Tags||No tags attached.|
It is arguably a design choice. As of today, the subdirectories
of the current directory are marked as "traverse" iff there is
either a "_tags", or a "myocamlbuild.ml" file.
Of course, this default behavior could as well be changed.
I am pondering the implications of such a change over
existing projects. Any advice is welcome.
Matthieu Lemerre (reporter)
I was not aware of this "traverse" tag, this solves my problem. But this behavior is quite surprising: adding _tags file seems unrelated to the notion of traversing subdirectories.
I am not sure of how "traverse" interacts with the rest of the system, or what is its purpose. Is this only to improve performance by avoiding directory traversal?
It seems that directories added by the -I flag are traversed (at least, "ocamlbuild -I plu use.byte" works in my case), so I think the .mlpack case is comparable: at least the directories present in the .mlpack files should be traversable (or a warning/error should be issued if a referenced directory is not traversable).
> I was not aware of this "traverse" tag, this solves my problem. But this behavior is quite surprising:
> adding _tags file seems unrelated to the notion of traversing subdirectories.
I do agree that is seems strange at first, and think it would be a good thing to
change that. I am just afraid of breaking something...
> I am not sure of how "traverse" interacts with the rest of the system, or what is its purpose. Is this
> only to improve performance by avoiding directory traversal?
That is also my understanding.
> It seems that directories added by the -I flag are traversed (at least, "ocamlbuild -I plu use.byte"
> works in my case), so I think the .mlpack case is comparable: at least the directories present in the
> .mlpack files should be traversable (or a warning/error should be issued if a referenced directory is
> not traversable).
OK, fixing the problem this way could indeed be better.
|This needs to be triaged again.|
from the documentation :
camlbuild used to traverse by default any subdirectory not explicitly excluded. This is no longer the case. Note that you can still have a fine grained control using your _tags file and the traverse tag.
There is no longer the true: traverse tag declaration by default. To make ocamlbuild recursive use one of these:
Give the -r flag to ocamlbuild.
Have a _tags or myocamlbuild.ml file in your top directory.
The reason is given in gallium website :
The problem with this default setting (true:traverse) is that when starting, ocamlbuild wants to read deeply the whole current directory. For instance running ocamlbuild -documentation in your home could take a while.
- There is the question of having traverse or not by default
- but the behaviour where creating a _tags file makes ocamlbuild recursive is bad IMHO
I see two options :
Either set the "traverse" by default, even if no _tags or myocamlbuild.ml file is present.
- it is already what happens for anyone having a _tags or myocamlbuild.ml file, that is to say 95% of people
- it works "out of the box"
- the drawback is that it is most likely ocamlbuild would not be setup in an optimal way, as user would not know that ocamlbuild would traverse all files
Either forbid the traverse by default, even if _tags or myocamlbuild.ml file is present. And add a message when ocamlbuild fails, along with the error message and the backtrace, that indicates which directories are traversed.
- it would break many user configurations
- it would require most people to add a "true:traverse" tag to their project
- but it would ensure people use ocamlbuild in a more optimal way
|2012-12-12 01:09||Matthieu Lemerre||New Issue|
|2012-12-12 17:09||xclerc||Note Added: 0008598|
|2012-12-12 17:09||xclerc||Assigned To||=> xclerc|
|2012-12-12 17:09||xclerc||Status||new => feedback|
|2012-12-13 14:42||Matthieu Lemerre||Note Added: 0008601|
|2012-12-13 14:42||Matthieu Lemerre||Status||feedback => assigned|
|2012-12-13 18:23||xclerc||Note Added: 0008605|
|2013-07-11 22:51||doligez||Target Version||=> 4.02.0+dev|
|2013-07-12 18:15||doligez||Target Version||4.02.0+dev => 4.01.1+dev|
|2013-07-26 10:37||meyer||Note Added: 0009864|
|2013-07-26 18:10||william||Note Added: 0009867|
|2013-07-26 18:48||william||Note Added: 0009870|
|Copyright © 2000 - 2011 MantisBT Group|