Skip to content

Commit 7fb9450

Browse files
[BOLT] Add nfc-check-validation step (#462)
NFC-mode runs in-tree and out-of-tree (large BOLT tests) when there are changes affecting llvm-bolt between the current revision and the previous one. However, the revision SHA itself and the GNU build-id may be two unique differences when doing such a comparison. This patch introduces a lightweight sanity check step that reports a warning on the Buildbot so that we are aware when this occurs.
1 parent ced9b63 commit 7fb9450

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

zorg/buildbot/builders/BOLTBuilder.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
from buildbot.plugins import steps
2+
from buildbot.process.results import SUCCESS, FAILURE, WARNINGS
23
from buildbot.steps.shell import ShellCommand
34
from zorg.buildbot.builders.UnifiedTreeBuilder import getLLVMBuildFactoryAndSourcecodeSteps, addCmakeSteps, addNinjaSteps
45
from zorg.buildbot.commands.LitTestCommand import LitTestCommand
@@ -92,6 +93,26 @@ def getBOLTCmakeBuildFactory(
9293
haltOnFailure=False,
9394
flunkOnFailure=False,
9495
env=env),
96+
ShellCommand(
97+
name='nfc-check-validation',
98+
command=(
99+
"info=$(bin/llvm-bolt.new --version | grep 'BOLT revision' "
100+
"| grep -q '<unknown>' || echo 'bolt-revision'); "
101+
"info=$info$(readelf --notes bin/llvm-bolt.new "
102+
"| grep -q 'Build ID:' && echo ' GNU-build-id'); "
103+
"info=$(echo \"$info\" | sed 's/^ //'); "
104+
"[ ! -z \"$info\" ] || return 0 && "
105+
"(printf \"NFC-Mode WARNING: unique IDs found in binaries ($info)"
106+
". This means tests will run at all times.\"; return 2)"
107+
),
108+
description=('Check that nfc-mode works as intended when '
109+
'comparing with the previous commit.'),
110+
haltOnFailure=False,
111+
warnOnFailure=True,
112+
warnOnWarnings=True,
113+
decodeRC={0: SUCCESS, 1: FAILURE, 2: WARNINGS},
114+
descriptionDone=["NFC-Mode unique IDs in binaries"],
115+
env=env),
95116
ShellCommand(
96117
name='check-bolt-different',
97118
command=('find -name timing.log -delete; '

0 commit comments

Comments
 (0)