ipd kmod dependencies: spell misc without a h
[unleashed.git] / tools / nightly.1onbld
blobff30712e7fcab5cd7d859c224575c4b9e12e7c5c
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 16, 2016"
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 CODEMGR_WS
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 $CODEMGR_WS.
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 $CODEMGR_WS.
213 .B TOOLS_ROOT
214 .RS 5
215 Root of the tools proto area for the build.  The makefiles direct
216 installation of tools build products to this area.
219 .B MACH
220 .RS 5
221 The instruction set architecture of the build machine as given
222 by \fIuname -p\fP, e.g. sparc, i386.
225 .B ATLOG
226 .RS 5
227 The location of the log directory maintained by
228 .IR nightly .
229 This should generally be left to the default setting.
232 .B LOGFILE
233 .RS 5
234 The name of the log file in the $ATLOG directory maintained by
235 .IR nightly .
236 This should generally be left to the default setting.
239 .B MAILTO
240 .RS 5
241 The address to be used to send completion e-mail at the end of
242 the build (for the \-m option).
245 .B RELEASE
246 .RS 5
247 The release version number to be used; e.g., 5.10.1 (Note: this is set
248 in Makefile.master and should not normally be overridden).
251 .B VERSION
252 .RS 5
253 The version text string to be used; e.g., "onnv:`date '+%Y-%m-%d'`".
256 .B RELEASE_DATE
257 .RS 5
258 The release date text to be used; e.g., October 2009. If not set in
259 your environment file, then this text defaults to the output from
260 $(LC_ALL=C date +"%B %Y"); e.g., "October 2009".
263 .B RELEASE_BUILD
264 .RS 5
265 Define this to build a release with a non-DEBUG kernel.
266 Generally, let
267 .I nightly
268 set this for you based on its options.
271 .B PKGARCHIVE
272 .RS 5
273 The destination for packages.  This may be relative to $CODEMGR_WS for
274 private packages.
277 .B MAKEFLAGS
278 .RS 5
279 Set default flags to make; e.g., -k to build all targets regardless of errors.
282 .B BUILD_TOOLS
283 .RS 5
284 BUILD_TOOLS is the root of all tools including the compilers; e.g.,
285 /ws/onnv-tools.  It is used by the makefile system, but not nightly.
288 .B ONBLD_TOOLS
289 .RS 5
290 ONBLD_TOOLS is the root of all the tools that are part of SUNWonbld; e.g.,
291 /ws/onnv-tools/onbld.  By default, it is derived from
292 .BR BUILD_TOOLS .
293 It is used by the makefile system, but not nightly.
296 .B JAVA_ROOT
297 .RS 5
298 The location for the java compilers for the build, generally /usr/java.
301 .B OPTHOME
302 .RS 5
303 The gate-defined default location of things formerly in /opt; e.g.,
304 /ws/onnv-tools.  This is used by nightly, but not the makefiles.
307 .B CHECK_PATHS
308 .RS 5
309 Normally, nightly runs the 'checkpaths' script to check for
310 discrepancies among the files that list paths to other files, such as
311 the exception lists.  Set this flag to 'n' to disable this
312 check, which appears in the nightly output as "Check lists of files."
314 .SH NIGHTLY HOOK ENVIRONMENT VARIABLES
316 Several optional environment variables may specify commands to run at
317 various points during the build.  Commands specified in the hook
318 variable will be run in a subshell; command output will be appended to
319 the mail message and log file.  If the hook exits with a non-zero
320 status, the build is aborted immediately.  Environment variables
321 defined in the environment file will be available.
323 .B SYS_PRE_NIGHTLY
324 .RS 5
325 This is reserved for per-build-machine customizations.
328 .B PRE_NIGHTLY
329 .RS 5
330 Run just after SYS_PRE_NIGHTLY.
333 .B POST_NIGHTLY
334 .RS 5
335 Run after the build completes, with the return status of nightly - one
336 of "Completed", "Interrupted", or "Failed" - available in the
337 environment variable NIGHTLY_STATUS.
340 .B SYS_POST_NIGHTLY
341 .RS 5
342 This is reserved for per-build-machine customizations, and runs
343 immedately after POST_NIGHTLY.
345 .SH EXAMPLES
347 Start with the example file in usr/src/tools/env/developer.sh
348 (or gatekeeper.sh), copy to myenv and make your changes.
350 .PD 0
351 # grep NIGHTLY_OPTIONS myenv
353 NIGHTLY_OPTIONS="-ACrlapDm"
355 export NIGHTLY_OPTIONS
357 # /opt/onbld/bin/nightly -i myenv
359 .SH SEE ALSO
360 .BR bldenv (1ONBLD)