Skip to content

Commit

Permalink
Merge pull request #1175 from thatcr/thatcr-fix-anaconda-python
Browse files Browse the repository at this point in the history
Fix cargo test with Anaconda python, and divergent gcc versions.
  • Loading branch information
davidhewitt authored Sep 11, 2020
2 parents 1489ca2 + 118646d commit e3408e8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## [Unreleased]
### Added
- Fix `build.rs` to work with Anaconda python
- Add FFI definitions `Py_FinalizeEx`, `PyOS_getsig`, `PyOS_setsig`. [#1021](https://github.com/PyO3/pyo3/pull/1021)
- Add `Python::with_gil` for executing a closure with the Python GIL. [#1037](https://github.com/PyO3/pyo3/pull/1037)
- Implement `Debug` for `PyIterator`. [#1051](https://github.com/PyO3/pyo3/pull/1051)
Expand Down
8 changes: 7 additions & 1 deletion build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -680,9 +680,15 @@ import platform
import struct
import sys
import sysconfig
import os.path
PYPY = platform.python_implementation() == "PyPy"
# Anaconda based python distributions have a static python executable, but include
# the shared library. Use the shared library for embedding to avoid rust trying to
# LTO the static library (and failing with newer gcc's, because it is old).
ANACONDA = os.path.exists(os.path.join(sys.prefix, 'conda-meta'))
try:
base_prefix = sys.base_prefix
except AttributeError:
Expand All @@ -697,7 +703,7 @@ if libdir is not None:
print("libdir", libdir)
print("ld_version", sysconfig.get_config_var('LDVERSION') or sysconfig.get_config_var('py_version_short'))
print("base_prefix", base_prefix)
print("shared", PYPY or bool(sysconfig.get_config_var('Py_ENABLE_SHARED')))
print("shared", PYPY or ANACONDA or bool(sysconfig.get_config_var('Py_ENABLE_SHARED')))
print("executable", sys.executable)
print("calcsize_pointer", struct.calcsize("P"))
"#;
Expand Down

0 comments on commit e3408e8

Please sign in to comment.