Skip to content

Commit 46424b0

Browse files
committed
feat: build with race detector
1 parent 32353f8 commit 46424b0

17 files changed

Lines changed: 20 additions & 11 deletions

tasks/agent.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ def build(
156156
mod=go_mod,
157157
env=env,
158158
bin_path=agent_bin,
159-
race=race,
159+
race=True,
160160
rebuild=rebuild,
161161
gcflags=gcflags,
162162
ldflags=ldflags,

tasks/cluster_agent_helpers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def build_common(
4545
ctx,
4646
f"{REPO_PATH}/cmd/cluster-agent{bin_suffix}",
4747
mod=go_mod,
48-
race=race,
48+
race=True,
4949
rebuild=rebuild,
5050
gcflags=gcflags,
5151
ldflags=ldflags,

tasks/cws_instrumentation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ def build(
7575
ctx,
7676
f"{REPO_PATH}/cmd/cws-instrumentation",
7777
mod=go_mod,
78-
race=race,
78+
race=True,
7979
rebuild=rebuild,
8080
gcflags=gcflags,
8181
ldflags=ldflags,

tasks/dogstatsd.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ def build(
6363
ctx,
6464
f"{REPO_PATH}/cmd/dogstatsd",
6565
mod=go_mod,
66-
race=race,
66+
race=True,
6767
rebuild=rebuild,
6868
gcflags=gcflags,
6969
ldflags=ldflags,

tasks/host_profiler.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ def build(ctx):
8787
ctx,
8888
f"{REPO_PATH}/cmd/host-profiler",
8989
mod="readonly",
90+
race=True,
9091
build_tags=build_tags,
9192
ldflags=ldflags,
9293
gcflags=gcflags,

tasks/installer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ def build(
7676
ctx,
7777
f"{REPO_PATH}/cmd/installer",
7878
mod=go_mod,
79-
race=race,
79+
race=True,
8080
rebuild=rebuild,
8181
gcflags=gcflags,
8282
ldflags=ldflags,

tasks/libs/common/go.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,10 @@ def go_build(
137137
print(color_message("Ignoring check_deadcode on AIX", "orange"), file=sys.stderr)
138138
check_deadcode = False
139139

140+
# aix and linux 32 bits don't support the -race flag
141+
if race and (sys.platform == "aix" or platform.machine() == "x86"):
142+
race = False
143+
140144
# When targeting Windows with a known output path, ensure the parent
141145
# directory exists and ask mingw ld to emit a PDB next to the binary
142146
# so cdb/WPA/xperf can resolve Go symbols. ld writes the PDB during

tasks/loader.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ def build(
2525
go_build(
2626
ctx,
2727
f"{REPO_PATH}/cmd/loader",
28+
race=True,
2829
build_tags=build_tags,
2930
ldflags=ldflags,
3031
gcflags=gcflags,

tasks/otel_agent.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ def build(ctx, byoc=False, flavor=AgentFlavor.base.name):
7979
ctx,
8080
f"{REPO_PATH}/cmd/otel-agent",
8181
mod="readonly",
82+
race=True,
8283
build_tags=build_tags,
8384
ldflags=ldflags,
8485
gcflags=gcflags,

tasks/privateactionrunner.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ def build(
4040
go_build(
4141
ctx,
4242
f"{REPO_PATH}/cmd/privateactionrunner",
43+
race=True,
4344
build_tags=build_tags,
4445
ldflags=ldflags,
4546
gcflags=gcflags,

0 commit comments

Comments
 (0)