Do not write TF_CONFIGURE_IOS to .bazelrc, only use it in ./configure.py.

PiperOrigin-RevId: 363484115
Change-Id: I5fd6186f19d1612ef9fe85a088aa7a72dc45d26d
This commit is contained in:
Christian Sigg 2021-03-17 12:45:10 -07:00 committed by TensorFlower Gardener
parent 0d6848cf23
commit dd372ec5e1
3 changed files with 8 additions and 19 deletions

View File

@ -542,7 +542,6 @@ try-import %workspace%/.bazelrc.user
# Here are bazelrc configs for release builds
build:release_base --config=v2
build:release_base --distinct_host_configuration=false
build:release_base --action_env TF_CONFIGURE_IOS="0"
build:release_cpu_linux --config=release_base
build:release_cpu_linux --config=avx_linux

View File

@ -1201,13 +1201,12 @@ def config_info_line(name, help_text):
print('\t--config=%-12s\t# %s' % (name, help_text))
def configure_ios():
"""Configures TensorFlow for iOS builds.
This function will only be executed if `is_macos()` is true.
"""
def configure_ios(environ_cp):
"""Configures TensorFlow for iOS builds."""
if not is_macos():
return
if not get_var(environ_cp, 'TF_CONFIGURE_IOS', 'iOS', False):
return
for filepath in APPLE_BAZEL_FILES:
existing_filepath = os.path.join(_TF_WORKSPACE_ROOT, filepath + '.apple')
renamed_filepath = os.path.join(_TF_WORKSPACE_ROOT, filepath)
@ -1326,8 +1325,6 @@ def main():
if is_macos():
environ_cp['TF_NEED_TENSORRT'] = '0'
else:
environ_cp['TF_CONFIGURE_IOS'] = '0'
with_xla_support = environ_cp.get('TF_ENABLE_XLA', None)
if with_xla_support is not None:
@ -1451,9 +1448,7 @@ def main():
system_specific_test_config(environ_cp)
set_action_env_var(environ_cp, 'TF_CONFIGURE_IOS', 'iOS', False)
if environ_cp.get('TF_CONFIGURE_IOS') == '1':
configure_ios()
configure_ios(environ_cp)
print('Preconfigured Bazel build configs. You can use any of the below by '
'adding "--config=<>" to your build command. See .bazelrc for more '

View File

@ -161,15 +161,10 @@ if ! grep -q "3.4.0" ".bazelversion"; then
echo "3.4.0" > .bazelversion
fi
# Check if users already run configure
if [ ! -f "$ROOT_DIR/.tf_configure.bazelrc" ]; then
echo "ERROR: Please run ./configure first."
# Check if users ran configure with iOS enabled.
if [ ! -f "$ROOT_DIR/TensorFlowLiteObjC.podspec" ]; then
echo "ERROR: Please run ./configure with iOS config."
exit 1
else
if ! grep -q "TF_CONFIGURE_IOS=\"1\"" "$ROOT_DIR/.tf_configure.bazelrc"; then
echo "ERROR: Please run ./configure with iOS config."
exit 1
fi
fi
# Prepare the tmp directory.