Skip to content

Commit

Permalink
Add ASAN tests to CI.
Browse files Browse the repository at this point in the history
  • Loading branch information
jdm committed Jul 31, 2020
1 parent 533407a commit 495bcbd
Showing 1 changed file with 53 additions and 17 deletions.
70 changes: 53 additions & 17 deletions etc/taskcluster/decision_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,11 @@ def tasks(task_for):
windows_uwp_x64,
macos_unit,
linux_wpt,
linux_wpt_asan,
linux_wpt_layout_2020,
linux_release,
macos_wpt,
macos_wpt_asan,
]
by_branch_name = {
"auto": all_tests,
Expand All @@ -56,7 +58,7 @@ def tasks(task_for):
# https://github.com/servo/saltfs/blob/master/homu/map.jinja

"try-mac": [macos_unit],
"try-linux": [linux_tidy_unit, linux_docs_check, linux_release],
"try-linux": [linux_wpt_asan, macos_wpt_asan],
"try-windows": [windows_unit, windows_arm64, windows_uwp_x64],
"try-arm": [windows_arm64],
"try-wpt": [linux_wpt],
Expand Down Expand Up @@ -484,26 +486,42 @@ def update_wpt():
)


def macos_release_build_with_debug_assertions(priority=None):
def macos_release_build_with_debug_assertions(priority=None, asan_target=None):
if asan_target:
name_prefix = "ASAN "
build_args = "--with-asan"
index_key_suffix = "_asan"
treeherder_prefix = "asan-"
target_dir = "target/" + asan_target
else:
name_prefix = ""
build_args = ""
index_key_suffix = ""
treeherder_prefix = ""
target_dir = "target"

return (
macos_build_task("Release build, with debug assertions")
.with_treeherder("macOS x64", "Release+A")
macos_build_task(name_prefix + "Release build, with debug assertions")
.with_treeherder("macOS x64", treeherder_prefix + "Release+A")
.with_priority(priority)
.with_script("\n".join([
"./mach build --release --verbose --with-debug-assertions",
"./mach build --release --verbose %s --with-debug-assertions" % build_args,
"./etc/ci/lockfile_changed.sh",
"tar -czf target.tar.gz" +
" target/release/servo" +
" target/release/*.so" +
" target/release/*.dylib" +
" resources",
" {target}/release/servo" +
" {target}/release/*.so" +
" {target}/release/*.dylib" +
" resources".format(target=target_dir),
]))
.with_artifacts("repo/target.tar.gz")
.find_or_create("build.macos_x64_release_w_assertions." + CONFIG.tree_hash())
.find_or_create("build.macos_x64%s_release_w_assertions.%s" % (
index_key_suffix,
CONFIG.tree_hash(),
))
)


def linux_release_build_with_debug_assertions(layout_2020):
def linux_release_build_with_debug_assertions(layout_2020, asan_target=None):
if layout_2020:
name_prefix = "Layout 2020 "
build_args = "--with-layout-2020"
Expand All @@ -514,6 +532,16 @@ def linux_release_build_with_debug_assertions(layout_2020):
build_args = ""
index_key_suffix = ""
treeherder_prefix = ""

if asan_target:
name_prefix += "ASAN "
build_args += " --with-asan"
index_key_suffix += "_asan"
treeherder_prefix += "asan-"
target_dir = "target/" + asan_target
else:
target_dir = "target"

return (
linux_build_task(name_prefix + "Release build, with debug assertions")
.with_treeherder("Linux x64", treeherder_prefix + "Release+A")
Expand All @@ -523,10 +551,10 @@ def linux_release_build_with_debug_assertions(layout_2020):
./mach build --release --with-debug-assertions %s -p servo
./etc/ci/lockfile_changed.sh
tar -czf /target.tar.gz \
target/release/servo \
%s/release/servo \
resources
sccache --show-stats
""" % build_args)
""" % (build_args, target_dir))
.with_artifacts("/target.tar.gz")
.find_or_create("build.linux_x64%s_release_w_assertions.%s" % (
index_key_suffix,
Expand All @@ -535,9 +563,13 @@ def linux_release_build_with_debug_assertions(layout_2020):
)


def macos_wpt():
def macos_wpt_asan():
return macos_wpt(asan_target="x86_64-apple-darwin")


def macos_wpt(asan_target=None):
priority = "high" if CONFIG.git_ref == "refs/heads/auto" else None
build_task = macos_release_build_with_debug_assertions(priority=priority)
build_task = macos_release_build_with_debug_assertions(priority=priority, asan_target=asan_target)
def macos_run_task(name):
task = macos_task(name).with_python2().with_python3() \
.with_repo_bundle(alternate_object_dir="/var/cache/servo.git/objects")
Expand All @@ -552,6 +584,10 @@ def macos_run_task(name):
)


def linux_wpt_asan():
linux_wpt_common(total_chunks=4, layout_2020=False, asan_target="x86_64-unknown-linux-gnu")


def linux_wpt():
linux_wpt_common(total_chunks=4, layout_2020=False)

Expand All @@ -560,8 +596,8 @@ def linux_wpt_layout_2020():
linux_wpt_common(total_chunks=2, layout_2020=True)


def linux_wpt_common(total_chunks, layout_2020):
release_build_task = linux_release_build_with_debug_assertions(layout_2020)
def linux_wpt_common(total_chunks, layout_2020, asan_target=None):
release_build_task = linux_release_build_with_debug_assertions(layout_2020, asan_target)
def linux_run_task(name):
return linux_task(name).with_dockerfile(dockerfile_path("run")).with_repo_bundle()
wpt_chunks("Linux x64", linux_run_task, release_build_task, repo_dir="/repo",
Expand Down

0 comments on commit 495bcbd

Please sign in to comment.