Skip to content

Commit

Permalink
11221 Should be able to enable findunref without lint
Browse files Browse the repository at this point in the history
Reviewed by: Joshua M. Clulow <josh@sysmgr.org>
Reviewed by: Toomas Soome <tsoome@me.com>
Reviewed by: John Levon <john.levon@joyent.com>
Approved by: Dan McDonald <danmcd@joyent.com>
  • Loading branch information
ptribble authored and Dan McDonald committed Jun 13, 2019
1 parent e664589 commit be0ffda
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 162 deletions.
7 changes: 0 additions & 7 deletions usr/src/tools/env/illumos.sh
Expand Up @@ -279,13 +279,6 @@ export BUILD_TOOLS='/opt'
export SPRO_ROOT='/opt/SUNWspro'
export SPRO_VROOT="$SPRO_ROOT"

# This goes along with lint - it is a series of the form "A [y|n]" which
# means "go to directory A and run 'make lint'" Then mail me (y) the
# difference in the lint output. 'y' should only be used if the area you're
# linting is actually lint clean or you'll get lots of mail.
# You shouldn't need to change this though.
#export LINTDIRS="$SRC y"

# Set this flag to 'n' to disable the use of 'checkpaths'. The default,
# if the 'N' option is not specified, is to run this test.
#CHECK_PATHS='y'
Expand Down
19 changes: 4 additions & 15 deletions usr/src/tools/scripts/nightly.1onbld
Expand Up @@ -18,8 +18,9 @@
.\" "
.\" "Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
.\" "Copyright 2012 Joshua M. Clulow <josh@sysmgr.org>
.\" "Copyright 2019 Peter Tribble.
.\" "
.TH NIGHTLY 1ONBLD "Jul 2, 2017"
.TH NIGHTLY 1ONBLD "Jun 9, 2019"
.SH NAME
.I nightly
\- build an OS-Net consolidation overnight
Expand Down Expand Up @@ -69,9 +70,6 @@ copy updated proto area to parent
list shared lib interface and compare with previous list
.TP
\(bu
perform a "make lint" of the kernel and report errors
.TP
\(bu
perform a "make check" to report hdrchk/cstyle errors
.TP
\(bu
Expand Down Expand Up @@ -136,8 +134,7 @@ Do not run pmodes (safe file permission checker)
.B \-i
Do an incremental build, suppressing the "make clobber" that by
default removes all existing binaries and derived files. From the
command line, -i also suppresses the lint pass and the cstyle/hdrchk
pass
command line, -i also suppresses the cstyle/hdrchk pass
.TP
.B \-n
Suppress the bringover so that the build will start immediately with
Expand Down Expand Up @@ -190,14 +187,11 @@ Check for cstyle/hdrchk errors
.B \-f
Check for unreferenced files. Since the full workspace must be built
in order to accurately identify unreferenced files, -f is ignored for
incremental (-i) builds, or builds that do not include -l, and -p.
incremental (-i) builds, or builds that do not include -p.
.TP
.B \-r
Check the ELF runtime attributes of all dynamic objects
.TP
.B \-l
Do "make lint" in $LINTDIRS (default: $SRC n)
.TP
.B \-N
Do not run protocmp or checkpaths (note: this option is not
recommended, especially in conjunction with the \-p option)
Expand Down Expand Up @@ -392,11 +386,6 @@ Disables usage reporting by listed Devpro tools. Otherwise it sends mail
to some Devpro machine every time the tools are used.
.RE
.LP
.B LINTDIRS
.RS 5
Directories to lint with the \-l option.
.RE
.LP
.B BUILD_TOOLS
.RS 5
BUILD_TOOLS is the root of all tools including the compilers; e.g.,
Expand Down
147 changes: 7 additions & 140 deletions usr/src/tools/scripts/nightly.sh
Expand Up @@ -28,6 +28,7 @@
# Copyright (c) 2017 by Delphix. All rights reserved.
# Copyright 2019 Joyent, Inc.
# Copyright 2018 OmniOS Community Edition (OmniOSce) Association.
# Copyright 2019 Peter Trible.
#
# Based on the nightly script from the integration folks,
# Mostly modified and owned by mike_s.
Expand All @@ -37,18 +38,9 @@
# The default is the old behavior of CLONE_WS
#
# -i on the command line, means fast options, so when it's on the
# command line (only), lint and check builds are skipped no matter what
# command line (only), check builds are skipped no matter what
# the setting of their individual flags are in NIGHTLY_OPTIONS.
#
# LINTDIRS can be set in the env file, format is a list of:
#
# /dirname-to-run-lint-on flag
#
# Where flag is: y - enable lint noise diff output
# n - disable lint noise diff output
#
# For example: LINTDIRS="$SRC/uts n $SRC/stand y $SRC/psm y"
#
# OPTHOME may be set in the environment to override /opt
#

Expand Down Expand Up @@ -361,99 +353,6 @@ function build {
ROOT=$ORIGROOT
}

# Usage: dolint /dir y|n
# Arg. 2 is a flag to turn on/off the lint diff output
function dolint {
if [ ! -d "$1" ]; then
echo "dolint error: $1 is not a directory"
exit 1
fi

if [ "$2" != "y" -a "$2" != "n" ]; then
echo "dolint internal error: $2 should be 'y' or 'n'"
exit 1
fi

lintdir=$1
dodiff=$2
base=`basename $lintdir`
LINTOUT=$lintdir/lint-${MACH}.out
LINTNOISE=$lintdir/lint-noise-${MACH}
export ENVLDLIBS1=`myldlibs $ROOT`
export ENVCPPFLAGS1=`myheaders $ROOT`

set_debug_build_flags

#
# '$MAKE lint' in $lintdir
#
echo "\n==== Begin '$MAKE lint' of $base at `date` ====\n" >> $LOGFILE

# remove old lint.out
rm -f $lintdir/lint.out $lintdir/lint-noise.out
if [ -f $lintdir/lint-noise.ref ]; then
mv $lintdir/lint-noise.ref ${LINTNOISE}.ref
fi

rm -f $LINTOUT
cd $lintdir
#
# Remove all .ln files to ensure a full reference file
#
rm -f Nothing_to_remove \
`find . \( -name SCCS -o -name .hg -o -name .svn -o -name .git \) \
-prune -o -type f -name '*.ln' -print `

/bin/time $MAKE -ek lint 2>&1 | \
tee -a $LINTOUT >> $LOGFILE

echo "\n==== '$MAKE lint' of $base ERRORS ====\n" >> $mail_msg_file

grep "$MAKE:" $LINTOUT |
egrep -v "Ignoring unknown host" | \
tee $TMPDIR/lint_errs >> $mail_msg_file
if [[ -s $TMPDIR/lint_errs ]]; then
build_extras_ok=n
fi

echo "\n==== Ended '$MAKE lint' of $base at `date` ====\n" >> $LOGFILE

echo "\n==== Elapsed time of '$MAKE lint' of $base ====\n" \
>>$mail_msg_file
tail -3 $LINTOUT >>$mail_msg_file

rm -f ${LINTNOISE}.ref
if [ -f ${LINTNOISE}.out ]; then
mv ${LINTNOISE}.out ${LINTNOISE}.ref
fi
grep : $LINTOUT | \
egrep -v '^(real|user|sys)' |
egrep -v '(library construction)' | \
egrep -v ': global crosschecks' | \
egrep -v 'Ignoring unknown host' | \
egrep -v '\.c:$' | \
sort | uniq > ${LINTNOISE}.out
if [ ! -f ${LINTNOISE}.ref ]; then
cp ${LINTNOISE}.out ${LINTNOISE}.ref
fi

if [ "$dodiff" != "n" ]; then
echo "\n==== lint warnings $base ====\n" \
>>$mail_msg_file
# should be none, though there are a few that were filtered out
# above
egrep -i '(warning|lint):' ${LINTNOISE}.out \
| sort | uniq | tee $TMPDIR/lint_warns >> $mail_msg_file
if [[ -s $TMPDIR/lint_warns ]]; then
build_extras_ok=n
fi
echo "\n==== lint noise differences $base ====\n" \
>> $mail_msg_file
diff ${LINTNOISE}.ref ${LINTNOISE}.out \
>> $mail_msg_file
fi
}

#
# Build and install the onbld tools.
#
Expand Down Expand Up @@ -567,7 +466,7 @@ fi
USAGE='Usage: nightly [-in] [+t] [-V VERS ] <env_file>
Where:
-i Fast incremental options (no clobber, lint, check)
-i Fast incremental options (no clobber, check)
-n Do not do a bringover
+t Use the build tools in $ONBLD_TOOLS/bin
-V VERS set the build version string to VERS
Expand All @@ -593,7 +492,6 @@ NIGHTLY_OPTIONS variable in the <env_file> as follows:
-V VERS set the build version string to VERS
-f find unreferenced files
-i do an incremental build (no "make clobber")
-l do "make lint" in $LINTDIRS (default: $SRC y)
-m send mail to $MAILTO at end of build
-n do not do a bringover
-p create packages
Expand All @@ -617,7 +515,6 @@ D_FLAG=n
F_FLAG=n
f_FLAG=n
i_FLAG=n; i_CMD_LINE_FLAG=n
l_FLAG=n
M_FLAG=n
m_FLAG=n
N_FLAG=n
Expand Down Expand Up @@ -801,7 +698,7 @@ check_closed_bins
#
NIGHTLY_OPTIONS=-${NIGHTLY_OPTIONS#-}
OPTIND=1
while getopts +ABCDdFfGIilMmNnpRrtUuwW FLAG $NIGHTLY_OPTIONS
while getopts +ABCDdFfGIiMmNnpRrtUuwW FLAG $NIGHTLY_OPTIONS
do
case $FLAG in
A ) A_FLAG=y
Expand All @@ -824,8 +721,6 @@ do
;;
i ) i_FLAG=y
;;
l ) l_FLAG=y
;;
M ) M_FLAG=y
;;
m ) m_FLAG=y
Expand Down Expand Up @@ -1285,27 +1180,14 @@ EOF
echo "" | tee -a $mail_msg_file >> $LOGFILE
fi

if [ "$D_FLAG" = "n" -a "$l_FLAG" = "y" ]; then
#
# In the past we just complained but went ahead with the lint
# pass, even though the proto area was built non-DEBUG. It's
# unlikely that non-DEBUG headers will make a difference, but
# rather than assuming it's a safe combination, force the user
# to specify a DEBUG build.
#
echo "WARNING: DEBUG build not requested; disabling lint.\n" \
| tee -a $mail_msg_file >> $LOGFILE
l_FLAG=n
fi

if [ "$f_FLAG" = "y" ]; then
if [ "$i_FLAG" = "y" ]; then
echo "WARNING: the -f flag cannot be used during incremental" \
"builds; ignoring -f\n" | tee -a $mail_msg_file >> $LOGFILE
f_FLAG=n
fi
if [ "${l_FLAG}${p_FLAG}" != "yy" ]; then
echo "WARNING: the -f flag requires -l, and -p;" \
if [ "${p_FLAG}" != "y" ]; then
echo "WARNING: the -f flag requires -p;" \
"ignoring -f\n" | tee -a $mail_msg_file >> $LOGFILE
f_FLAG=n
fi
Expand Down Expand Up @@ -1916,7 +1798,7 @@ if [[ ($build_ok = y) && (($A_FLAG = y) || ($r_FLAG = y)) ]]; then
if [[ "$ELF_DATA_BASELINE_DIR" != '' ]]; then
base_ifile="$ELF_DATA_BASELINE_DIR/interface"

echo "\n==== Compare versioning and ABI information" \
echo "\n==== Compare versioning and ABI information" \
"to baseline ====\n" | \
tee -a $LOGFILE >> $mail_msg_file
echo "Baseline: $base_ifile\n" >> $LOGFILE
Expand Down Expand Up @@ -2012,21 +1894,6 @@ if [[ ($build_ok = y) && (($A_FLAG = y) || ($r_FLAG = y)) ]]; then
fi
fi

# DEBUG lint of kernel begins

if [ "$i_CMD_LINE_FLAG" = "n" -a "$l_FLAG" = "y" ]; then
if [ "$LINTDIRS" = "" ]; then
# LINTDIRS="$SRC/uts y $SRC/stand y $SRC/psm y"
LINTDIRS="$SRC y"
fi
set $LINTDIRS
while [ $# -gt 0 ]; do
dolint $1 $2; shift; shift
done
else
echo "\n==== No '$MAKE lint' ====\n" >> $LOGFILE
fi

# "make check" begins

if [ "$i_CMD_LINE_FLAG" = "n" -a "$C_FLAG" = "y" ]; then
Expand Down

0 comments on commit be0ffda

Please sign in to comment.