Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 21 additions & 8 deletions zorg/buildbot/builders/BOLTBuilder.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from zorg.buildbot.builders.UnifiedTreeBuilder import getLLVMBuildFactoryAndSourcecodeSteps, addCmakeSteps, addNinjaSteps
from zorg.buildbot.commands.LitTestCommand import LitTestCommand
from zorg.buildbot.commands.CmakeCommand import CmakeCommand
from zorg.buildbot.conditions.FileConditions import FileExists
from zorg.buildbot.conditions.FileConditions import FileDoesNotExist
from zorg.buildbot.process.factory import LLVMBuildFactory

def getBOLTCmakeBuildFactory(
Expand Down Expand Up @@ -90,14 +90,23 @@ def getBOLTCmakeBuildFactory(
logic.
"""
if is_nfc:
# Marker for relevant source code changes, e.g., when updating tests.
# Generated by nfc-check-setup.py and used to trigger the in-tree tests.
hasSrcChanges = ".llvm-bolt.changes"
# Individual markers to skip either in-tree or out-of-tree tests.
skipInTree = ".llvm-bolt.skip.in-tree"
skipOutOfTree = ".llvm-bolt.skip.out-of-tree"

f.addSteps([
ShellCommand(
name='nfc-check-setup',
command=[
f"../{f.monorepo_dir}/bolt/utils/nfc-check-setup.py",
"--switch-back"
f"../{f.monorepo_dir}/bolt/utils/nfc-check-setup.py",
"--switch-back",
"--check-bolt-sources"
],
description=('Setup NFC testing'),
descriptionDone=["NFC-Mode setup"],
warnOnFailure=True,
haltOnFailure=False,
flunkOnFailure=False,
Expand All @@ -124,9 +133,13 @@ def getBOLTCmakeBuildFactory(
env=env),
ShellCommand(
name='nfc-check-bolt-different',
command=('rm -f .llvm-bolt.diff; '
'cmp -s bin/llvm-bolt.old bin/llvm-bolt.new || '
'touch .llvm-bolt.diff'),
command=(
f'rm -f {skipInTree} {skipOutOfTree}; '
f'cmp -s bin/llvm-bolt.old bin/llvm-bolt.new && ('
f'touch {skipInTree}; touch {skipOutOfTree}); '
f'[ -f {hasSrcChanges} ] && rm -f {skipInTree};'
f'rm -f {hasSrcChanges}; '
),
description=('Check if llvm-bolt binaries are different and '
'skip the following nfc-check steps'),
haltOnFailure=False,
Expand All @@ -139,7 +152,7 @@ def getBOLTCmakeBuildFactory(
warnOnFailure=True,
haltOnFailure=False,
flunkOnFailure=True,
doStepIf=FileExists('build/.llvm-bolt.diff'),
doStepIf=FileDoesNotExist(f"build/{skipInTree}"),
env=env),
LitTestCommand(
name='nfc-check-large-bolt',
Expand All @@ -150,7 +163,7 @@ def getBOLTCmakeBuildFactory(
warnOnFailure=True,
haltOnFailure=False,
flunkOnFailure=True,
doStepIf=FileExists('build/.llvm-bolt.diff'),
doStepIf=FileDoesNotExist(f"build/{skipOutOfTree}"),
env=env),
])

Expand Down