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

ocamlbuild should pass -I to ocamldoc for external libraries #4896

Closed
vicuna opened this issue Oct 16, 2009 · 2 comments
Closed

ocamlbuild should pass -I to ocamldoc for external libraries #4896

vicuna opened this issue Oct 16, 2009 · 2 comments

Comments

@vicuna
Copy link

vicuna commented Oct 16, 2009

Original bug ID: 4896
Reporter: @ygrek
Assigned to: ertai
Status: closed (set by @xavierleroy on 2011-05-29T10:20:05Z)
Resolution: fixed
Priority: normal
Severity: minor
Version: 3.11.1
Fixed in version: 3.11.2+dev
Category: -for ocamlbuild use https://github.com/ocaml/ocamlbuild/issues

Bug description

Looks like ocamlbuild doesn't pass include directories to ocamldoc when building documentation referencing external libraries.

Workaround -- add the -I flag manually :
flag ["ocaml"; "doc"; "use_extLib"] (S[A"-I"; A "+extlib"]);

Additional information

$ cat q.ml
let f () = Enum.empty ()

$ cat q.odocl
Q

$ cat _tags
true: use_extLib

$ cat myocamlbuild.ml
open Ocamlbuild_plugin

;;

dispatch begin function
| After_rules ->

 ocaml_lib ~extern:true ~dir:"+extlib" "extLib";

(* flag ["ocaml"; "doc"; "use_extLib"] (S[A"-I"; A "+extlib"]); *)

| _ -> ()
end

$ ocamlbuild -classic-display q.byte
/usr/bin/ocamlopt.opt -I /usr/lib/ocaml/ocamlbuild unix.cmxa /usr/lib/ocaml/ocamlbuild/ocamlbuildlib.cmxa myocamlbuild.ml /usr/lib/ocaml/ocamlbuild/ocamlbuild.cmx -o myocamlbuild
/usr/bin/ocamldep.opt -modules q.ml > q.ml.depends
/usr/bin/ocamlc.opt -c -I +extlib -o q.cmo q.ml
/usr/bin/ocamlc.opt -I +extlib extLib.cma q.cmo -o q.byte

$ ocamlbuild -classic-display q.docdir/index.html
/usr/bin/ocamldoc.opt -dump q.odoc q.ml

  • /usr/bin/ocamldoc.opt -dump q.odoc q.ml
    File "q.ml", line 2, characters 11-21:
    Error: Unbound value Enum.empty
    1 error(s) encountered
    Command exited with code 1.

File attachments

@vicuna
Copy link
Author

vicuna commented Nov 3, 2009

Comment author: @ygrek

The same goes for "*.inferred.mli"
Manual fix :
flag ["ocaml"; "infer_interface"; "use_extLib"] (S[A"-I"; A "+extlib"]);

@vicuna
Copy link
Author

vicuna commented Nov 3, 2009

Comment author: @ygrek

Straightforward fix attached

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

1 participant