You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Original bug ID: 6755 Reporter: dario Status: resolved (set by @damiendoligez on 2017-02-24T12:26:11Z) Resolution: suspended Priority: normal Severity: minor Version: 4.02.1 Target version: later Category: -for ocamlbuild use https://github.com/ocaml/ocamlbuild/issues Monitored by:@gasche@hcarty
Bug description
I wanted to let OCamlbuild know that the module "src/foo.ml" has actually zero dependencies, instead of depending on Foo_a, Foo_b, and Foo_c as determined by OCamldep. I have used the extensionless notation described in the OCamlbuild API, as exemplified below:
let my_dispatcher = function
| After_rules ->
non_dependency "src/foo" "Foo_a";
non_dependency "src/foo" "Foo_b";
non_dependency "src/foo" "Foo_c"
| _ -> ()
This fails with an internal error:
INTERNAL ERROR: Invalid argument non_dependency: no extension
This is likely to be a bug, please report this to the ocamlbuild
developers.
(Replacing "src/foo" with "src/foo.ml" does work, though)
The text was updated successfully, but these errors were encountered:
I just reproduced your issue. I think there is a mistake in the API documentation (signatures.mli) which currently says:
(** [non_dependency module_path module_name]
Example:
[non_dependency "foo/bar/baz" "Goo"]
Says that the module [Baz] in the file [foo/bar/baz.*] does
not depend on [Goo]. *)
val non_dependency : Pathname.t -> string -> unit
while the implementation actually requires the first parameter to be a pathname, rather than a module_path, that is a path to an actual file of the project.
Could you confirm that using "src/foo.ml" instead of "src/foo" in your myocamlbuild.ml fixes the issue? If it works, then I will correct the .mli documentation.
I'll also try to see if there is a reasonable way to lift this restriction, and give a semantics to the module_path version. It seems to me that, morally, considering "src/foo" as a glob pattern for "src/foo.*" and calling non_dependency on all matching files in the projet would be a reasonable choice.
Yes, I mentioned at the end of my initial report, replacing "src/foo" with "src/foo.ml" does work. I think it's okay to categorise this as just a documentation problem. Lifting the restriction would be welcome, but given that there's little burden on using pathname instead of module_path, just fixing the documentation might be the most sensible approach.
Original bug ID: 6755
Reporter: dario
Status: resolved (set by @damiendoligez on 2017-02-24T12:26:11Z)
Resolution: suspended
Priority: normal
Severity: minor
Version: 4.02.1
Target version: later
Category: -for ocamlbuild use https://github.com/ocaml/ocamlbuild/issues
Monitored by: @gasche @hcarty
Bug description
I wanted to let OCamlbuild know that the module "src/foo.ml" has actually zero dependencies, instead of depending on Foo_a, Foo_b, and Foo_c as determined by OCamldep. I have used the extensionless notation described in the OCamlbuild API, as exemplified below:
let my_dispatcher = function
| After_rules ->
non_dependency "src/foo" "Foo_a";
non_dependency "src/foo" "Foo_b";
non_dependency "src/foo" "Foo_c"
| _ -> ()
This fails with an internal error:
INTERNAL ERROR: Invalid argument non_dependency: no extension
This is likely to be a bug, please report this to the ocamlbuild
developers.
(Replacing "src/foo" with "src/foo.ml" does work, though)
The text was updated successfully, but these errors were encountered: