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