[CI] Fix JVM tests on GH Action (#10064)

---------

Co-authored-by: Hyunsu Cho <chohyu01@cs.washington.edu>
This commit is contained in:
Jiaming Yuan
2024-02-23 06:21:32 +08:00
committed by GitHub
parent b9171d8f0b
commit eb281ff9b4
3 changed files with 69 additions and 47 deletions

View File

@@ -32,7 +32,10 @@ def build_libxgboost(
build_dir: pathlib.Path,
build_config: BuildConfiguration,
) -> pathlib.Path:
"""Build libxgboost in a temporary directory and obtain the path to built libxgboost"""
"""Build libxgboost in a temporary directory and obtain the path to built
libxgboost.
"""
logger = logging.getLogger("xgboost.packager.build_libxgboost")
if not cpp_src_dir.is_dir():
@@ -51,8 +54,8 @@ def build_libxgboost(
cmake_cmd.extend(build_config.get_cmake_args())
# Flag for cross-compiling for Apple Silicon
# We use environment variable because it's the only way to pass down custom flags
# through the cibuildwheel package, which calls `pip wheel` command.
# We use environment variable because it's the only way to pass down custom
# flags through the cibuildwheel package, which calls `pip wheel` command.
if "CIBW_TARGET_OSX_ARM64" in os.environ:
cmake_cmd.append("-DCMAKE_OSX_ARCHITECTURES=arm64")