Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Packing modules without _tag #4573

Closed
vicuna opened this issue Jul 1, 2008 · 1 comment
Closed

Packing modules without _tag #4573

vicuna opened this issue Jul 1, 2008 · 1 comment
Assignees
Milestone

Comments

@vicuna
Copy link

vicuna commented Jul 1, 2008

Original bug ID: 4573
Reporter: Radzevich Belevich
Assigned to: @gasche
Status: closed (set by @xavierleroy on 2015-12-11T18:19:52Z)
Resolution: not a bug
Priority: normal
Severity: tweak
Target version: 4.00.2+dev
Category: -for ocamlbuild use https://github.com/ocaml/ocamlbuild/issues
Monitored by: pveber

Bug description

Sorry for my bad english.
Ocamlbuild try to find submodules for .mlpack file in same dir when the .mlpack file exists, but when we get "touch _tags" it's look at subdir for this modules.

@vicuna
Copy link
Author

vicuna commented Jun 17, 2013

Comment author: @gasche

This is not a bug, but rather a not-well-documented feature of ocamlbuild, related to the default value of the "traverse" tag that controls recursive traversal of subdirectories.

Initially ocamlbuild has "traverse: true" in all circumstances, because that's the most convenient when compiling an OCaml project. However, that was a performance nightmare when ocamlbuild was called from somewhere else: calling ocamlbuild from your home directory could try to traverse it entirely!

So the change that was made (around 3.11 I'd guess) is to use a heuristic to detect whether we're in an real OCaml project, or in a random directory:

  • if a "_tags" or a "myocamlbuild.ml" exists in the current working directory, then "traverse" is enabled by default (all subdirectories are recursively traversed)
  • if no "_tags" and no "myocamlbuild.ml" file exists, "traverse" is not enabled by default

Note that in either case you can change this default by adding the "traverse" tag to specific subdirectories (": traverse") or for everything ("true: traverse"), and conversely disabling it with "-traverse" instead -- either in a _tags file or through the -tag-line "..." option).

PS: I'm not fond of this heuristic, for precisely the reason that it is surprising that adding a "_tags" file would change the observed semantics. But I'm not sure what would be a better choice, and don't see how to change this without breaking compatibility.

@vicuna vicuna closed this as completed Dec 11, 2015
@vicuna vicuna added this to the 4.00.2 milestone Mar 14, 2019
@vicuna vicuna added the bug label Mar 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants