Skip to content

Depend on the generated header from the ctypes stanza - #15

Open
shonfeder wants to merge 1 commit into
ocaml-multicore:mainfrom
shonfeder:declare-ctypes-header-deps-dune-3.25
Open

shonfeder wants to merge 1 commit into
ocaml-multicore:mainfrom
shonfeder:declare-ctypes-header-deps-dune-3.25

Conversation

@shonfeder

Copy link
Copy Markdown

Since dune 3.25 (ocaml/dune#16223, release in progress) the ctypes stub
generation runs in a sandbox and only sees the dependencies declared in the
ctypes field. hdr_histogram.h is produced by the cmake rule in lib/dune
rather than being a source file, so building with dune 3.25.0~alpha0 fails at
the type probe:

hdr_histogram__c_cout_generated_types.c:1:10: fatal error: hdr_histogram.h: No such file or directory

This adds the required (deps hdr_histogram.h) to the stanza.

The requirement for this dependency specification is documented at
https://dune.readthedocs.io/en/stable/foreign-code.html#stub-generation-with-dune-ctypes

Additionally, you must list any C headers and a method for resolving build and link flags.

Diagnosed by @Alizter in ocaml/dune#16834 .

Since dune 3.25 the ctypes stub generation runs in a sandbox that only
contains the dependencies the stanza declares, and hdr_histogram.h is a
target of the cmake rule rather than a source file, so the type probe
no longer finds it:

    fatal error: hdr_histogram.h: No such file or directory

More context can be found at ocaml/dune#16834

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant