Skip to content

Commit 0dba014

Browse files
authored
fix(IDX): don't cache jemalloc build (#5174)
This prevents `jemalloc` from being cached. An issue in the build currently causes the cache to get polluted, which makes all subsequent CI runs to fail the build determinism tests. The root cause is not yet 100% clear.
1 parent bb76b8f commit 0dba014

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

.github/actions/bazel-test-all/action.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,18 @@ runs:
7777
bazel_targets+=( "$tgt" )
7878
done
7979
80+
# jemalloc -- or rather, the "hermetic" zig toolchain -- has issues when too
81+
# many targets are built concurrently (leads to determinism issues & linking
82+
# errors).
83+
#
84+
# To work around this, we build jemalloc separately.
85+
if [ $(uname -o) != "Darwin" ]; then
86+
if [[ $release_build == "true" ]]; then
87+
bazel build "${bazel_args[@]}" @@jemalloc//:libjemalloc --config=release
88+
else
89+
bazel build "${bazel_args[@]}" @@jemalloc//:libjemalloc
90+
fi
91+
fi
8092
8193
if [[ $diff_only == "true" ]]; then
8294
target_pattern_file=$(mktemp)

third_party/jemalloc/BUILD.jemalloc.bazel

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,13 @@ configure_make(
5050
# Specify the name for the static archive instead of defaulting to <rulename>.a
5151
out_static_libs = ["libjemalloc.a"],
5252

53+
# The jemalloc build (most likely rules_foreign_cc) sometimes creates corrupt artifacts
54+
# which can pollute the cache -- so we build it locally.
55+
tags = [
56+
"manual",
57+
"no-cache",
58+
],
59+
5360
# Ensures only the static archive is built. Otherwise (make) targets (including jemalloc.sh) cause
5461
# non-determinism in the build and aren't necessary for us.
5562
targets = [

0 commit comments

Comments
 (0)