Skip to content

Don't check target architecture if cross-compiling #1361

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

Closed
wants to merge 1 commit into from
Closed

Don't check target architecture if cross-compiling #1361

wants to merge 1 commit into from

Conversation

dalcde
Copy link
Contributor

@dalcde dalcde commented Jan 5, 2021

Part of the point of cross-compiling is to be able to compile to other architectures.

This is needed in order to compile to wasm32-unknown-unknown: see #1221

Part of the point of cross-compiling is to be able to compile to other
architectures.
@davidhewitt
Copy link
Member

I'm wary of this... The purpose of check_target_architecture is to give a friendly error message at build time if the Rust target doesn't match what PyO3 has detected from the config.

If it's wrong for you, this could mean that the library you're getting build configuration from thinks the pointer size is 64-bit?

If your build configuration really is correct, I think rather than disable this check for all cross compiles I'd rather have an environment variable PYO3_ALLOW_INCORRECT_ARCHITECTURE (or a better name if you can think of one). So that in cases like this, users who know what they're doing can proceed anyway.

@davidhewitt
Copy link
Member

... maybe PYO3_SKIP_TARGET_CHECK is a better name for the environment variable.

@dalcde dalcde closed this Jan 6, 2021
@dalcde
Copy link
Contributor Author

dalcde commented Jan 6, 2021 via email

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