diff --git a/.bazelrc b/.bazelrc index 8c195cb..47839a7 100644 --- a/.bazelrc +++ b/.bazelrc @@ -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 + diff --git a/.circleci/config.yml b/.circleci/config.yml index ae98d8f..02f357d 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -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 diff --git a/MODULE.bazel b/MODULE.bazel index 258dc67..60ace3e 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -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") diff --git a/dataproxy_sdk/python/test/BUILD.bazel b/dataproxy_sdk/python/test/BUILD.bazel index bf2e23b..9ac3758 100644 --- a/dataproxy_sdk/python/test/BUILD.bazel +++ b/dataproxy_sdk/python/test/BUILD.bazel @@ -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", ], diff --git a/dataproxy_sdk/python/test/exported_symbols.lds b/dataproxy_sdk/python/test/exported_symbols.lds new file mode 100644 index 0000000..2637585 --- /dev/null +++ b/dataproxy_sdk/python/test/exported_symbols.lds @@ -0,0 +1 @@ +_PyInit_* \ No newline at end of file diff --git a/dataproxy_sdk/python/test/version_script.lds b/dataproxy_sdk/python/test/version_script.lds new file mode 100644 index 0000000..a7e3bc0 --- /dev/null +++ b/dataproxy_sdk/python/test/version_script.lds @@ -0,0 +1,9 @@ +VERS_1.0 { + # Export symbols in pybind. + global: + PyInit_*; + + # Hide everything else. + local: + *; +};