Skip to content

ctypes' deps field doesn't follow the dependency specification language #11440

Open
@Khady

Description

Expected Behavior

The documentation of the cytpes feature mentions that there is support for deps, with the usual dependency specification language

https://dune.readthedocs.io/en/stable/foreign-code.html#ctypes-field-reference

Since the Dune’s ctypes feature is still experimental, it could be useful to add additional dependencies in order to make sure that local headers or libraries are available: (deps ). See Dependency Specification for more details.

So I expect to be able to write

 (ctypes
  (external_library_name somelib)
  (build_flags_resolver pkg_config)
  (deps
   (:h "ocaml_bindings.h"))
  (headers
   (preamble "#include \"ocaml_bindings.h\""))
  (type_description
   (instance Type)
   (functor Type_description))
  (function_description
   (concurrency sequential)
   (instance Functions)
   (functor Function_description))
  (generated_types Types_generated)
  (generated_entry_point C))

Actual Behavior

File "backend/cassandra_client/dune", line 14, characters 3-26:
14 |    (:h "ocaml_bindings.h"))
        ^^^^^^^^^^^^^^^^^^^^^^^
Error: Unexpected list

Reproduction

  1. setup a basic project like indicated in https://dune.readthedocs.io/en/stable/foreign-code.html#a-toy-example
  2. create an ocaml_bindings.h file
  3. add (deps (:h "ocaml_bindings.h"))
  4. dune build

Specifications

  • Version of dune (output of dune --version): 3.16.0
  • Version of ocaml (output of ocamlc --version): 4.14
  • Operating system (distribution and version): debian 12

Metadata

Assignees

No one assigned

    Labels

    config-fileEverything related to dune configuration file (workspace, project, dune)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions