Skip to content

[WIP] Fix cross-version: ABI tag-based precompilation cache directory #172

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 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ matrix:
os: linux
- language: python
python: 3.5
env: JULIA_VERSION=juliareleases
env:
- JULIA_VERSION=juliareleases
- CROSS_VERSION=1
os: linux
- language: python
python: 3.5
Expand Down Expand Up @@ -65,7 +67,6 @@ before_script:
- which ${PYTHON:-python}
script:
- julia -e 'Pkg.add("PyCall")'
- julia -e 'Pkg.checkout("PyCall"); Pkg.build("PyCall")'
- /usr/bin/python --version
- PYTHON=${PYTHON:-python}
- echo $PYTHON
Expand Down
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ build_script:
# - C:\projects\julia\bin\julia -e "versioninfo(); Pkg.add(\"PyCall\"); Pkg.init(); Pkg.resolve()"
# - C:\projects\julia\bin\julia -e "using PyCall; @assert isdefined(:PyCall); @assert typeof(PyCall) === Module"
- "SET PYTHON=%PYTHONDIR%\\python.exe"
- C:\projects\julia\bin\julia -e "versioninfo(); Pkg.add(\"PyCall\"); Pkg.checkout(\"PyCall\"); Pkg.build(\"PyCall\")"
- C:\projects\julia\bin\julia -e "versioninfo(); Pkg.add(\"PyCall\")"

test_script:
- "SET PATH=%PYTHONDIR%;%PYTHONDIR%\\Scripts;C:\\projects\\julia\\bin;%PATH%"
Expand Down
7 changes: 5 additions & 2 deletions julia/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
# this is python 3.3 specific
from types import ModuleType, FunctionType

from setuptools.pep425tags import get_abi_tag
Copy link
Member Author

Choose a reason for hiding this comment

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

This is not a good idea since this function is not setuptools's API. We should probably copy their function https://github.com/pypa/setuptools/blob/e0433cf32dfdf39c0c14a3740c3920c496f09486/setuptools/pep425tags.py#L81 if we want to use ABI tag. Alternatively, we can drop Python 2 support. In that case sysconfig.get_config_var('SOABI') would work (https://www.python.org/dev/peps/pep-3149/). Of course, if we don't need ABI, then we can just use sys.version_info.

Copy link
Member Author

Choose a reason for hiding this comment

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

...and it fails in Windows because they don't have setuptools by default? https://ci.appveyor.com/project/Keno/pyjulia/build/1.0.98/job/kh23o578ngvjkysy#L89


#-----------------------------------------------------------------------------
# Classes and funtions
#-----------------------------------------------------------------------------
Expand Down Expand Up @@ -356,8 +358,9 @@ def __init__(self, init_julia=True, jl_runtime_path=None, jl_init_path=None,
os.environ["PYCALL_LIBJULIA_PATH"] = os.path.dirname(libjulia_path)
# Add a private cache directory. PyCall needs a different
# configuration and so do any packages that depend on it.
self._call(u"unshift!(Base.LOAD_CACHE_PATH, abspath(Pkg.Dir._pkgroot()," +
"\"lib\", \"pyjulia%s-v$(VERSION.major).$(VERSION.minor)\"))" % sys.version_info[0])
self._call(u"unshift!(Base.LOAD_CACHE_PATH, abspath(Pkg.Dir._pkgroot(),"
"\"lib\", \"pyjulia.{}-v$(VERSION.major).$(VERSION.minor)\"))"
.format(get_abi_tag()))
# If PyCall.ji does not exist, create an empty file to force
# recompilation
self._call(u"""
Expand Down