Skip to content

fix(ctypes): mismatch between modules field and ctypes stanza#12124

Merged
Alizter merged 2 commits intoocaml:mainfrom
Alizter:gh12018
Aug 11, 2025
Merged

fix(ctypes): mismatch between modules field and ctypes stanza#12124
Alizter merged 2 commits intoocaml:mainfrom
Alizter:gh12018

Conversation

@Alizter
Copy link
Copy Markdown
Collaborator

@Alizter Alizter commented Aug 4, 2025

When the ctypes stanza asks for some modules, but these are not included
in the modules field, we get a code error later during linking.

We fix this issue by checking for the required modules beforehand and raising a user error if they are missing.

I'm not sure if we need to do something similar for any other generated modules.

Comment thread src/dune_rules/buildable_rules.ml
Comment thread test/blackbox-tests/test-cases/ctypes/gh12018.t
Comment thread src/dune_rules/buildable_rules.ml
Comment thread src/dune_rules/buildable_rules.ml Outdated
@Alizter Alizter force-pushed the gh12018 branch 4 times, most recently from 00eb0dc to 4cff68e Compare August 11, 2025 08:22
When the ctypes stanza asks for some modules, but these are not included
in the modules field, we get a code error later during linking. Ideally,
these should be caught earlier on and a nice error message presented.

Signed-off-by: Ali Caglayan <alizter@gmail.com>
Signed-off-by: Ali Caglayan <alizter@gmail.com>
@Alizter Alizter merged commit 620a450 into ocaml:main Aug 11, 2025
7 of 8 checks passed
@Alizter Alizter deleted the gh12018 branch August 11, 2025 13:48
Alizter added a commit that referenced this pull request Jan 2, 2026
…3123)

This reverts commit 87faddc from
#12124.

The validation introduced in #12124 is
incorrect as explained in #13001.
Reproduction case is here #13000. I
will merge these separately so it is easier to backport.

This PR reverts the PR that introduced the incorrect validation.

- #12124
- #13001
- #13000
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.

crash when using ctypes stanza

2 participants