Commit 3a0c6ef9 authored by André Anjos's avatar André Anjos

[init] Address review requests

parent 66adf361
Pipeline #29635 passed with stage
in 11 minutes and 26 seconds
......@@ -413,34 +413,37 @@ class Extension(DistutilsExtension):
target = os.environ.get('MACOSX_DEPLOYMENT_TARGET')
if target is None: #not set on the environment, try resource
target = rc.get('bob.extension.macosx_deployment_target')
target = rc['bob.extension.macosx_deployment_target']
if target is None or not target:
raise EnvironmentError('${MACOSX_DEPLOYMENT_TARGET} environment ' \
'variable is **NOT** set - To avoid this error, either set ' \
'${MACOSX_DEPLOYMENT_TARGET} or Bob\'s resource ' \
'"bob.extension.macosx_deployment_target" to a suitable ' \
'value (e.g. "10.9") before trying to build C/C++ extensions')
'value (e.g. ' \
'"bob config set bob.extension.macosx_deployment_target 10.9") ' \
'before trying to build C/C++ extensions')
os.environ.setdefault('MACOSX_DEPLOYMENT_TARGET', target)
sdkroot = os.environ.get('SDKROOT', os.environ.get('CONDA_BUILD_SYSROOT'))
if sdkroot is None: #not set on the environment, try resource
sdkroot = rc.get('bob.extension.macosx_sdkroot')
sdkroot = rc['bob.extension.macosx_sdkroot']
if sdkroot is None or not sdkroot:
raise EnvironmentError('${SDKROOT} environment variable is **NOT** ' \
'set - To avoid this error, either set ${SDKROOT} or Bob\'s ' \
'resource "bob.extension.macosx_sdkroot" to a suitable value ' \
'(e.g. "/opt/MacOSX10.9.sdk") before trying to build C/C++ ' \
'extensions')
'(e.g. "bob config ' \
'set bob.extension.macosx_sdkroot /opt/MacOSX10.9.sdk")' \
'before trying to build C/C++ extensions')
# test for the compatibility between deployment target and sdk root
sdkversion = os.path.basename(sdkroot)[6:-4]
if sdkversion != target:
raise EnvironmentError('There is an inconsistence between the value ' \
logger.warn('There is an inconsistence between the value ' \
'set for ${MACOSX_DEPLOYMENT_TARGET} (%s) and ' \
'${SDKROOT}/${CONDA_BUILD_SYSROOT} (%s) - Fix it by properly ' \
'setting up these environment variables via Bob\'s ' \
'configuration (refer to bob.extension\'s user guide for ' \
'detailed instructions)' % (target, sdkroot))
'detailed instructions)', target, sdkroot)
os.environ.setdefault('SDKROOT', sdkroot)
......
......@@ -151,7 +151,7 @@ just do:
MACOSX_DEPLOYMENT_TARGET and SDKROOT are properly set. This is
automatically handled for conda-build based runs. If you are using
buildout or any other setuptools-based system (such as pip installs) to
build your package, you should ensure that is the case with one of these 3
build your package, you should ensure that is the case with one of these 2
methods (more to least recommended):
1. You set the RC variables (see: :ref:`bob.extension.rc`)
......@@ -173,32 +173,7 @@ just do:
affect builds in other machines and are preserved across package builds,
guaranteeing uniformity.
2. You set buildout environment variables MACOSX_DEPLOYMENT_TARGET and
SDKROOT directly on your buildout configuration file. Example:
.. code-block:: ini
[buildout]
parts = scripts
develop = .
eggs = <PACKAGE>
extensions = bob.buildout
newest = false
verbose = true
default = true
[environ]
MACOSX_DEPLOYMENT_TARGET = '10.9'
SDKROOT = '/opt/MacOSX10.9.sdk'
Please refer to bob.buildout's user guide for more details.
With this method you affect **only** the current package and risk not
having uniform builds across different packages. You also run on the
risk to commit/push changes back to the original package, which may
affect builds in other machines.
3. You set the environment variables directly on the current environment.
2. You set the environment variables directly on the current environment.
Example:
.. code-block:: sh
......@@ -211,8 +186,7 @@ just do:
will not be available anymore.
**Precedence**: Values set on the environment have precedence over values
set on your Bob RC configuration. Values setup on your buildout
configuration file override the environment variables.
set on your Bob RC configuration.
**Compatibility**: We recommend you check our stock
`conda_build_config.yaml` for ensuring cross-package compatibility
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment