Browse Source

CI: removed px4 builds

mission-4.1.18
Andrew Tridgell 6 years ago
parent
commit
9596358f3c
  1. 4
      .travis.yml
  2. 9
      BUILD.md
  3. 21
      Tools/autotest/autotest.py
  4. 23
      Tools/scripts/build_all_px4.sh
  5. 82
      Tools/scripts/build_binaries.py
  6. 23
      Tools/scripts/build_ci.sh
  7. 93
      Tools/scripts/build_devrelease.sh
  8. 2
      Tools/scripts/build_examples.py
  9. 2
      Tools/vagrant/shellinit.sh
  10. 1
      Vagrantfile

4
.travis.yml

@ -58,9 +58,9 @@ matrix: @@ -58,9 +58,9 @@ matrix:
include:
- if: type != cron
compiler: "gcc"
env: CI_BUILD_TARGET="px4-v2 revo-bootloader iofirmware"
env: CI_BUILD_TARGET="revo-bootloader iofirmware"
- compiler: "gcc"
env: CI_BUILD_TARGET="px4-v4 revo-mini"
env: CI_BUILD_TARGET="revo-mini"
- if: type != cron
compiler: "gcc"
env: CI_BUILD_TARGET="sitltest-copter"

9
BUILD.md

@ -20,7 +20,7 @@ list some basic and more used commands as example. @@ -20,7 +20,7 @@ list some basic and more used commands as example.
supported and the next section shows how to get a full list of them.
```sh
./waf configure --board fmuv3
./waf configure --board CubeBlack
./waf copter
```
@ -62,10 +62,9 @@ list some basic and more used commands as example. @@ -62,10 +62,9 @@ list some basic and more used commands as example.
./waf configure --board fmuv3 # Pixhawk2/Cube using ChibiOS
./waf configure --board fmuv4 # Pixracer using ChibiOS
./waf configure --board navio2 # emlid navio2
./waf configure --board px4-v1 # the very old two layer Pixhawk (almost none exist)
./waf configure --board px4-v2 # older Pixhawks that suffer from the 1MB flash limit issue
./waf configure --board px4-v3 # Pixhawk2/Cube and newer Pixhawks with no 1MB flash limit issue
./waf configure --board px4-v4 # Pixracer
./waf configure --board Pixhawk1 # Pixhawk1
./waf configure --board CubeBlack # Pixhawk2
./waf configure --board Pixracer # Pixracer
./waf configure --board skyviper-v2450 # SkyRocket's SkyViper GPS drone using ChibiOS
./waf configure --board sitl # software-in-the-loop simulator
./waf configure --board sitl --debug # software-in-the-loop simulator with debug symbols

21
Tools/autotest/autotest.py

@ -116,24 +116,9 @@ def build_binaries(): @@ -116,24 +116,9 @@ def build_binaries():
return True
def build_devrelease():
"""Run the build_devrelease.sh script."""
print("Running build_devrelease.sh")
# copy the script as it changes git branch, which can change the
# script while running
orig = util.reltopdir('Tools/scripts/build_devrelease.sh')
copy = util.reltopdir('./build_devrelease.sh')
shutil.copy2(orig, copy)
if util.run_cmd(copy, directory=util.reltopdir('.')) != 0:
print("Failed build_devrelease.sh")
return False
return True
def build_examples():
"""Build examples."""
for target in 'fmuv2', 'px4-v2', 'navio', 'linux':
for target in 'fmuv2', 'Pixhawk1', 'navio', 'linux':
print("Running build.examples for %s" % target)
try:
util.build_examples(target)
@ -434,9 +419,6 @@ def run_step(step): @@ -434,9 +419,6 @@ def run_step(step):
if step == 'build.Binaries':
return build_binaries()
if step == 'build.DevRelease':
return build_devrelease()
if step == 'build.examples':
return build_examples()
@ -722,7 +704,6 @@ if __name__ == "__main__": @@ -722,7 +704,6 @@ if __name__ == "__main__":
'prerequisites',
'build.All',
'build.Binaries',
# 'build.DevRelease',
'build.Parameters',
'build.unit_tests',

23
Tools/scripts/build_all_px4.sh

@ -1,23 +0,0 @@ @@ -1,23 +0,0 @@
#!/bin/bash
# build all targets for PX4
# This helps when doing large merges
# Andrew Tridgell, February 2013
. config.mk
set -e
set -x
git submodule init
git submodule update --recursive
builds="px4-v1 px4-v2 px4-v3 px4-v4 px4-v4pro"
for b in $builds; do
echo "Testing $b build"
./waf clean
./waf configure --board $b
./waf
done
exit 0

82
Tools/scripts/build_binaries.py

@ -385,7 +385,7 @@ is bob we will attempt to checkout bob-AVR''' @@ -385,7 +385,7 @@ is bob we will attempt to checkout bob-AVR'''
"bin",
"".join([binaryname, framesuffix]))
files_to_copy = []
for extension in [".px4", ".apj", ".abin", "_with_bl.hex", ".hex"]:
for extension in [".apj", ".abin", "_with_bl.hex", ".hex"]:
filepath = "".join([bare_path, extension])
if os.path.exists(filepath):
files_to_copy.append(filepath)
@ -402,86 +402,6 @@ is bob we will attempt to checkout bob-AVR''' @@ -402,86 +402,6 @@ is bob we will attempt to checkout bob-AVR'''
self.touch_filepath(os.path.join(self.binaries,
vehicle_binaries_subdir, tag))
# PX4-building
board = "px4"
for frame in frames:
self.progress("Building frame %s for board %s" % (frame, board))
if frame is None:
framesuffix = ""
else:
framesuffix = "-%s" % frame
if not self.checkout(vehicle, tag, "PX4", frame):
msg = ("Failed checkout of %s %s %s %s" %
(vehicle, "PX4", tag, frame))
self.progress(msg)
self.error_strings.append(msg)
self.checkout(vehicle, "latest")
continue
try:
deadwood = "../Build.%s" % vehicle
if os.path.exists(deadwood):
self.progress("#### Removing (%s)" % deadwood)
shutil.rmtree(os.path.join(deadwood))
except Exception as e:
self.progress("FIXME: narrow exception (%s)" % repr(e))
self.progress("Building %s %s PX4%s binaries" %
(vehicle, tag, framesuffix))
ddir = os.path.join(self.binaries,
vehicle_binaries_subdir,
self.hdate_ym,
self.hdate_ymdhm,
"".join(["PX4", framesuffix]))
if self.skip_build(tag, ddir):
continue
for v in ["v1", "v2", "v3", "v4", "v4pro"]:
px4_v = "%s-%s" % (board, v)
if self.skip_board_waf(px4_v):
continue
if os.path.exists(self.buildroot):
shutil.rmtree(self.buildroot)
self.progress("Configuring for %s in %s" %
(px4_v, self.buildroot))
try:
self.run_waf(["configure", "--board", px4_v,
"--out", self.buildroot, "clean"])
except subprocess.CalledProcessError as e:
self.progress("waf configure failed")
continue
try:
self.run_waf([
"build",
"--targets",
os.path.join("bin",
"".join([binaryname, framesuffix]))])
except subprocess.CalledProcessError as e:
msg = ("Failed build of %s %s%s %s for %s" %
(vehicle, board, framesuffix, tag, v))
self.progress(msg)
self.error_strings.append(msg)
continue
oldfile = os.path.join(self.buildroot, px4_v, "bin",
"%s%s.px4" % (binaryname, framesuffix))
newfile = "%s-%s.px4" % (px4_binaryname, v)
self.progress("Copying (%s) to (%s)" % (oldfile, newfile,))
try:
shutil.copyfile(oldfile, newfile)
except Exception as e:
self.progress("FIXME: narrow exception (%s)" % repr(e))
msg = ("Failed build copy of %s PX4%s %s for %s" %
(vehicle, framesuffix, tag, v))
self.progress(msg)
self.error_strings.append(msg)
continue
# FIXME: why the two stage copy?!
self.copyit(newfile, ddir, tag, vehicle)
self.checkout(vehicle, "latest")
def common_boards(self):

23
Tools/scripts/build_ci.sh

@ -16,14 +16,13 @@ export BUILDROOT=/tmp/ci.build @@ -16,14 +16,13 @@ export BUILDROOT=/tmp/ci.build
rm -rf $BUILDROOT
export GIT_VERSION="ci_test"
export NUTTX_GIT_VERSION="ci_test"
export PX4_GIT_VERSION="ci_test"
export CHIBIOS_GIT_VERSION="ci_test"
export CCACHE_SLOPPINESS="include_file_ctime,include_file_mtime"
autotest_args=""
# If CI_BUILD_TARGET is not set, build 3 different ones
if [ -z "$CI_BUILD_TARGET" ]; then
CI_BUILD_TARGET="sitl linux px4-v2"
CI_BUILD_TARGET="sitl linux"
fi
declare -A waf_supported_boards
@ -116,26 +115,6 @@ for t in $CI_BUILD_TARGET; do @@ -116,26 +115,6 @@ for t in $CI_BUILD_TARGET; do
continue
fi
# only do make-based builds for GCC, when target is PX4-v3 or build is launched by a scheduled job and target is a PX4 board or SITL
if [[ "$cxx_compiler" != "clang++" && ($t == "px4-v3" || (-n ${CI_CRON_JOB+1} && ($t == "px4"* || $t == "sitl"))) ]]; then
echo "Starting make based build for target ${t}..."
for v in "ArduPlane" "ArduCopter" "APMrover2" "ArduSub" "AntennaTracker"; do
echo "Building $v for ${t}..."
pushd $v
make clean
if [[ $t == "px4"* ]]; then
make px4-cleandep
fi
start_time=$(get_time)
make "$t" -j$(nproc)
diff_time=$(($(get_time)-$start_time))
echo -e "\033[32m'make' finished successfully (${diff_time}s)\033[0m"
popd
done
fi
if [[ -n ${waf_supported_boards[$t]} && -z ${CI_CRON_JOB+1} ]]; then
echo "Starting waf build for board ${t}..."
$waf configure --board "$t" \

93
Tools/scripts/build_devrelease.sh

@ -1,93 +0,0 @@ @@ -1,93 +0,0 @@
#!/bin/bash
# script to build developer releases.
# Andrew Tridgell, October 2014
set -e
set -x
export PATH=$PATH:/bin:/usr/bin
DEVBUILD="$PWD/../buildlogs/binaries/devbuild"
error_count=0
# build one developer release
build_devrelease() {
GITURL="$1"
BRANCH="$2"
BUILD_TARGET="$3"
BUILD_DIR="$4"
RELEASE_DIR="$5"
RELEASE_FILE="$6"
shift 6
export TMPDIR=$PWD/build.tmp.$$
echo $TMDIR
rm -rf $TMPDIR
echo "Building $RELEASE_DIR in $TMPDIR"
LOCAL_BRANCH="branch_$RELEASE_DIR"
REMOTE_NAME="remote_$RELEASE_DIR"
date
git checkout "$LOCAL_BRANCH" || {
git remote add "$REMOTE_NAME" "$GITURL" || return 1
git fetch "$REMOTE_NAME" || return 1
git checkout -b "$LOCAL_BRANCH" "$REMOTE_NAME/$BRANCH" -t || return 1
}
git fetch "$REMOTE_NAME" || return 1
git reset --hard "$REMOTE_NAME/$BRANCH" || return 1
echo "Checkout master for PX4Firmware"
(cd ../PX4Firmware && git checkout master) || return 1
echo "Checkout master for PX4NuttX"
(cd ../PX4NuttX && git checkout master) || return 1
mkdir -p "$DEVBUILD/$RELEASE_DIR" || return 1
pushd "$BUILD_DIR" || return 1
for frame in $*; do
if [ -z $frame ]; then
SUBDIR="$DEVBUILD/$RELEASE_DIR"
make_target="$BUILD_TARGET"
else
SUBDIR="$DEVBUILD/$RELEASE_DIR/$frame"
make_target="$BUILD_TARGET-$frame"
fi
# check if we should skip this build because we have already
# built this version
oldversion=$(cat "$SUBDIR/git-version.txt" | head -1)
newversion=$(git log -1 | head -1)
[ "$oldversion" = "$newversion" ] && {
echo "Skipping build of $frame - version match $newversion"
continue
}
mkdir -p $SUBDIR || return 1
make px4-clean || return 1
make clean || return 1
make "$make_target" || return 1
/bin/cp "$RELEASE_FILE" "$SUBDIR" || return 1
git log -1 > "$SUBDIR/git-version.txt" || return 1
[ -f APM_Config.h ] && {
shopt -s nullglob
version=$(grep 'define.THISFIRMWARE' version.h 2> /dev/null | cut -d'"' -f2)
echo >> "$SUBDIR/git-version.txt"
echo "APMVERSION: $version" >> "$SUBDIR/git-version.txt"
}
done
git checkout master || return 1
popd
rm -rf $TMPDIR
}
# list all developer releases here
COPTER_FRAMES="quad tri hexa y6 octa octa-quad heli"
build_devrelease git://github.com/jschall/ardupilot devbuild-jon-copter px4-v2 ArduCopter devbuild-jon-copter ArduCopter-v2.px4 $COPTER_FRAMES || error_count=$((error_count+1))
git checkout master || error_count=$((error_count+1))
exit $error_count

2
Tools/scripts/build_examples.py

@ -26,7 +26,7 @@ class BuildExamples(): @@ -26,7 +26,7 @@ class BuildExamples():
if __name__ == '__main__':
parser = optparse.OptionParser("build_examples.py")
parser.add_option("--target", type='string', default=['navio','px4-v2'], help='list of targets for which to build examples', action='append')
parser.add_option("--target", type='string', default=['navio','Pixhawk1'], help='list of targets for which to build examples', action='append')
parser.add_option("--clean", action='store_true', default=False, help='clean build')
opts, args = parser.parse_args()

2
Tools/vagrant/shellinit.sh

@ -15,5 +15,5 @@ cd $APMROOT/ArduCopter @@ -15,5 +15,5 @@ cd $APMROOT/ArduCopter
echo "Ardupilot environment ready. Run 'sim_vehicle.py' to start simulating an arducopter instance."
echo "To build for fmuv2:"
echo " cd /vagrant"
echo " ./waf configure --board=px4-v2"
echo " ./waf configure --board=Pixhawk1"
echo " ./waf build --target=bin/arducopter"

1
Vagrantfile vendored

@ -6,7 +6,6 @@ @@ -6,7 +6,6 @@
# xterm # X11 forwarding should work
# sim_vehicle.py --debug --gdb
# sim_vehicle.py --valgrind
# time (cd /vagrant && ./waf configure --board=px4-v2 && ./waf build --target=bin/ardusub) # ~17 minutes
# time (cd /vagrant && ./waf configure --board=fmuv2 && ./waf build --target=bin/ardusub) # ~9 minutes
# time (cd /vagrant && ./waf configure --board=fmuv3 && ./waf build --target=bin/ardusub) # ~ minutes (after building fmuv2)
# time (cd /vagrant && ./waf configure --board=navio2 && ./waf build --target=bin/arduplane)

Loading…
Cancel
Save