Print this page
Nightly can use a different tempdir.
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/tools/scripts/nightly.sh
+++ new/usr/src/tools/scripts/nightly.sh
1 1 #!/bin/ksh -p
2 2 #
3 3 # CDDL HEADER START
4 4 #
5 5 # The contents of this file are subject to the terms of the
6 6 # Common Development and Distribution License (the "License").
7 7 # You may not use this file except in compliance with the License.
8 8 #
9 9 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 10 # or http://www.opensolaris.org/os/licensing.
11 11 # See the License for the specific language governing permissions
12 12 # and limitations under the License.
13 13 #
14 14 # When distributing Covered Code, include this CDDL HEADER in each
15 15 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 16 # If applicable, add the following below this CDDL HEADER, with the
17 17 # fields enclosed by brackets "[]" replaced with your own identifying
18 18 # information: Portions Copyright [yyyy] [name of copyright owner]
19 19 #
20 20 # CDDL HEADER END
21 21 #
22 22
23 23 #
24 24 # Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
25 25 # Copyright 2008, 2010, Richard Lowe
26 26 # Copyright 2011 Nexenta Systems, Inc. All rights reserved.
27 27 # Copyright 2012 Joshua M. Clulow <josh@sysmgr.org>
28 28 #
29 29 # Based on the nightly script from the integration folks,
30 30 # Mostly modified and owned by mike_s.
31 31 # Changes also by kjc, dmk.
32 32 #
33 33 # BRINGOVER_WS may be specified in the env file.
34 34 # The default is the old behavior of CLONE_WS
35 35 #
36 36 # -i on the command line, means fast options, so when it's on the
37 37 # command line (only), lint and check builds are skipped no matter what
38 38 # the setting of their individual flags are in NIGHTLY_OPTIONS.
39 39 #
40 40 # LINTDIRS can be set in the env file, format is a list of:
41 41 #
42 42 # /dirname-to-run-lint-on flag
43 43 #
44 44 # Where flag is: y - enable lint noise diff output
45 45 # n - disable lint noise diff output
46 46 #
47 47 # For example: LINTDIRS="$SRC/uts n $SRC/stand y $SRC/psm y"
48 48 #
49 49 # OPTHOME and TEAMWARE may be set in the environment to override /opt
50 50 # and /opt/teamware defaults.
51 51 #
52 52
53 53 #
54 54 # The CDPATH variable causes ksh's `cd' builtin to emit messages to stdout
55 55 # under certain circumstances, which can really screw things up; unset it.
56 56 #
57 57 unset CDPATH
58 58
59 59 # Get the absolute path of the nightly script that the user invoked. This
60 60 # may be a relative path, and we need to do this before changing directory.
61 61 nightly_path=`whence $0`
62 62
63 63 #
64 64 # Keep track of where we found nightly so we can invoke the matching
65 65 # which_scm script. If that doesn't work, don't go guessing, just rely
66 66 # on the $PATH settings, which will generally give us either /opt/onbld
67 67 # or the user's workspace.
68 68 #
69 69 WHICH_SCM=$(dirname $nightly_path)/which_scm
70 70 if [[ ! -x $WHICH_SCM ]]; then
71 71 WHICH_SCM=which_scm
72 72 fi
73 73
74 74 function fatal_error
75 75 {
76 76 print -u2 "nightly: $*"
77 77 exit 1
78 78 }
79 79
80 80 #
81 81 # Function to do a DEBUG and non-DEBUG build. Needed because we might
82 82 # need to do another for the source build, and since we only deliver DEBUG or
83 83 # non-DEBUG packages.
84 84 #
85 85 # usage: normal_build
86 86 #
87 87 function normal_build {
88 88
89 89 typeset orig_p_FLAG="$p_FLAG"
90 90 typeset crypto_signer="$CODESIGN_USER"
91 91
92 92 suffix=""
93 93
94 94 # non-DEBUG build begins
95 95
96 96 if [ "$F_FLAG" = "n" ]; then
97 97 set_non_debug_build_flags
98 98 CODESIGN_USER="$crypto_signer" \
99 99 build "non-DEBUG" "$suffix-nd" "-nd" "$MULTI_PROTO"
100 100 if [ "$build_ok" = "y" -a "$X_FLAG" = "y" -a \
101 101 "$p_FLAG" = "y" ]; then
102 102 copy_ihv_pkgs non-DEBUG -nd
103 103 fi
104 104 else
105 105 echo "\n==== No non-DEBUG $open_only build ====\n" >> "$LOGFILE"
106 106 fi
107 107
108 108 # non-DEBUG build ends
109 109
110 110 # DEBUG build begins
111 111
112 112 if [ "$D_FLAG" = "y" ]; then
113 113 set_debug_build_flags
114 114 CODESIGN_USER="$crypto_signer" \
115 115 build "DEBUG" "$suffix" "" "$MULTI_PROTO"
116 116 if [ "$build_ok" = "y" -a "$X_FLAG" = "y" -a \
117 117 "$p_FLAG" = "y" ]; then
118 118 copy_ihv_pkgs DEBUG ""
119 119 fi
120 120 else
121 121 echo "\n==== No DEBUG $open_only build ====\n" >> "$LOGFILE"
122 122 fi
123 123
124 124 # DEBUG build ends
125 125
126 126 p_FLAG="$orig_p_FLAG"
127 127 }
128 128
129 129 #
130 130 # usage: run_hook HOOKNAME ARGS...
131 131 #
132 132 # If variable "$HOOKNAME" is defined, insert a section header into
133 133 # our logs and then run the command with ARGS
134 134 #
135 135 function run_hook {
136 136 HOOKNAME=$1
137 137 eval HOOKCMD=\$$HOOKNAME
138 138 shift
139 139
140 140 if [ -n "$HOOKCMD" ]; then
141 141 (
142 142 echo "\n==== Running $HOOKNAME command: $HOOKCMD ====\n"
143 143 ( $HOOKCMD "$@" 2>&1 )
144 144 if [ "$?" -ne 0 ]; then
145 145 # Let exit status propagate up
146 146 touch $TMPDIR/abort
147 147 fi
148 148 ) | tee -a $mail_msg_file >> $LOGFILE
149 149
150 150 if [ -f $TMPDIR/abort ]; then
151 151 build_ok=n
152 152 echo "\nAborting at request of $HOOKNAME" |
153 153 tee -a $mail_msg_file >> $LOGFILE
154 154 exit 1
155 155 fi
156 156 fi
157 157 }
158 158
159 159 #
160 160 # usage: filelist DESTDIR PATTERN
161 161 #
162 162 function filelist {
163 163 DEST=$1
164 164 PATTERN=$2
165 165 cd ${DEST}
166 166 }
167 167
168 168 # function to save off binaries after a full build for later
169 169 # restoration
170 170 function save_binaries {
171 171 # save off list of binaries
172 172 echo "\n==== Saving binaries from build at `date` ====\n" | \
173 173 tee -a $mail_msg_file >> $LOGFILE
174 174 rm -f ${BINARCHIVE}
175 175 cd ${CODEMGR_WS}
176 176 filelist ${CODEMGR_WS} '^preserve:' >> $LOGFILE
177 177 filelist ${CODEMGR_WS} '^preserve:' | \
178 178 cpio -ocB 2>/dev/null | compress \
179 179 > ${BINARCHIVE}
180 180 }
181 181
182 182 # delete files
183 183 # usage: hybridize_files DESTDIR MAKE_TARGET
184 184 function hybridize_files {
185 185 DEST=$1
186 186 MAKETARG=$2
187 187
188 188 echo "\n==== Hybridizing files at `date` ====\n" | \
189 189 tee -a $mail_msg_file >> $LOGFILE
190 190 for i in `filelist ${DEST} '^delete:'`
191 191 do
192 192 echo "removing ${i}." | tee -a $mail_msg_file >> $LOGFILE
193 193 rm -rf "${i}"
194 194 done
195 195 for i in `filelist ${DEST} '^hybridize:' `
196 196 do
197 197 echo "hybridizing ${i}." | tee -a $mail_msg_file >> $LOGFILE
198 198 rm -f ${i}+
199 199 sed -e "/^# HYBRID DELETE START/,/^# HYBRID DELETE END/d" \
200 200 < ${i} > ${i}+
201 201 mv ${i}+ ${i}
202 202 done
203 203 }
204 204
205 205 # restore binaries into the proper source tree.
206 206 # usage: restore_binaries DESTDIR MAKE_TARGET
207 207 function restore_binaries {
208 208 DEST=$1
209 209 MAKETARG=$2
210 210
211 211 echo "\n==== Restoring binaries to ${MAKETARG} at `date` ====\n" | \
212 212 tee -a $mail_msg_file >> $LOGFILE
213 213 cd ${DEST}
214 214 zcat ${BINARCHIVE} | \
215 215 cpio -idmucvB 2>/dev/null | tee -a $mail_msg_file >> ${LOGFILE}
216 216 }
217 217
218 218 # rename files we save binaries of
219 219 # usage: rename_files DESTDIR MAKE_TARGET
220 220 function rename_files {
221 221 DEST=$1
222 222 MAKETARG=$2
223 223 echo "\n==== Renaming source files in ${MAKETARG} at `date` ====\n" | \
224 224 tee -a $mail_msg_file >> $LOGFILE
225 225 for i in `filelist ${DEST} '^rename:'`
226 226 do
227 227 echo ${i} | tee -a $mail_msg_file >> ${LOGFILE}
228 228 rm -f ${i}.export
229 229 mv ${i} ${i}.export
230 230 done
231 231 }
232 232
233 233 # Return library search directive as function of given root.
234 234 function myldlibs {
235 235 echo "-L$1/lib -L$1/usr/lib"
236 236 }
237 237
238 238 # Return header search directive as function of given root.
239 239 function myheaders {
240 240 echo "-I$1/usr/include"
241 241 }
242 242
243 243 #
244 244 # Function to do the build, including package generation.
245 245 # usage: build LABEL SUFFIX ND MULTIPROTO
246 246 # - LABEL is used to tag build output.
247 247 # - SUFFIX is used to distinguish files (e.g., DEBUG vs non-DEBUG,
248 248 # open-only vs full tree).
249 249 # - ND is "-nd" (non-DEBUG builds) or "" (DEBUG builds).
250 250 # - If MULTIPROTO is "yes", it means to name the proto area according to
251 251 # SUFFIX. Otherwise ("no"), (re)use the standard proto area.
252 252 #
253 253 function build {
254 254 LABEL=$1
255 255 SUFFIX=$2
256 256 ND=$3
257 257 MULTIPROTO=$4
258 258 INSTALLOG=install${SUFFIX}-${MACH}
259 259 NOISE=noise${SUFFIX}-${MACH}
260 260 PKGARCHIVE=${PKGARCHIVE_ORIG}${SUFFIX}
261 261
262 262 ORIGROOT=$ROOT
263 263 [ $MULTIPROTO = no ] || export ROOT=$ROOT$SUFFIX
264 264
265 265 export ENVLDLIBS1=`myldlibs $ROOT`
266 266 export ENVCPPFLAGS1=`myheaders $ROOT`
267 267
268 268 this_build_ok=y
269 269 #
270 270 # Build OS-Networking source
271 271 #
272 272 echo "\n==== Building OS-Net source at `date` ($LABEL) ====\n" \
273 273 >> $LOGFILE
274 274
275 275 rm -f $SRC/${INSTALLOG}.out
276 276 cd $SRC
277 277 /bin/time $MAKE -e install 2>&1 | \
278 278 tee -a $SRC/${INSTALLOG}.out >> $LOGFILE
279 279
280 280 if [[ "$SCM_TYPE" = teamware ]]; then
281 281 echo "\n==== SCCS Noise ($LABEL) ====\n" >> $mail_msg_file
282 282 egrep 'sccs(check:| *get)' $SRC/${INSTALLOG}.out >> \
283 283 $mail_msg_file
284 284 fi
285 285
286 286 echo "\n==== Build errors ($LABEL) ====\n" >> $mail_msg_file
287 287 egrep ":" $SRC/${INSTALLOG}.out |
288 288 egrep -e "(^${MAKE}:|[ ]error[: \n])" | \
289 289 egrep -v "Ignoring unknown host" | \
290 290 egrep -v "cc .* -o error " | \
291 291 egrep -v "warning" >> $mail_msg_file
292 292 if [ "$?" = "0" ]; then
293 293 build_ok=n
294 294 this_build_ok=n
295 295 fi
296 296 grep "bootblock image is .* bytes too big" $SRC/${INSTALLOG}.out \
297 297 >> $mail_msg_file
298 298 if [ "$?" = "0" ]; then
299 299 build_ok=n
300 300 this_build_ok=n
301 301 fi
302 302
303 303 if [ "$W_FLAG" = "n" ]; then
304 304 echo "\n==== Build warnings ($LABEL) ====\n" >>$mail_msg_file
305 305 egrep -i warning: $SRC/${INSTALLOG}.out \
306 306 | egrep -v '^tic:' \
307 307 | egrep -v "symbol (\`|')timezone' has differing types:" \
308 308 | egrep -v "parameter <PSTAMP> set to" \
309 309 | egrep -v "Ignoring unknown host" \
310 310 | egrep -v "redefining segment flags attribute for" \
311 311 >> $mail_msg_file
312 312 fi
313 313
314 314 echo "\n==== Ended OS-Net source build at `date` ($LABEL) ====\n" \
315 315 >> $LOGFILE
316 316
317 317 echo "\n==== Elapsed build time ($LABEL) ====\n" >>$mail_msg_file
318 318 tail -3 $SRC/${INSTALLOG}.out >>$mail_msg_file
319 319
320 320 if [ "$i_FLAG" = "n" -a "$W_FLAG" = "n" ]; then
321 321 rm -f $SRC/${NOISE}.ref
322 322 if [ -f $SRC/${NOISE}.out ]; then
323 323 mv $SRC/${NOISE}.out $SRC/${NOISE}.ref
324 324 fi
325 325 grep : $SRC/${INSTALLOG}.out \
326 326 | egrep -v '^/' \
327 327 | egrep -v '^(Start|Finish|real|user|sys|./bld_awk)' \
328 328 | egrep -v '^tic:' \
329 329 | egrep -v '^mcs' \
330 330 | egrep -v '^LD_LIBRARY_PATH=' \
331 331 | egrep -v 'ar: creating' \
332 332 | egrep -v 'ar: writing' \
333 333 | egrep -v 'conflicts:' \
334 334 | egrep -v ':saved created' \
335 335 | egrep -v '^stty.*c:' \
336 336 | egrep -v '^mfgname.c:' \
337 337 | egrep -v '^uname-i.c:' \
338 338 | egrep -v '^volumes.c:' \
339 339 | egrep -v '^lint library construction:' \
340 340 | egrep -v 'tsort: INFORM:' \
341 341 | egrep -v 'stripalign:' \
342 342 | egrep -v 'chars, width' \
343 343 | egrep -v "symbol (\`|')timezone' has differing types:" \
344 344 | egrep -v 'PSTAMP' \
345 345 | egrep -v '|%WHOANDWHERE%|' \
346 346 | egrep -v '^Manifying' \
347 347 | egrep -v 'Ignoring unknown host' \
348 348 | egrep -v 'Processing method:' \
349 349 | egrep -v '^Writing' \
350 350 | egrep -v 'spellin1:' \
351 351 | egrep -v '^adding:' \
352 352 | egrep -v "^echo 'msgid" \
353 353 | egrep -v '^echo ' \
354 354 | egrep -v '\.c:$' \
355 355 | egrep -v '^Adding file:' \
356 356 | egrep -v 'CLASSPATH=' \
357 357 | egrep -v '\/var\/mail\/:saved' \
358 358 | egrep -v -- '-DUTS_VERSION=' \
359 359 | egrep -v '^Running Mkbootstrap' \
360 360 | egrep -v '^Applet length read:' \
361 361 | egrep -v 'bytes written:' \
362 362 | egrep -v '^File:SolarisAuthApplet.bin' \
363 363 | egrep -v -i 'jibversion' \
364 364 | egrep -v '^Output size:' \
365 365 | egrep -v '^Solo size statistics:' \
366 366 | egrep -v '^Using ROM API Version' \
367 367 | egrep -v '^Zero Signature length:' \
368 368 | egrep -v '^Note \(probably harmless\):' \
369 369 | egrep -v '::' \
370 370 | egrep -v -- '-xcache' \
371 371 | egrep -v '^\+' \
372 372 | egrep -v '^cc1: note: -fwritable-strings' \
373 373 | egrep -v 'svccfg-native -s svc:/' \
374 374 | sort | uniq >$SRC/${NOISE}.out
375 375 if [ ! -f $SRC/${NOISE}.ref ]; then
376 376 cp $SRC/${NOISE}.out $SRC/${NOISE}.ref
377 377 fi
378 378 echo "\n==== Build noise differences ($LABEL) ====\n" \
379 379 >>$mail_msg_file
380 380 diff $SRC/${NOISE}.ref $SRC/${NOISE}.out >>$mail_msg_file
381 381 fi
382 382
383 383 #
384 384 # Re-sign selected binaries using signing server
385 385 # (gatekeeper builds only)
386 386 #
387 387 if [ -n "$CODESIGN_USER" -a "$this_build_ok" = "y" ]; then
388 388 echo "\n==== Signing proto area at `date` ====\n" >> $LOGFILE
389 389 signing_file="${TMPDIR}/signing"
390 390 rm -f ${signing_file}
391 391 export CODESIGN_USER
392 392 signproto $SRC/tools/codesign/creds 2>&1 | \
393 393 tee -a ${signing_file} >> $LOGFILE
394 394 echo "\n==== Finished signing proto area at `date` ====\n" \
395 395 >> $LOGFILE
396 396 echo "\n==== Crypto module signing errors ($LABEL) ====\n" \
397 397 >> $mail_msg_file
398 398 egrep 'WARNING|ERROR' ${signing_file} >> $mail_msg_file
399 399 if (( $? == 0 )) ; then
400 400 build_ok=n
401 401 this_build_ok=n
402 402 fi
403 403 fi
404 404
405 405 #
406 406 # Building Packages
407 407 #
408 408 if [ "$p_FLAG" = "y" -a "$this_build_ok" = "y" ]; then
409 409 if [ -d $SRC/pkg -o -d $SRC/pkgdefs ]; then
410 410 echo "\n==== Creating $LABEL packages at `date` ====\n" \
411 411 >> $LOGFILE
412 412 echo "Clearing out $PKGARCHIVE ..." >> $LOGFILE
413 413 rm -rf $PKGARCHIVE >> "$LOGFILE" 2>&1
414 414 mkdir -p $PKGARCHIVE >> "$LOGFILE" 2>&1
415 415
416 416 for d in pkg pkgdefs; do
417 417 if [ ! -f "$SRC/$d/Makefile" ]; then
418 418 continue
419 419 fi
420 420 rm -f $SRC/$d/${INSTALLOG}.out
421 421 cd $SRC/$d
422 422 /bin/time $MAKE -e install 2>&1 | \
423 423 tee -a $SRC/$d/${INSTALLOG}.out >> $LOGFILE
424 424 done
425 425
426 426 echo "\n==== package build errors ($LABEL) ====\n" \
427 427 >> $mail_msg_file
428 428
429 429 for d in pkg pkgdefs; do
430 430 if [ ! -f "$SRC/$d/Makefile" ]; then
431 431 continue
432 432 fi
433 433
434 434 egrep "${MAKE}|ERROR|WARNING" $SRC/$d/${INSTALLOG}.out | \
435 435 grep ':' | \
436 436 grep -v PSTAMP | \
437 437 egrep -v "Ignoring unknown host" \
438 438 >> $mail_msg_file
439 439 done
440 440 else
441 441 #
442 442 # Handle it gracefully if -p was set but there are
443 443 # neither pkg nor pkgdefs directories.
444 444 #
445 445 echo "\n==== No $LABEL packages to build ====\n" \
446 446 >> $LOGFILE
447 447 fi
448 448 else
449 449 echo "\n==== Not creating $LABEL packages ====\n" >> $LOGFILE
450 450 fi
451 451
452 452 ROOT=$ORIGROOT
453 453 }
454 454
455 455 # Usage: dolint /dir y|n
456 456 # Arg. 2 is a flag to turn on/off the lint diff output
457 457 function dolint {
458 458 if [ ! -d "$1" ]; then
459 459 echo "dolint error: $1 is not a directory"
460 460 exit 1
461 461 fi
462 462
463 463 if [ "$2" != "y" -a "$2" != "n" ]; then
464 464 echo "dolint internal error: $2 should be 'y' or 'n'"
465 465 exit 1
466 466 fi
467 467
468 468 lintdir=$1
469 469 dodiff=$2
470 470 base=`basename $lintdir`
471 471 LINTOUT=$lintdir/lint-${MACH}.out
472 472 LINTNOISE=$lintdir/lint-noise-${MACH}
473 473 export ENVLDLIBS1=`myldlibs $ROOT`
474 474 export ENVCPPFLAGS1=`myheaders $ROOT`
475 475
476 476 set_debug_build_flags
477 477
478 478 #
479 479 # '$MAKE lint' in $lintdir
480 480 #
481 481 echo "\n==== Begin '$MAKE lint' of $base at `date` ====\n" >> $LOGFILE
482 482
483 483 # remove old lint.out
484 484 rm -f $lintdir/lint.out $lintdir/lint-noise.out
485 485 if [ -f $lintdir/lint-noise.ref ]; then
486 486 mv $lintdir/lint-noise.ref ${LINTNOISE}.ref
487 487 fi
488 488
489 489 rm -f $LINTOUT
490 490 cd $lintdir
491 491 #
492 492 # Remove all .ln files to ensure a full reference file
493 493 #
494 494 rm -f Nothing_to_remove \
495 495 `find . \( -name SCCS -o -name .hg -o -name .svn -o -name .git \) \
496 496 -prune -o -type f -name '*.ln' -print `
497 497
498 498 /bin/time $MAKE -ek lint 2>&1 | \
499 499 tee -a $LINTOUT >> $LOGFILE
500 500 echo "\n==== '$MAKE lint' of $base ERRORS ====\n" >> $mail_msg_file
501 501 grep "$MAKE:" $LINTOUT |
502 502 egrep -v "Ignoring unknown host" \
503 503 >> $mail_msg_file
504 504
505 505 echo "\n==== Ended '$MAKE lint' of $base at `date` ====\n" >> $LOGFILE
506 506
507 507 echo "\n==== Elapsed time of '$MAKE lint' of $base ====\n" \
508 508 >>$mail_msg_file
509 509 tail -3 $LINTOUT >>$mail_msg_file
510 510
511 511 rm -f ${LINTNOISE}.ref
512 512 if [ -f ${LINTNOISE}.out ]; then
513 513 mv ${LINTNOISE}.out ${LINTNOISE}.ref
514 514 fi
515 515 grep : $LINTOUT | \
516 516 egrep -v '^(real|user|sys)' |
517 517 egrep -v '(library construction)' | \
518 518 egrep -v ': global crosschecks' | \
519 519 egrep -v 'Ignoring unknown host' | \
520 520 egrep -v '\.c:$' | \
521 521 sort | uniq > ${LINTNOISE}.out
522 522 if [ ! -f ${LINTNOISE}.ref ]; then
523 523 cp ${LINTNOISE}.out ${LINTNOISE}.ref
524 524 fi
525 525 if [ "$dodiff" != "n" ]; then
526 526 echo "\n==== lint warnings $base ====\n" \
527 527 >>$mail_msg_file
528 528 # should be none, though there are a few that were filtered out
529 529 # above
530 530 egrep -i '(warning|lint):' ${LINTNOISE}.out \
531 531 | sort | uniq >> $mail_msg_file
532 532 echo "\n==== lint noise differences $base ====\n" \
533 533 >> $mail_msg_file
534 534 diff ${LINTNOISE}.ref ${LINTNOISE}.out \
535 535 >> $mail_msg_file
536 536 fi
537 537 }
538 538
539 539 # Install proto area from IHV build
540 540
541 541 function copy_ihv_proto {
542 542
543 543 echo "\n==== Installing IHV proto area ====\n" \
544 544 >> $LOGFILE
545 545 if [ -d "$IA32_IHV_ROOT" ]; then
546 546 if [ ! -d "$ROOT" ]; then
547 547 echo "mkdir -p $ROOT" >> $LOGFILE
548 548 mkdir -p $ROOT
549 549 fi
550 550 echo "copying $IA32_IHV_ROOT to $ROOT\n" >> $LOGFILE
551 551 cd $IA32_IHV_ROOT
552 552 tar cf - . | (cd $ROOT; umask 0; tar xpf - ) 2>&1 >> $LOGFILE
553 553 else
554 554 echo "$IA32_IHV_ROOT: not found" >> $LOGFILE
555 555 fi
556 556
557 557 if [ "$MULTI_PROTO" = yes ]; then
558 558 if [ ! -d "$ROOT-nd" ]; then
559 559 echo "mkdir -p $ROOT-nd" >> $LOGFILE
560 560 mkdir -p $ROOT-nd
561 561 fi
562 562 # If there's a non-DEBUG version of the IHV proto area,
563 563 # copy it, but copy something if there's not.
564 564 if [ -d "$IA32_IHV_ROOT-nd" ]; then
565 565 echo "copying $IA32_IHV_ROOT-nd to $ROOT-nd\n" >> $LOGFILE
566 566 cd $IA32_IHV_ROOT-nd
567 567 elif [ -d "$IA32_IHV_ROOT" ]; then
568 568 echo "copying $IA32_IHV_ROOT to $ROOT-nd\n" >> $LOGFILE
569 569 cd $IA32_IHV_ROOT
570 570 else
571 571 echo "$IA32_IHV_ROOT{-nd,}: not found" >> $LOGFILE
572 572 return
573 573 fi
574 574 tar cf - . | (cd $ROOT-nd; umask 0; tar xpf - ) 2>&1 >> $LOGFILE
575 575 fi
576 576 }
577 577
578 578 # Install IHV packages in PKGARCHIVE
579 579 # usage: copy_ihv_pkgs LABEL SUFFIX
580 580 function copy_ihv_pkgs {
581 581 LABEL=$1
582 582 SUFFIX=$2
583 583 # always use non-DEBUG IHV packages
584 584 IA32_IHV_PKGS=${IA32_IHV_PKGS_ORIG}-nd
585 585 PKGARCHIVE=${PKGARCHIVE_ORIG}${SUFFIX}
586 586
587 587 echo "\n==== Installing IHV packages from $IA32_IHV_PKGS ($LABEL) ====\n" \
588 588 >> $LOGFILE
589 589 if [ -d "$IA32_IHV_PKGS" ]; then
590 590 cd $IA32_IHV_PKGS
591 591 tar cf - * | \
592 592 (cd $PKGARCHIVE; umask 0; tar xpf - ) 2>&1 >> $LOGFILE
593 593 else
594 594 echo "$IA32_IHV_PKGS: not found" >> $LOGFILE
595 595 fi
596 596
597 597 echo "\n==== Installing IHV packages from $IA32_IHV_BINARY_PKGS ($LABEL) ====\n" \
598 598 >> $LOGFILE
599 599 if [ -d "$IA32_IHV_BINARY_PKGS" ]; then
600 600 cd $IA32_IHV_BINARY_PKGS
601 601 tar cf - * | \
602 602 (cd $PKGARCHIVE; umask 0; tar xpf - ) 2>&1 >> $LOGFILE
603 603 else
604 604 echo "$IA32_IHV_BINARY_PKGS: not found" >> $LOGFILE
605 605 fi
606 606 }
607 607
608 608 #
609 609 # Build and install the onbld tools.
610 610 #
611 611 # usage: build_tools DESTROOT
612 612 #
613 613 # returns non-zero status if the build was successful.
614 614 #
615 615 function build_tools {
616 616 DESTROOT=$1
617 617
618 618 INSTALLOG=install-${MACH}
619 619
620 620 echo "\n==== Building tools at `date` ====\n" \
621 621 >> $LOGFILE
622 622
623 623 rm -f ${TOOLS}/${INSTALLOG}.out
624 624 cd ${TOOLS}
625 625 /bin/time $MAKE TOOLS_PROTO=${DESTROOT} -e install 2>&1 | \
626 626 tee -a ${TOOLS}/${INSTALLOG}.out >> $LOGFILE
627 627
628 628 echo "\n==== Tools build errors ====\n" >> $mail_msg_file
629 629
630 630 egrep ":" ${TOOLS}/${INSTALLOG}.out |
631 631 egrep -e "(${MAKE}:|[ ]error[: \n])" | \
632 632 egrep -v "Ignoring unknown host" | \
633 633 egrep -v warning >> $mail_msg_file
634 634 return $?
635 635 }
636 636
637 637 #
638 638 # Set up to use locally installed tools.
639 639 #
640 640 # usage: use_tools TOOLSROOT
641 641 #
642 642 function use_tools {
643 643 TOOLSROOT=$1
644 644
645 645 #
646 646 # If we're not building ON workspace, then the TOOLSROOT
647 647 # settings here are clearly ignored by the workspace
648 648 # makefiles, prepending nonexistent directories to PATH is
649 649 # harmless, and we clearly do not wish to override
650 650 # ONBLD_TOOLS.
651 651 #
652 652 # If we're building an ON workspace, then the prepended PATH
653 653 # elements should supercede the preexisting ONBLD_TOOLS paths,
654 654 # and we want to override ONBLD_TOOLS to catch the tools that
655 655 # don't have specific path env vars here.
656 656 #
657 657 # So the only conditional behavior is overriding ONBLD_TOOLS,
658 658 # and we check for "an ON workspace" by looking for
659 659 # ${TOOLSROOT}/opt/onbld.
660 660 #
661 661
662 662 STABS=${TOOLSROOT}/opt/onbld/bin/${MACH}/stabs
663 663 export STABS
664 664 CTFSTABS=${TOOLSROOT}/opt/onbld/bin/${MACH}/ctfstabs
665 665 export CTFSTABS
666 666 GENOFFSETS=${TOOLSROOT}/opt/onbld/bin/genoffsets
667 667 export GENOFFSETS
668 668
669 669 CTFCONVERT=${TOOLSROOT}/opt/onbld/bin/${MACH}/ctfconvert
670 670 export CTFCONVERT
671 671 CTFMERGE=${TOOLSROOT}/opt/onbld/bin/${MACH}/ctfmerge
672 672 export CTFMERGE
673 673
674 674 CTFCVTPTBL=${TOOLSROOT}/opt/onbld/bin/ctfcvtptbl
675 675 export CTFCVTPTBL
676 676 CTFFINDMOD=${TOOLSROOT}/opt/onbld/bin/ctffindmod
677 677 export CTFFINDMOD
678 678
679 679 if [ "$VERIFY_ELFSIGN" = "y" ]; then
680 680 ELFSIGN=${TOOLSROOT}/opt/onbld/bin/elfsigncmp
681 681 else
682 682 ELFSIGN=${TOOLSROOT}/opt/onbld/bin/${MACH}/elfsign
683 683 fi
684 684 export ELFSIGN
685 685
686 686 PATH="${TOOLSROOT}/opt/onbld/bin/${MACH}:${PATH}"
687 687 PATH="${TOOLSROOT}/opt/onbld/bin:${PATH}"
688 688 export PATH
689 689
690 690 if [ -d "${TOOLSROOT}/opt/onbld" ]; then
691 691 ONBLD_TOOLS=${TOOLSROOT}/opt/onbld
692 692 export ONBLD_TOOLS
693 693 fi
694 694
695 695 echo "\n==== New environment settings. ====\n" >> $LOGFILE
696 696 echo "STABS=${STABS}" >> $LOGFILE
697 697 echo "CTFSTABS=${CTFSTABS}" >> $LOGFILE
698 698 echo "CTFCONVERT=${CTFCONVERT}" >> $LOGFILE
699 699 echo "CTFMERGE=${CTFMERGE}" >> $LOGFILE
700 700 echo "CTFCVTPTBL=${CTFCVTPTBL}" >> $LOGFILE
701 701 echo "CTFFINDMOD=${CTFFINDMOD}" >> $LOGFILE
702 702 echo "ELFSIGN=${ELFSIGN}" >> $LOGFILE
703 703 echo "PATH=${PATH}" >> $LOGFILE
704 704 echo "ONBLD_TOOLS=${ONBLD_TOOLS}" >> $LOGFILE
705 705 }
706 706
707 707 function staffer {
708 708 if [ $ISUSER -ne 0 ]; then
709 709 "$@"
710 710 else
711 711 arg="\"$1\""
712 712 shift
713 713 for i
714 714 do
715 715 arg="$arg \"$i\""
716 716 done
717 717 eval su $STAFFER -c \'$arg\'
718 718 fi
719 719 }
720 720
721 721 #
722 722 # Verify that the closed tree is present if it needs to be.
723 723 #
724 724 function check_closed_tree {
725 725 if [[ ! -d "$ON_CLOSED_BINS" ]]; then
726 726 echo "ON_CLOSED_BINS must point to the closed binaries tree."
727 727 build_ok=n
728 728 exit 1
729 729 fi
730 730 }
731 731
732 732 function obsolete_build {
733 733 echo "WARNING: Obsolete $1 build requested; request will be ignored"
734 734 }
735 735
736 736 #
737 737 # wrapper over wsdiff.
738 738 # usage: do_wsdiff LABEL OLDPROTO NEWPROTO
739 739 #
740 740 function do_wsdiff {
741 741 label=$1
742 742 oldproto=$2
743 743 newproto=$3
744 744
745 745 wsdiff="wsdiff"
746 746 [ "$t_FLAG" = y ] && wsdiff="wsdiff -t"
747 747
748 748 echo "\n==== Getting object changes since last build at `date`" \
749 749 "($label) ====\n" | tee -a $LOGFILE >> $mail_msg_file
750 750 $wsdiff -s -r ${TMPDIR}/wsdiff.results $oldproto $newproto 2>&1 | \
751 751 tee -a $LOGFILE >> $mail_msg_file
752 752 echo "\n==== Object changes determined at `date` ($label) ====\n" | \
753 753 tee -a $LOGFILE >> $mail_msg_file
754 754 }
755 755
756 756 #
757 757 # Functions for setting build flags (DEBUG/non-DEBUG). Keep them
758 758 # together.
759 759 #
760 760
761 761 function set_non_debug_build_flags {
762 762 export RELEASE_BUILD ; RELEASE_BUILD=
763 763 unset EXTRA_OPTIONS
764 764 unset EXTRA_CFLAGS
765 765 }
766 766
767 767 function set_debug_build_flags {
768 768 unset RELEASE_BUILD
769 769 unset EXTRA_OPTIONS
770 770 unset EXTRA_CFLAGS
771 771 }
772 772
773 773
774 774 MACH=`uname -p`
775 775
776 776 if [ "$OPTHOME" = "" ]; then
777 777 OPTHOME=/opt
778 778 export OPTHOME
779 779 fi
780 780 if [ "$TEAMWARE" = "" ]; then
781 781 TEAMWARE=$OPTHOME/teamware
782 782 export TEAMWARE
783 783 fi
784 784
785 785 USAGE='Usage: nightly [-in] [+t] [-V VERS ] <env_file>
786 786
787 787 Where:
788 788 -i Fast incremental options (no clobber, lint, check)
789 789 -n Do not do a bringover
790 790 +t Use the build tools in $ONBLD_TOOLS/bin
791 791 -V VERS set the build version string to VERS
792 792
793 793 <env_file> file in Bourne shell syntax that sets and exports
794 794 variables that configure the operation of this script and many of
795 795 the scripts this one calls. If <env_file> does not exist,
796 796 it will be looked for in $OPTHOME/onbld/env.
797 797
798 798 non-DEBUG is the default build type. Build options can be set in the
799 799 NIGHTLY_OPTIONS variable in the <env_file> as follows:
800 800
801 801 -A check for ABI differences in .so files
802 802 -C check for cstyle/hdrchk errors
803 803 -D do a build with DEBUG on
804 804 -F do _not_ do a non-DEBUG build
805 805 -G gate keeper default group of options (-au)
806 806 -I integration engineer default group of options (-ampu)
807 807 -M do not run pmodes (safe file permission checker)
808 808 -N do not run protocmp
809 809 -R default group of options for building a release (-mp)
810 810 -U update proto area in the parent
811 811 -V VERS set the build version string to VERS
812 812 -X copy x86 IHV proto area
813 813 -f find unreferenced files
814 814 -i do an incremental build (no "make clobber")
815 815 -l do "make lint" in $LINTDIRS (default: $SRC y)
816 816 -m send mail to $MAILTO at end of build
817 817 -n do not do a bringover
818 818 -o build using root privileges to set OWNER/GROUP (old style)
819 819 -p create packages
820 820 -r check ELF runtime attributes in the proto area
821 821 -t build and use the tools in $SRC/tools (default setting)
822 822 +t Use the build tools in $ONBLD_TOOLS/bin
823 823 -u update proto_list_$MACH and friends in the parent workspace;
824 824 when used with -f, also build an unrefmaster.out in the parent
825 825 -w report on differences between previous and current proto areas
826 826 -z compress cpio archives with gzip
827 827 -W Do not report warnings (freeware gate ONLY)
828 828 '
829 829 #
830 830 # A log file will be generated under the name $LOGFILE
831 831 # for partially completed build and log.`date '+%F'`
832 832 # in the same directory for fully completed builds.
833 833 #
834 834
835 835 # default values for low-level FLAGS; G I R are group FLAGS
836 836 A_FLAG=n
837 837 C_FLAG=n
838 838 D_FLAG=n
839 839 F_FLAG=n
840 840 f_FLAG=n
841 841 i_FLAG=n; i_CMD_LINE_FLAG=n
842 842 l_FLAG=n
843 843 M_FLAG=n
844 844 m_FLAG=n
845 845 N_FLAG=n
846 846 n_FLAG=n
847 847 o_FLAG=n
848 848 P_FLAG=n
849 849 p_FLAG=n
850 850 r_FLAG=n
851 851 T_FLAG=n
852 852 t_FLAG=y
853 853 U_FLAG=n
854 854 u_FLAG=n
855 855 V_FLAG=n
856 856 W_FLAG=n
857 857 w_FLAG=n
858 858 X_FLAG=n
859 859 #
860 860 XMOD_OPT=
861 861 #
862 862 build_ok=y
863 863
864 864 #
865 865 # examine arguments
866 866 #
867 867
868 868 OPTIND=1
869 869 while getopts +intV: FLAG
870 870 do
871 871 case $FLAG in
872 872 i ) i_FLAG=y; i_CMD_LINE_FLAG=y
873 873 ;;
874 874 n ) n_FLAG=y
875 875 ;;
876 876 +t ) t_FLAG=n
877 877 ;;
878 878 V ) V_FLAG=y
879 879 V_ARG="$OPTARG"
880 880 ;;
881 881 \? ) echo "$USAGE"
882 882 exit 1
883 883 ;;
884 884 esac
885 885 done
886 886
887 887 # correct argument count after options
888 888 shift `expr $OPTIND - 1`
889 889
890 890 # test that the path to the environment-setting file was given
891 891 if [ $# -ne 1 ]; then
892 892 echo "$USAGE"
893 893 exit 1
894 894 fi
895 895
896 896 # check if user is running nightly as root
897 897 # ISUSER is set non-zero if an ordinary user runs nightly, or is zero
898 898 # when root invokes nightly.
899 899 /usr/bin/id | grep '^uid=0(' >/dev/null 2>&1
900 900 ISUSER=$?; export ISUSER
901 901
902 902 #
903 903 # force locale to C
904 904 LC_COLLATE=C; export LC_COLLATE
905 905 LC_CTYPE=C; export LC_CTYPE
906 906 LC_MESSAGES=C; export LC_MESSAGES
907 907 LC_MONETARY=C; export LC_MONETARY
908 908 LC_NUMERIC=C; export LC_NUMERIC
909 909 LC_TIME=C; export LC_TIME
910 910
911 911 # clear environment variables we know to be bad for the build
912 912 unset LD_OPTIONS
913 913 unset LD_AUDIT LD_AUDIT_32 LD_AUDIT_64
914 914 unset LD_BIND_NOW LD_BIND_NOW_32 LD_BIND_NOW_64
915 915 unset LD_BREADTH LD_BREADTH_32 LD_BREADTH_64
916 916 unset LD_CONFIG LD_CONFIG_32 LD_CONFIG_64
917 917 unset LD_DEBUG LD_DEBUG_32 LD_DEBUG_64
918 918 unset LD_DEMANGLE LD_DEMANGLE_32 LD_DEMANGLE_64
919 919 unset LD_FLAGS LD_FLAGS_32 LD_FLAGS_64
920 920 unset LD_LIBRARY_PATH LD_LIBRARY_PATH_32 LD_LIBRARY_PATH_64
921 921 unset LD_LOADFLTR LD_LOADFLTR_32 LD_LOADFLTR_64
922 922 unset LD_NOAUDIT LD_NOAUDIT_32 LD_NOAUDIT_64
923 923 unset LD_NOAUXFLTR LD_NOAUXFLTR_32 LD_NOAUXFLTR_64
924 924 unset LD_NOCONFIG LD_NOCONFIG_32 LD_NOCONFIG_64
925 925 unset LD_NODIRCONFIG LD_NODIRCONFIG_32 LD_NODIRCONFIG_64
926 926 unset LD_NODIRECT LD_NODIRECT_32 LD_NODIRECT_64
927 927 unset LD_NOLAZYLOAD LD_NOLAZYLOAD_32 LD_NOLAZYLOAD_64
928 928 unset LD_NOOBJALTER LD_NOOBJALTER_32 LD_NOOBJALTER_64
929 929 unset LD_NOVERSION LD_NOVERSION_32 LD_NOVERSION_64
930 930 unset LD_ORIGIN LD_ORIGIN_32 LD_ORIGIN_64
931 931 unset LD_PRELOAD LD_PRELOAD_32 LD_PRELOAD_64
932 932 unset LD_PROFILE LD_PROFILE_32 LD_PROFILE_64
933 933
934 934 unset CONFIG
935 935 unset GROUP
936 936 unset OWNER
937 937 unset REMOTE
938 938 unset ENV
939 939 unset ARCH
940 940 unset CLASSPATH
941 941 unset NAME
942 942
943 943 #
944 944 # To get ONBLD_TOOLS from the environment, it must come from the env file.
945 945 # If it comes interactively, it is generally TOOLS_PROTO, which will be
946 946 # clobbered before the compiler version checks, which will therefore fail.
947 947 #
948 948 unset ONBLD_TOOLS
949 949
950 950 #
951 951 # Setup environmental variables
952 952 #
953 953 if [ -f /etc/nightly.conf ]; then
954 954 . /etc/nightly.conf
955 955 fi
956 956
957 957 if [ -f $1 ]; then
958 958 if [[ $1 = */* ]]; then
959 959 . $1
960 960 else
961 961 . ./$1
962 962 fi
963 963 else
964 964 if [ -f $OPTHOME/onbld/env/$1 ]; then
965 965 . $OPTHOME/onbld/env/$1
966 966 else
967 967 echo "Cannot find env file as either $1 or $OPTHOME/onbld/env/$1"
968 968 exit 1
969 969 fi
970 970 fi
971 971
972 972 # contents of stdenv.sh inserted after next line:
973 973 # STDENV_START
974 974 # STDENV_END
975 975
976 976 # Check if we have sufficient data to continue...
977 977 [[ -v CODEMGR_WS ]] || fatal_error "Error: Variable CODEMGR_WS not set."
978 978 if [[ "${NIGHTLY_OPTIONS}" == ~(F)n ]] ; then
979 979 # Check if the gate data are valid if we don't do a "bringover" below
980 980 [[ -d "${CODEMGR_WS}" ]] || \
981 981 fatal_error "Error: ${CODEMGR_WS} is not a directory."
982 982 [[ -f "${CODEMGR_WS}/usr/src/Makefile" ]] || \
983 983 fatal_error "Error: ${CODEMGR_WS}/usr/src/Makefile not found."
984 984 fi
985 985
986 986 #
987 987 # place ourselves in a new task, respecting BUILD_PROJECT if set.
988 988 #
989 989 if [ -z "$BUILD_PROJECT" ]; then
990 990 /usr/bin/newtask -c $$
991 991 else
992 992 /usr/bin/newtask -c $$ -p $BUILD_PROJECT
993 993 fi
994 994
995 995 ps -o taskid= -p $$ | read build_taskid
996 996 ps -o project= -p $$ | read build_project
997 997
998 998 #
999 999 # See if NIGHTLY_OPTIONS is set
1000 1000 #
1001 1001 if [ "$NIGHTLY_OPTIONS" = "" ]; then
1002 1002 NIGHTLY_OPTIONS="-aBm"
1003 1003 fi
1004 1004
1005 1005 #
1006 1006 # If BRINGOVER_WS was not specified, let it default to CLONE_WS
1007 1007 #
1008 1008 if [ "$BRINGOVER_WS" = "" ]; then
1009 1009 BRINGOVER_WS=$CLONE_WS
1010 1010 fi
1011 1011
1012 1012 #
1013 1013 # If CLOSED_BRINGOVER_WS was not specified, let it default to CLOSED_CLONE_WS
1014 1014 #
1015 1015 if [ "$CLOSED_BRINGOVER_WS" = "" ]; then
1016 1016 CLOSED_BRINGOVER_WS=$CLOSED_CLONE_WS
1017 1017 fi
1018 1018
1019 1019 #
1020 1020 # If BRINGOVER_FILES was not specified, default to usr
1021 1021 #
1022 1022 if [ "$BRINGOVER_FILES" = "" ]; then
1023 1023 BRINGOVER_FILES="usr"
1024 1024 fi
1025 1025
1026 1026 check_closed_tree
1027 1027
1028 1028 #
1029 1029 # Note: changes to the option letters here should also be applied to the
1030 1030 # bldenv script. `d' is listed for backward compatibility.
1031 1031 #
1032 1032 NIGHTLY_OPTIONS=-${NIGHTLY_OPTIONS#-}
1033 1033 OPTIND=1
1034 1034 while getopts +ABCDdFfGIilMmNnoPpRrTtUuWwXxz FLAG $NIGHTLY_OPTIONS
1035 1035 do
1036 1036 case $FLAG in
1037 1037 A ) A_FLAG=y
1038 1038 ;;
1039 1039 B ) D_FLAG=y
1040 1040 ;; # old version of D
1041 1041 C ) C_FLAG=y
1042 1042 ;;
1043 1043 D ) D_FLAG=y
1044 1044 ;;
1045 1045 F ) F_FLAG=y
1046 1046 ;;
1047 1047 f ) f_FLAG=y
1048 1048 ;;
1049 1049 G ) u_FLAG=y
1050 1050 ;;
1051 1051 I ) m_FLAG=y
1052 1052 p_FLAG=y
1053 1053 u_FLAG=y
1054 1054 ;;
1055 1055 i ) i_FLAG=y
1056 1056 ;;
1057 1057 l ) l_FLAG=y
1058 1058 ;;
1059 1059 M ) M_FLAG=y
1060 1060 ;;
1061 1061 m ) m_FLAG=y
1062 1062 ;;
1063 1063 N ) N_FLAG=y
1064 1064 ;;
1065 1065 n ) n_FLAG=y
1066 1066 ;;
1067 1067 o ) o_FLAG=y
1068 1068 ;;
1069 1069 P ) P_FLAG=y
1070 1070 ;; # obsolete
1071 1071 p ) p_FLAG=y
1072 1072 ;;
1073 1073 R ) m_FLAG=y
1074 1074 p_FLAG=y
1075 1075 ;;
1076 1076 r ) r_FLAG=y
1077 1077 ;;
1078 1078 T ) T_FLAG=y
1079 1079 ;; # obsolete
1080 1080 +t ) t_FLAG=n
1081 1081 ;;
1082 1082 U ) if [ -z "${PARENT_ROOT}" ]; then
1083 1083 echo "PARENT_ROOT must be set if the U flag is" \
1084 1084 "present in NIGHTLY_OPTIONS."
1085 1085 exit 1
1086 1086 fi
1087 1087 NIGHTLY_PARENT_ROOT=$PARENT_ROOT
1088 1088 if [ -n "${PARENT_TOOLS_ROOT}" ]; then
1089 1089 NIGHTLY_PARENT_TOOLS_ROOT=$PARENT_TOOLS_ROOT
1090 1090 fi
1091 1091 U_FLAG=y
1092 1092 ;;
1093 1093 u ) u_FLAG=y
1094 1094 ;;
1095 1095 W ) W_FLAG=y
1096 1096 ;;
1097 1097
1098 1098 w ) w_FLAG=y
1099 1099 ;;
1100 1100 X ) # now that we no longer need realmode builds, just
1101 1101 # copy IHV packages. only meaningful on x86.
1102 1102 if [ "$MACH" = "i386" ]; then
1103 1103 X_FLAG=y
1104 1104 fi
1105 1105 ;;
1106 1106 x ) XMOD_OPT="-x"
1107 1107 ;;
1108 1108 \? ) echo "$USAGE"
1109 1109 exit 1
1110 1110 ;;
1111 1111 esac
1112 1112 done
1113 1113
1114 1114 if [ $ISUSER -ne 0 ]; then
1115 1115 if [ "$o_FLAG" = "y" ]; then
1116 1116 echo "Old-style build requires root permission."
1117 1117 exit 1
1118 1118 fi
1119 1119
1120 1120 # Set default value for STAFFER, if needed.
1121 1121 if [ -z "$STAFFER" -o "$STAFFER" = "nobody" ]; then
1122 1122 STAFFER=`/usr/xpg4/bin/id -un`
1123 1123 export STAFFER
1124 1124 fi
1125 1125 fi
1126 1126
1127 1127 if [ -z "$MAILTO" -o "$MAILTO" = "nobody" ]; then
1128 1128 MAILTO=$STAFFER
1129 1129 export MAILTO
1130 1130 fi
1131 1131
1132 1132 PATH="$OPTHOME/onbld/bin:$OPTHOME/onbld/bin/${MACH}:/usr/ccs/bin"
1133 1133 PATH="$PATH:$OPTHOME/SUNWspro/bin:$TEAMWARE/bin:/usr/bin:/usr/sbin:/usr/ucb"
1134 1134 PATH="$PATH:/usr/openwin/bin:/usr/sfw/bin:/opt/sfw/bin:."
1135 1135 export PATH
1136 1136
1137 1137 # roots of source trees, both relative to $SRC and absolute.
1138 1138 relsrcdirs="."
1139 1139 abssrcdirs="$SRC"
1140 1140
1141 1141 unset CH
1142 1142 if [ "$o_FLAG" = "y" ]; then
1143 1143 # root invoked old-style build -- make sure it works as it always has
1144 1144 # by exporting 'CH'. The current Makefile.master doesn't use this, but
1145 1145 # the old ones still do.
1146 1146 PROTOCMPTERSE="protocmp.terse"
1147 1147 CH=
1148 1148 export CH
1149 1149 else
1150 1150 PROTOCMPTERSE="protocmp.terse -gu"
1151 1151 fi
1152 1152 POUND_SIGN="#"
1153 1153 # have we set RELEASE_DATE in our env file?
1154 1154 if [ -z "$RELEASE_DATE" ]; then
1155 1155 RELEASE_DATE=$(LC_ALL=C date +"%B %Y")
1156 1156 fi
1157 1157 BUILD_DATE=$(LC_ALL=C date +%Y-%b-%d)
1158 1158 BASEWSDIR=$(basename $CODEMGR_WS)
1159 1159 DEV_CM="\"@(#)SunOS Internal Development: $LOGNAME $BUILD_DATE [$BASEWSDIR]\""
1160 1160
1161 1161 # we export POUND_SIGN, RELEASE_DATE and DEV_CM to speed up the build process
1162 1162 # by avoiding repeated shell invocations to evaluate Makefile.master definitions.
1163 1163 # we export o_FLAG and X_FLAG for use by makebfu, and by usr/src/pkg/Makefile
1164 1164 export o_FLAG X_FLAG POUND_SIGN RELEASE_DATE DEV_CM
1165 1165
1166 1166 maketype="distributed"
1167 1167 if [[ -z "$MAKE" ]]; then
1168 1168 MAKE=dmake
1169 1169 elif [[ ! -x "$MAKE" ]]; then
1170 1170 echo "\$MAKE is set to garbage in the environment"
1171 1171 exit 1
1172 1172 fi
1173 1173 # get the dmake version string alone
1174 1174 DMAKE_VERSION=$( $MAKE -v )
1175 1175 DMAKE_VERSION=${DMAKE_VERSION#*: }
1176 1176 # focus in on just the dotted version number alone
1177 1177 DMAKE_MAJOR=$( echo $DMAKE_VERSION | \
1178 1178 sed -e 's/.*\<\([^.]*\.[^ ]*\).*$/\1/' )
1179 1179 # extract the second (or final) integer
1180 1180 DMAKE_MINOR=${DMAKE_MAJOR#*.}
1181 1181 DMAKE_MINOR=${DMAKE_MINOR%%.*}
1182 1182 # extract the first integer
1183 1183 DMAKE_MAJOR=${DMAKE_MAJOR%%.*}
1184 1184 CHECK_DMAKE=${CHECK_DMAKE:-y}
1185 1185 # x86 was built on the 12th, sparc on the 13th.
1186 1186 if [ "$CHECK_DMAKE" = "y" -a \
1187 1187 "$DMAKE_VERSION" != "Sun Distributed Make 7.3 2003/03/12" -a \
1188 1188 "$DMAKE_VERSION" != "Sun Distributed Make 7.3 2003/03/13" -a \( \
1189 1189 "$DMAKE_MAJOR" -lt 7 -o \
1190 1190 "$DMAKE_MAJOR" -eq 7 -a "$DMAKE_MINOR" -lt 4 \) ]; then
1191 1191 if [ -z "$DMAKE_VERSION" ]; then
1192 1192 echo "$MAKE is missing."
1193 1193 exit 1
1194 1194 fi
1195 1195 echo `whence $MAKE`" version is:"
1196 1196 echo " ${DMAKE_VERSION}"
1197 1197 cat <<EOF
1198 1198
1199 1199 This version may not be safe for use. Either set TEAMWARE to a better
1200 1200 path or (if you really want to use this version of dmake anyway), add
1201 1201 the following to your environment to disable this check:
1202 1202
1203 1203 CHECK_DMAKE=n
1204 1204 EOF
1205 1205 exit 1
1206 1206 fi
1207 1207 export PATH
1208 1208 export MAKE
1209 1209
1210 1210 if [ "${SUNWSPRO}" != "" ]; then
1211 1211 PATH="${SUNWSPRO}/bin:$PATH"
1212 1212 export PATH
1213 1213 fi
1214 1214
1215 1215 hostname=$(uname -n)
1216 1216 if [[ $DMAKE_MAX_JOBS != +([0-9]) || $DMAKE_MAX_JOBS -eq 0 ]]
1217 1217 then
1218 1218 maxjobs=
1219 1219 if [[ -f $HOME/.make.machines ]]
1220 1220 then
1221 1221 # Note: there is a hard tab and space character in the []s
1222 1222 # below.
1223 1223 egrep -i "^[ ]*$hostname[ \.]" \
1224 1224 $HOME/.make.machines | read host jobs
1225 1225 maxjobs=${jobs##*=}
1226 1226 fi
1227 1227
1228 1228 if [[ $maxjobs != +([0-9]) || $maxjobs -eq 0 ]]
1229 1229 then
1230 1230 # default
1231 1231 maxjobs=4
1232 1232 fi
1233 1233
1234 1234 export DMAKE_MAX_JOBS=$maxjobs
1235 1235 fi
1236 1236
1237 1237 DMAKE_MODE=parallel;
1238 1238 export DMAKE_MODE
1239 1239
1240 1240 if [ -z "${ROOT}" ]; then
1241 1241 echo "ROOT must be set."
1242 1242 exit 1
1243 1243 fi
1244 1244
1245 1245 #
1246 1246 # if -V flag was given, reset VERSION to V_ARG
1247 1247 #
1248 1248 if [ "$V_FLAG" = "y" ]; then
1249 1249 VERSION=$V_ARG
1250 1250 fi
1251 1251
1252 1252 #
1253 1253 # Check for IHV root for copying ihv proto area
1254 1254 #
1255 1255 if [ "$X_FLAG" = "y" ]; then
1256 1256 if [ "$IA32_IHV_ROOT" = "" ]; then
1257 1257 echo "IA32_IHV_ROOT: must be set for copying ihv proto"
1258 1258 args_ok=n
1259 1259 fi
1260 1260 if [ ! -d "$IA32_IHV_ROOT" ]; then
1261 1261 echo "$IA32_IHV_ROOT: not found"
1262 1262 args_ok=n
1263 1263 fi
↓ open down ↓ |
1263 lines elided |
↑ open up ↑ |
1264 1264 if [ "$IA32_IHV_WS" = "" ]; then
1265 1265 echo "IA32_IHV_WS: must be set for copying ihv proto"
1266 1266 args_ok=n
1267 1267 fi
1268 1268 if [ ! -d "$IA32_IHV_WS" ]; then
1269 1269 echo "$IA32_IHV_WS: not found"
1270 1270 args_ok=n
1271 1271 fi
1272 1272 fi
1273 1273
1274 -TMPDIR="/tmp/nightly.tmpdir.$$"
1274 +if [[ -z "$TMPDIR_ROOT" ]]; then
1275 + TMPDIR_ROOT="/tmp"
1276 +fi
1277 +TMPDIR="${TMPDIR_ROOT}/nightly.tmpdir.$$"
1275 1278 export TMPDIR
1276 1279 rm -rf ${TMPDIR}
1277 1280 mkdir -p $TMPDIR || exit 1
1278 1281 chmod 777 $TMPDIR
1279 1282
1280 1283 #
1281 1284 # Keep elfsign's use of pkcs11_softtoken from looking in the user home
1282 1285 # directory, which doesn't always work. Needed until all build machines
1283 1286 # have the fix for 6271754
1284 1287 #
1285 1288 SOFTTOKEN_DIR=$TMPDIR
1286 1289 export SOFTTOKEN_DIR
1287 1290
1288 1291 #
1289 1292 # Tools should only be built non-DEBUG. Keep track of the tools proto
1290 1293 # area path relative to $TOOLS, because the latter changes in an
1291 1294 # export build.
1292 1295 #
1293 1296 # TOOLS_PROTO is included below for builds other than usr/src/tools
1294 1297 # that look for this location. For usr/src/tools, this will be
1295 1298 # overridden on the $MAKE command line in build_tools().
1296 1299 #
1297 1300 TOOLS=${SRC}/tools
1298 1301 TOOLS_PROTO_REL=proto/root_${MACH}-nd
1299 1302 TOOLS_PROTO=${TOOLS}/${TOOLS_PROTO_REL}; export TOOLS_PROTO
1300 1303
1301 1304 unset CFLAGS LD_LIBRARY_PATH LDFLAGS
1302 1305
1303 1306 # create directories that are automatically removed if the nightly script
1304 1307 # fails to start correctly
1305 1308 function newdir {
1306 1309 dir=$1
1307 1310 toadd=
1308 1311 while [ ! -d $dir ]; do
1309 1312 toadd="$dir $toadd"
1310 1313 dir=`dirname $dir`
1311 1314 done
1312 1315 torm=
1313 1316 newlist=
1314 1317 for dir in $toadd; do
1315 1318 if staffer mkdir $dir; then
1316 1319 newlist="$ISUSER $dir $newlist"
1317 1320 torm="$dir $torm"
1318 1321 else
1319 1322 [ -z "$torm" ] || staffer rmdir $torm
1320 1323 return 1
1321 1324 fi
1322 1325 done
1323 1326 newdirlist="$newlist $newdirlist"
1324 1327 return 0
1325 1328 }
1326 1329 newdirlist=
1327 1330
1328 1331 [ -d $CODEMGR_WS ] || newdir $CODEMGR_WS || exit 1
1329 1332
1330 1333 # since this script assumes the build is from full source, it nullifies
1331 1334 # variables likely to have been set by a "ws" script; nullification
1332 1335 # confines the search space for headers and libraries to the proto area
1333 1336 # built from this immediate source.
1334 1337 ENVLDLIBS1=
1335 1338 ENVLDLIBS2=
1336 1339 ENVLDLIBS3=
1337 1340 ENVCPPFLAGS1=
1338 1341 ENVCPPFLAGS2=
1339 1342 ENVCPPFLAGS3=
1340 1343 ENVCPPFLAGS4=
1341 1344 PARENT_ROOT=
1342 1345
1343 1346 export ENVLDLIBS3 ENVCPPFLAGS1 ENVCPPFLAGS2 ENVCPPFLAGS3 ENVCPPFLAGS4 \
1344 1347 ENVLDLIBS1 ENVLDLIBS2 PARENT_ROOT
1345 1348
1346 1349 PKGARCHIVE_ORIG=$PKGARCHIVE
1347 1350 IA32_IHV_PKGS_ORIG=$IA32_IHV_PKGS
1348 1351
1349 1352 #
1350 1353 # Juggle the logs and optionally send mail on completion.
1351 1354 #
1352 1355
1353 1356 function logshuffle {
1354 1357 LLOG="$ATLOG/log.`date '+%F.%H:%M'`"
1355 1358 if [ -f $LLOG -o -d $LLOG ]; then
1356 1359 LLOG=$LLOG.$$
1357 1360 fi
1358 1361 mkdir $LLOG
1359 1362 export LLOG
1360 1363
1361 1364 if [ "$build_ok" = "y" ]; then
1362 1365 mv $ATLOG/proto_list_${MACH} $LLOG
1363 1366
1364 1367 if [ -f $ATLOG/proto_list_tools_${MACH} ]; then
1365 1368 mv $ATLOG/proto_list_tools_${MACH} $LLOG
1366 1369 fi
1367 1370
1368 1371 if [ -f $TMPDIR/wsdiff.results ]; then
1369 1372 mv $TMPDIR/wsdiff.results $LLOG
1370 1373 fi
1371 1374
1372 1375 if [ -f $TMPDIR/wsdiff-nd.results ]; then
1373 1376 mv $TMPDIR/wsdiff-nd.results $LLOG
1374 1377 fi
1375 1378 fi
1376 1379
1377 1380 #
1378 1381 # Now that we're about to send mail, it's time to check the noise
1379 1382 # file. In the event that an error occurs beyond this point, it will
1380 1383 # be recorded in the nightly.log file, but nowhere else. This would
1381 1384 # include only errors that cause the copying of the noise log to fail
1382 1385 # or the mail itself not to be sent.
1383 1386 #
1384 1387
1385 1388 exec >>$LOGFILE 2>&1
1386 1389 if [ -s $build_noise_file ]; then
1387 1390 echo "\n==== Nightly build noise ====\n" |
1388 1391 tee -a $LOGFILE >>$mail_msg_file
1389 1392 cat $build_noise_file >>$LOGFILE
1390 1393 cat $build_noise_file >>$mail_msg_file
1391 1394 echo | tee -a $LOGFILE >>$mail_msg_file
1392 1395 fi
1393 1396 rm -f $build_noise_file
1394 1397
1395 1398 case "$build_ok" in
1396 1399 y)
1397 1400 state=Completed
1398 1401 ;;
1399 1402 i)
1400 1403 state=Interrupted
1401 1404 ;;
1402 1405 *)
1403 1406 state=Failed
1404 1407 ;;
1405 1408 esac
1406 1409 NIGHTLY_STATUS=$state
1407 1410 export NIGHTLY_STATUS
1408 1411
1409 1412 run_hook POST_NIGHTLY $state
1410 1413 run_hook SYS_POST_NIGHTLY $state
1411 1414
1412 1415 #
1413 1416 # mailx(1) sets From: based on the -r flag
1414 1417 # if it is given.
1415 1418 #
1416 1419 mailx_r=
1417 1420 if [[ -n "${MAILFROM}" ]]; then
1418 1421 mailx_r="-r ${MAILFROM}"
1419 1422 fi
1420 1423
1421 1424 cat $build_time_file $build_environ_file $mail_msg_file \
1422 1425 > ${LLOG}/mail_msg
1423 1426 if [ "$m_FLAG" = "y" ]; then
1424 1427 cat ${LLOG}/mail_msg | /usr/bin/mailx ${mailx_r} -s \
1425 1428 "Nightly ${MACH} Build of `basename ${CODEMGR_WS}` ${state}." \
1426 1429 ${MAILTO}
1427 1430 fi
1428 1431
1429 1432 if [ "$u_FLAG" = "y" -a "$build_ok" = "y" ]; then
1430 1433 staffer cp ${LLOG}/mail_msg $PARENT_WS/usr/src/mail_msg-${MACH}
1431 1434 staffer cp $LOGFILE $PARENT_WS/usr/src/nightly-${MACH}.log
1432 1435 fi
1433 1436
1434 1437 mv $LOGFILE $LLOG
1435 1438 }
1436 1439
1437 1440 #
1438 1441 # Remove the locks and temporary files on any exit
1439 1442 #
1440 1443 function cleanup {
1441 1444 logshuffle
1442 1445
1443 1446 [ -z "$lockfile" ] || staffer rm -f $lockfile
1444 1447 [ -z "$atloglockfile" ] || rm -f $atloglockfile
1445 1448 [ -z "$ulockfile" ] || staffer rm -f $ulockfile
1446 1449 [ -z "$Ulockfile" ] || rm -f $Ulockfile
1447 1450
1448 1451 set -- $newdirlist
1449 1452 while [ $# -gt 0 ]; do
1450 1453 ISUSER=$1 staffer rmdir $2
1451 1454 shift; shift
1452 1455 done
1453 1456 rm -rf $TMPDIR
1454 1457 }
1455 1458
1456 1459 function cleanup_signal {
1457 1460 build_ok=i
1458 1461 # this will trigger cleanup(), above.
1459 1462 exit 1
1460 1463 }
1461 1464
1462 1465 trap cleanup 0
1463 1466 trap cleanup_signal 1 2 3 15
1464 1467
1465 1468 #
1466 1469 # Generic lock file processing -- make sure that the lock file doesn't
1467 1470 # exist. If it does, it should name the build host and PID. If it
1468 1471 # doesn't, then make sure we can create it. Clean up locks that are
1469 1472 # known to be stale (assumes host name is unique among build systems
1470 1473 # for the workspace).
1471 1474 #
1472 1475 function create_lock {
1473 1476 lockf=$1
1474 1477 lockvar=$2
1475 1478
1476 1479 ldir=`dirname $lockf`
1477 1480 [ -d $ldir ] || newdir $ldir || exit 1
1478 1481 eval $lockvar=$lockf
1479 1482
1480 1483 while ! staffer ln -s $hostname.$STAFFER.$$ $lockf 2> /dev/null; do
1481 1484 basews=`basename $CODEMGR_WS`
1482 1485 ls -l $lockf | nawk '{print $NF}' | IFS=. read host user pid
1483 1486 if [ "$host" != "$hostname" ]; then
1484 1487 echo "$MACH build of $basews apparently" \
1485 1488 "already started by $user on $host as $pid."
1486 1489 exit 1
1487 1490 elif kill -s 0 $pid 2>/dev/null; then
1488 1491 echo "$MACH build of $basews already started" \
1489 1492 "by $user as $pid."
1490 1493 exit 1
1491 1494 else
1492 1495 # stale lock; clear it out and try again
1493 1496 rm -f $lockf
1494 1497 fi
1495 1498 done
1496 1499 }
1497 1500
1498 1501 #
1499 1502 # Return the list of interesting proto areas, depending on the current
1500 1503 # options.
1501 1504 #
1502 1505 function allprotos {
1503 1506 typeset roots="$ROOT"
1504 1507
1505 1508 if [[ "$F_FLAG" = n && "$MULTI_PROTO" = yes ]]; then
1506 1509 roots="$roots $ROOT-nd"
1507 1510 fi
1508 1511
1509 1512 echo $roots
1510 1513 }
1511 1514
1512 1515 # Ensure no other instance of this script is running on this host.
1513 1516 # LOCKNAME can be set in <env_file>, and is by default, but is not
1514 1517 # required due to the use of $ATLOG below.
1515 1518 if [ -n "$LOCKNAME" ]; then
1516 1519 create_lock /tmp/$LOCKNAME "lockfile"
1517 1520 fi
1518 1521 #
1519 1522 # Create from one, two, or three other locks:
1520 1523 # $ATLOG/nightly.lock
1521 1524 # - protects against multiple builds in same workspace
1522 1525 # $PARENT_WS/usr/src/nightly.$MACH.lock
1523 1526 # - protects against multiple 'u' copy-backs
1524 1527 # $NIGHTLY_PARENT_ROOT/nightly.lock
1525 1528 # - protects against multiple 'U' copy-backs
1526 1529 #
1527 1530 # Overriding ISUSER to 1 causes the lock to be created as root if the
1528 1531 # script is run as root. The default is to create it as $STAFFER.
1529 1532 ISUSER=1 create_lock $ATLOG/nightly.lock "atloglockfile"
1530 1533 if [ "$u_FLAG" = "y" ]; then
1531 1534 create_lock $PARENT_WS/usr/src/nightly.$MACH.lock "ulockfile"
1532 1535 fi
1533 1536 if [ "$U_FLAG" = "y" ]; then
1534 1537 # NIGHTLY_PARENT_ROOT is written as root if script invoked as root.
1535 1538 ISUSER=1 create_lock $NIGHTLY_PARENT_ROOT/nightly.lock "Ulockfile"
1536 1539 fi
1537 1540
1538 1541 # Locks have been taken, so we're doing a build and we're committed to
1539 1542 # the directories we may have created so far.
1540 1543 newdirlist=
1541 1544
1542 1545 #
1543 1546 # Create mail_msg_file
1544 1547 #
1545 1548 mail_msg_file="${TMPDIR}/mail_msg"
1546 1549 touch $mail_msg_file
1547 1550 build_time_file="${TMPDIR}/build_time"
1548 1551 build_environ_file="${TMPDIR}/build_environ"
1549 1552 touch $build_environ_file
1550 1553 #
1551 1554 # Move old LOGFILE aside
1552 1555 # ATLOG directory already made by 'create_lock' above
1553 1556 #
1554 1557 if [ -f $LOGFILE ]; then
1555 1558 mv -f $LOGFILE ${LOGFILE}-
1556 1559 fi
1557 1560 #
1558 1561 # Build OsNet source
1559 1562 #
1560 1563 START_DATE=`date`
1561 1564 SECONDS=0
1562 1565 echo "\n==== Nightly $maketype build started: $START_DATE ====" \
1563 1566 | tee -a $LOGFILE > $build_time_file
1564 1567
1565 1568 echo "\nBuild project: $build_project\nBuild taskid: $build_taskid" | \
1566 1569 tee -a $mail_msg_file >> $LOGFILE
1567 1570
1568 1571 # make sure we log only to the nightly build file
1569 1572 build_noise_file="${TMPDIR}/build_noise"
1570 1573 exec </dev/null >$build_noise_file 2>&1
1571 1574
1572 1575 run_hook SYS_PRE_NIGHTLY
1573 1576 run_hook PRE_NIGHTLY
1574 1577
1575 1578 echo "\n==== list of environment variables ====\n" >> $LOGFILE
1576 1579 env >> $LOGFILE
1577 1580
1578 1581 echo "\n==== Nightly argument issues ====\n" | tee -a $mail_msg_file >> $LOGFILE
1579 1582
1580 1583 if [ "$P_FLAG" = "y" ]; then
1581 1584 obsolete_build GPROF | tee -a $mail_msg_file >> $LOGFILE
1582 1585 fi
1583 1586
1584 1587 if [ "$T_FLAG" = "y" ]; then
1585 1588 obsolete_build TRACE | tee -a $mail_msg_file >> $LOGFILE
1586 1589 fi
1587 1590
1588 1591 if [ "$N_FLAG" = "y" ]; then
1589 1592 if [ "$p_FLAG" = "y" ]; then
1590 1593 cat <<EOF | tee -a $mail_msg_file >> $LOGFILE
1591 1594 WARNING: the p option (create packages) is set, but so is the N option (do
1592 1595 not run protocmp); this is dangerous; you should unset the N option
1593 1596 EOF
1594 1597 else
1595 1598 cat <<EOF | tee -a $mail_msg_file >> $LOGFILE
1596 1599 Warning: the N option (do not run protocmp) is set; it probably shouldn't be
1597 1600 EOF
1598 1601 fi
1599 1602 echo "" | tee -a $mail_msg_file >> $LOGFILE
1600 1603 fi
1601 1604
1602 1605 if [ "$D_FLAG" = "n" -a "$l_FLAG" = "y" ]; then
1603 1606 #
1604 1607 # In the past we just complained but went ahead with the lint
1605 1608 # pass, even though the proto area was built non-DEBUG. It's
1606 1609 # unlikely that non-DEBUG headers will make a difference, but
1607 1610 # rather than assuming it's a safe combination, force the user
1608 1611 # to specify a DEBUG build.
1609 1612 #
1610 1613 echo "WARNING: DEBUG build not requested; disabling lint.\n" \
1611 1614 | tee -a $mail_msg_file >> $LOGFILE
1612 1615 l_FLAG=n
1613 1616 fi
1614 1617
1615 1618 if [ "$f_FLAG" = "y" ]; then
1616 1619 if [ "$i_FLAG" = "y" ]; then
1617 1620 echo "WARNING: the -f flag cannot be used during incremental" \
1618 1621 "builds; ignoring -f\n" | tee -a $mail_msg_file >> $LOGFILE
1619 1622 f_FLAG=n
1620 1623 fi
1621 1624 if [ "${l_FLAG}${p_FLAG}" != "yy" ]; then
1622 1625 echo "WARNING: the -f flag requires -l, and -p;" \
1623 1626 "ignoring -f\n" | tee -a $mail_msg_file >> $LOGFILE
1624 1627 f_FLAG=n
1625 1628 fi
1626 1629 fi
1627 1630
1628 1631 if [ "$w_FLAG" = "y" -a ! -d $ROOT ]; then
1629 1632 echo "WARNING: -w specified, but $ROOT does not exist;" \
1630 1633 "ignoring -w\n" | tee -a $mail_msg_file >> $LOGFILE
1631 1634 w_FLAG=n
1632 1635 fi
1633 1636
1634 1637 if [ "$t_FLAG" = "n" ]; then
1635 1638 #
1636 1639 # We're not doing a tools build, so make sure elfsign(1) is
1637 1640 # new enough to safely sign non-crypto binaries. We test
1638 1641 # debugging output from elfsign to detect the old version.
1639 1642 #
1640 1643 newelfsigntest=`SUNW_CRYPTO_DEBUG=stderr /usr/bin/elfsign verify \
1641 1644 -e /usr/lib/security/pkcs11_softtoken.so.1 2>&1 \
1642 1645 | egrep algorithmOID`
1643 1646 if [ -z "$newelfsigntest" ]; then
1644 1647 echo "WARNING: /usr/bin/elfsign out of date;" \
1645 1648 "will only sign crypto modules\n" | \
1646 1649 tee -a $mail_msg_file >> $LOGFILE
1647 1650 export ELFSIGN_OBJECT=true
1648 1651 elif [ "$VERIFY_ELFSIGN" = "y" ]; then
1649 1652 echo "WARNING: VERIFY_ELFSIGN=y requires" \
1650 1653 "the -t flag; ignoring VERIFY_ELFSIGN\n" | \
1651 1654 tee -a $mail_msg_file >> $LOGFILE
1652 1655 fi
1653 1656 fi
1654 1657
1655 1658 case $MULTI_PROTO in
1656 1659 yes|no) ;;
1657 1660 *)
1658 1661 echo "WARNING: MULTI_PROTO is \"$MULTI_PROTO\"; " \
1659 1662 "should be \"yes\" or \"no\"." | tee -a $mail_msg_file >> $LOGFILE
1660 1663 echo "Setting MULTI_PROTO to \"no\".\n" | \
1661 1664 tee -a $mail_msg_file >> $LOGFILE
1662 1665 export MULTI_PROTO=no
1663 1666 ;;
1664 1667 esac
1665 1668
1666 1669 echo "\n==== Build version ====\n" | tee -a $mail_msg_file >> $LOGFILE
1667 1670 echo $VERSION | tee -a $mail_msg_file >> $LOGFILE
1668 1671
1669 1672 # Save the current proto area if we're comparing against the last build
1670 1673 if [ "$w_FLAG" = "y" -a -d "$ROOT" ]; then
1671 1674 if [ -d "$ROOT.prev" ]; then
1672 1675 rm -rf $ROOT.prev
1673 1676 fi
1674 1677 mv $ROOT $ROOT.prev
1675 1678 fi
1676 1679
1677 1680 # Same for non-DEBUG proto area
1678 1681 if [ "$w_FLAG" = "y" -a "$MULTI_PROTO" = yes -a -d "$ROOT-nd" ]; then
1679 1682 if [ -d "$ROOT-nd.prev" ]; then
1680 1683 rm -rf $ROOT-nd.prev
1681 1684 fi
1682 1685 mv $ROOT-nd $ROOT-nd.prev
1683 1686 fi
1684 1687
1685 1688 #
1686 1689 # Echo the SCM type of the parent workspace, this can't just be which_scm
1687 1690 # as that does not know how to identify various network repositories.
1688 1691 #
1689 1692 function parent_wstype {
1690 1693 typeset scm_type junk
1691 1694
1692 1695 CODEMGR_WS="$BRINGOVER_WS" "$WHICH_SCM" 2>/dev/null \
1693 1696 | read scm_type junk
1694 1697 if [[ -z "$scm_type" || "$scm_type" == unknown ]]; then
1695 1698 # Probe BRINGOVER_WS to determine its type
1696 1699 if [[ $BRINGOVER_WS == svn*://* ]]; then
1697 1700 scm_type="subversion"
1698 1701 elif [[ $BRINGOVER_WS == file://* ]] &&
1699 1702 egrep -s "This is a Subversion repository" \
1700 1703 ${BRINGOVER_WS#file://}/README.txt 2> /dev/null; then
1701 1704 scm_type="subversion"
1702 1705 elif [[ $BRINGOVER_WS == ssh://* ]]; then
1703 1706 scm_type="mercurial"
1704 1707 elif [[ $BRINGOVER_WS == http://* ]] && \
1705 1708 wget -q -O- --save-headers "$BRINGOVER_WS/?cmd=heads" | \
1706 1709 egrep -s "application/mercurial" 2> /dev/null; then
1707 1710 scm_type="mercurial"
1708 1711 elif svn info $BRINGOVER_WS > /dev/null 2>&1; then
1709 1712 scm_type="subversion"
1710 1713 else
1711 1714 scm_type="none"
1712 1715 fi
1713 1716 fi
1714 1717
1715 1718 # fold both unsupported and unrecognized results into "none"
1716 1719 case "$scm_type" in
1717 1720 none|subversion|teamware|mercurial)
1718 1721 ;;
1719 1722 *) scm_type=none
1720 1723 ;;
1721 1724 esac
1722 1725
1723 1726 echo $scm_type
1724 1727 }
1725 1728
1726 1729 # Echo the SCM types of $CODEMGR_WS and $BRINGOVER_WS
1727 1730 function child_wstype {
1728 1731 typeset scm_type junk
1729 1732
1730 1733 # Probe CODEMGR_WS to determine its type
1731 1734 if [[ -d $CODEMGR_WS ]]; then
1732 1735 $WHICH_SCM | read scm_type junk || exit 1
1733 1736 fi
1734 1737
1735 1738 case "$scm_type" in
1736 1739 none|subversion|git|teamware|mercurial)
1737 1740 ;;
1738 1741 *) scm_type=none
1739 1742 ;;
1740 1743 esac
1741 1744
1742 1745 echo $scm_type
1743 1746 }
1744 1747
1745 1748 SCM_TYPE=$(child_wstype)
1746 1749
1747 1750 #
1748 1751 # Decide whether to clobber
1749 1752 #
1750 1753 if [ "$i_FLAG" = "n" -a -d "$SRC" ]; then
1751 1754 echo "\n==== Make clobber at `date` ====\n" >> $LOGFILE
1752 1755
1753 1756 cd $SRC
1754 1757 # remove old clobber file
1755 1758 rm -f $SRC/clobber.out
1756 1759 rm -f $SRC/clobber-${MACH}.out
1757 1760
1758 1761 # Remove all .make.state* files, just in case we are restarting
1759 1762 # the build after having interrupted a previous 'make clobber'.
1760 1763 find . \( -name SCCS -o -name .hg -o -name .svn -o -name .git \
1761 1764 -o -name 'interfaces.*' \) -prune \
1762 1765 -o -name '.make.*' -print | xargs rm -f
1763 1766
1764 1767 $MAKE -ek clobber 2>&1 | tee -a $SRC/clobber-${MACH}.out >> $LOGFILE
1765 1768 echo "\n==== Make clobber ERRORS ====\n" >> $mail_msg_file
1766 1769 grep "$MAKE:" $SRC/clobber-${MACH}.out |
1767 1770 egrep -v "Ignoring unknown host" \
1768 1771 >> $mail_msg_file
1769 1772
1770 1773 if [[ "$t_FLAG" = "y" ]]; then
1771 1774 echo "\n==== Make tools clobber at `date` ====\n" >> $LOGFILE
1772 1775 cd ${TOOLS}
1773 1776 rm -f ${TOOLS}/clobber-${MACH}.out
1774 1777 $MAKE TOOLS_PROTO=$TOOLS_PROTO -ek clobber 2>&1 | \
1775 1778 tee -a ${TOOLS}/clobber-${MACH}.out >> $LOGFILE
1776 1779 echo "\n==== Make tools clobber ERRORS ====\n" \
1777 1780 >> $mail_msg_file
1778 1781 grep "$MAKE:" ${TOOLS}/clobber-${MACH}.out \
1779 1782 >> $mail_msg_file
1780 1783 rm -rf ${TOOLS_PROTO}
1781 1784 mkdir -p ${TOOLS_PROTO}
1782 1785 fi
1783 1786
1784 1787 typeset roots=$(allprotos)
1785 1788 echo "\n\nClearing $roots" >> "$LOGFILE"
1786 1789 rm -rf $roots
1787 1790
1788 1791 # Get back to a clean workspace as much as possible to catch
1789 1792 # problems that only occur on fresh workspaces.
1790 1793 # Remove all .make.state* files, libraries, and .o's that may
1791 1794 # have been omitted from clobber. A couple of libraries are
1792 1795 # under source code control, so leave them alone.
1793 1796 # We should probably blow away temporary directories too.
1794 1797 cd $SRC
1795 1798 find $relsrcdirs \( -name SCCS -o -name .hg -o -name .svn \
1796 1799 -o -name .git -o -name 'interfaces.*' \) -prune -o \
1797 1800 \( -name '.make.*' -o -name 'lib*.a' -o -name 'lib*.so*' -o \
1798 1801 -name '*.o' \) -print | \
1799 1802 grep -v 'tools/ctf/dwarf/.*/libdwarf' | xargs rm -f
1800 1803 else
1801 1804 echo "\n==== No clobber at `date` ====\n" >> $LOGFILE
1802 1805 fi
1803 1806
1804 1807 type bringover_teamware > /dev/null 2>&1 || function bringover_teamware {
1805 1808 # sleep on the parent workspace's lock
1806 1809 while egrep -s write $BRINGOVER_WS/Codemgr_wsdata/locks
1807 1810 do
1808 1811 sleep 120
1809 1812 done
1810 1813
1811 1814 if [[ -z $BRINGOVER ]]; then
1812 1815 BRINGOVER=$TEAMWARE/bin/bringover
1813 1816 fi
1814 1817
1815 1818 staffer $BRINGOVER -c "nightly update" -p $BRINGOVER_WS \
1816 1819 -w $CODEMGR_WS $BRINGOVER_FILES < /dev/null 2>&1 ||
1817 1820 touch $TMPDIR/bringover_failed
1818 1821
1819 1822 staffer bringovercheck $CODEMGR_WS >$TMPDIR/bringovercheck.out 2>&1
1820 1823 if [ -s $TMPDIR/bringovercheck.out ]; then
1821 1824 echo "\n==== POST-BRINGOVER CLEANUP NOISE ====\n"
1822 1825 cat $TMPDIR/bringovercheck.out
1823 1826 fi
1824 1827 }
1825 1828
1826 1829 type bringover_mercurial > /dev/null 2>&1 || function bringover_mercurial {
1827 1830 typeset -x PATH=$PATH
1828 1831
1829 1832 # If the repository doesn't exist yet, then we want to populate it.
1830 1833 if [[ ! -d $CODEMGR_WS/.hg ]]; then
1831 1834 staffer hg init $CODEMGR_WS
1832 1835 staffer echo "[paths]" > $CODEMGR_WS/.hg/hgrc
1833 1836 staffer echo "default=$BRINGOVER_WS" >> $CODEMGR_WS/.hg/hgrc
1834 1837 touch $TMPDIR/new_repository
1835 1838 fi
1836 1839
1837 1840 typeset -x HGMERGE="/bin/false"
1838 1841
1839 1842 #
1840 1843 # If the user has changes, regardless of whether those changes are
1841 1844 # committed, and regardless of whether those changes conflict, then
1842 1845 # we'll attempt to merge them either implicitly (uncommitted) or
1843 1846 # explicitly (committed).
1844 1847 #
1845 1848 # These are the messages we'll use to help clarify mercurial output
1846 1849 # in those cases.
1847 1850 #
1848 1851 typeset mergefailmsg="\
1849 1852 ***\n\
1850 1853 *** nightly was unable to automatically merge your changes. You should\n\
1851 1854 *** redo the full merge manually, following the steps outlined by mercurial\n\
1852 1855 *** above, then restart nightly.\n\
1853 1856 ***\n"
1854 1857 typeset mergepassmsg="\
1855 1858 ***\n\
1856 1859 *** nightly successfully merged your changes. This means that your working\n\
1857 1860 *** directory has been updated, but those changes are not yet committed.\n\
1858 1861 *** After nightly completes, you should validate the results of the merge,\n\
1859 1862 *** then use hg commit manually.\n\
1860 1863 ***\n"
1861 1864
1862 1865 #
1863 1866 # For each repository in turn:
1864 1867 #
1865 1868 # 1. Do the pull. If this fails, dump the output and bail out.
1866 1869 #
1867 1870 # 2. If the pull resulted in an extra head, do an explicit merge.
1868 1871 # If this fails, dump the output and bail out.
1869 1872 #
1870 1873 # Because we can't rely on Mercurial to exit with a failure code
1871 1874 # when a merge fails (Mercurial issue #186), we must grep the
1872 1875 # output of pull/merge to check for attempted and/or failed merges.
1873 1876 #
1874 1877 # 3. If a merge failed, set the message and fail the bringover.
1875 1878 #
1876 1879 # 4. Otherwise, if a merge succeeded, set the message
1877 1880 #
1878 1881 # 5. Dump the output, and any message from step 3 or 4.
1879 1882 #
1880 1883
1881 1884 typeset HG_SOURCE=$BRINGOVER_WS
1882 1885 if [ ! -f $TMPDIR/new_repository ]; then
1883 1886 HG_SOURCE=$TMPDIR/open_bundle.hg
1884 1887 staffer hg --cwd $CODEMGR_WS incoming --bundle $HG_SOURCE \
1885 1888 -v $BRINGOVER_WS > $TMPDIR/incoming_open.out
1886 1889
1887 1890 #
1888 1891 # If there are no incoming changesets, then incoming will
1889 1892 # fail, and there will be no bundle file. Reset the source,
1890 1893 # to allow the remaining logic to complete with no false
1891 1894 # negatives. (Unlike incoming, pull will return success
1892 1895 # for the no-change case.)
1893 1896 #
1894 1897 if (( $? != 0 )); then
1895 1898 HG_SOURCE=$BRINGOVER_WS
1896 1899 fi
1897 1900 fi
1898 1901
1899 1902 staffer hg --cwd $CODEMGR_WS pull -u $HG_SOURCE \
1900 1903 > $TMPDIR/pull_open.out 2>&1
1901 1904 if (( $? != 0 )); then
1902 1905 printf "%s: pull failed as follows:\n\n" "$CODEMGR_WS"
1903 1906 cat $TMPDIR/pull_open.out
1904 1907 if grep "^merging.*failed" $TMPDIR/pull_open.out > /dev/null 2>&1; then
1905 1908 printf "$mergefailmsg"
1906 1909 fi
1907 1910 touch $TMPDIR/bringover_failed
1908 1911 return
1909 1912 fi
1910 1913
1911 1914 if grep "not updating" $TMPDIR/pull_open.out > /dev/null 2>&1; then
1912 1915 staffer hg --cwd $CODEMGR_WS merge \
1913 1916 >> $TMPDIR/pull_open.out 2>&1
1914 1917 if (( $? != 0 )); then
1915 1918 printf "%s: merge failed as follows:\n\n" \
1916 1919 "$CODEMGR_WS"
1917 1920 cat $TMPDIR/pull_open.out
1918 1921 if grep "^merging.*failed" $TMPDIR/pull_open.out \
1919 1922 > /dev/null 2>&1; then
1920 1923 printf "$mergefailmsg"
1921 1924 fi
1922 1925 touch $TMPDIR/bringover_failed
1923 1926 return
1924 1927 fi
1925 1928 fi
1926 1929
1927 1930 printf "updated %s with the following results:\n" "$CODEMGR_WS"
1928 1931 cat $TMPDIR/pull_open.out
1929 1932 if grep "^merging" $TMPDIR/pull_open.out >/dev/null 2>&1; then
1930 1933 printf "$mergepassmsg"
1931 1934 fi
1932 1935 printf "\n"
1933 1936
1934 1937 #
1935 1938 # Per-changeset output is neither useful nor manageable for a
1936 1939 # newly-created repository.
1937 1940 #
1938 1941 if [ -f $TMPDIR/new_repository ]; then
1939 1942 return
1940 1943 fi
1941 1944
1942 1945 printf "\nadded the following changesets to open repository:\n"
1943 1946 cat $TMPDIR/incoming_open.out
1944 1947
1945 1948 #
1946 1949 # The closed repository could have been newly created, even though
1947 1950 # the open one previously existed...
1948 1951 #
1949 1952 if [ -f $TMPDIR/new_closed ]; then
1950 1953 return
1951 1954 fi
1952 1955
1953 1956 if [ -f $TMPDIR/incoming_closed.out ]; then
1954 1957 printf "\nadded the following changesets to closed repository:\n"
1955 1958 cat $TMPDIR/incoming_closed.out
1956 1959 fi
1957 1960 }
1958 1961
1959 1962 type bringover_subversion > /dev/null 2>&1 || function bringover_subversion {
1960 1963 typeset -x PATH=$PATH
1961 1964
1962 1965 if [[ ! -d $CODEMGR_WS/.svn ]]; then
1963 1966 staffer svn checkout $BRINGOVER_WS $CODEMGR_WS ||
1964 1967 touch $TMPDIR/bringover_failed
1965 1968 else
1966 1969 typeset root
1967 1970 root=$(staffer svn info $CODEMGR_WS |
1968 1971 nawk '/^Repository Root:/ {print $NF}')
1969 1972 if [[ $root != $BRINGOVER_WS ]]; then
1970 1973 # We fail here because there's no way to update
1971 1974 # from a named repo.
1972 1975 cat <<-EOF
1973 1976 \$BRINGOVER_WS doesn't match repository root:
1974 1977 \$BRINGOVER_WS: $BRINGOVER_WS
1975 1978 Repository root: $root
1976 1979 EOF
1977 1980 touch $TMPDIR/bringover_failed
1978 1981 else
1979 1982 # If a conflict happens, svn still exits 0.
1980 1983 staffer svn update $CODEMGR_WS | tee $TMPDIR/pull.out ||
1981 1984 touch $TMPDIR/bringover_failed
1982 1985 if grep "^C" $TMPDIR/pull.out > /dev/null 2>&1; then
1983 1986 touch $TMPDIR/bringover_failed
1984 1987 fi
1985 1988 fi
1986 1989 fi
1987 1990 }
1988 1991
1989 1992 type bringover_none > /dev/null 2>&1 || function bringover_none {
1990 1993 echo "Couldn't figure out what kind of SCM to use for $BRINGOVER_WS."
1991 1994 touch $TMPDIR/bringover_failed
1992 1995 }
1993 1996
1994 1997 #
1995 1998 # Decide whether to bringover to the codemgr workspace
1996 1999 #
1997 2000 if [ "$n_FLAG" = "n" ]; then
1998 2001 PARENT_SCM_TYPE=$(parent_wstype)
1999 2002
2000 2003 if [[ $SCM_TYPE != none && $SCM_TYPE != $PARENT_SCM_TYPE ]]; then
2001 2004 echo "cannot bringover from $PARENT_SCM_TYPE to $SCM_TYPE, " \
2002 2005 "quitting at `date`." | tee -a $mail_msg_file >> $LOGFILE
2003 2006 exit 1
2004 2007 fi
2005 2008
2006 2009 run_hook PRE_BRINGOVER
2007 2010
2008 2011 echo "\n==== bringover to $CODEMGR_WS at `date` ====\n" >> $LOGFILE
2009 2012 echo "\n==== BRINGOVER LOG ====\n" >> $mail_msg_file
2010 2013
2011 2014 eval "bringover_${PARENT_SCM_TYPE}" 2>&1 |
2012 2015 tee -a $mail_msg_file >> $LOGFILE
2013 2016
2014 2017 if [ -f $TMPDIR/bringover_failed ]; then
2015 2018 rm -f $TMPDIR/bringover_failed
2016 2019 build_ok=n
2017 2020 echo "trouble with bringover, quitting at `date`." |
2018 2021 tee -a $mail_msg_file >> $LOGFILE
2019 2022 exit 1
2020 2023 fi
2021 2024
2022 2025 #
2023 2026 # It's possible that we used the bringover above to create
2024 2027 # $CODEMGR_WS. If so, then SCM_TYPE was previously "none,"
2025 2028 # but should now be the same as $BRINGOVER_WS.
2026 2029 #
2027 2030 [[ $SCM_TYPE = none ]] && SCM_TYPE=$PARENT_SCM_TYPE
2028 2031
2029 2032 run_hook POST_BRINGOVER
2030 2033
2031 2034 check_closed_tree
2032 2035
2033 2036 else
2034 2037 echo "\n==== No bringover to $CODEMGR_WS ====\n" >> $LOGFILE
2035 2038 fi
2036 2039
2037 2040 # Safeguards
2038 2041 [[ -v CODEMGR_WS ]] || fatal_error "Error: Variable CODEMGR_WS not set."
2039 2042 [[ -d "${CODEMGR_WS}" ]] || fatal_error "Error: ${CODEMGR_WS} is not a directory."
2040 2043 [[ -f "${CODEMGR_WS}/usr/src/Makefile" ]] || fatal_error "Error: ${CODEMGR_WS}/usr/src/Makefile not found."
2041 2044
2042 2045 echo "\n==== Build environment ====\n" | tee -a $build_environ_file >> $LOGFILE
2043 2046
2044 2047 # System
2045 2048 whence uname | tee -a $build_environ_file >> $LOGFILE
2046 2049 uname -a 2>&1 | tee -a $build_environ_file >> $LOGFILE
2047 2050 echo | tee -a $build_environ_file >> $LOGFILE
2048 2051
2049 2052 # make
2050 2053 whence $MAKE | tee -a $build_environ_file >> $LOGFILE
2051 2054 $MAKE -v | tee -a $build_environ_file >> $LOGFILE
2052 2055 echo "number of concurrent jobs = $DMAKE_MAX_JOBS" |
2053 2056 tee -a $build_environ_file >> $LOGFILE
2054 2057
2055 2058 #
2056 2059 # Report the compiler versions.
2057 2060 #
2058 2061
2059 2062 if [[ ! -f $SRC/Makefile ]]; then
2060 2063 build_ok=n
2061 2064 echo "\nUnable to find \"Makefile\" in $SRC." | \
2062 2065 tee -a $build_environ_file >> $LOGFILE
2063 2066 exit 1
2064 2067 fi
2065 2068
2066 2069 ( cd $SRC
2067 2070 for target in cc-version cc64-version java-version; do
2068 2071 echo
2069 2072 #
2070 2073 # Put statefile somewhere we know we can write to rather than trip
2071 2074 # over a read-only $srcroot.
2072 2075 #
2073 2076 rm -f $TMPDIR/make-state
2074 2077 export SRC
2075 2078 if $MAKE -K $TMPDIR/make-state -e $target 2>/dev/null; then
2076 2079 continue
2077 2080 fi
2078 2081 touch $TMPDIR/nocompiler
2079 2082 done
2080 2083 echo
2081 2084 ) | tee -a $build_environ_file >> $LOGFILE
2082 2085
2083 2086 if [ -f $TMPDIR/nocompiler ]; then
2084 2087 rm -f $TMPDIR/nocompiler
2085 2088 build_ok=n
2086 2089 echo "Aborting due to missing compiler." |
2087 2090 tee -a $build_environ_file >> $LOGFILE
2088 2091 exit 1
2089 2092 fi
2090 2093
2091 2094 # as
2092 2095 whence as | tee -a $build_environ_file >> $LOGFILE
2093 2096 as -V 2>&1 | head -1 | tee -a $build_environ_file >> $LOGFILE
2094 2097 echo | tee -a $build_environ_file >> $LOGFILE
2095 2098
2096 2099 # Check that we're running a capable link-editor
2097 2100 whence ld | tee -a $build_environ_file >> $LOGFILE
2098 2101 LDVER=`ld -V 2>&1`
2099 2102 echo $LDVER | tee -a $build_environ_file >> $LOGFILE
2100 2103 LDVER=`echo $LDVER | sed -e "s/.*-1\.\([0-9]*\).*/\1/"`
2101 2104 if [ `expr $LDVER \< 422` -eq 1 ]; then
2102 2105 echo "The link-editor needs to be at version 422 or higher to build" | \
2103 2106 tee -a $build_environ_file >> $LOGFILE
2104 2107 echo "the latest stuff. Hope your build works." | \
2105 2108 tee -a $build_environ_file >> $LOGFILE
2106 2109 fi
2107 2110
2108 2111 #
2109 2112 # Build and use the workspace's tools if requested
2110 2113 #
2111 2114 if [[ "$t_FLAG" = "y" ]]; then
2112 2115 set_non_debug_build_flags
2113 2116
2114 2117 build_tools ${TOOLS_PROTO}
2115 2118 if [[ $? != 0 && "$t_FLAG" = y ]]; then
2116 2119 use_tools $TOOLS_PROTO
2117 2120 fi
2118 2121 fi
2119 2122
2120 2123 #
2121 2124 # copy ihv proto area in addition to the build itself
2122 2125 #
2123 2126 if [ "$X_FLAG" = "y" ]; then
2124 2127 copy_ihv_proto
2125 2128 fi
2126 2129
2127 2130 # timestamp the start of the normal build; the findunref tool uses it.
2128 2131 touch $SRC/.build.tstamp
2129 2132
2130 2133 normal_build
2131 2134
2132 2135 ORIG_SRC=$SRC
2133 2136 BINARCHIVE=${CODEMGR_WS}/bin-${MACH}.cpio.Z
2134 2137
2135 2138
2136 2139 #
2137 2140 # There are several checks that need to look at the proto area, but
2138 2141 # they only need to look at one, and they don't care whether it's
2139 2142 # DEBUG or non-DEBUG.
2140 2143 #
2141 2144 if [[ "$MULTI_PROTO" = yes && "$D_FLAG" = n ]]; then
2142 2145 checkroot=$ROOT-nd
2143 2146 else
2144 2147 checkroot=$ROOT
2145 2148 fi
2146 2149
2147 2150 if [ "$build_ok" = "y" ]; then
2148 2151 echo "\n==== Creating protolist system file at `date` ====" \
2149 2152 >> $LOGFILE
2150 2153 protolist $checkroot > $ATLOG/proto_list_${MACH}
2151 2154 echo "==== protolist system file created at `date` ====\n" \
2152 2155 >> $LOGFILE
2153 2156
2154 2157 if [ "$N_FLAG" != "y" ]; then
2155 2158
2156 2159 E1=
2157 2160 f1=
2158 2161 if [ -d "$SRC/pkgdefs" ]; then
2159 2162 f1="$SRC/pkgdefs/etc/exception_list_$MACH"
2160 2163 if [ "$X_FLAG" = "y" ]; then
2161 2164 f1="$f1 $IA32_IHV_WS/usr/src/pkgdefs/etc/exception_list_$MACH"
2162 2165 fi
2163 2166 fi
2164 2167
2165 2168 for f in $f1; do
2166 2169 if [ -f "$f" ]; then
2167 2170 E1="$E1 -e $f"
2168 2171 fi
2169 2172 done
2170 2173
2171 2174 E2=
2172 2175 f2=
2173 2176 if [ -d "$SRC/pkg" ]; then
2174 2177 f2="$f2 exceptions/packaging"
2175 2178 fi
2176 2179
2177 2180 for f in $f2; do
2178 2181 if [ -f "$f" ]; then
2179 2182 E2="$E2 -e $f"
2180 2183 fi
2181 2184 done
2182 2185
2183 2186 if [ -f "$REF_PROTO_LIST" ]; then
2184 2187 #
2185 2188 # For builds that copy the IHV proto area (-X), add the
2186 2189 # IHV proto list to the reference list if the reference
2187 2190 # was built without -X.
2188 2191 #
2189 2192 # For builds that don't copy the IHV proto area, add the
2190 2193 # IHV proto list to the build's proto list if the
2191 2194 # reference was built with -X.
2192 2195 #
2193 2196 # Use the presence of the first file entry of the cached
2194 2197 # IHV proto list in the reference list to determine
2195 2198 # whether it was built with -X or not.
2196 2199 #
2197 2200 IHV_REF_PROTO_LIST=$SRC/pkg/proto_list_ihv_$MACH
2198 2201 grepfor=$(nawk '$1 == "f" { print $2; exit }' \
2199 2202 $IHV_REF_PROTO_LIST 2> /dev/null)
2200 2203 if [ $? = 0 -a -n "$grepfor" ]; then
2201 2204 if [ "$X_FLAG" = "y" ]; then
2202 2205 grep -w "$grepfor" \
2203 2206 $REF_PROTO_LIST > /dev/null
2204 2207 if [ ! "$?" = "0" ]; then
2205 2208 REF_IHV_PROTO="-d $IHV_REF_PROTO_LIST"
2206 2209 fi
2207 2210 else
2208 2211 grep -w "$grepfor" \
2209 2212 $REF_PROTO_LIST > /dev/null
2210 2213 if [ "$?" = "0" ]; then
2211 2214 IHV_PROTO_LIST="$IHV_REF_PROTO_LIST"
2212 2215 fi
2213 2216 fi
2214 2217 fi
2215 2218 fi
2216 2219 fi
2217 2220
2218 2221 if [ "$N_FLAG" != "y" -a -f $SRC/pkgdefs/Makefile ]; then
2219 2222 echo "\n==== Impact on SVr4 packages ====\n" >> $mail_msg_file
2220 2223 #
2221 2224 # Compare the build's proto list with current package
2222 2225 # definitions to audit the quality of package
2223 2226 # definitions and makefile install targets. Use the
2224 2227 # current exception list.
2225 2228 #
2226 2229 PKGDEFS_LIST=""
2227 2230 for d in $abssrcdirs; do
2228 2231 if [ -d $d/pkgdefs ]; then
2229 2232 PKGDEFS_LIST="$PKGDEFS_LIST -d $d/pkgdefs"
2230 2233 fi
2231 2234 done
2232 2235 if [ "$X_FLAG" = "y" -a \
2233 2236 -d $IA32_IHV_WS/usr/src/pkgdefs ]; then
2234 2237 PKGDEFS_LIST="$PKGDEFS_LIST -d $IA32_IHV_WS/usr/src/pkgdefs"
2235 2238 fi
2236 2239 $PROTOCMPTERSE \
2237 2240 "Files missing from the proto area:" \
2238 2241 "Files missing from packages:" \
2239 2242 "Inconsistencies between pkgdefs and proto area:" \
2240 2243 ${E1} \
2241 2244 ${PKGDEFS_LIST} \
2242 2245 $ATLOG/proto_list_${MACH} \
2243 2246 >> $mail_msg_file
2244 2247 fi
2245 2248
2246 2249 if [ "$N_FLAG" != "y" -a -d $SRC/pkg ]; then
2247 2250 echo "\n==== Validating manifests against proto area ====\n" \
2248 2251 >> $mail_msg_file
2249 2252 ( cd $SRC/pkg ; $MAKE -e protocmp ROOT="$checkroot" ) \
2250 2253 >> $mail_msg_file
2251 2254
2252 2255 fi
2253 2256
2254 2257 if [ "$N_FLAG" != "y" -a -f "$REF_PROTO_LIST" ]; then
2255 2258 echo "\n==== Impact on proto area ====\n" >> $mail_msg_file
2256 2259 if [ -n "$E2" ]; then
2257 2260 ELIST=$E2
2258 2261 else
2259 2262 ELIST=$E1
2260 2263 fi
2261 2264 $PROTOCMPTERSE \
2262 2265 "Files in yesterday's proto area, but not today's:" \
2263 2266 "Files in today's proto area, but not yesterday's:" \
2264 2267 "Files that changed between yesterday and today:" \
2265 2268 ${ELIST} \
2266 2269 -d $REF_PROTO_LIST \
2267 2270 $REF_IHV_PROTO \
2268 2271 $ATLOG/proto_list_${MACH} \
2269 2272 $IHV_PROTO_LIST \
2270 2273 >> $mail_msg_file
2271 2274 fi
2272 2275 fi
2273 2276
2274 2277 if [ "$u_FLAG" = "y" -a "$build_ok" = "y" ]; then
2275 2278 staffer cp $ATLOG/proto_list_${MACH} \
2276 2279 $PARENT_WS/usr/src/proto_list_${MACH}
2277 2280 fi
2278 2281
2279 2282 # Update parent proto area if necessary. This is done now
2280 2283 # so that the proto area has either DEBUG or non-DEBUG kernels.
2281 2284 # Note that this clears out the lock file, so we can dispense with
2282 2285 # the variable now.
2283 2286 if [ "$U_FLAG" = "y" -a "$build_ok" = "y" ]; then
2284 2287 echo "\n==== Copying proto area to $NIGHTLY_PARENT_ROOT ====\n" | \
2285 2288 tee -a $LOGFILE >> $mail_msg_file
2286 2289 rm -rf $NIGHTLY_PARENT_ROOT/*
2287 2290 unset Ulockfile
2288 2291 mkdir -p $NIGHTLY_PARENT_ROOT
2289 2292 if [[ "$MULTI_PROTO" = no || "$D_FLAG" = y ]]; then
2290 2293 ( cd $ROOT; tar cf - . |
2291 2294 ( cd $NIGHTLY_PARENT_ROOT; umask 0; tar xpf - ) ) 2>&1 |
2292 2295 tee -a $mail_msg_file >> $LOGFILE
2293 2296 fi
2294 2297 if [[ "$MULTI_PROTO" = yes && "$F_FLAG" = n ]]; then
2295 2298 rm -rf $NIGHTLY_PARENT_ROOT-nd/*
2296 2299 mkdir -p $NIGHTLY_PARENT_ROOT-nd
2297 2300 cd $ROOT-nd
2298 2301 ( tar cf - . |
2299 2302 ( cd $NIGHTLY_PARENT_ROOT-nd; umask 0; tar xpf - ) ) 2>&1 |
2300 2303 tee -a $mail_msg_file >> $LOGFILE
2301 2304 fi
2302 2305 if [ -n "${NIGHTLY_PARENT_TOOLS_ROOT}" ]; then
2303 2306 echo "\n==== Copying tools proto area to $NIGHTLY_PARENT_TOOLS_ROOT ====\n" | \
2304 2307 tee -a $LOGFILE >> $mail_msg_file
2305 2308 rm -rf $NIGHTLY_PARENT_TOOLS_ROOT/*
2306 2309 mkdir -p $NIGHTLY_PARENT_TOOLS_ROOT
2307 2310 if [[ "$MULTI_PROTO" = no || "$D_FLAG" = y ]]; then
2308 2311 ( cd $TOOLS_PROTO; tar cf - . |
2309 2312 ( cd $NIGHTLY_PARENT_TOOLS_ROOT;
2310 2313 umask 0; tar xpf - ) ) 2>&1 |
2311 2314 tee -a $mail_msg_file >> $LOGFILE
2312 2315 fi
2313 2316 fi
2314 2317 fi
2315 2318
2316 2319 #
2317 2320 # ELF verification: ABI (-A) and runtime (-r) checks
2318 2321 #
2319 2322 if [[ ($build_ok = y) && ( ($A_FLAG = y) || ($r_FLAG = y) ) ]]; then
2320 2323 # Directory ELF-data.$MACH holds the files produced by these tests.
2321 2324 elf_ddir=$SRC/ELF-data.$MACH
2322 2325
2323 2326 # If there is a previous ELF-data backup directory, remove it. Then,
2324 2327 # rotate current ELF-data directory into its place and create a new
2325 2328 # empty directory
2326 2329 rm -rf $elf_ddir.ref
2327 2330 if [[ -d $elf_ddir ]]; then
2328 2331 mv $elf_ddir $elf_ddir.ref
2329 2332 fi
2330 2333 mkdir -p $elf_ddir
2331 2334
2332 2335 # Call find_elf to produce a list of the ELF objects in the proto area.
2333 2336 # This list is passed to check_rtime and interface_check, preventing
2334 2337 # them from separately calling find_elf to do the same work twice.
2335 2338 find_elf -fr $checkroot > $elf_ddir/object_list
2336 2339
2337 2340 if [[ $A_FLAG = y ]]; then
2338 2341 echo "\n==== Check versioning and ABI information ====\n" | \
2339 2342 tee -a $LOGFILE >> $mail_msg_file
2340 2343
2341 2344 # Produce interface description for the proto. Report errors.
2342 2345 interface_check -o -w $elf_ddir -f object_list \
2343 2346 -i interface -E interface.err
2344 2347 if [[ -s $elf_ddir/interface.err ]]; then
2345 2348 tee -a $LOGFILE < $elf_ddir/interface.err \
2346 2349 >> $mail_msg_file
2347 2350 fi
2348 2351
2349 2352 # If ELF_DATA_BASELINE_DIR is defined, compare the new interface
2350 2353 # description file to that from the baseline gate. Issue a
2351 2354 # warning if the baseline is not present, and keep going.
2352 2355 if [[ "$ELF_DATA_BASELINE_DIR" != '' ]]; then
2353 2356 base_ifile="$ELF_DATA_BASELINE_DIR/interface"
2354 2357
2355 2358 echo "\n==== Compare versioning and ABI information" \
2356 2359 "to baseline ====\n" | \
2357 2360 tee -a $LOGFILE >> $mail_msg_file
2358 2361 echo "Baseline: $base_ifile\n" >> $LOGFILE
2359 2362
2360 2363 if [[ -f $base_ifile ]]; then
2361 2364 interface_cmp -d -o $base_ifile \
2362 2365 $elf_ddir/interface > $elf_ddir/interface.cmp
2363 2366 if [[ -s $elf_ddir/interface.cmp ]]; then
2364 2367 echo | tee -a $LOGFILE >> $mail_msg_file
2365 2368 tee -a $LOGFILE < \
2366 2369 $elf_ddir/interface.cmp \
2367 2370 >> $mail_msg_file
2368 2371 fi
2369 2372 else
2370 2373 echo "baseline not available. comparison" \
2371 2374 "skipped" | \
2372 2375 tee -a $LOGFILE >> $mail_msg_file
2373 2376 fi
2374 2377
2375 2378 fi
2376 2379 fi
2377 2380
2378 2381 if [[ $r_FLAG = y ]]; then
2379 2382 echo "\n==== Check ELF runtime attributes ====\n" | \
2380 2383 tee -a $LOGFILE >> $mail_msg_file
2381 2384
2382 2385 # If we're doing a DEBUG build the proto area will be left
2383 2386 # with debuggable objects, thus don't assert -s.
2384 2387 if [[ $D_FLAG = y ]]; then
2385 2388 rtime_sflag=""
2386 2389 else
2387 2390 rtime_sflag="-s"
2388 2391 fi
2389 2392 check_rtime -i -m -v $rtime_sflag -o -w $elf_ddir \
2390 2393 -D object_list -f object_list -E runtime.err \
2391 2394 -I runtime.attr.raw
2392 2395
2393 2396 # check_rtime -I output needs to be sorted in order to
2394 2397 # compare it to that from previous builds.
2395 2398 sort $elf_ddir/runtime.attr.raw > $elf_ddir/runtime.attr
2396 2399 rm $elf_ddir/runtime.attr.raw
2397 2400
2398 2401 # Report errors
2399 2402 if [[ -s $elf_ddir/runtime.err ]]; then
2400 2403 tee -a $LOGFILE < $elf_ddir/runtime.err \
2401 2404 >> $mail_msg_file
2402 2405 fi
2403 2406
2404 2407 # If there is an ELF-data directory from a previous build,
2405 2408 # then diff the attr files. These files contain information
2406 2409 # about dependencies, versioning, and runpaths. There is some
2407 2410 # overlap with the ABI checking done above, but this also
2408 2411 # flushes out non-ABI interface differences along with the
2409 2412 # other information.
2410 2413 echo "\n==== Diff ELF runtime attributes" \
2411 2414 "(since last build) ====\n" | \
2412 2415 tee -a $LOGFILE >> $mail_msg_file >> $mail_msg_file
2413 2416
2414 2417 if [[ -f $elf_ddir.ref/runtime.attr ]]; then
2415 2418 diff $elf_ddir.ref/runtime.attr \
2416 2419 $elf_ddir/runtime.attr \
2417 2420 >> $mail_msg_file
2418 2421 fi
2419 2422 fi
2420 2423
2421 2424 # If -u set, copy contents of ELF-data.$MACH to the parent workspace.
2422 2425 if [[ "$u_FLAG" = "y" ]]; then
2423 2426 p_elf_ddir=$PARENT_WS/usr/src/ELF-data.$MACH
2424 2427
2425 2428 # If parent lacks the ELF-data.$MACH directory, create it
2426 2429 if [[ ! -d $p_elf_ddir ]]; then
2427 2430 staffer mkdir -p $p_elf_ddir
2428 2431 fi
2429 2432
2430 2433 # These files are used asynchronously by other builds for ABI
2431 2434 # verification, as above for the -A option. As such, we require
2432 2435 # the file replacement to be atomic. Copy the data to a temp
2433 2436 # file in the same filesystem and then rename into place.
2434 2437 (
2435 2438 cd $elf_ddir
2436 2439 for elf_dfile in *; do
2437 2440 staffer cp $elf_dfile \
2438 2441 ${p_elf_ddir}/${elf_dfile}.new
2439 2442 staffer mv -f ${p_elf_ddir}/${elf_dfile}.new \
2440 2443 ${p_elf_ddir}/${elf_dfile}
2441 2444 done
2442 2445 )
2443 2446 fi
2444 2447 fi
2445 2448
2446 2449 # DEBUG lint of kernel begins
2447 2450
2448 2451 if [ "$i_CMD_LINE_FLAG" = "n" -a "$l_FLAG" = "y" ]; then
2449 2452 if [ "$LINTDIRS" = "" ]; then
2450 2453 # LINTDIRS="$SRC/uts y $SRC/stand y $SRC/psm y"
2451 2454 LINTDIRS="$SRC y"
2452 2455 fi
2453 2456 set $LINTDIRS
2454 2457 while [ $# -gt 0 ]; do
2455 2458 dolint $1 $2; shift; shift
2456 2459 done
2457 2460 else
2458 2461 echo "\n==== No '$MAKE lint' ====\n" >> $LOGFILE
2459 2462 fi
2460 2463
2461 2464 # "make check" begins
2462 2465
2463 2466 if [ "$i_CMD_LINE_FLAG" = "n" -a "$C_FLAG" = "y" ]; then
2464 2467 # remove old check.out
2465 2468 rm -f $SRC/check.out
2466 2469
2467 2470 rm -f $SRC/check-${MACH}.out
2468 2471 cd $SRC
2469 2472 $MAKE -ek check ROOT="$checkroot" 2>&1 | tee -a $SRC/check-${MACH}.out \
2470 2473 >> $LOGFILE
2471 2474 echo "\n==== cstyle/hdrchk errors ====\n" >> $mail_msg_file
2472 2475
2473 2476 grep ":" $SRC/check-${MACH}.out |
2474 2477 egrep -v "Ignoring unknown host" | \
2475 2478 sort | uniq >> $mail_msg_file
2476 2479 else
2477 2480 echo "\n==== No '$MAKE check' ====\n" >> $LOGFILE
2478 2481 fi
2479 2482
2480 2483 echo "\n==== Find core files ====\n" | \
2481 2484 tee -a $LOGFILE >> $mail_msg_file
2482 2485
2483 2486 find $abssrcdirs -name core -a -type f -exec file {} \; | \
2484 2487 tee -a $LOGFILE >> $mail_msg_file
2485 2488
2486 2489 if [ "$f_FLAG" = "y" -a "$build_ok" = "y" ]; then
2487 2490 echo "\n==== Diff unreferenced files (since last build) ====\n" \
2488 2491 | tee -a $LOGFILE >>$mail_msg_file
2489 2492 rm -f $SRC/unref-${MACH}.ref
2490 2493 if [ -f $SRC/unref-${MACH}.out ]; then
2491 2494 mv $SRC/unref-${MACH}.out $SRC/unref-${MACH}.ref
2492 2495 fi
2493 2496
2494 2497 findunref -S $SCM_TYPE -t $SRC/.build.tstamp -s usr $CODEMGR_WS \
2495 2498 ${TOOLS}/findunref/exception_list 2>> $mail_msg_file | \
2496 2499 sort > $SRC/unref-${MACH}.out
2497 2500
2498 2501 if [ ! -f $SRC/unref-${MACH}.ref ]; then
2499 2502 cp $SRC/unref-${MACH}.out $SRC/unref-${MACH}.ref
2500 2503 fi
2501 2504
2502 2505 diff $SRC/unref-${MACH}.ref $SRC/unref-${MACH}.out >>$mail_msg_file
2503 2506 fi
2504 2507
2505 2508 #
2506 2509 # Generate the OpenSolaris deliverables if requested. Some of these
2507 2510 # steps need to come after findunref and are commented below.
2508 2511 #
2509 2512
2510 2513 # Verify that the usual lists of files, such as exception lists,
2511 2514 # contain only valid references to files. If the build has failed,
2512 2515 # then don't check the proto area.
2513 2516 CHECK_PATHS=${CHECK_PATHS:-y}
2514 2517 if [ "$CHECK_PATHS" = y -a "$N_FLAG" != y ]; then
2515 2518 echo "\n==== Check lists of files ====\n" | tee -a $LOGFILE \
2516 2519 >>$mail_msg_file
2517 2520 arg=-b
2518 2521 [ "$build_ok" = y ] && arg=
2519 2522 checkpaths $arg $checkroot 2>&1 | tee -a $LOGFILE >>$mail_msg_file
2520 2523 fi
2521 2524
2522 2525 if [ "$M_FLAG" != "y" -a "$build_ok" = y ]; then
2523 2526 echo "\n==== Impact on file permissions ====\n" \
2524 2527 >> $mail_msg_file
2525 2528
2526 2529 abspkgdefs=
2527 2530 abspkg=
2528 2531 for d in $abssrcdirs; do
2529 2532 if [ -d "$d/pkgdefs" ]; then
2530 2533 abspkgdefs="$abspkgdefs $d"
2531 2534 fi
2532 2535 if [ -d "$d/pkg" ]; then
2533 2536 abspkg="$abspkg $d"
2534 2537 fi
2535 2538 done
2536 2539
2537 2540 if [ -n "$abspkgdefs" ]; then
2538 2541 pmodes -qvdP \
2539 2542 `find $abspkgdefs -name pkginfo.tmpl -print -o \
2540 2543 -name .del\* -prune | sed -e 's:/pkginfo.tmpl$::' | \
2541 2544 sort -u` >> $mail_msg_file
2542 2545 fi
2543 2546
2544 2547 if [ -n "$abspkg" ]; then
2545 2548 for d in "$abspkg"; do
2546 2549 ( cd $d/pkg ; $MAKE -e pmodes ) >> $mail_msg_file
2547 2550 done
2548 2551 fi
2549 2552 fi
2550 2553
2551 2554 if [ "$w_FLAG" = "y" -a "$build_ok" = "y" ]; then
2552 2555 if [[ "$MULTI_PROTO" = no || "$D_FLAG" = y ]]; then
2553 2556 do_wsdiff DEBUG $ROOT.prev $ROOT
2554 2557 fi
2555 2558
2556 2559 if [[ "$MULTI_PROTO" = yes && "$F_FLAG" = n ]]; then
2557 2560 do_wsdiff non-DEBUG $ROOT-nd.prev $ROOT-nd
2558 2561 fi
2559 2562 fi
2560 2563
2561 2564 END_DATE=`date`
2562 2565 echo "==== Nightly $maketype build completed: $END_DATE ====" | \
2563 2566 tee -a $LOGFILE >> $build_time_file
2564 2567
2565 2568 typeset -i10 hours
2566 2569 typeset -Z2 minutes
2567 2570 typeset -Z2 seconds
2568 2571
2569 2572 elapsed_time=$SECONDS
2570 2573 ((hours = elapsed_time / 3600 ))
2571 2574 ((minutes = elapsed_time / 60 % 60))
2572 2575 ((seconds = elapsed_time % 60))
2573 2576
2574 2577 echo "\n==== Total build time ====" | \
2575 2578 tee -a $LOGFILE >> $build_time_file
2576 2579 echo "\nreal ${hours}:${minutes}:${seconds}" | \
2577 2580 tee -a $LOGFILE >> $build_time_file
2578 2581
2579 2582 if [ "$u_FLAG" = "y" -a "$f_FLAG" = "y" -a "$build_ok" = "y" ]; then
2580 2583 staffer cp ${SRC}/unref-${MACH}.out $PARENT_WS/usr/src/
2581 2584
2582 2585 #
2583 2586 # Produce a master list of unreferenced files -- ideally, we'd
2584 2587 # generate the master just once after all of the nightlies
2585 2588 # have finished, but there's no simple way to know when that
2586 2589 # will be. Instead, we assume that we're the last nightly to
2587 2590 # finish and merge all of the unref-${MACH}.out files in
2588 2591 # $PARENT_WS/usr/src/. If we are in fact the final ${MACH} to
2589 2592 # finish, then this file will be the authoritative master
2590 2593 # list. Otherwise, another ${MACH}'s nightly will eventually
2591 2594 # overwrite ours with its own master, but in the meantime our
2592 2595 # temporary "master" will be no worse than any older master
2593 2596 # which was already on the parent.
2594 2597 #
2595 2598
2596 2599 set -- $PARENT_WS/usr/src/unref-*.out
2597 2600 cp "$1" ${TMPDIR}/unref.merge
2598 2601 shift
2599 2602
2600 2603 for unreffile; do
2601 2604 comm -12 ${TMPDIR}/unref.merge "$unreffile" > ${TMPDIR}/unref.$$
2602 2605 mv ${TMPDIR}/unref.$$ ${TMPDIR}/unref.merge
2603 2606 done
2604 2607
2605 2608 staffer cp ${TMPDIR}/unref.merge $PARENT_WS/usr/src/unrefmaster.out
2606 2609 fi
2607 2610
2608 2611 #
2609 2612 # All done save for the sweeping up.
2610 2613 # (whichever exit we hit here will trigger the "cleanup" trap which
2611 2614 # optionally sends mail on completion).
2612 2615 #
2613 2616 if [ "$build_ok" = "y" ]; then
2614 2617 exit 0
2615 2618 fi
2616 2619 exit 1
↓ open down ↓ |
1332 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX