Skip to content

Commit f2ee31f

Browse files
[BOLT] Set nfc-tests once (#466)
When setting up the nfc-mode tests, avoid adding an extra pair of in-tree and out-of-tree tests that were unconditional. This was previously done with addNinjaSteps. Instead, add those later and make them conditional on llvm-bolt being modified. Since tests are now only added by BOLTBuilder: - `ninja` runs the in-tree tests to correctly build dependencies. - flunkOnFailure is set to update the build status on failures. Some nits: - the '--switch-back' flag is used (from nfc-check-setup.py). - a 'nfc-' prefix is appended to 'check-bolt-different' step - remove timing.log cleanup
1 parent e95f358 commit f2ee31f

File tree

1 file changed

+16
-11
lines changed

1 file changed

+16
-11
lines changed

zorg/buildbot/builders/BOLTBuilder.py

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -79,15 +79,24 @@ def getBOLTCmakeBuildFactory(
7979
addNinjaSteps(
8080
f,
8181
targets=targets,
82-
checks=checks,
82+
checks = None if is_nfc else checks,
8383
env=env,
8484
**kwargs)
8585

86+
"""
87+
In NFC mode we conditionally run tests only when the llvm-bolt binary has
88+
changed between the previous and current revision. We skipped passing checks
89+
to addNinjaSteps, so we add those checks below, along with the conditional
90+
logic.
91+
"""
8692
if is_nfc:
8793
f.addSteps([
8894
ShellCommand(
8995
name='nfc-check-setup',
90-
command=[f"../{f.monorepo_dir}/bolt/utils/nfc-check-setup.py"],
96+
command=[
97+
f"../{f.monorepo_dir}/bolt/utils/nfc-check-setup.py",
98+
"--switch-back"
99+
],
91100
description=('Setup NFC testing'),
92101
warnOnFailure=True,
93102
haltOnFailure=False,
@@ -114,9 +123,8 @@ def getBOLTCmakeBuildFactory(
114123
descriptionDone=["NFC-Mode unique IDs in binaries"],
115124
env=env),
116125
ShellCommand(
117-
name='check-bolt-different',
118-
command=('find -name timing.log -delete; '
119-
'rm -f .llvm-bolt.diff; '
126+
name='nfc-check-bolt-different',
127+
command=('rm -f .llvm-bolt.diff; '
120128
'cmp -s bin/llvm-bolt.old bin/llvm-bolt.new || '
121129
'touch .llvm-bolt.diff'),
122130
description=('Check if llvm-bolt binaries are different and '
@@ -125,15 +133,12 @@ def getBOLTCmakeBuildFactory(
125133
env=env),
126134
LitTestCommand(
127135
name='nfc-check-bolt',
128-
command=['bin/llvm-lit', '-sv', '-j4',
129-
# bolt-info will always mismatch in NFC mode
130-
'--xfail=bolt-info.test',
131-
'tools/bolt/test'],
136+
command=["ninja", "check-bolt"],
132137
description=["running", "NFC", "check-bolt"],
133138
descriptionDone=["NFC", "check-bolt", "completed"],
134139
warnOnFailure=True,
135140
haltOnFailure=False,
136-
flunkOnFailure=False,
141+
flunkOnFailure=True,
137142
doStepIf=FileExists('build/.llvm-bolt.diff'),
138143
env=env),
139144
LitTestCommand(
@@ -144,7 +149,7 @@ def getBOLTCmakeBuildFactory(
144149
descriptionDone=["NFC", "check-large-bolt", "completed"],
145150
warnOnFailure=True,
146151
haltOnFailure=False,
147-
flunkOnFailure=False,
152+
flunkOnFailure=True,
148153
doStepIf=FileExists('build/.llvm-bolt.diff'),
149154
env=env),
150155
])

0 commit comments

Comments
 (0)