@@ -29,6 +29,19 @@ if [[ $IN_UBUNTU_BASE_CONTAINER == "true" ]]; then
29
29
export LC_ALL=" en_US.UTF-8"
30
30
fi
31
31
32
+ # Setting MACOSX_DEPLOYMENT_TARGET prevents CMake from building against too-new
33
+ # macOS features, and helps tools like Python build tools determine the appropriate
34
+ # wheel compatibility tags.
35
+ #
36
+ # ref:
37
+ # * https://cmake.org/cmake/help/latest/envvar/MACOSX_DEPLOYMENT_TARGET.html
38
+ # * https://github.com/scikit-build/scikit-build-core/blob/acb7d0346e4a05bcb47a4ea3939c705ab71e3145/src/scikit_build_core/builder/macos.py#L36
39
+ if [[ $ARCH == " x86_64" ]]; then
40
+ export MACOSX_DEPLOYMENT_TARGET=10.15
41
+ else
42
+ export MACOSX_DEPLOYMENT_TARGET=12.0
43
+ fi
44
+
32
45
if [[ " ${TASK} " == " r-package" ]] || [[ " ${TASK} " == " r-rchk" ]]; then
33
46
bash ${BUILD_DIRECTORY} /.ci/test_r_package.sh || exit 1
34
47
exit 0
@@ -168,17 +181,6 @@ elif [[ $TASK == "bdist" ]]; then
168
181
if [[ $OS_NAME == " macos" ]]; then
169
182
cd $BUILD_DIRECTORY && sh ./build-python.sh bdist_wheel || exit 1
170
183
sh $BUILD_DIRECTORY /.ci/check_python_dists.sh $BUILD_DIRECTORY /dist || exit 1
171
- mv \
172
- ./dist/* .whl \
173
- ./dist/tmp.whl || exit 1
174
- if [[ $ARCH == " x86_64" ]]; then
175
- PLATFORM=" macosx_10_15_x86_64.macosx_11_6_x86_64.macosx_12_5_x86_64"
176
- else
177
- PLATFORM=" macosx_14_0_arm64"
178
- fi
179
- mv \
180
- ./dist/tmp.whl \
181
- dist/lightgbm-$LGB_VER -py3-none-$PLATFORM .whl || exit 1
182
184
if [[ $PRODUCES_ARTIFACTS == " true" ]]; then
183
185
cp dist/lightgbm-$LGB_VER -py3-none-macosx* .whl $BUILD_ARTIFACTSTAGINGDIRECTORY || exit 1
184
186
fi
0 commit comments