Skip to content
Permalink
Browse files

Install OpenSSL on OSX UCS4 shard

The shard was failing when trying to build cryptography from an sdist because it could not find openssl. So, we now explicitly install it with Brew and modify the env vars to expose it. This is identical to how we install Py3 on OSX.
  • Loading branch information...
Eric-Arellano committed Feb 17, 2019
1 parent e87f567 commit 170e9c8bd7ddc252afdcd390563484226bc749ea
@@ -172,9 +172,7 @@ py36_osx_config: &py36_osx_config
env:
# Fix Python 3 issue linking to OpenSSL
- &py36_osx_config_env >
PATH="/usr/local/opt/openssl/bin:$PATH"
LDFLAGS="-L/usr/local/opt/openssl/lib"
CPPFLAGS="-I/usr/local/opt/openssl/include"
PATH="/usr/local/opt/openssl/bin:$PATH" LDFLAGS="-L/usr/local/opt/openssl/lib" CPPFLAGS="-I/usr/local/opt/openssl/include"
PYENV_ROOT="${HOME}/.pyenv"
PATH="${PYENV_ROOT}/shims:${PATH}"
before_install:
@@ -208,9 +206,7 @@ py36_osx_test_config: &py36_osx_test_config
env:
# Must duplicate py36_osx_config's env because it cannot be merged into a new anchor
- &py36_osx_test_config_env >
PATH="/usr/local/opt/openssl/bin:$PATH"
LDFLAGS="-L/usr/local/opt/openssl/lib"
CPPFLAGS="-I/usr/local/opt/openssl/include"
PATH="/usr/local/opt/openssl/bin:$PATH" LDFLAGS="-L/usr/local/opt/openssl/lib" CPPFLAGS="-I/usr/local/opt/openssl/include"
PYENV_ROOT="${HOME}/.pyenv"
PATH="${PYENV_ROOT}/shims:${PATH}"
BOOTSTRAPPED_PEX_KEY_SUFFIX=py36.osx
@@ -453,10 +449,16 @@ py27_osx_build_wheels_ucs2: &py27_osx_build_wheels_ucs2
py27_osx_build_wheels_ucs4: &py27_osx_build_wheels_ucs4
<<: *py27_osx_build_wheels_no_ucs
name: "Build OSX wheels (Py27 and UCS4 pantsbuild.pants)"
addons:
brew:
packages:
- openssl
env:
- *py27_osx_test_config_env
- *base_build_wheels_env
- CACHE_NAME=osxwheelsbuild.ucs4
- PATH="/usr/local/opt/openssl/bin:$PATH" LDFLAGS="-L/usr/local/opt/openssl/lib" CPPFLAGS="-I/usr/local/opt/openssl/include"

- PYTHON_CONFIGURE_OPTS=--enable-unicode=ucs4
- PYENV_ROOT="${HOME}/.pyenv"
- PATH="${PYENV_ROOT}/shims:${PATH}"
@@ -25,12 +25,14 @@

def generate_travis_yml():
"""Generates content for a .travis.yml file from templates."""
template = pkg_resources.resource_string(
__name__, 'travis.yml.mustache').decode('utf-8')
before_install_linux = pkg_resources.resource_string(
__name__, 'before_install_linux.mustache').decode('utf-8')
before_install_osx = pkg_resources.resource_string(
__name__, 'before_install_osx.mustache').decode('utf-8')
def get_mustache_file(file_name):
return pkg_resources.resource_string(__name__, file_name).decode('utf-8')

template = get_mustache_file('travis.yml.mustache')
before_install_linux = get_mustache_file('before_install_linux.mustache')
before_install_osx = get_mustache_file('before_install_osx.mustache')
osx_openssl_env = get_mustache_file('osx_openssl_env.mustache')

context = {
'header': HEADER,
'py3_integration_shards': range(0, num_py3_integration_shards),
@@ -42,6 +44,7 @@ def generate_travis_yml():
}
renderer = pystache.Renderer(partials={
'before_install_linux': before_install_linux,
'before_install_osx': before_install_osx
'before_install_osx': before_install_osx,
'osx_openssl_env': osx_openssl_env
})
print(renderer.render(template, context))
@@ -0,0 +1 @@
PATH="/usr/local/opt/openssl/bin:$PATH" LDFLAGS="-L/usr/local/opt/openssl/lib" CPPFLAGS="-I/usr/local/opt/openssl/include"
@@ -158,9 +158,7 @@ py36_osx_config: &py36_osx_config
env:
# Fix Python 3 issue linking to OpenSSL
- &py36_osx_config_env >
PATH="/usr/local/opt/openssl/bin:$PATH"
LDFLAGS="-L/usr/local/opt/openssl/lib"
CPPFLAGS="-I/usr/local/opt/openssl/include"
{{>osx_openssl_env}}
PYENV_ROOT="${HOME}/.pyenv"
PATH="${PYENV_ROOT}/shims:${PATH}"
before_install:
@@ -192,9 +190,7 @@ py36_osx_test_config: &py36_osx_test_config
env:
# Must duplicate py36_osx_config's env because it cannot be merged into a new anchor
- &py36_osx_test_config_env >
PATH="/usr/local/opt/openssl/bin:$PATH"
LDFLAGS="-L/usr/local/opt/openssl/lib"
CPPFLAGS="-I/usr/local/opt/openssl/include"
{{>osx_openssl_env}}
PYENV_ROOT="${HOME}/.pyenv"
PATH="${PYENV_ROOT}/shims:${PATH}"
BOOTSTRAPPED_PEX_KEY_SUFFIX=py36.osx
@@ -432,10 +428,15 @@ py27_osx_build_wheels_ucs2: &py27_osx_build_wheels_ucs2
py27_osx_build_wheels_ucs4: &py27_osx_build_wheels_ucs4
<<: *py27_osx_build_wheels_no_ucs
name: "Build OSX wheels (Py27 and UCS4 pantsbuild.pants)"
addons:
brew:
packages:
- openssl
env:
- *py27_osx_test_config_env
- *base_build_wheels_env
- CACHE_NAME=osxwheelsbuild.ucs4
- {{>osx_openssl_env}}
- PYTHON_CONFIGURE_OPTS=--enable-unicode=ucs4
- PYENV_ROOT="${HOME}/.pyenv"
- PATH="${PYENV_ROOT}/shims:${PATH}"

0 comments on commit 170e9c8

Please sign in to comment.
You can’t perform that action at this time.