xref: /freebsd/share/man/man7/development.7 (revision 5b56413d04e608379c9a306373554a8e4d321bc0)
1.\"-
2.\" SPDX-License-Identifier: BSD-2-Clause
3.\"
4.\" Copyright (c) 2018 Edward Tomasz Napierala <trasz@FreeBSD.org>
5.\"
6.\" Redistribution and use in source and binary forms, with or without
7.\" modification, are permitted provided that the following conditions
8.\" are met:
9.\" 1. Redistributions of source code must retain the above copyright
10.\"    notice, this list of conditions and the following disclaimer.
11.\" 2. Redistributions in binary form must reproduce the above copyright
12.\"    notice, this list of conditions and the following disclaimer in the
13.\"    documentation and/or other materials provided with the distribution.
14.\"
15.\" THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
16.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
19.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25.\" SUCH DAMAGE.
26.\"
27.Dd July 7, 2024
28.Dt DEVELOPMENT 7
29.Os
30.Sh NAME
31.Nm development
32.Nd introduction to
33.Fx
34development process
35.Sh DESCRIPTION
36.Fx
37development is split into three major subprojects: doc, ports, and src.
38Doc is the documentation, such as the
39.Fx
40Handbook.
41To read more, see:
42.Pp
43.Lk https://docs.FreeBSD.org/en/books/fdp-primer/
44.Pp
45Ports, described further in
46.Xr ports 7 ,
47are the way to build, package, and install third party software.
48To read more, see:
49.Pp
50.Lk https://docs.FreeBSD.org/en/books/porters-handbook/
51.Pp
52The last one, src, revolves around the source code for the base system,
53consisting of the kernel, and the libraries and utilities commonly called
54the world.
55.Pp
56The Committer's Guide, describing topics relevant to all committers,
57can be found at:
58.Pp
59.Lk https://docs.freebsd.org/en/articles/committers-guide/
60.Pp
61.Fx
62src development takes place in the project-hosted
63Git repository, located at:
64.Pp
65.Lk https://git.FreeBSD.org/src.git
66.Pp
67The push URL is:
68.Pp
69.Lk ssh://git@gitrepo.FreeBSD.org/src.git
70.Pp
71There is also a list of public, read-only Git mirrors at:
72.Pp
73.Lk https://docs.FreeBSD.org/en/books/handbook/mirrors/#external-mirrors
74.Pp
75The
76.Ql main
77Git branch represents CURRENT;
78all changes are first committed to CURRENT and then usually cherry-picked
79back to STABLE, which refers to Git branches such as
80.Ql stable/13 .
81Every few years a new STABLE is branched from CURRENT,
82with an incremented major version number.
83Releases are then branched off STABLE and numbered with consecutive minor
84numbers.
85.Pp
86The layout of the source tree is described in its
87.Pa README.md
88file.
89Build instructions can be found in
90.Xr build 7
91and
92.Xr release 7 .
93Kernel programming interfaces (KPIs) are documented in section 9
94manual pages; use
95.Ql apropos -s 9 \&.
96for a list.
97Regression test suite is described in
98.Xr tests 7 .
99For coding conventions, see
100.Xr style 9 .
101.Pp
102To ask questions regarding development, use the mailing lists,
103such as freebsd-arch@ and freebsd-hackers@:
104.Pp
105.Lk https://lists.FreeBSD.org
106.Pp
107To get your patches integrated into the main
108.Fx
109repository use Phabricator;
110it is a code review tool that allows other developers to review the changes,
111suggest improvements, and, eventually, allows them to pick up the change and
112commit it:
113.Pp
114.Lk https://reviews.FreeBSD.org
115.Pp
116To check the latest
117.Fx
118build and test status of CURRENT and STABLE branches,
119the continuous integration system is at:
120.Pp
121.Lk https://ci.FreeBSD.org
122.Sh FILES
123.Bl -compact -tag -width "/usr/src/tools/tools/git/git-arc.sh"
124.It Pa /usr/src/CONTRIBUTING.md
125.Fx
126contribution guidelines
127.It Pa /usr/src/tools/tools/git/git-arc.sh
128Phabricator review tooling
129.El
130.Sh EXAMPLES
131Check out the CURRENT branch, build it, and install, overwriting the current
132system:
133.Bd -literal -offset indent
134git clone https://git.FreeBSD.org/src.git src
135cd src
136make -sj8 buildworld buildkernel installkernel
137shutdown -r now
138.Ed
139.Pp
140After reboot:
141.Bd -literal -offset indent
142cd src
143make -j8 installworld
144reboot
145.Ed
146.Pp
147Rebuild and reinstall a single piece of userspace, in this
148case
149.Xr ls 1 :
150.Bd -literal -offset indent
151cd src/bin/ls
152make clean all install
153.Ed
154.Pp
155Quickly rebuild and reinstall the kernel, only recompiling the files
156changed since last build; note that this will only work if the full kernel
157build has been completed in the past, not on a fresh source tree:
158.Bd -literal -offset indent
159cd src
160make -sj8 kernel KERNFAST=1
161.Ed
162.Pp
163To rebuild parts of
164.Fx
165for another CPU architecture,
166first prepare your source tree by building the cross-toolchain:
167.Bd -literal -offset indent
168cd src
169make -sj8 toolchain TARGET_ARCH=aarch64
170.Ed
171.Pp
172Afterwards, to build and install a single piece of userspace, use:
173.Bd -literal -offset indent
174cd src/bin/ls
175make buildenv TARGET_ARCH=aarch64
176make clean all install DESTDIR=/clients/arm
177.Ed
178.Pp
179Likewise, to quickly rebuild and reinstall the kernel, use:
180.Bd -literal -offset indent
181cd src
182make buildenv TARGET_ARCH=aarch64
183make -sj8 kernel KERNFAST=1 DESTDIR=/clients/arm
184.Ed
185.Sh SEE ALSO
186.Xr git 1 ,
187.Xr witness 4 ,
188.Xr build 7 ,
189.Xr hier 7 ,
190.Xr ports 7 ,
191.Xr release 7 ,
192.Xr tests 7 ,
193.Xr locking 9 ,
194.Xr style 9
195.Sh HISTORY
196The
197.Nm
198manual page was originally written by
199.An Matthew Dillon Aq Mt dillon@FreeBSD.org
200and first appeared in
201.Fx 5.0 ,
202December 2002.
203It was since extensively modified by
204.An Eitan Adler Aq Mt eadler@FreeBSD.org
205to reflect the repository conversion from
206.Lk https://www.nongnu.org/cvs/ CVS
207to
208.Lk https://subversion.apache.org/ Subversion .
209It was rewritten from scratch by
210.An Edward Tomasz Napierala Aq Mt trasz@FreeBSD.org
211for
212.Fx 12.0 .
213