Skip to content


Subversion checkout URL

You can clone with
Download ZIP


Fix part of #22 #30

merged 1 commit into from

3 participants


Global command line flag for generating annot files


just added a patch to do this myself before noticing this :)

however, i blocked on getting the .annot files into the right place for emacs/typerex to pick them up -- they get generated in the build directory rather than the source directory it seems. any ideas? i've tried constructing and spawning an appropriate cp command line, but it doesn't seem to work (or possibly run) -- i suspect i don't understand ext/ and absolute/relative paths well enough...


@mor1: is that a problem that they are not in the source directory ? i.e. can't the search path be specified ? I'm not up-to-date on what's the other system do, as i don't use annot.


short answer: don't know. best to talk to thomas about that i think -- current beta of typrerex appears to allow a ROOT/.typerex file that can specify where to find .cmt files; but i couldn't get .cmt files it would accept to be generated, whereas with the current stable release, putting .annot file into the source directory definitely does work... (possibly this is a cul de sac and i should just manage manually until the next release of typerex...)


I looked at ocamlspot, it does not work well either when .annot/.cmt are not in the same directory as the sources. There is an ad-hoc hack for ocamlbuild as well as a config file to specify a directory to search, but I did not manage to get that working for now


is there a way to execute a command in ocamlspot that would tell ocamlspot where to look for the annot files ?

for example we could have: obuild get annot:src/ => /path/to/a.annot


Yeah there should be, it is just not working well or not easy to make it work. But there is nothing obuild can do about it for sure :)


Please look if it is correct now.

@vincenthz vincenthz merged commit 11116ca into ocaml-obuild:master

Thanks @vbmithr. For the location, we probably need to sort it out, but i guess it could be a different issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Apr 4, 2013
  1. @vbmithr

    Fixed the annot patch

    vbmithr authored
This page is out of date. Refresh to see the latest.
Showing with 4 additions and 0 deletions.
  1. +3 −0  obuild/
  2. +1 −0  src/
3  obuild/
@@ -18,6 +18,7 @@ let set_lib_bytecode v () = gconf.conf_library_bytecode <- v
let set_exe_native v () = gconf.conf_executable_native <- v
let set_exe_bytecode v () = gconf.conf_executable_bytecode <- v
let set_exe_as_obj v () = gconf.conf_executable_as_obj <- v
+let set_annot v () = gconf.conf_annot <- v
let set_build_examples v () = gconf.conf_build_examples <- v
let set_build_tests v () = gconf.conf_build_tests <- v
@@ -60,6 +61,7 @@ let makeSetup digestKV project = hashtbl_fromList
; ("build-benchs", string_of_bool gconf.conf_build_benchs)
; ("build-tests", string_of_bool gconf.conf_build_tests)
; ("build-examples", string_of_bool gconf.conf_build_examples)
+ ; ("annot", string_of_bool gconf.conf_annot)
@ (fun (flagname,flagval) -> ("flag-" ^ flagname, string_of_bool flagval)) gconf.conf_user_flags
@@ -192,6 +194,7 @@ let check () =
set_build_examples (bool_of_opt "build-examples") ();
set_build_benchs (bool_of_opt "build-benchs") ();
set_build_tests (bool_of_opt "build-tests") ();
+ set_annot (bool_of_opt "annot") ();
let ver = string_split '.' (Hashtbl.find ocamlCfg "version") in
(match ver with
1  src/
@@ -37,6 +37,7 @@ let mainConfigure argv =
let opts =
[ ("--flag", Arg.String userSetFlagSettings, "enable or disable a project's flag")
; ("--executable-as-obj", Arg.Unit (Configure.set_exe_as_obj true), "output executable as obj file")
+ ; ("--annot", Arg.Unit (Configure.set_annot true), "generate .annot files")
Arg.parse_argv (Array.of_list argv)
Something went wrong with that request. Please try again.