Skip to content

Commit

Permalink
#Centipede MacOS support 2/X: fix the build flags for early_exit and …
Browse files Browse the repository at this point in the history
…stats.

PiperOrigin-RevId: 674065155
  • Loading branch information
xinhaoyuan authored and copybara-github committed Sep 30, 2024
1 parent c6b9071 commit ed3e104
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 3 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/bazel_test_centipede.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,14 +108,17 @@ jobs:
if: ${{ !cancelled() }}
run: |
bazel test --local_test_jobs=1 --test_output=errors --no//fuzztest:use_riegeli \
centipede:binary_info_test centipede:call_graph_test \
centipede:callstack_test centipede:concurrent_bitset_test \
centipede:concurrent_byteset_test centipede:config_file_test \
centipede:config_util_test centipede:environment_test \
centipede:feature_test centipede:foreach_nonzero_test \
centipede:feature_set_test centipede:feature_test \
centipede:foreach_nonzero_test \
centipede:hashed_ring_buffer_test centipede:int_utils_test \
centipede:knobs_test centipede:pc_info_test \
centipede:reverse_pc_table_test centipede:rolling_hash_test \
centipede:runner_cmp_trace_test centipede:runner_flags_test \
centipede:stats_test centipede:symbol_table_test \
centipede:util_test centipede:workdir_test
- name: Save new cache based on main
if: github.ref == 'refs/heads/main'
Expand Down
6 changes: 6 additions & 0 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@ bazel_dep(
version = "1.7.1",
)

bazel_dep(
name = "platforms",
version = "0.0.10",
repo_name = "platforms",
)

# Dev dependencies.
bazel_dep(
name = "googletest",
Expand Down
9 changes: 9 additions & 0 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,15 @@ http_archive(
url = "https://github.com/abseil/abseil-cpp/releases/download/20240116.0/abseil-cpp-20240116.0.tar.gz"
)

http_archive(
name = "platforms",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/platforms/releases/download/0.0.10/platforms-0.0.10.tar.gz",
"https://github.com/bazelbuild/platforms/releases/download/0.0.10/platforms-0.0.10.tar.gz",
],
sha256 = "218efe8ee736d26a3572663b374a253c012b716d8af0c07e842e82f238a0a7ee",
)

################################################################################
# Transitive dependencies for core FuzzTest
################################################################################
Expand Down
14 changes: 12 additions & 2 deletions centipede/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,12 @@ cc_library(
name = "stats",
srcs = ["stats.cc"],
hdrs = ["stats.h"],
linkopts = ["-latomic"], # for std::atomic::load()/store().
linkopts = select({
"@platforms//os:macos": [],
"//conditions:default": [
"-latomic", # for std::atomic::load()/store().
],
}),
deps = [
":environment",
":workdir",
Expand Down Expand Up @@ -704,7 +709,12 @@ cc_library(
name = "early_exit",
srcs = ["early_exit.cc"],
hdrs = ["early_exit.h"],
linkopts = ["-latomic"], # for std::atomic::load()/store().
linkopts = select({
"@platforms//os:macos": [],
"//conditions:default": [
"-latomic", # for std::atomic::load()/store().
],
}),
visibility = PUBLIC_API_VISIBILITY,
)

Expand Down

0 comments on commit ed3e104

Please sign in to comment.