Skip to content

Commit 2797688

Browse files
[libc][docs] Add a sunset policy to porting docs (llvm#168936)
As discussed in the monthly meeting, update the porting docs to clarify what's needed for a target and add a policy for sunsetting targets.
1 parent 98aa840 commit 2797688

File tree

3 files changed

+73
-20
lines changed

3 files changed

+73
-20
lines changed

libc/docs/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ if (SPHINX_FOUND)
8686

8787
# docgen invocation.
8888
add_custom_target(${stem_rst}
89-
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/../utils/docgen/docgen.py ${stem}.h >
89+
COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/../utils/docgen/docgen.py ${stem}.h >
9090
${CMAKE_CURRENT_BINARY_DIR}/headers/${stem}.rst)
9191
# depend on the docgen invocation.
9292
add_dependencies(docs-libc-html ${stem_rst})

libc/docs/porting.rst

Lines changed: 71 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8,23 +8,11 @@ Bringup on a New OS or Architecture
88
:depth: 4
99
:local:
1010

11-
CI builders
12-
===========
13-
14-
If you are contributing a port for an operating system or architecture which
15-
is not covered by existing CI builders, you will also have to present a plan
16-
for testing and contribute a CI builder. See
17-
`this guide <https://llvm.org/docs/HowToAddABuilder.html>`_ for information
18-
on how to add new builders to the
19-
`LLVM buildbot <https://lab.llvm.org/buildbot>`_.
20-
You will either have to extend the existing
21-
`Linux script <https://github.com/llvm/llvm-zorg/blob/main/zorg/buildbot/builders/annotated/libc-linux.py>`_
22-
and/or
23-
`Windows script <https://github.com/llvm/llvm-zorg/blob/main/zorg/buildbot/builders/annotated/libc-windows.py>`_
24-
or add a new script for your operating system.
11+
Building the libc
12+
=================
2513

2614
An OS specific config directory
27-
===============================
15+
-------------------------------
2816

2917
If you are starting to bring up LLVM's libc on a new operating system, the first
3018
step is to add a directory for that OS in the ``libc/config`` directory. Both
@@ -44,7 +32,7 @@ have their own config directory.
4432
source tree.
4533

4634
Architecture Subdirectory
47-
=========================
35+
-------------------------
4836

4937
There are parts of the libc which are implemented differently for different
5038
architectures. The simplest example of this is the ``syscall`` function and
@@ -63,7 +51,7 @@ The libc CMake machinery looks for subdirectories named after the target
6351
architecture.
6452

6553
The entrypoints.txt file
66-
========================
54+
------------------------
6755

6856
One of the important pieces of config information is listed in a file named
6957
``entrypoints.txt``. This file lists the targets for the entrypoints (see
@@ -90,7 +78,7 @@ target architectures, then multiple ``entrypoints.txt`` files will have to be
9078
updated.
9179

9280
The headers.txt file
93-
====================
81+
--------------------
9482

9583
Another important piece of config information is listed in a file named
9684
``headers.txt``. It lists the targets for the set of public headers that are
@@ -103,3 +91,68 @@ bring up. The Linux config has ``headers.txt`` file listed separately for the
10391
config and the
10492
`x86_64 <https://github.com/llvm/llvm-project/tree/main/libc/config/linux/x86_64>`_
10593
config.
94+
95+
96+
Upstreaming
97+
===========
98+
99+
Adding a target to the main LLVM-libc has some requirements to ensure that the
100+
targets stay in usable condition. LLVM-libc is under active development and
101+
without active maintenance targets will become stale and may be sunset.
102+
103+
Maintenance
104+
-----------
105+
106+
To add a target there must be one or more people whose responsibility it is to
107+
keep the target up to date or push it forwards if it's not complete. Those
108+
people are the maintainers, and they are responsible for keeping their target in
109+
good shape. This means fixing their target when it breaks, reviewing patches
110+
related to their target, and keeping the target's CI running.
111+
112+
Maintainers are listed in libc/maintainers.rst and must follow
113+
`LLVM's maintainer policy <https://llvm.org/docs/DeveloperPolicy.html#maintainers>`_.
114+
115+
CI builders
116+
-----------
117+
118+
Every target needs at least one CI builder. These are used to check when the
119+
target breaks, and to help people who don't have access to the specific
120+
architecture fix their bugs. LLVM-libc has both presubmit CI on github
121+
and postsubmit CI on the `LLVM buildbot <https://lab.llvm.org/buildbot>`_. For
122+
instructions on contributing a postsubmit buildbot read
123+
`the LLVM documentation <https://llvm.org/docs/HowToAddABuilder.html>`_ and for
124+
presubmit tests read
125+
`the best practices <https://llvm.org/docs/CIBestPractices.html>`_
126+
127+
The test configurations are at these links:
128+
* `Linux Postsubmit <https://github.com/llvm/llvm-zorg/blob/main/zorg/buildbot/builders/annotated/libc-linux.py>`_
129+
* `Windows Postsubmit <https://github.com/llvm/llvm-zorg/blob/main/zorg/buildbot/builders/annotated/libc-windows.py>`_
130+
* `Fullbuild Presubmit <https://github.com/llvm/llvm-project/blob/main/.github/workflows/libc-fullbuild-tests.yml>`_
131+
* `Overlay Presubmit <https://github.com/llvm/llvm-project/blob/main/.github/workflows/libc-overlay-tests.yml>`_
132+
133+
Sunsetting
134+
----------
135+
136+
Sunsetting is the process through which targets can be removed from LLVM-libc.
137+
If a target is broken or stale it may be sunset. It is the responsibility of the
138+
target's maintainers to keep it from being sunset. The target's maintainers may
139+
be marked inactive if their target is sunset.
140+
141+
Broken targets are ones where the target's CI has been failing for at least
142+
30 days. After 30 days have passed the CI should be changed so it does not
143+
block commits and does not notify people when it fails. If the target remains
144+
broken for another 90 days it may be sunset.
145+
146+
Stale targets are ones with no active maintainers or no contributions. If a
147+
target has 0 specific contributions between two major LLVM releases, or if it
148+
has no active maintainers, then it may be marked "deprecated" in the next major
149+
release. If there are still no contributions or no maintainers after the next
150+
major release it may be sunset.
151+
152+
To sunset a target, all specific references to that target in the code and build
153+
system should be removed. All buildbots for that target should be shut down, or
154+
otherwise removed.
155+
156+
To restart a target that was previously sunset, the new maintainers are
157+
encouraged to look at the commit(s) removing the target to provide a starting
158+
point.

libc/utils/docgen/docgen.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env python
1+
#!/usr/bin/env python3
22
#
33
# ====- Generate documentation for libc functions ------------*- python -*--==#
44
#

0 commit comments

Comments
 (0)