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