Skip to content

Commit ab0ad40

Browse files
committed
Add README.md
1 parent afe083f commit ab0ad40

3 files changed

Lines changed: 67 additions & 11 deletions

File tree

.ci/buildbot/README.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# ScriptedBuilder Buildbot Workers
2+
3+
This directory contains code shared by LLVM Buildbot workers. The typical
4+
pipeline of a ScriptedBuilder-based builder is as follows.
5+
6+
1. A commit is pushed to [main](https://github.com/llvm/llvm-project/tree/main)
7+
8+
2. The [Buildbot master](https://lab.llvm.org/) polls the repository and finds
9+
new commits. It schedules build requests on every relevant worker.
10+
Alternatively, a build request of a specific llvm-project commit can be
11+
created using the "Force Build" or "Rebuild" buttons.
12+
13+
3. When a worker is ready, the master sends the build steps determined by
14+
[ScriptedBuilder](https://github.com/llvm/llvm-zorg/blob/main/zorg/buildbot/builders/ScriptedBuilder.py)
15+
to the worker.
16+
17+
4. The checkout step checks out llvm-project commit into a directory named
18+
`llvm.src` on the worker.
19+
20+
5. The annotate step executes a predefined Python script from the llvm-project
21+
source tree on the worker. Its working directory is an initially empty
22+
sibling directory named `build`. The argument `--workdir=.` is passed to
23+
override the default build directory (which is different to avoid
24+
accidentally spilling clutter into the cwd)
25+
26+
6. The script is expected to use the utilities from
27+
[`worker.py`](https://github.com/llvm/llvm-project/blob/main/.ci/buildbot/worker.py)
28+
to build LLVM. The `with w.step("stepname"):` pattern is used to visually
29+
separate additional steps in the [Buildbot GUI](https://lab.llvm.org/).
30+
31+
32+
## Reproducing Builds
33+
34+
Users can execute the worker script directly to reproduce a build problem with
35+
a worker using the llvm-project source tree in which it is located. By default
36+
it will use a new directory with `.workdir` suffix (so it can be
37+
`.gitignore`-ignored) next to the script as build directory.
38+
39+
The ScriptedBuilder system tries to keep all worker/build settings within the
40+
script, but some parameters can be overridden using command line parameters.
41+
For instance, `--jobs` overrides the Ninja and llvm-lit `-j` argument that the
42+
worker would use. Script should be written to honor these overrides where they
43+
apply, and may also add additional ones.
44+
45+
See
46+
[`worker.py`](https://github.com/llvm/llvm-project/blob/main/.ci/buildbot/worker.py)
47+
or a
48+
[reference script](https://github.com/llvm/llvm-project/blob/main/polly/polly-x86_64-linux-test-suite)
49+
for further details.

.ci/buildbot/worker.py

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
2+
# See https://llvm.org/LICENSE.txt for license information.
3+
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
4+
"""Utilities for ScriptedBuilder Buildbot worker scripts"""
5+
16
import argparse
27
import filecmp
38
import os
@@ -337,17 +342,15 @@ def run(
337342
involves deleting ${prefix}/llvm.src as well as ${prefix}/build.
338343
The term 'clobber' means deleting build artifacts, but not already
339344
downloaded git repositories. Build artifacts include build- and
340-
install-directories, but not source directories. Changes in the llvm.src
341-
directory will either be force-reset by the buildbot's 'checkout' step
342-
anyway, or -- in case of local invocation -- represents the state the user
343-
wants to reproduce. In either case the source directories should not be
344-
touched. We consider 'clean' to comprise 'clobber'. The llvm-zorg also uses
345-
the term 'clean_obj' instead of 'clobber'.
346-
347-
be reset before the next build anyway. By default, we will
348-
always clobber to get the same starting point at every build. If
349-
incremental=True or the --incremental command line option is used, the
350-
starting point is the previous build.
345+
install-directories. Changes in the llvm.src directory will
346+
either be force-reset by the buildbot's 'checkout' step anyway,
347+
or -- in case of local invocation -- represents the source the user wants
348+
to reproduce without being tied to a specific commit. In either case the
349+
source directories should not be touched. We consider 'clean' to comprise
350+
'clobber'. llvm-zorg also uses the term 'clean_obj' instead of 'clobber'.
351+
By default, we will always clobber to get the same starting point at every
352+
build. If incremental=True or the --incremental command line option is used,
353+
the starting point is the previous build.
351354
352355
A buildbot worker will invoke this script using this directory structure,
353356
where ${prefix} is a dedicated directory for this builder:

polly/ci/polly-x86_64-linux-test-suite.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
#! /usr/bin/env python3
2+
# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
3+
# See https://llvm.org/LICENSE.txt for license information.
4+
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
5+
"""Check Polly optimizations on llvm-test-suite"""
26

37
import os
48
import sys

0 commit comments

Comments
 (0)