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

Auto generate Windows import libraries when using a pyo3 config file #2372

Merged
merged 2 commits into from May 14, 2022

Conversation

messense
Copy link
Member

Currently the build script of pyo3-ffi calls pyo3-build-config's resolve_interpreter_config function

pyo3/pyo3-ffi/build.rs

Lines 79 to 80 in 87bd10c

fn configure_pyo3() -> Result<()> {
let interpreter_config = resolve_interpreter_config()?;

when PYO3_CONFIG_FILE env var is set, it simply read the file using InterpreterConfig::from_reader which missed the "generate import library" setup thus no python3.dll/python3y.dll is generated causing linking errors

if !CONFIG_FILE.is_empty() {
InterpreterConfig::from_reader(Cursor::new(CONFIG_FILE))

@messense
Copy link
Member Author

cc @ravenexp

Copy link
Contributor

@ravenexp ravenexp left a comment

Choose a reason for hiding this comment

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

LGTM in general, but I'd fix up lib_name either way.

pyo3-build-config/src/impl_.rs Outdated Show resolved Hide resolved
pyo3-build-config/src/impl_.rs Show resolved Hide resolved
@messense messense force-pushed the interpreter-config-import-lib branch from 88aae26 to ded0d9f Compare May 14, 2022 12:45
Copy link
Contributor

@ravenexp ravenexp left a comment

Choose a reason for hiding this comment

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

Looks good, thanks!

Copy link
Member

@davidhewitt davidhewitt left a comment

Choose a reason for hiding this comment

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

👍

@davidhewitt davidhewitt merged commit a8b74a7 into PyO3:main May 14, 2022
@messense messense mentioned this pull request May 15, 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.

None yet

3 participants