comm: add -Wall
[unleashed.git] / tools / nightly.1
blob4c0edc06a3bf7aeb5a922a875e7a54a97c9b247e
1 .\" "
2 .\" " The contents of this file are subject to the terms of the
3 .\" " Common Development and Distribution License (the "License").
4 .\" " You may not use this file except in compliance with the License.
5 .\" "
6 .\" " You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
7 .\" " or http://www.opensolaris.org/os/licensing.
8 .\" " See the License for the specific language governing permissions
9 .\" " and limitations under the License.
10 .\" "
11 .\" " When distributing Covered Code, include this CDDL HEADER in each
12 .\" " file and include the License file at usr/src/OPENSOLARIS.LICENSE.
13 .\" " If applicable, add the following below this CDDL HEADER, with the
14 .\" " fields enclosed by brackets "[]" replaced with your own identifying
15 .\" " information: Portions Copyright [yyyy] [name of copyright owner]
16 .\" "
17 .\" " CDDL HEADER END
18 .\" "
19 .\" "Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
20 .\" "Copyright 2012 Joshua M. Clulow <josh@sysmgr.org>
21 .\" "
22 .TH NIGHTLY 1ONBLD "Jul 2, 2017"
23 .SH NAME
24 .I nightly
25 \- build an OS-Net consolidation overnight
26 .SH SYNOPSIS
27 \fBnightly [-in] [-V VERS] <env_file>\fP
28 .SH DESCRIPTION
29 .LP
30 .I nightly,
31 the mother of all build scripts,
32 can build, archive, package, error check, and
33 generally do everything it takes to
34 turn OS/Net consolidation source code into useful stuff.
35 It is customizable to permit you to run anything from a
36 simple build to all of the cross-checking a gatekeeper
37 needs.  The advantage to using
38 .I nightly
39 is that you build things correctly, consistently and
40 automatically, with the best practices; building with
41 .I nightly
42 can mean never having to say you're sorry to your
43 gatekeeper.
44 .LP
45 More
46 specifically,
47 .I nightly
48 performs the following tasks, in order, if
49 all these things are desired:
50 .LP
51 .RS
52 .TP
53 \(bu
54 perform a "make clobber" to clean up old binaries
55 .TP
56 \(bu
57 perform non-DEBUG and DEBUG builds
58 .TP
59 \(bu
60 list proto area files and compare with previous list
61 .TP
62 \(bu
63 copy updated proto area to parent
64 .TP
65 \(bu
66 list shared lib interface and compare with previous list
67 .TP
68 \(bu
69 perform a "make check" to report hdrchk/cstyle errors
70 .TP
71 \(bu
72 report the presence of any core files
73 .TP
74 \(bu
75 check the ELF runtime attributes of all dynamic objects
76 .TP
77 \(bu
78 check for unreferenced files
79 .TP
80 \(bu
81 report on which proto area objects have changed (since the last build)
82 .TP
83 \(bu
84 report the total build time
85 .TP
86 \(bu
87 save a detailed log file for reference
88 .TP
89 \(bu
90 mail the user a summary of the completed build
91 .RE
92 .LP
93 The actions of the script are almost completely determined by
94 the environment variables in the
95 .I env
96 file, the only necessary argument.  Ths only thing you really
97 need to use
98 .I nightly
99 is an
100 .I env
101 file that does what you want.
103 Like most of the other build tools in usr/src/tools, this script tends
104 to change on a fairly regular basis; do not expect to be able to build
105 OS/Net with a version of nightly significantly older than your source
106 tree.  It has what is effectively a Consolidation Private relationship
107 to other build tools and with many parts of the OS/Net makefiles,
108 although it may also be used to build other consolidations.
109 .SH NIGHTLY_OPTIONS
110 The environment variable NIGHTLY_OPTIONS controls the actions
111 .I nightly
112 will take as it proceeds.
113 The -i, -n, and -V options may also be used from the command
114 line to control the actions without editing your environment file.
115 The -i and -n options complete the build more quickly by bypassing
116 some actions. If NIGHTLY_OPTIONS is not set, then "-Bmt" build
117 options will be used.
119 .B Basic action options
120 .TP 10
121 .B \-D
122 Do a DEBUG build instead of non-DEBUG
124 .B \-M
125 Do not run pmodes (safe file permission checker)
127 .B \-i
128 Do an incremental build, suppressing the "make clobber" that by
129 default removes all existing binaries and derived files.  From the
130 command line, -i also suppresses the cstyle/hdrchk pass
132 .B \-p
133 Create packages for regular install
135 .B \-m
136 Send mail to $MAILTO at end of build
140 .B Code checking options
141 .TP 10
142 .B \-A
143 Check for ABI discrepancies in .so files.
144 It is only required for shared object developers when there is an
145 addition, deletion or change of interface in the .so files.
147 .B \-C
148 Check for cstyle/hdrchk errors
150 .B \-f
151 Check for unreferenced files.  Since the full workspace must be built
152 in order to accurately identify unreferenced files, -f is ignored for
153 incremental (-i) builds, or builds that do not include -p.
155 .B \-r
156 Check the ELF runtime attributes of all dynamic objects
158 .B \-N
159 Do not run protocmp or checkpaths (note: this option is not
160 recommended, especially in conjunction with the \-p option)
162 .B \-w
163 Report which proto area objects differ between this and the last build.
164 See wsdiff(1ONBLD) for details. Note that the proto areas used for comparison
165 are the last ones constructed as part of the build. As an example, if both
166 a non-debug and debug build are performed (in that order), then the debug
167 proto area will be used for comparison (which might not be what you want).
169 .B Groups of options
170 .TP 10
171 .B \-G
172 Gate keeper default group of options
174 .B \-I
175 Integration engineer default group of options (-mp)
177 .B \-R
178 Default group of options for building a release (-mp)
181 .B Miscellaneous options
182 .TP 10
183 .B \-V VERS
184 set the build version string to VERS, overriding VERSION
186 .SH ENVIRONMENT VARIABLES
188 Here is a list of prominent environment variables that
189 .I nightly
190 references and the meaning of each variable.
191 .B SRCTOP
192 .RS 5
193 The root of your workspace, including whatever metadata is kept by
194 the source code management system.  This is the workspace in which the
195 build will be done.
198 .B SRC
199 .RS 5
200 Root of OS-Net source code, referenced by the Makefiles.  It is
201 the starting point of build activity.  It should be expressed
202 in terms of $SRCTOP.
205 .B ROOT
206 .RS 5
207 Root of the proto area for the build.  The makefiles direct
208 installation of build products to this area and
209 direct references to these files by builds of commands and other
210 targets.  It should be expressed in terms of $SRCTOP.
213 .B MACH
214 .RS 5
215 The instruction set architecture of the build machine as given
216 by \fIuname -p\fP, e.g. sparc, i386.
219 .B ATLOG
220 .RS 5
221 The location of the log directory maintained by
222 .IR nightly .
223 This should generally be left to the default setting.
226 .B LOGFILE
227 .RS 5
228 The name of the log file in the $ATLOG directory maintained by
229 .IR nightly .
230 This should generally be left to the default setting.
233 .B MAILTO
234 .RS 5
235 The address to be used to send completion e-mail at the end of
236 the build (for the \-m option).
239 .B RELEASE
240 .RS 5
241 The release version number to be used; e.g., 5.10.1 (Note: this is set
242 in Makefile.master and should not normally be overridden).
245 .B VERSION
246 .RS 5
247 The version text string to be used; e.g., "onnv:`date '+%Y-%m-%d'`".
250 .B RELEASE_DATE
251 .RS 5
252 The release date text to be used; e.g., October 2009. If not set in
253 your environment file, then this text defaults to the output from
254 $(LC_ALL=C date +"%B %Y"); e.g., "October 2009".
257 .B RELEASE_BUILD
258 .RS 5
259 Define this to build a release with a non-DEBUG kernel.
260 Generally, let
261 .I nightly
262 set this for you based on its options.
265 .B PKGARCHIVE
266 .RS 5
267 The destination for packages.  This may be relative to $SRCTOP for
268 private packages.
271 .B MAKEFLAGS
272 .RS 5
273 Set default flags to make; e.g., -k to build all targets regardless of errors.
276 .B BUILD_TOOLS
277 .RS 5
278 BUILD_TOOLS is the root of all tools including the compilers; e.g.,
279 /ws/onnv-tools.  It is used by the makefile system, but not nightly.
282 .B ONBLD_TOOLS
283 .RS 5
284 ONBLD_TOOLS is the root of all the tools that are part of SUNWonbld; e.g.,
285 /ws/onnv-tools/onbld.  By default, it is derived from
286 .BR BUILD_TOOLS .
287 It is used by the makefile system, but not nightly.
290 .B JAVA_ROOT
291 .RS 5
292 The location for the java compilers for the build, generally /usr/java.
295 .B OPTHOME
296 .RS 5
297 The gate-defined default location of things formerly in /opt; e.g.,
298 /ws/onnv-tools.  This is used by nightly, but not the makefiles.
301 .B CHECK_PATHS
302 .RS 5
303 Normally, nightly runs the 'checkpaths' script to check for
304 discrepancies among the files that list paths to other files, such as
305 the exception lists.  Set this flag to 'n' to disable this
306 check, which appears in the nightly output as "Check lists of files."
308 .SH NIGHTLY HOOK ENVIRONMENT VARIABLES
310 Several optional environment variables may specify commands to run at
311 various points during the build.  Commands specified in the hook
312 variable will be run in a subshell; command output will be appended to
313 the mail message and log file.  If the hook exits with a non-zero
314 status, the build is aborted immediately.  Environment variables
315 defined in the environment file will be available.
317 .B SYS_PRE_NIGHTLY
318 .RS 5
319 This is reserved for per-build-machine customizations.
322 .B PRE_NIGHTLY
323 .RS 5
324 Run just after SYS_PRE_NIGHTLY.
327 .B POST_NIGHTLY
328 .RS 5
329 Run after the build completes, with the return status of nightly - one
330 of "Completed", "Interrupted", or "Failed" - available in the
331 environment variable NIGHTLY_STATUS.
334 .B SYS_POST_NIGHTLY
335 .RS 5
336 This is reserved for per-build-machine customizations, and runs
337 immedately after POST_NIGHTLY.
339 .SH EXAMPLES
341 Start with the example file in usr/src/tools/env/developer.sh
342 (or gatekeeper.sh), copy to myenv and make your changes.
344 .PD 0
345 # grep NIGHTLY_OPTIONS myenv
347 NIGHTLY_OPTIONS="-ACrlapDm"
349 export NIGHTLY_OPTIONS
351 # /opt/onbld/bin/nightly -i myenv
353 .SH SEE ALSO
354 .BR bldenv (1ONBLD)