Skip to content

Commit 425318b

Browse files
committed
MDBF-1076: Create MSAN Debug sequence builder (for aarch64)
1 parent a4ae465 commit 425318b

4 files changed

Lines changed: 169 additions & 2 deletions

File tree

configuration/builders/sequences/sanitizers.py

Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,3 +180,124 @@ def asan_ubsan(
180180
sequence.add_step(step)
181181

182182
return sequence
183+
184+
185+
def msan(
186+
config: DockerConfig,
187+
jobs: int,
188+
isDebugBuildType: bool,
189+
):
190+
sequence = BuildSequence()
191+
192+
sequence.add_step(ShellStep(command=PrintEnvironmentDetails()))
193+
194+
sequence.add_step(
195+
InContainer(
196+
docker_environment=config,
197+
container_commit=False,
198+
step=ShellStep(
199+
command=FetchTarball(workdir=PurePath("src")),
200+
options=StepOptions(descriptionDone="Fetch tarball"),
201+
),
202+
)
203+
)
204+
205+
flags = [
206+
CMakeOption(WITH.MSAN, True),
207+
CMakeOption(
208+
CMAKE.EXE_LINKER_FLAGS, "-L${MSAN_LIBDIR} -Wl,-rpath=${MSAN_LIBDIR}"
209+
),
210+
CMakeOption(
211+
CMAKE.MODULE_LINKER_FLAGS, "-L${MSAN_LIBDIR} -Wl,-rpath=${MSAN_LIBDIR}"
212+
),
213+
CMakeOption(WITH.UNIT_TESTS, False),
214+
CMakeOption(WITH.ZLIB, "bundled"),
215+
CMakeOption(WITH.SYSTEMD, "no"),
216+
CMakeOption(PLUGIN.COLUMNSTORE_STORAGE_ENGINE, False),
217+
CMakeOption(PLUGIN.SPIDER_STORAGE_ENGINE, False),
218+
CMakeOption(PLUGIN.ROCKSDB_STORAGE_ENGINE, False),
219+
CMakeOption(PLUGIN.OQGRAPH_STORAGE_ENGINE, False),
220+
]
221+
if isDebugBuildType:
222+
flags.append(CMakeOption(CMAKE.BUILD_TYPE, BuildType.DEBUG))
223+
flags.append(CMakeOption(WITH.DBUG_TRACE, False))
224+
225+
sequence.add_step(
226+
InContainer(
227+
docker_environment=config,
228+
step=ShellStep(
229+
command=ConfigureMariaDBCMake(
230+
name="configure",
231+
workdir=PurePath("bld"),
232+
cmake_generator=CMakeGenerator(
233+
use_ccache=True,
234+
flags=flags,
235+
source_path="../src",
236+
compiler=ClangCompiler(),
237+
),
238+
),
239+
options=StepOptions(descriptionDone="Configure"),
240+
),
241+
)
242+
)
243+
244+
sequence.add_step(
245+
InContainer(
246+
docker_environment=config,
247+
step=ShellStep(
248+
command=CompileCMakeCommand(
249+
builddir="bld",
250+
jobs=jobs,
251+
verbose=True,
252+
),
253+
options=StepOptions(descriptionDone="compile"),
254+
),
255+
)
256+
)
257+
258+
env_vars = [
259+
(
260+
"MSAN_OPTIONS",
261+
"abort_on_error=1:poison_in_dtor=0",
262+
),
263+
("MTR_FEEDBACK_PLUGIN", "1"),
264+
]
265+
266+
## ADD MTR TESTS
267+
for step in (
268+
get_mtr_normal_steps(
269+
jobs=jobs,
270+
env_vars=env_vars,
271+
halt_on_failure=False,
272+
path_to_test_runner=PurePath("bld", "mysql-test"),
273+
additional_mtr_options=[MTROption(MTR.BIG_TEST, True)],
274+
step_wrapping_fn=lambda step: InContainer(
275+
docker_environment=config, step=step
276+
),
277+
)
278+
+ get_mtr_s3_steps(
279+
jobs=jobs,
280+
env_vars=env_vars,
281+
halt_on_failure=False,
282+
additional_mtr_options=[MTROption(MTR.BIG_TEST, True)],
283+
path_to_test_runner=PurePath("bld", "mysql-test"),
284+
step_wrapping_fn=lambda step: InContainer(
285+
docker_environment=config, step=step
286+
),
287+
)
288+
+ [
289+
save_mtr_logs(
290+
step_wrapping_fn=lambda step: InContainer(
291+
docker_environment=config, step=step
292+
),
293+
),
294+
mtr_junit_reporter(
295+
step_wrapping_fn=lambda step: InContainer(
296+
docker_environment=config, step=step
297+
),
298+
),
299+
]
300+
):
301+
sequence.add_step(step)
302+
303+
return sequence

configuration/steps/generators/cmake/options.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,10 @@ class CMAKE(StrEnum):
2424
C_FLAGS = "C_FLAGS"
2525
C_COMPILER_LAUNCHER = "C_COMPILER_LAUNCHER"
2626
CXX_COMPILER_LAUNCHER = "CXX_COMPILER_LAUNCHER"
27+
EXE_LINKER_FLAGS = "EXE_LINKER_FLAGS"
2728
INSTALL_PREFIX = "INSTALL_PREFIX"
2829
LIBRARY_PATH = "LIBRARY_PATH"
30+
MODULE_LINKER_FLAGS = "MODULE_LINKER_FLAGS"
2931

3032
def __str__(self):
3133
return f"CMAKE_{self.value}"
@@ -71,13 +73,16 @@ class WITH(StrEnum):
7173
EMBEDDED_SERVER = "EMBEDDED_SERVER"
7274
EXTRA_CHARSETS = "EXTRA_CHARSETS"
7375
JEMALLOC = "JEMALLOC"
76+
MSAN = "MSAN"
7477
NONE = "NONE"
7578
SAFEMALLOC = "SAFEMALLOC"
7679
SSL = "SSL"
80+
SYSTEMD = "SYSTEMD"
7781
UBSAN = "UBSAN"
7882
UNIT_TESTS = "UNIT_TESTS"
7983
VALGRIND = "VALGRIND"
8084
WSREP = "WSREP"
85+
ZLIB = "ZLIB"
8186

8287
def __str__(self):
8388
return f"WITH_{self.value}"

constants.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,7 @@
169169
"aarch64-debian-12",
170170
"aarch64-fedora-41",
171171
"aarch64-fedora-42",
172+
"aarch64-msan-clang-20",
172173
"aarch64-rhel-10",
173174
"aarch64-ubuntu-2404",
174175
"amd64-centos-stream10",

master-migration/master.cfg

Lines changed: 42 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ from configuration.builders.sequences.compile_only import (
1515
)
1616
from configuration.builders.sequences.debug import openssl_fips
1717
from configuration.builders.sequences.release import deb_autobake, rpm_autobake
18-
from configuration.builders.sequences.sanitizers import asan_ubsan
18+
from configuration.builders.sequences.sanitizers import asan_ubsan, msan
1919
from configuration.reporters import github_summary
2020
from configuration.workers import worker
2121
from master_common import base_master_config, IS_CHECKCONFIG
@@ -272,11 +272,51 @@ def ubasan_builder(name: str, debug: bool) -> GenericBuilder:
272272
)
273273

274274

275-
#for builder in ["amd64-ubasan-clang-20", "amd64-ubasan-clang-20-debug"]:
275+
# for builder in ["amd64-ubasan-clang-20", "amd64-ubasan-clang-20-debug"]:
276276
builder = "amd64-ubasan-clang-20"
277277
c["builders"].append(ubasan_builder(name=builder, debug=builder.endswith("debug")))
278278

279279

280+
def msan_builder(name: str, debug: bool) -> GenericBuilder:
281+
tags_msan = ("Debian", "clang", "msan", "big")
282+
if debug:
283+
tag_msan = tags_msan + ("debug",)
284+
285+
return GenericBuilder(
286+
name=name,
287+
sequences=[
288+
msan(
289+
jobs=12,
290+
config=DockerConfig(
291+
repository=os.environ["CONTAINER_REGISTRY_URL"],
292+
image_tag="debian12-msan-clang-20",
293+
workdir=PurePath("/home/buildbot"),
294+
bind_mounts=[
295+
("/srv/buildbot/ccache", "/mnt/ccache"),
296+
(f'{os.environ["MASTER_PACKAGES_DIR"]}/', "/packages"),
297+
],
298+
shm_size="24g",
299+
env_vars=[
300+
("CCACHE_DIR", "/mnt/ccache"),
301+
("ARTIFACTS_URL", os.environ["ARTIFACTS_URL"]),
302+
],
303+
memlock_limit=memlock_limit,
304+
),
305+
isDebugBuildType=debug,
306+
)
307+
],
308+
).get_config(
309+
workers=WORKER_POOL.get_workers_for_arch(arch="arm64"),
310+
next_build=nextBuild,
311+
can_start_build=canStartBuild,
312+
tags=list(tags_msan),
313+
jobs=12,
314+
)
315+
316+
317+
builder = "aarch64-msan-clang-20-debug"
318+
c["builders"].append(msan_builder(name=builder, debug=builder.endswith("debug")))
319+
280320

281321
## ------------------------------------------------------------------- ##
282322
## REPORTERS ##

0 commit comments

Comments
 (0)