Skip to content

fix: give extism_log_drain's param a named type#638

Merged
chrisdickinson merged 1 commit intomainfrom
chris/20231215-test-windows-fn-ptr
Dec 15, 2023
Merged

fix: give extism_log_drain's param a named type#638
chrisdickinson merged 1 commit intomainfrom
chris/20231215-test-windows-fn-ptr

Conversation

@chrisdickinson
Copy link
Copy Markdown
Contributor

This fixes a test failure on the python-sdk 1. (See also 2). In particular, while maturin creates bindings for extism_log_drain on clang platforms, it seems that MSVC cannot generate the required binding information for ffi.py. This results in an extism_sys wheel whose shared object (in this case, a DLL) contains the extism_log_drain, but whose Python FFI bindings don't contain a definition for that function.

Naming the function pointer type parameter resolves the issue. What a strange issue!

This fixes a test failure on the python-sdk [1]. (See also [2]). In particular,
while maturin creates bindings for `extism_log_drain` on clang platforms, it
seems that MSVC cannot generate the required binding information for `ffi.py`.
This results in an `extism_sys` wheel whose shared object (in this case, a DLL)
contains the `extism_log_drain`, but whose Python FFI bindings don't contain a
definition for that function.

Naming the function pointer type parameter resolves the issue.

[1]: https://github.com/extism/python-sdk/actions/runs/7172934060/job/19669775001#step:9:35
[2]: extism/python-sdk#18 (comment)
@chrisdickinson chrisdickinson force-pushed the chris/20231215-test-windows-fn-ptr branch from 2bff168 to 60bcf43 Compare December 15, 2023 23:18
Copy link
Copy Markdown
Contributor

@zshipko zshipko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Definitely a strange one!

@chrisdickinson chrisdickinson merged commit 212e28b into main Dec 15, 2023
@chrisdickinson chrisdickinson deleted the chris/20231215-test-windows-fn-ptr branch December 15, 2023 23:40
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.

2 participants