Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor and add zig dlltool support #18

Merged
merged 9 commits into from
May 16, 2022
Merged

Conversation

ravenexp
Copy link
Collaborator

Rewrite the dlltool flavor selection and invocation code.

Add two private helper methods `write_def_file()`
and `implib_file_name()`.

Expand the docstrings on some public items.
Convert `build_dlltool_command()` megamethod into a new builder type
using two-stage construction.

Implement preliminary support for `zig dlltool` using the new
`DllToolCommand` capabilities.
Maturin sets `ZIG_COMMAND` environment variable when it
is using `zig cc` to link the output binary.
The import library file extension is determined by the linker flavor,
not the target environment per se.

`zig cc` uses `lld` even when targeting `x86_64-windows-gnu`,
so the import library should get the standard `.lib` extension.

The `.dll.a` libraries are only understood by the MinGW (GNU) `ld`.
Test the new `zig dlltool` command functionality.

Update unit tests to use the new builder API.
Copy link
Member

@messense messense left a comment

Choose a reason for hiding this comment

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

LGTM

Add doctests for `ImportLibraryGenerator`.
It appears to use temporary object files which collide even
when the output file paths are different.
@ravenexp ravenexp marked this pull request as ready for review May 16, 2022 13:31
@ravenexp ravenexp changed the title WIP: Refactor and add zig dlltool support Refactor and add zig dlltool support May 16, 2022
@ravenexp ravenexp requested a review from messense May 16, 2022 13:33
@ravenexp
Copy link
Collaborator Author

I think it's ready to merge now.

@messense messense merged commit b350bba into PyO3:main May 16, 2022
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