Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ MF2TAR = $(PWD)/mf2tar/target/release/mf2tar
INCLUDE_PACKAGES = system/header \
system/library \
system/library/math \
system/library/c-runtime
system/library/c-runtime \
system/library/security/gss

#
# A list of paths to exclude, even if they appear in the packages listed above.
Expand Down
313 changes: 313 additions & 0 deletions env/illumos.20210501.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,313 @@
# Configuration variables for the runtime environment of the nightly
# build script and other tools for construction and packaging of
# releases.
# This example is suitable for building an illumos workspace, which
# will contain the resulting archives. It is based off the onnv
# release. It sets NIGHTLY_OPTIONS to make nightly do:
# DEBUG build only (-D, -F)
# do not bringover from the parent (-n)
# runs 'make check' (-C)
# checks for new interfaces in libraries (-A)
# sends mail on completion (-m and the MAILTO variable)
# creates packages for PIT/RE (-p)
# checks for changes in ELF runpaths (-r)
# build and use this workspace's tools in $SRC/tools (-t)
#
# - This file is sourced by "bldenv.sh" and "nightly.sh" and should not
# be executed directly.
# - This script is only interpreted by ksh93 and explicitly allows the
# use of ksh93 language extensions.
#
export NIGHTLY_OPTIONS='-nCAmprt'

# CODEMGR_WS - where is your workspace at
export CODEMGR_WS="`git rev-parse --show-toplevel`"

# Maximum number of dmake jobs. The recommended number is 2 + NCPUS,
# where NCPUS is the number of logical CPUs on your build system.
function maxjobs
{
nameref maxjobs=$1
integer ncpu
integer -r min_mem_per_job=512 # minimum amount of memory for a job

ncpu=$(builtin getconf ; getconf 'NPROCESSORS_ONLN')
(( maxjobs=ncpu + 2 ))

# Throttle number of parallel jobs launched by dmake to a value which
# gurantees that all jobs have enough memory. This was added to avoid
# excessive paging/swapping in cases of virtual machine installations
# which have lots of CPUs but not enough memory assigned to handle
# that many parallel jobs
if [[ $(/usr/sbin/prtconf 2>'/dev/null') == ~(E)Memory\ size:\ ([[:digit:]]+)\ Megabytes ]] ; then
integer max_jobs_per_memory # parallel jobs which fit into physical memory
integer physical_memory # physical memory installed

# The array ".sh.match" contains the contents of capturing
# brackets in the last regex, .sh.match[1] will contain
# the value matched by ([[:digit:]]+), i.e. the amount of
# memory installed
physical_memory="10#${.sh.match[1]}"

((
max_jobs_per_memory=round(physical_memory/min_mem_per_job) ,
maxjobs=fmax(2, fmin(maxjobs, max_jobs_per_memory))
))
fi

return 0
}

maxjobs DMAKE_MAX_JOBS # "DMAKE_MAX_JOBS" passed as ksh(1) name reference
export DMAKE_MAX_JOBS

# path to onbld tool binaries
ONBLD_BIN='/opt/onbld/bin'

# PARENT_WS is used to determine the parent of this workspace. This is
# for the options that deal with the parent workspace (such as where the
# proto area will go).
export PARENT_WS=''

# CLONE_WS is the workspace nightly should do a bringover from.
export CLONE_WS='ssh://anonhg@hg.illumos.org/illumos-gate'

# The bringover, if any, is done as STAFFER.
# Set STAFFER to your own login as gatekeeper or developer
# The point is to use group "staff" and avoid referencing the parent
# workspace as root.
# Some scripts optionally send mail messages to MAILTO.
#
export STAFFER="$LOGNAME"
export MAILTO="$STAFFER"

# If you wish the mail messages to be From: an arbitrary address, export
# MAILFROM.
#export MAILFROM="user@example.com"

# The project (see project(4)) under which to run this build. If not
# specified, the build is simply run in a new task in the current project.
export BUILD_PROJECT=''

# You should not need to change the next three lines
export ATLOG="$CODEMGR_WS/log"
export LOGFILE="$ATLOG/nightly.log"
export MACH="$(uname -p)"

#
# The following macro points to the closed binaries. Once illumos has
# totally freed itself, we can remove this reference.
#
# Location of encumbered binaries.
export ON_CLOSED_BINS="$CODEMGR_WS/closed"

# REF_PROTO_LIST - for comparing the list of stuff in your proto area
# with. Generally this should be left alone, since you want to see differences
# from your parent (the gate).
#
export REF_PROTO_LIST="$PARENT_WS/usr/src/proto_list_${MACH}"


export ROOT="$CODEMGR_WS/proto/root_${MACH}"
export SRC="$CODEMGR_WS/usr/src"
export MULTI_PROTO="no"

#
# build environment variables, including version info for mcs, motd,
# motd, uname and boot messages. Mostly you shouldn't change this except
# when the release slips (nah) or you move an environment file to a new
# release
#
export VERSION="`git describe --long --all HEAD | cut -d/ -f2-`"

#
# the RELEASE and RELEASE_DATE variables are set in Makefile.master;
# there might be special reasons to override them here, but that
# should not be the case in general
#
# export RELEASE='5.11'
# export RELEASE_DATE='October 2007'

# proto area in parent for optionally depositing a copy of headers and
# libraries corresponding to the protolibs target
# not applicable given the NIGHTLY_OPTIONS
#
export PARENT_ROOT="$PARENT_WS/proto/root_$MACH"
export PARENT_TOOLS_ROOT="$PARENT_WS/usr/src/tools/proto/root_$MACH-nd"

# Package creation variables. You probably shouldn't change these,
# either.
#
# PKGARCHIVE determines where the repository will be created.
#
# PKGPUBLISHER_REDIST controls the publisher setting for the repository.
#
export PKGARCHIVE="${CODEMGR_WS}/packages/${MACH}/nightly"
# export PKGPUBLISHER_REDIST='on-redist'

# Package manifest format version.
export PKGFMT_OUTPUT='v2'

# we want make to do as much as it can, just in case there's more than
# one problem.
export MAKEFLAGS='k'

# Magic variables to prevent the devpro compilers/teamware from checking
# for updates or sending mail back to devpro on every use.
export SUNW_NO_UPDATE_NOTIFY='1'
export UT_NO_USAGE_TRACKING='1'

# Build tools - don't change these unless you know what you're doing. These
# variables allows you to get the compilers and onbld files locally.
# Set BUILD_TOOLS to pull everything from one location.
# Alternately, you can set ONBLD_TOOLS to where you keep the contents of
# SUNWonbld and SPRO_ROOT to where you keep the compilers. SPRO_VROOT
# exists to make it easier to test new versions of the compiler.
export BUILD_TOOLS='/opt'
#export ONBLD_TOOLS='/opt/onbld'
export SPRO_ROOT='/opt/SUNWspro'
export SPRO_VROOT="$SPRO_ROOT"

# Compilers may be specified using the following variables:
# PRIMARY_CC - primary C compiler
# PRIMARY_CCC - primary C++ compiler
#
# SHADOW_CCS - list of shadow C compilers
# SHADOW_CCCS - list of shadow C++ compilers
#
# Each entry has the form <name>,<path to binary>,<style> where name is a
# free-form name (possibly used in the makefiles to guard options), path is
# the path to the executable. style is the 'style' of command line taken by
# the compiler, currently either gnu (or gcc) or sun (or cc), which is also
# used by Makefiles to guard options.
#
# __SUNC and __GNUC must still be set to reflect the style of the primary
# compiler (and to influence the default primary, otherwise)
#
# for example:
# export PRIMARY_CC=gcc4,/opt/gcc/4.4.4/bin/gcc,gnu
# export PRIMARY_CCC=gcc4,/opt/gcc/4.4.4/bin/g++,gnu
# export SHADOW_CCS=studio12,/opt/SUNWspro/bin/cc,sun
# export SHADOW_CCCS=studio12,/opt/SUNWspro/bin/CC,sun
#
# There can be several space-separated entries in SHADOW_* to run multiple
# shadow compilers.
#
# To disable shadow compilation, unset SHADOW_* or set them to the empty string.
#
export GNUC_ROOT=/usr/gcc/7
export PRIMARY_CC=gcc7,$GNUC_ROOT/bin/gcc,gnu
export PRIMARY_CCC=gcc7,$GNUC_ROOT/bin/g++,gnu

# comment to disable smatch
export ENABLE_SMATCH=0

# Comment this out to disable support for SMB printing, i.e. if you
# don't want to bother providing the CUPS headers this needs.
#export ENABLE_SMB_PRINTING=

# If your distro uses certain versions of Perl, make sure either Makefile.master
# contains your new defaults OR your .env file sets them.
# These are how you would override for building on OmniOS r151028, for example.
#export PERL_VERSION=5.28
#export PERL_ARCH=i86pc-solaris-thread-multi-64int
#export PERL_PKGVERS=

# If your distro uses certain versions of Python, make sure either
# Makefile.master contains your new defaults OR your .env file sets them.
#export PYTHON_VERSION=2.7
#export PYTHON_PKGVERS=-27
#export PYTHON_SUFFIX=
#export PYTHON3_VERSION=3.5
#export PYTHON3_PKGVERS=-35
#export PYTHON3_SUFFIX=m

# To disable building with either Python2 or Python 3 (or both), uncomment
# these lines:
#export BUILDPY2='#'
#export BUILDPY3='#'

# To disable building this workspace's tools in $SRC/tools with either Python2
# or Python3 (but not both!), uncomment either of these lines:
#export BUILDPY2TOOLS='#'
#export BUILDPY3TOOLS='#'

# Set console color scheme either by build type:
#
#export RELEASE_CONSOLE_COLOR="-DDEFAULT_ANSI_FOREGROUND=ANSI_COLOR_BLACK \
# -DDEFAULT_ANSI_BACKGROUND=ANSI_COLOR_WHITE"
#
#export DEBUG_CONSOLE_COLOR="-DDEFAULT_ANSI_FOREGROUND=ANSI_COLOR_RED \
# -DDEFAULT_ANSI_BACKGROUND=ANSI_COLOR_WHITE"
#
# or just one for any build type:
#
#export DEFAULT_CONSOLE_COLOR="-DDEFAULT_ANSI_FOREGROUND=ANSI_COLOR_BLACK \
# -DDEFAULT_ANSI_BACKGROUND=ANSI_COLOR_WHITE"

# Set if your distribution has different package versioning
#export PKGVERS_BRANCH=2018.0.0.17900

# Skip Java 11 builds on distributions that don't support it
#export BLD_JAVA_11=

# POST_NIGHTLY can be any command to be run at the end of nightly. See
# nightly(1) for interactions between environment variables and this command.
#POST_NIGHTLY=

# Populates /etc/versions/build on each nightly run
export BUILDVERSION_EXEC="git describe --all --long --dirty"

# -----------------------------------------------------------------------------
# You are less likely to need to modify parameters below.
# -----------------------------------------------------------------------------

# 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'

if [[ "$ENABLE_SMATCH" = "1" ]]; then
SMATCHBIN=$CODEMGR_WS/usr/src/tools/proto/root_$MACH-nd/opt/onbld/bin/$MACH/smatch
export SHADOW_CCS="$SHADOW_CCS smatch,$SMATCHBIN,smatch"
fi

######################################################################
# OmniOS-specific overrides

# Enable the non-DEBUG build
NIGHTLY_OPTIONS=${NIGHTLY_OPTIONS/F/}

export PERL_VERSION=5.32
export PERL_PKGVERS=
export PERL_VARIANT=-thread-multi
export BUILDPERL32='#'

export JAVA_ROOT=/usr/jdk/openjdk11.0
export JAVA_HOME=$JAVA_ROOT
export BLD_JAVA_11=

export BUILDPY2='#'
export BUILDPY3='#'
export BUILDPY2TOOLS=
export BUILDPY3TOOLS=
export PYTHON3_VERSION=3.9
export PYTHON3_PKGVERS=-39
export PYTHON3_SUFFIX=
export TOOLS_PYTHON=/usr/bin/python$PYTHON3_VERSION


# On OmniOS, gcc resides in /opt/gcc-<version> - adjust variables
export GNUC_ROOT=/opt/gcc-7/
for name in PRIMARY_CC PRIMARY_CCC SHADOW_CCS SHADOW_CCCS; do
typeset -n var=$name
var="`echo $var | sed '
s^/usr/gcc^/opt/gcc^
s^/opt/gcc/^/opt/gcc-^
'`"
done

# export ON_CLOSED_BINS=/opt/onbld/closed
# ENABLE_SMB_PRINTING='#'

# export ONNV_BUILDNUM=`grep '^VERSION=r' /etc/os-release | cut -c10-15`
# export PKGVERS_BRANCH=$ONNV_BUILDNUM.0