Skip to content

Commit 96d46c6

Browse files
authored
[docs] Improvements to HowToAddABuilder local test guide (#125802)
This patch makes the following improvements: * Corrects the suggestion that `bbenv` needs to be made within an llvm-zorg checkout. * Gives workarounds for following the instructions on a system with Python 3.13 (it removed some long-deprecated libraries, which causes problems). * Adds a note about how some builder workflows involve checking out llvm-zorg to retrieve additional scripts and gives guidance on how you can still make and test local changes to those scripts when that's the case.
1 parent 1eeca67 commit 96d46c6

File tree

1 file changed

+27
-6
lines changed

1 file changed

+27
-6
lines changed

llvm/docs/HowToAddABuilder.rst

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -200,20 +200,32 @@ will:
200200

201201
In order to use this "local testing" mode:
202202

203-
* Within a checkout of `llvm-zorg <https://github.com/llvm/llvm-zorg>`_,
204-
create and activate a Python `venv
203+
* Create and activate a Python `venv
205204
<https://docs.python.org/3/library/venv.html>`_ and install the necessary
206-
dependencies.
205+
dependencies. This step can be run from any directory.
207206

208207
.. code-block:: bash
209208
210209
python -m venv bbenv
211210
source bbenv/bin/activate
212211
pip install buildbot{,-console-view,-grid-view,-waterfall-view,-worker,-www}==3.11.7 urllib3
213212
214-
* Initialise the necessary buildmaster files, link to the configuration in
215-
``llvm-zorg`` and ask ``buildbot`` to check the configuration. This step can
216-
be run from any directory.
213+
* If your system has Python 3.13 or newer you will need to additionally
214+
install ``legacy-cgi`` and make a minor patch to the installed buildbot
215+
package. This step does not need to be followed for earlier Python versions.
216+
217+
.. code-block:: bash
218+
219+
pip install legacy-cgi
220+
sed -i \
221+
-e 's/import pipes/import shlex/' \
222+
-e 's/pipes\.quote/shlex.quote/' \
223+
bbenv/lib/python3.13/site-packages/buildbot_worker/runprocess.py
224+
225+
* Initialise the necessary buildmaster files, link to the configuration in a
226+
local checkout out of `llvm-zorg <https://github.com/llvm/llvm-zorg>`_`, and
227+
ask ``buildbot`` to check the configuration. This step can be run from any
228+
directory.
217229

218230
.. code-block:: bash
219231
@@ -266,6 +278,15 @@ to the remote buildmaster by connecting to ``localhost:9900``:
266278
267279
ssh -N -L 8011:localhost:8011 -L 9990:localhost:9990 username@buildmaster_server_address
268280
281+
Be aware that some build configurations may checkout the current upstream
282+
``llvm-zorg`` repository in order to retrieve additional scripts used during
283+
the build process, meaning any local changes will not be reflected in this
284+
part of the build. If you wish to test changes to any of these scripts without
285+
committing them upstream, you will need to temporarily patch the builder logic
286+
in order to instead check out your own branch.
287+
Typically, ``addGetSourcecodeForProject`` from
288+
``zorg/buildbot/process/factory.py`` is used for this and you can edit the
289+
caller to specify your own ``repourl`` and/or ``branch`` keyword argument.
269290

270291
Best Practices for Configuring a Fast Builder
271292
=============================================

0 commit comments

Comments
 (0)