You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .ci/buildbot/worker.py
+56-16Lines changed: 56 additions & 16 deletions
Original file line number
Diff line number
Diff line change
@@ -214,31 +214,64 @@ def run(
214
214
workerjobs=None,
215
215
always_clobber=False,
216
216
):
217
-
"""Runs the boilerplate for a ScriptedBuilder buildbot. It is not necessary to use this function (one can also all run_command() etc. directly), but allows for some more flexibility and safety checks. Arguments passed to this function represent the worker configuration.
218
-
219
-
We use the term 'clean' for resetting the worker to an empty state. This involves deleting ${prefix}/llvm.src as well as ${prefix}/build.
220
-
The term 'clobber' means deleting build artifacts, but not already downloaded git repositories. Build artifacts including build- and install-directories, but not source directories. Changes in the llvm.src directory will be reset before the next build anyway. Clobber is necessary if the build instructions change. Otherwise, we try an incremental build. We consider 'clean' to imply 'clean_obj'.
221
-
222
-
A buildbot worker will invoke this script using this directory structure, where ${prefix} is a dedicated directory for this builder:
217
+
"""
218
+
Runs the boilerplate for a ScriptedBuilder buildbot. It is not necessary to
219
+
use this function (one can also all run_command() etc. directly), but allows
220
+
for some more flexibility and safety checks. Arguments passed to this
221
+
function represent the worker configuration.
222
+
223
+
We use the term 'clean' for resetting the worker to an empty state. This
224
+
involves deleting ${prefix}/llvm.src as well as ${prefix}/build.
225
+
The term 'clobber' means deleting build artifacts, but not already
226
+
downloaded git repositories. Build artifacts including build- and
227
+
install-directories, but not source directories. Changes in the llvm.src
228
+
directory will be reset before the next build anyway. Clobber is necessary
229
+
if the build instructions change. Otherwise, we try an incremental build.
230
+
We consider 'clean' to imply 'clean_obj'.
231
+
232
+
A buildbot worker will invoke this script using this directory structure,
233
+
where ${prefix} is a dedicated directory for this builder:
223
234
${prefix}/llvm.src # Checkout location for the llvm-source
224
235
${prefix}/build # cwd when launching the build script
225
236
226
-
The build script is called with --workdir=. parameter, i.e. the build artifacts are written into ${prefix}/build. When cleaning, the worker (NOT the build script) will delete ${prefix}/llvm.src; Deleting any contents of ${prefix}/build is to be done by the builder script, e.g. by this function. The builder script can choose to not delete the complete workdir, e.g. additional source checkouts such as the llvm-test-suite.
237
+
The build script is called with --workdir=. parameter, i.e. the build
238
+
artifacts are written into ${prefix}/build. When cleaning, the worker (NOT
239
+
the build script) will delete ${prefix}/llvm.src; Deleting any contents of
240
+
${prefix}/build is to be done by the builder script, e.g. by this function.
241
+
The builder script can choose to not delete the complete workdir, e.g.
242
+
additional source checkouts such as the llvm-test-suite.
227
243
228
-
The buildbot master will set the 'clean' build property and the environment variable BUILDBOT_CLEAN when in the GUI the option "Clean source code and build directory" is checked by the user. The 'clean_obj' build property and the BUILDBOT_CLEAN_OBJ environment variable will be set when either the "Clean build directory" GUI option is set, or the master detects a change to a CMakeLists.txt or *.cmake file.
244
+
The buildbot master will set the 'clean' build property and the environment
245
+
variable BUILDBOT_CLEAN when in the GUI the option "Clean source code and
246
+
build directory" is checked by the user. The 'clean_obj' build property and
247
+
the BUILDBOT_CLEAN_OBJ environment variable will be set when either the
248
+
"Clean build directory" GUI option is set, or the master detects a change
249
+
to a CMakeLists.txt or *.cmake file.
229
250
230
251
Parameters
231
252
----------
232
253
scriptpath
233
254
Pass __file__ from the main builder script.
234
255
llvmsrcroot
235
-
Absolute path to the llvm-project source checkout. Since the builder script is supposed to be a part of llvm-project itself, the builder script can compute it from __file__.
256
+
Absolute path to the llvm-project source checkout. Since the builder
257
+
script is supposed to be a part of llvm-project itself, the builder
258
+
script can compute it from __file__.
236
259
parser
237
-
Use this argparse.ArgumentParser instead of creating a new one. Allows adding additional command line switched in addition to the pre-defined ones. Build script are encouraged to apply the pre-defined switches.
260
+
Use this argparse.ArgumentParser instead of creating a new one. Allows
261
+
adding additional command line switched in addition to the pre-defined
262
+
ones. Build script are encouraged to apply the pre-defined switches.
238
263
clobberpaths
239
-
Directories relative to workdir that need to be deleted if the build configuration changes (due to changes of CMakeLists.txt or changes of configuration parameters). Typically, only source checkouts are not deleted.
264
+
Directories relative to workdir that need to be deleted if the build
265
+
configuration changes (due to changes of CMakeLists.txt or changes of
266
+
configuration parameters). Typically, only source checkouts are not
267
+
deleted.
240
268
workerjobs
241
-
Default number of build and test jobs; If set, expected to be the number of jobs of the actual buildbot worker that executes this script. Can be overridden using the --jobs parameter so in case someone needs to reproduce this build, they can adjust the number of jobs for the reproducer platform. Alternatively, the worker can set the BUILDBOT_JOBS environment variable or keep ninja/llvm-lit defaults.
269
+
Default number of build and test jobs; If set, expected to be the number
270
+
of jobs of the actual buildbot worker that executes this script. Can be
271
+
overridden using the --jobs parameter so in case someone needs to
272
+
reproduce this build, they can adjust the number of jobs for the
273
+
reproducer platform. Alternatively, the worker can set the
274
+
BUILDBOT_JOBS environment variable or keep ninja/llvm-lit defaults.
242
275
always_clobber
243
276
Always clobber the build artifacts, i.e. disable incremental builds.
244
277
"""
@@ -260,25 +293,32 @@ def run(
260
293
261
294
parser=parserorargparse.ArgumentParser(
262
295
allow_abbrev=True,
263
-
description=f"When executed without arguments, builds the worker's LLVM build configuration in {os.path.abspath(workdir_default)}. Some build configuration parameters can be altered using the following switches:",
296
+
description="When executed without arguments, builds the worker's "
297
+
f"LLVM build configuration in {os.path.abspath(workdir_default)}. "
298
+
"Some build configuration parameters can be altered using the "
299
+
"following switches:",
264
300
)
265
301
parser.add_argument(
266
302
"--workdir",
267
303
default=workdir_default,
268
-
help="Use this dir as workdir to write the build artifact into. --workdir=. uses the current directory.\nWarning: This directory might be deleted",
304
+
help="Use this dir as workdir to write the build artifact into. "
305
+
"--workdir=. uses the current directory.\nWarning: This directory "
0 commit comments