Skip to content

Commit

Permalink
i#3002: Build ARM, AArch64, and Android cronbuild packages
Browse files Browse the repository at this point in the history
Adds jobs to the Travis cronbuild matrix to build ARM, AArch64, and
Android packages.  Adds toolchain setting based on the existing env
var and parameter scheme into package.cmake to match runsuite.cmake.
Adds logic to exclude the Dr. Memory build for AArch64.  Adds ignoring
of a "git tag" failure to handle races among the four jobs.

Issue: #2861
Fixes #3002
  • Loading branch information
derekbruening committed Feb 9, 2020
1 parent 47ea6ac commit 12c23e7
Show file tree
Hide file tree
Showing 4 changed files with 71 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ deploy:
force_update: true
# Using the default "release:" name (the tag) to match Travis.
# This description replaces the one provided by Travis.
description: 'Auto-generated periodic build (Appveyor build $(appveyor_build_version)). Unlike official release builds, Dr. Memory is not included in this build, and for Linux, i686 is separated from x86_64 rather than being combined in one package.'
description: 'Auto-generated periodic build.'
on:
branch: master
appveyor_repo_tag: true
29 changes: 26 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ language:
# with excludes so we can use conditional builds (plus it's clearer this way).
jobs:
include:
#######################################################################
# Regular test jobs:

# 32-bit Linux build with gcc and run tests:
- if: env(TRAVIS_EVENT_TYPE) != cron
os: linux
Expand Down Expand Up @@ -111,12 +114,29 @@ jobs:
compiler: clang
# We do not have 64-bit support on OSX yet (i#1979).
env: DYNAMORIO_CROSS_AARCHXX_LINUX_ONLY=no DEPLOY=no EXTRA_ARGS=32_only
# Package builds.

#######################################################################
# Package jobs
# Linux x86 + amd64:
- if: env(TRAVIS_EVENT_TYPE) = cron
os: linux
compiler: gcc
env: DYNAMORIO_CROSS_AARCHXX_LINUX_ONLY=no DEPLOY=yes
# TODO i#3002: Build packages for AArchXX.
# Linux AArch64:
- if: env(TRAVIS_EVENT_TYPE) = cron
os: linux
compiler: gcc
env: DYNAMORIO_CROSS_AARCHXX_LINUX_ONLY=yes DEPLOY=yes EXTRA_ARGS=64_only
# Linux ARM:
- if: env(TRAVIS_EVENT_TYPE) = cron
os: linux
compiler: gcc
env: DYNAMORIO_CROSS_AARCHXX_LINUX_ONLY=yes DEPLOY=yes EXTRA_ARGS=32_only
# Android ARM:
- if: env(TRAVIS_EVENT_TYPE) = cron
os: linux
compiler: gcc
env: DYNAMORIO_CROSS_ANDROID_ONLY=yes DYNAMORIO_ANDROID_TOOLCHAIN='/tmp/android-gcc-arm-ndk-10e' DEPLOY=no EXTRA_ARGS=32_only

# For C/C++ there is no default install, so we set "install", not "before_install".
install:
Expand Down Expand Up @@ -176,7 +196,10 @@ before_deploy:
# We support setting TAG_SUFFIX on triggered builds so we can have
# multiple unique tags in one day (the patchlevel here is the day number).
- export GIT_TAG="cronbuild-7.91.$((`git log -n 1 --format=%ct` / (60*60*24)))${TAG_SUFFIX}"
- git tag $GIT_TAG -a -m "Travis auto-generated tag for build $TRAVIS_BUILD_NUMBER."
# We handle races among our 4 package jobs by ignoring failure here.
# XXX: That could mask a real failure: we could try to distinguish the
# type of error.
- git tag $GIT_TAG -a -m "Travis auto-generated tag for build $TRAVIS_BUILD_NUMBER." || echo "Race to create tag: must already exist"
deploy:
provider: releases
api_key:
Expand Down
29 changes: 28 additions & 1 deletion make/package.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# **********************************************************
# Copyright (c) 2011-2017 Google, Inc. All rights reserved.
# Copyright (c) 2011-2020 Google, Inc. All rights reserved.
# Copyright (c) 2009-2010 VMware, Inc. All rights reserved.
# **********************************************************

Expand Down Expand Up @@ -58,6 +58,8 @@ set(arg_invoke "") # sub-project package.cmake to invoke
set(arg_preload "") # cmake file to include prior to each 32-bit build
set(arg_preload64 "") # cmake file to include prior to each 64-bit build
set(arg_cpackappend "")# string to append to CPackConfig.cmake before packaging
set(cross_aarchxx_linux_only OFF)
set(cross_android_only OFF)

foreach (arg ${CTEST_SCRIPT_ARG})
if (${arg} MATCHES "^build=")
Expand Down Expand Up @@ -91,6 +93,31 @@ foreach (arg ${CTEST_SCRIPT_ARG})
endif ()
endforeach (arg)

# These are set by env var instead of arg to match Travis test jobs.
if ($ENV{DYNAMORIO_CROSS_AARCHXX_LINUX_ONLY} MATCHES "yes")
set(cross_aarchxx_linux_only ON)
if (arg_no32)
set(arg_cacheappend "${arg_cacheappend}
CMAKE_TOOLCHAIN_FILE:PATH=${CTEST_SOURCE_DIRECTORY}/make/toolchain-arm64.cmake")
elsif (arg_no64)
set(arg_cacheappend "${arg_cacheappend}
CMAKE_TOOLCHAIN_FILE:PATH=${CTEST_SOURCE_DIRECTORY}/make/toolchain-arm32.cmake")
else ()
message("Fatal error: package.cmake supports just one package at a time and 32-bit "
"and 64-bit AArch cannot be combined")
endif ()
endif()
if ($ENV{DYNAMORIO_CROSS_ANDROID_ONLY} MATCHES "yes")
set(cross_android_only ON)
if (arg_no32)
set(arg_cacheappend "${arg_cacheappend}
CMAKE_TOOLCHAIN_FILE:PATH=${CTEST_SOURCE_DIRECTORY}/make/toolchain-android.cmake
ANDROID_TOOLCHAIN:PATH=$ENV{DYNAMORIO_ANDROID_TOOLCHAIN}")
else ()
message("Fatal error: Android is only supported as 32_only")
endif ()
endif()

if ("${arg_build}" STREQUAL "")
message(FATAL_ERROR "build number not set: pass as build= arg")
endif()
Expand Down
17 changes: 16 additions & 1 deletion suite/runsuite_wrapper.pl
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@
# a Travis matrix of builds.
# Travis only supports Linux and Mac, so we're ok relying on perl.

# XXX: We currently have a patchwork of scripts and methods of passing arguments
# (some are env vars while others are command-line parameters) and thus have
# too many control points for the details of test builds and package builds.
# Maybe we can clean it up and eliminate this layer of script by moving logic
# in both directions (.{travis,appveyor}.yml and {runsuite,package}.cmake)?

use strict;
use Config;
use Cwd 'abs_path';
Expand Down Expand Up @@ -83,8 +89,17 @@
} elsif ($ENV{'TRAVIS_EVENT_TYPE'} eq 'cron' ||
$ENV{'APPVEYOR_REPO_TAG'} eq 'true') {
# A package build.
my $def_args = "build=1;invoke=${osdir}/../drmemory/package.cmake;drmem_only";
$args =~ s/^,/;/;
# XXX: Should we get rid of the build #? It was useful for manual build
# release candidates but makes less sense for automated builds.
my $def_args = "build=1";
# Include Dr. Memory.
if (($is_aarchxx || $ENV{'DYNAMORIO_CROSS_AARCHXX_LINUX_ONLY'} eq 'yes') &&
$args =~ /64_only/) {
# Dr. Memory is not ported to AArch64 yet.
} else {
$def_args = "${def_args};invoke=${osdir}/../drmemory/package.cmake;drmem_only";
}
system("ctest -VV -S \"${osdir}/../make/package.cmake,${def_args}${args}\" 2>&1");
exit 0;
} else {
Expand Down

0 comments on commit 12c23e7

Please sign in to comment.