Skip to content

Commit 2b44506

Browse files
authored
Insert debugify-report into the test suite build directory (#582)
As part of the DebugifyBuilder, we add cflag arguments to the test suite build step containing the path of a report file, where any bugs detected by debugify will be written. Debugify appends to the file rather than replacing it, as we wish to accumulate the bugs found in all invocations of Clang during the test suite build step to a single file. Currently however, this file is not cleaned up after builds, meaning that we are constantly appending bugs to the same file after each test run, rather than creating a fresh file - this contaminates the results for future builds, as bugs will never disappear from the list even if they no longer exist in LLVM. This patch moves the report file into the test suite build directory, which will always be cleaned before each test run, preventing the results of one run from seeping into subsequent runs.
1 parent 4422ed1 commit 2b44506

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

zorg/buildbot/builders/DebugifyBuilder.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from buildbot.plugins import util
22
from buildbot.steps.shell import ShellCommand
33
from zorg.buildbot.builders import TestSuiteBuilder
4+
from zorg.buildbot.builders.TestSuiteBuilder import test_suite_build_path
45
from zorg.buildbot.commands.CmakeCommand import CmakeCommand
56

67

@@ -53,7 +54,9 @@ def getDebugifyBuildFactory(
5354
])
5455

5556
# This path will be passed through to util.Interpolate, so we leave it in this format.
56-
debugify_output_path = f"%(prop:builddir)s/debugify-report.json"
57+
# NB: This must be stored in the test suite build directory, as that is the only way to ensure that it is
58+
# unconditionally up before (and not after) each run.
59+
debugify_output_path = f"%(prop:builddir)s/{test_suite_build_path}/debugify-report.json"
5760

5861
# Make a local copy of the test suite configure args, as we are going to modify that.
5962
if extra_test_suite_configure_args is not None:

zorg/buildbot/builders/TestSuiteBuilder.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
from zorg.buildbot.commands.NinjaCommand import NinjaCommand
99
from zorg.buildbot.commands.LitTestCommand import LitTestCommand
1010

11+
# The DebugifyBuilder needs to know the test-suite build directory, so we share the build directory via this variable.
12+
test_suite_build_path = 'test/build-test-suite'
13+
1114
# This builder is uses UnifiedTreeBuilders and adds running
1215
# llvm-test-suite with cmake and ninja step.
1316

@@ -30,7 +33,7 @@ def addTestSuiteStep(
3033
lit = util.Interpolate('%(prop:builddir)s/' + compiler_dir + '/bin/llvm-lit')
3134
test_suite_base_dir = util.Interpolate('%(prop:builddir)s/' + 'test')
3235
test_suite_src_dir = util.Interpolate('%(prop:builddir)s/' + 'test/test-suite')
33-
test_suite_workdir = util.Interpolate('%(prop:builddir)s/' + 'test/build-test-suite')
36+
test_suite_workdir = util.Interpolate('%(prop:builddir)s/' + test_suite_build_path)
3437
cmake_lit_arg = util.Interpolate('-DTEST_SUITE_LIT:FILEPATH=%(prop:builddir)s/' + compiler_dir + '/bin/llvm-lit')
3538
# used for cmake building test-suite step
3639
if extra_configure_args is not None:

0 commit comments

Comments
 (0)