Skip to content

Commit

Permalink
Fix mac build error (#16)
Browse files Browse the repository at this point in the history
* repo-sync-2024-10-11T15:57:26+0800

* fix mac build error
  • Loading branch information
SuperMarz authored Jan 14, 2025
1 parent e960265 commit d687b82
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 7 deletions.
13 changes: 8 additions & 5 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,13 @@ build:linux --action_env=BAZEL_LINKLIBS=-l%:libstdc++.a:-l%:libgcc.a

# platform specific config
# Bazel will automatic pick platform config since we have enable_platform_specific_config set
build:linux --copt=-fopenmp
build:linux --linkopt=-fopenmp
build:macos --copt="-Xpreprocessor -fopenmp"
build:macos --copt=-Xclang=-fopenmp
build:macos --copt=-Wno-unused-command-line-argument
build:macos --features=-supports_dynamic_linker
build:macos --macos_minimum_os=12.0
build:macos --host_macos_minimum_os=12.0
build:macos --macos_minimum_os=13.0
build:macos --host_macos_minimum_os=13.0
build:macos --action_env MACOSX_DEPLOYMENT_TARGET=13.0

build:linux --copt=-fopenmp
build:linux --linkopt=-fopenmp

2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,5 +76,5 @@ workflows:
.circleci/continue-config.yml sdk-build-and-run true
dataproxy_sdk/.* sdk-build-and-run true
.bazelrc sdk-build-and-run true
WORKSPACE sdk-build-and-run true
MODULE.bazel sdk-build-and-run true
- lint
3 changes: 2 additions & 1 deletion MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,14 @@ pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip")
pip.parse(
hub_name = "dataproxy_sdk_pip",
python_version = python_version,
requirements_linux = "//dataproxy_sdk/python:requirements_lock_{}.txt".format(python_version.replace(".", "_")),
requirements_lock = "//dataproxy_sdk/python:requirements_lock_{}.txt".format(python_version.replace(".", "_")),
)
for python_version in SUPPORTED_PYTHON_VERSIONS
]

use_repo(pip, "dataproxy_sdk_pip")

bazel_dep(name = "apple_support", version = "1.17.1")
bazel_dep(name = "arrow", version = "14.0.2")
bazel_dep(name = "rules_foreign_cc", version = "0.13.0")
bazel_dep(name = "spdlog", version = "1.14.1")
Expand Down
18 changes: 18 additions & 0 deletions dataproxy_sdk/python/test/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,28 @@ load("@rules_python//python:defs.bzl", "py_library", "py_test")

package(default_visibility = ["//visibility:public"])

exports_files(
[
"exported_symbols.lds",
"version_script.lds",
],
visibility = ["//visibility:private"],
)

pybind_extension(
name = "_dm_mock",
srcs = ["_dm_mock.cc"],
linkopts = select({
"@bazel_tools//src/conditions:darwin": [
"-Wl,-exported_symbols_list,$(location :exported_symbols.lds)",
],
"//conditions:default": [
"-Wl,--version-script,$(location :version_script.lds)",
],
}),
deps = [
":exported_symbols.lds",
":version_script.lds",
"//dataproxy_sdk/cc:exception",
"//dataproxy_sdk/test:data_mesh_mock",
],
Expand Down
1 change: 1 addition & 0 deletions dataproxy_sdk/python/test/exported_symbols.lds
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_PyInit_*
9 changes: 9 additions & 0 deletions dataproxy_sdk/python/test/version_script.lds
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
VERS_1.0 {
# Export symbols in pybind.
global:
PyInit_*;

# Hide everything else.
local:
*;
};

0 comments on commit d687b82

Please sign in to comment.