Skip to content

Commit

Permalink
Introduce check phase in release.py
Browse files Browse the repository at this point in the history
  • Loading branch information
mzhaom committed Jun 15, 2017
1 parent 47c7124 commit 7832164
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 6 deletions.
36 changes: 36 additions & 0 deletions check.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/bin/bash

# Check the LRTE runtime and Crosstool can be used.

absname=`readlink -f "$0"`
absroot="${absname%/*}"

. "${absroot}/grte/grte.cfg"

GRTEROOT="${1}/v${GRTEVERSION}"
tb=`readlink -f "${2}"`
GRTEBASENAME="${GRTE_PACKAGE_PREFIX}$(basename $1)v${GRTEVERSION}"
STAGING="${tb}/staging"
RESULTS="${tb}/results"
DEB_DIR=${RESULTS}/debs

# Install the packages for GRTE
for pkg in runtime headers; do
dpkg -i ${DEB_DIR}/${GRTEBASENAME}-${pkg}_${grte_rpmver}-${grte_rpmrel}_amd64.deb
done

dpkg -i ${DEB_DIR}/${GRTEBASENAME}-crosstoolv2-*_amd64.deb

export CROSSTOOL_TOP=/usr/crosstool/v2/gcc-${gcc_version}-${GRTEBASENAME}/x86/bin/
# Put llvm-symbolizer to the path
export PATH=${CROSSTOOL_TOP}:$PATH

# Check normal build
${CROSSTOOL_TOP}/clang++ hello.cc -o /tmp/hello
/tmp/hello

# Check address sanitizer build
${CROSSTOOL_TOP}/clang++ -fsanitize=address hello.cc -o /tmp/hello
/tmp/hello


24 changes: 18 additions & 6 deletions release.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,6 @@ def main():
help='Directory to store the output')
parser.add_argument('--debug', action='store_true',
help='Start the docker container using bash')
parser.add_argument('--no_build_lrte', action='store_true',
help='Skip building the whole lrte')
parser.add_argument('--lrte_prefix', default='/usr/lrte',
help='Directory prefix where lrte gets installed')
parser.add_argument('--lrte_package_prefix', default='',
Expand All @@ -110,8 +108,8 @@ def main():
help='Steps to skip when building LRTE(which could be step1, step2, final)')
parser.add_argument('--upstream_source', default=os.path.join(os.path.dirname(__file__), 'upstream'),
help='Directory that stores original downloaded packages, like glibc code')
parser.add_argument('--no_build_crosstool', action='store_true',
help='Skip building crosstool')
parser.add_argument('--actions', choices=['lrte', 'crosstool', 'check'], nargs='+',
help='Select the actions to perform')
parser.add_argument('--crosstool_skip', choices=['gcc'], action='append',
help='Steps to skip when building crosstool')

Expand Down Expand Up @@ -152,7 +150,8 @@ def main():

lrte_output = os.path.join(args.output, 'lrte')
lrte_output_in_docker = os.path.join(output_dir, 'lrte')
if not args.no_build_lrte:

if 'lrte' in args.actions:
start_container(args.docker_image,
['./build_grte.sh', args.lrte_prefix, lrte_output_in_docker],
workdir = topdir,
Expand All @@ -164,7 +163,7 @@ def main():
print('deb packages: %s' % (os.path.join(lrte_output, 'results/debs')))
print('rpm packages: %s' % (os.path.join(lrte_output, 'results/rpms')))

if not args.no_build_crosstool:
if 'crosstool' in args.actions:
if not os.path.isdir(os.path.join(lrte_output, 'results/debs')):
raise Exception(os.path.join(lrte_output, 'results/debs') + ' does not exit, please build LRTE packages first')
env['GCC_SVN_VERSION'] = get_svn_revision(
Expand All @@ -187,6 +186,19 @@ def main():
mounts = mounts,
environment = env)

if 'check' in args.actions:
if not os.path.isdir(os.path.join(lrte_output, 'results/debs')):
raise Exception(os.path.join(lrte_output, 'results/debs') + ' does not exit, please build LRTE packages first')
start_container(args.docker_image,
['./check.sh', args.lrte_prefix,
lrte_output_in_docker],
workdir = topdir,
attach_stdin = True,
attach_stdout = True,
attach_stderr = True,
mounts = mounts,
environment = env)



if __name__ == '__main__':
Expand Down

0 comments on commit 7832164

Please sign in to comment.