4030 remove useless nightly/bldenv options
[unleashed.git] / usr / src / tools / scripts / nightly.1
blob577fe292a1fcfeb4c85b5c052fb6d3ef3974ae0a
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 1 "6 July 2010"
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 .LP
29 .SH DESCRIPTION
30 .IX "OS-Net build tools" "nightly" "" "\fBnightly\fP"
31 .LP
32 .I nightly,
33 the mother of all build scripts,
34 can bringover, build, archive, package, error check, and
35 generally do everything it takes to
36 turn OS/Net consolidation source code into useful stuff.
37 It is customizable to permit you to run anything from a
38 simple build to all of the cross-checking a gatekeeper
39 needs.  The advantage to using
40 .I nightly
41 is that you build things correctly, consistently and
42 automatically, with the best practices; building with
43 .I nightly
44 can mean never having to say you're sorry to your
45 gatekeeper.
46 .LP
47 More
48 specifically,
49 .I nightly
50 performs the following tasks, in order, if
51 all these things are desired:
52 .LP
53 .RS
54 .TP
55 \(bu
56 perform a "make clobber" to clean up old binaries
57 .TP
58 \(bu
59 bringover from the identified parent gate/clone
60 .TP
61 \(bu
62 perform non-DEBUG and DEBUG builds
63 .TP
64 \(bu
65 list proto area files and compare with previous list
66 .TP
67 \(bu
68 copy updated proto area to parent
69 .TP
70 \(bu
71 list shared lib interface and compare with previous list
72 .TP
73 \(bu
74 perform a "make lint" of the kernel and report errors
75 .TP
76 \(bu
77 perform a "make check" to report hdrchk/cstyle errors
78 .TP
79 \(bu
80 report the presence of any core files
81 .TP
82 \(bu
83 check the ELF runtime attributes of all dynamic objects
84 .TP
85 \(bu
86 check for unreferenced files
87 .TP
88 \(bu
89 report on which proto area objects have changed (since the last build)
90 .TP
91 \(bu
92 report the total build time
93 .TP
94 \(bu
95 save a detailed log file for reference
96 .TP
97 \(bu
98 mail the user a summary of the completed build
99 .RE
101 The actions of the script are almost completely determined by
102 the environment variables in the
103 .I env
104 file, the only necessary argument.  Ths only thing you really
105 need to use 
106 .I nightly
107 is an
108 .I env
109 file that does what you want.
111 Like most of the other build tools in usr/src/tools, this script tends
112 to change on a fairly regular basis; do not expect to be able to build
113 OS/Net with a version of nightly significantly older than your source
114 tree.  It has what is effectively a Consolidation Private relationship
115 to other build tools and with many parts of the OS/Net makefiles,
116 although it may also be used to build other consolidations.
118 .SH NIGHTLY_OPTIONS
119 The environment variable NIGHTLY_OPTIONS controls the actions
120 .I nightly
121 will take as it proceeds.
122 The -i, -n, +t and -V options may also be used from the command
123 line to control the actions without editing your environment file.
124 The -i and -n options complete the build more quickly by bypassing
125 some actions. If NIGHTLY_OPTIONS is not set, then "-Bmt" build
126 options will be used.
128 .B Basic action options
129 .TP 10
130 .B \-D
131 Do a build with DEBUG on (non-DEBUG is built by default)
133 .B \-F
134 Do _not_ do a non-DEBUG build (use with -D to get just a DEBUG build)
136 .B \-M
137 Do not run pmodes (safe file permission checker)
139 .B \-i
140 Do an incremental build, suppressing the "make clobber" that by
141 default removes all existing binaries and derived files.  From the
142 command line, -i also suppresses the lint pass and the cstyle/hdrchk
143 pass
145 .B \-n
146 Suppress the bringover so that the build will start immediately with
147 current source code
149 .B \-o
150 Do an "old style" (pre-S10) build using root privileges to set OWNER
151 and GROUP from the Makefiles.
153 .B \-p
154 Create packages for regular install
156 .B \-U
157 Update proto area in the parent workspace
159 .B \-u
160 Update the parent workspace with files generated by the build, as follows.
163 \(bu
164 Copy proto_list_${MACH} and friends to usr/src in the parent.
166 \(bu
167 When used with -f, build a usr/src/unrefmaster.out in
168 the parent by merging all the usr/src/unref-${MACH}.out files in the
169 parent.
171 \(bu
172 When used with -A or -r, copy the contents of the resulting
173 ELF-data.${MACH} directory to usr/src/ELF-data.${MACH} in the parent
174 workspace.
177 .B \-m
178 Send mail to $MAILTO at end of build
180 .B \-t
181 Build and use the tools in $SRC/tools (default setting).
183 .B \+t
184 Use the build tools in "$ONBLD_TOOLS/bin".
187 .B Code checking options
188 .TP 10
189 .B \-A
190 Check for ABI discrepancies in .so files.
191 It is only required for shared object developers when there is an
192 addition, deletion or change of interface in the .so files.
194 .B \-C
195 Check for cstyle/hdrchk errors
197 .B \-f
198 Check for unreferenced files.  Since the full workspace must be built
199 in order to accurately identify unreferenced files, -f is ignored for
200 incremental (-i) builds, or builds that do not include -l, and -p.
202 .B \-r
203 Check the ELF runtime attributes of all dynamic objects
205 .B \-l
206 Do "make lint" in $LINTDIRS (default: $SRC n)
208 .B \-N
209 Do not run protocmp or checkpaths (note: this option is not
210 recommended, especially in conjunction with the \-p option)
212 .B \-W
213 Do not report warnings (for freeware gate ONLY)
215 .B \-w
216 Report which proto area objects differ between this and the last build.
217 See wsdiff(1) for details. Note that the proto areas used for comparison
218 are the last ones constructed as part of the build. As an example, if both
219 a non-debug and debug build are performed (in that order), then the debug
220 proto area will be used for comparison (which might not be what you want).
222 .B Groups of options
223 .TP 10
224 .B \-G
225 Gate keeper default group of options (-u)
227 .B \-I
228 Integration engineer default group of options (-mpu)
230 .B \-R
231 Default group of options for building a release (-mp)
234 .B Miscellaneous options
235 .TP 10
236 .B \-V VERS
237 set the build version string to VERS, overriding VERSION
239 .B \-X
240 Copies the proto area and packages from the IHV and IHV-bin gates into the
241 nightly proto and package areas.  This is only available on i386.  See
242 .B REALMODE ENVIRONMENT VARIABLES
244 .B BUILDING THE IHV WORKSPACE
245 below.
248 .SH ENVIRONMENT VARIABLES
250 Here is a list of prominent environment variables that 
251 .I nightly
252 references and the meaning of each variable.
255 .B CODEMGR_WS
256 .RS 5
257 The root of your workspace, including whatever metadata is kept by
258 the source code management system.  This is the workspace in which the
259 build will be done. 
262 .B PARENT_WS
263 .RS 5
264 The root of the workspace that is the parent of the
265 one being built.  This is particularly relevant for configurations
266 with a main
267 workspace and build workspaces underneath it; see the 
268 \-u and \-U
269 options as well as the PKGARCHIVE environment variable, for more
270 information.
273 .B BRINGOVER_WS
274 .RS 5
275 This is the workspace from which
276 .I nightly
277 will fetch sources to either populate or update your workspace;
278 it defaults to $CLONE_WS.
281 .B CLOSED_BRINGOVER_WS
282 .RS 5
283 A full Mercurial workspace has two repositories: one for open source
284 and one for closed source.  If this variable is non-null, 
285 .I nightly
286 will pull from the repository that it names to get the closed source.
287 It defaults to $CLOSED_CLONE_WS.
289 If $CODEMGR_WS already exists and contains only the open repository,
290 .I nightly
291 will ignore this variable; you'll need to pull the closed repository
292 by hand if you want it.
295 .B CLONE_WS
296 .RS 5
297 This is the workspace from which
298 .I nightly
299 will fetch sources by default.  This is
300 often distinct from the parent, particularly if the parent is a gate.
303 .B CLOSED_CLONE_WS
304 .RS 5
305 This is the default closed-source Mercurial repository that 
306 .I nightly
307 might pull from (see
308 .B CLOSED_BRINGOVER_WS
309 for details).
312 .B SRC
313 .RS 5
314 Root of OS-Net source code, referenced by the Makefiles.  It is
315 the starting point of build activity.  It should be expressed
316 in terms of $CODEMGR_WS.
319 .B ROOT
320 .RS 5
321 Root of the proto area for the build.  The makefiles direct
322 installation of build products to this area and
323 direct references to these files by builds of commands and other
324 targets.  It should be expressed in terms of $CODEMGR_WS.
326 If $MULTI_PROTO is "no", $ROOT may contain a DEBUG or non-DEBUG
327 build.  If $MULTI_PROTO is "yes", $ROOT contains the DEBUG build and
328 $ROOT-nd contains the non-DEBUG build.
331 .B TOOLS_ROOT
332 .RS 5
333 Root of the tools proto area for the build.  The makefiles direct
334 installation of tools build products to this area.  Unless \fB+t\fR
335 is part of $NIGHTLY_OPTIONS, these tools will be used during the
336 build.
338 As built by nightly, this will always contain non-DEBUG objects.
339 Therefore, this will always have a -nd suffix, regardless of
340 $MULTI_PROTO.
343 .B MACH
344 .RS 5
345 The instruction set architecture of the build machine as given
346 by \fIuname -p\fP, e.g. sparc, i386.
349 .B LOCKNAME
350 .RS 5
351 The name of the file used to lock out multiple runs of
352 .IR nightly .
353 This should generally be left to the default setting.
356 .B ATLOG
357 .RS 5
358 The location of the log directory maintained by
359 .IR nightly .
360 This should generally be left to the default setting.
363 .B LOGFILE
364 .RS 5
365 The name of the log file in the $ATLOG directory maintained by
366 .IR nightly .
367 This should generally be left to the default setting.
370 .B STAFFER
371 .RS 5
372 The non-root account to use on the build machine for the
373 bringover from the clone or parent workspace.
374 This may not be the same identify used by the SCM.
377 .B MAILTO
378 .RS 5
379 The address to be used to send completion e-mail at the end of
380 the build (for the \-m option).
383 .B MAILFROM
384 .RS 5
385 The address to be used for From: in the completion e-mail at the
386 end of the build (for the \-m option).
389 .B REF_PROTO_LIST
390 .RS 5
391 Name of file used with protocmp to compare proto area contents.
394 .B PARENT_ROOT
395 .RS 5
396 The parent root, which is the destination for copying the proto
397 area(s) when using the \-U option.
400 .B PARENT_TOOLS_ROOT
401 .RS 5
402 The parent tools root, which is the destination for copying the tools
403 proto area when using the \-U option.
406 .B RELEASE
407 .RS 5
408 The release version number to be used; e.g., 5.10.1 (Note: this is set
409 in Makefile.master and should not normally be overridden).
412 .B VERSION
413 .RS 5
414 The version text string to be used; e.g., "onnv:`date '+%Y-%m-%d'`".
417 .B RELEASE_DATE
418 .RS 5
419 The release date text to be used; e.g., October 2009. If not set in
420 your environment file, then this text defaults to the output from
421 $(LC_ALL=C date +"%B %Y"); e.g., "October 2009".
424 .B INTERNAL_RELEASE_BUILD
425 .RS 5
426 See Makefile.master - but it mostly controls id strings. Generally,
428 .I nightly
429 set this for you.
432 .B RELEASE_BUILD
433 .RS 5
434 Define this to build a release with a non-DEBUG kernel. 
435 Generally, let
436 .I nightly
437 set this for you based on its options.
440 .B PKGARCHIVE
441 .RS 5
442 The destination for packages.  This may be relative to
443 $CODEMGR_WS for private packages or relative to $PARENT_WS
444 if you have different workspaces for different architectures
445 but want one hierarchy of packages.
448 .B MAKEFLAGS
449 .RS 5
450 Set default flags to make; e.g., -k to build all targets regardless of errors.
453 .B UT_NO_USAGE_TRACKING
454 .RS 5
455 Disables usage reporting by listed Devpro tools. Otherwise it sends mail
456 to some Devpro machine every time the tools are used.
459 .B LINTDIRS
460 .RS 5
461 Directories to lint with the \-l option.
464 .B BUILD_TOOLS
465 .RS 5
466 BUILD_TOOLS is the root of all tools including the compilers; e.g.,
467 /ws/onnv-tools.  It is used by the makefile system, but not nightly.
470 .B ONBLD_TOOLS
471 .RS 5
472 ONBLD_TOOLS is the root of all the tools that are part of SUNWonbld; e.g.,
473 /ws/onnv-tools/onbld.  By default, it is derived from
474 .BR BUILD_TOOLS .
475 It is used by the makefile system, but not nightly.
478 .B SPRO_ROOT
479 .RS 5
480 The gate-defined default location for the Sun compilers, e.g.
481 /ws/onnv-tools/SUNWspro.  By default, it is derived from
482 .BR BUILD_TOOLS .
483 It is used by the makefile system, but not nightly.
486 .B JAVA_ROOT
487 .RS 5
488 The location for the java compilers for the build, generally /usr/java.
491 .B OPTHOME
492 .RS 5
493 The gate-defined default location of things formerly in /opt; e.g.,
494 /ws/onnv-tools.  This is used by nightly, but not the makefiles.
497 .B TEAMWARE
498 .RS 5
499 The gate-defined default location for the Teamware tools; e.g.,
500 /ws/onnv-tools/SUNWspro.  By default, it is derived from
501 .BR OPTHOME .
502 This is used by nightly, but not the makefiles.  There is no
503 corresponding variable for Mercurial or Subversion, which are assumed
504 to be installed in the default path.
507 .B ON_CLOSED_BINS
508 .RS 5
509 OpenSolaris builds do not contain the closed source tree.  Instead,
510 the developer downloads a closed binaries tree and unpacks it.  
511 .B ON_CLOSED_BINS
512 tells nightly
513 where to find these closed binaries, so that it can add them into the
514 build.
517 .B ON_CRYPTO_BINS
518 .RS 5
519 This is the path to a compressed tarball that contains debug
520 cryptographic binaries that have been signed to allow execution
521 outside of Sun, e.g., $PARENT_WS/packages/$MACH/on-crypto.$MACH.bz2.
522 .I nightly
523 will automatically adjust the path for non-debug builds.  This tarball
524 is needed if the closed-source tree is not present.  Also, it is
525 usually needed when generating OpenSolaris deliverables from a project
526 workspace.  This is because most projects do not have access to the
527 necessary key and certificate that would let them sign their own
528 cryptographic binaries.
531 .B CHECK_PATHS
532 .RS 5
533 Normally, nightly runs the 'checkpaths' script to check for
534 discrepancies among the files that list paths to other files, such as
535 exception lists and req.flg.  Set this flag to 'n' to disable this
536 check, which appears in the nightly output as "Check lists of files."
539 .B CHECK_DMAKE
540 .RS 5
541 Nightly validates that the version of dmake encountered is known to be
542 safe to use.  Set this flag to 'n' to disable this test, allowing any
543 version of dmake to be used.
546 .B MULTI_PROTO
547 .RS 5
548 If "no" (the default), 
549 .I nightly
550 will reuse $ROOT for both the DEBUG and non-DEBUG builds.  If "yes",
551 the DEBUG build will go in $ROOT and the non-DEBUG build will go in
552 $ROOT-nd.  Other values will be treated as "no".
555 .SH NIGHTLY HOOK ENVIRONMENT VARIABLES
557 Several optional environment variables may specify commands to run at
558 various points during the build.  Commands specified in the hook
559 variable will be run in a subshell; command output will be appended to
560 the mail message and log file.  If the hook exits with a non-zero
561 status, the build is aborted immediately.  Environment variables
562 defined in the environment file will be available.
564 .B SYS_PRE_NIGHTLY
565 .RS 5
566 Run just after the workspace lock is acquired.  This is reserved for
567 per-build-machine customizations and should be set only in /etc/nightly.conf
570 .B PRE_NIGHTLY
571 .RS 5
572 Run just after SYS_PRE_NIGHTLY.
575 .B PRE_BRINGOVER
576 .RS 5
577 Run just before bringover is started; not run if no bringover is done.
580 .B POST_BRINGOVER
581 .RS 5
582 Run just after bringover completes; not run if no bringover is done.
585 .B POST_NIGHTLY
586 .RS 5
587 Run after the build completes, with the return status of nightly - one
588 of "Completed", "Interrupted", or "Failed" - available in the
589 environment variable NIGHTLY_STATUS.
592 .B SYS_POST_NIGHTLY
593 .RS 5
594 This is reserved for per-build-machine customizations, and runs
595 immedately after POST_NIGHTLY.
598 .SH REALMODE ENVIRONMENT VARIABLES
600 The following environment variables referenced by
601 .I nightly
602 are only required when the -X option is used.
605 .B IA32_IHV_WS
606 .RS 5
607 Reference to the IHV workspace containing IHV driver binaries.
608 The IHV workspace must be fully built before starting the ON realmode build.
611 .B IA32_IHV_ROOT
612 .RS 5
613 Reference to the IHV workspace proto area.
614 The IHV workspace must be fully built before starting the ON realmode build.
617 .B IA32_IHV_PKGS
618 .RS 5
619 Reference to the IHV workspace packages.  If this is empty or the directory
620 is non-existent, then nightly will skip copying the packages.
623 .B IA32_IHV_BINARY_PKGS
624 .RS 5
625 Reference to binary-only IHV packages.  If this is empty or the directory
626 is non-existent, then nightly will skip copying the packages.
629 .B SPARC_RM_PKGARCHIVE
630 .RS 5
631 Destination for sparc realmode package SUNWrmodu.
632 Yes, this sparc package really is built on x86.
633 .SH FILES
635 .RS 5
636 /etc/nightly.conf
639 If present, nightly executes this file just prior to executing the
640 .I env
641 file.  
642 .SH BUILDING THE IHV WORKSPACE
644 The IHV workspace can be built with
645 .I nightly.
646 The recommended options are:
648 .RS 5
649 NIGHTLY_OPTIONS="-pmWN"
652 None of the realmode environment variables needed for ON realmode builds
653 are required to build the IHV workspace.
654 .SH EXAMPLES
656 Start with the example file in usr/src/tools/env/developer.sh
657 (or gatekeeper.sh), copy to myenv and make your changes.
659 .PD 0
660 # grep NIGHTLY_OPTIONS myenv
662 NIGHTLY_OPTIONS="-ACrlapDm"
664 export NIGHTLY_OPTIONS
666 # /opt/onbld/bin/nightly -i myenv
669 .SH SEE ALSO
670 .BR bldenv (1)