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

Check python and target arcitecture match in build.rs #779

Merged
merged 1 commit into from
Mar 3, 2020

Conversation

davidhewitt
Copy link
Member

Fixes #752

@kngwyu
Copy link
Member

kngwyu commented Mar 3, 2020

Thank you!

@kngwyu kngwyu merged commit 09e36f2 into PyO3:master Mar 3, 2020
@oconnor663
Copy link
Contributor

oconnor663 commented Mar 23, 2020

I'm not sure this is accurate when running 32-bit Python on a 64-bit platform. For example see this run: https://github.com/oconnor663/blake3-py/runs/527998905

That's building with 32-bit Python, on a 64-bit Windows host. When I expand the the " Run python tests/python_info.py" step (which runs this script), I see this output:

{
  "libdir": null,
  "platform": "Windows-10-10.0.17763-SP0",
  "architecture": [
    "32bit",
    "WindowsPE"
  ],
  "version": {
    "implementation": "CPython",
    "minor": 5,
    "major": 3
  },
  "ld_version": "3.5",
  "executable": "C:\\hostedtoolcache\\windows\\Python\\3.5.4\\x86\\python.exe",
  "machine": "AMD64",
  "base_prefix": "C:\\hostedtoolcache\\windows\\Python\\3.5.4\\x86",
  "shared": false,
  "maxsize_bits": 31
}

Specifically, machine is AMD64, but architecture and maxsize_bits indicate 32-bit Python. I think that's causing the build to get confused later. I'll start working on a PR, but please let me know if I'm misunderstanding the intended behavior here.

@davidhewitt
Copy link
Member Author

@oconnor663 it is very possible I misunderstood the literature out there on how to detect the Python architecture correctly. Please do open a PR 🙏

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.

Report error in build.rs when detected python interpreter architecture does not match target architecture
3 participants