Skip to content

Commit e3cc1a4

Browse files
committed
build: configure BAZEL_USE_CPP_ONLY_TOOLCHAIN=1 on macOS to bypass wrapped_clang
1 parent 273b4f2 commit e3cc1a4

4 files changed

Lines changed: 9 additions & 2 deletions

File tree

.bazelrc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@ build --protocopt=--experimental_allow_proto3_optional
2929
build --incompatible_require_linker_input_cc_api=false
3030

3131
build:macos --apple_platform_type=macos
32+
build:macos --repo_env=BAZEL_USE_CPP_ONLY_TOOLCHAIN=1
3233
build:macos_arm64 --cpu=darwin_arm64
34+
build:macos_arm64 --repo_env=BAZEL_USE_CPP_ONLY_TOOLCHAIN=1
3335
build:macos_arm64 --linkopt=-Wl,-undefined,dynamic_lookup
3436
build:macos_arm64 --host_linkopt=-Wl,-undefined,dynamic_lookup
3537
build --conlyopt=-std=c11

.github/workflows/conda-build.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ jobs:
6464
fi
6565
echo "$HOME/.local/bin" >> $GITHUB_PATH
6666
echo "USE_BAZEL_VERSION=7.7.0" >> $GITHUB_ENV
67+
echo "BAZEL_USE_CPP_ONLY_TOOLCHAIN=1" >> $GITHUB_ENV
6768
bazel --version
6869
6970
- name: Install build tooling

.github/workflows/conda-test.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ jobs:
6262
fi
6363
echo "$HOME/.local/bin" >> $GITHUB_PATH
6464
echo "USE_BAZEL_VERSION=7.7.0" >> $GITHUB_ENV
65+
echo "BAZEL_USE_CPP_ONLY_TOOLCHAIN=1" >> $GITHUB_ENV
6566
bazel --version
6667
6768
- name: Build the package

setup.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,13 +99,16 @@ def finalize_options(self):
9999
# This flag determines the platform qualifier of the macos wheel.
100100
if platform.machine() == 'arm64':
101101
self._additional_build_options = ['--macos_minimum_os=11.0',
102-
'--config=macos_arm64']
102+
'--config=macos_arm64',
103+
'--repo_env=BAZEL_USE_CPP_ONLY_TOOLCHAIN=1']
103104
else:
104-
self._additional_build_options = ['--macos_minimum_os=10.14']
105+
self._additional_build_options = ['--macos_minimum_os=10.14',
106+
'--repo_env=BAZEL_USE_CPP_ONLY_TOOLCHAIN=1']
105107

106108
# Remove any overrides from conda environment that break Bazel on macOS
107109
os.environ.pop('APPLE_SDK_VERSION_OVERRIDE', None)
108110
os.environ.pop('XCODE_VERSION_OVERRIDE', None)
111+
os.environ['BAZEL_USE_CPP_ONLY_TOOLCHAIN'] = '1'
109112

110113
if 'ICONV_LIBRARIES' in os.environ:
111114
self._additional_build_options.append(

0 commit comments

Comments
 (0)