From e9e01af18712ab524f711455811d1cc588d0cbd5 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Fri, 14 Sep 2018 16:34:03 +0100 Subject: [PATCH 1/5] Kill any left overs from previous builds before proceeding --- compile/eclipsebuild/eclipseds5build.gsh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/compile/eclipsebuild/eclipseds5build.gsh b/compile/eclipsebuild/eclipseds5build.gsh index dfefd02..1c213d5 100644 --- a/compile/eclipsebuild/eclipseds5build.gsh +++ b/compile/eclipsebuild/eclipseds5build.gsh @@ -1,4 +1,19 @@ +def doKillLeftovers() { + if (isUnix()) { + sh """ + # Killing any processes that may interfere with the next build + # The build system must be setup to do more than one eclipse build concurrently + ps aux | grep "eclipsews" + ps aux | grep "make" + ps aux | grep "arm-linux" + pkill -9 eclipsews + pkill -9 make + pkill -9 "*arm-linux*" + """ + } +} + def doExport(exportfolder, exportpathlist, project = "", build_variant = "") { def result = 0 for (exportpath in exportpathlist) { @@ -60,6 +75,7 @@ def doBuild(apps, exportfolder = "${WORKSPACE}/bin") { echo "Build command: ${DS5SHELL} \'${BUILD_COMMAND} ${buildtype} \"${project}/${build_variant}\"\'" if (isUnix()) { sh """ + doKillLeftovers() echo Start time: `date` ${DS5SHELL} \'${BUILD_COMMAND} ${buildtype} \"${project}/${build_variant}\"\' echo End time: `date` From aa25d4d5614f56e3b2055aee3d1ddaf2c18ebe5c Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Fri, 14 Sep 2018 16:44:21 +0100 Subject: [PATCH 2/5] Kill any left overs from previous builds before proceeding --- compile/eclipsebuild/eclipseds5build.gsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compile/eclipsebuild/eclipseds5build.gsh b/compile/eclipsebuild/eclipseds5build.gsh index 1c213d5..68bb64a 100644 --- a/compile/eclipsebuild/eclipseds5build.gsh +++ b/compile/eclipsebuild/eclipseds5build.gsh @@ -73,9 +73,9 @@ def doBuild(apps, exportfolder = "${WORKSPACE}/bin") { for (build_variant in variants) { retry(maxprojectbuildretries) { // Eclipse occasionally raises exceptions (rather than the builds failing) echo "Build command: ${DS5SHELL} \'${BUILD_COMMAND} ${buildtype} \"${project}/${build_variant}\"\'" + doKillLeftovers() if (isUnix()) { sh """ - doKillLeftovers() echo Start time: `date` ${DS5SHELL} \'${BUILD_COMMAND} ${buildtype} \"${project}/${build_variant}\"\' echo End time: `date` From 0bb2733aae93427abbdc8c05027ad7592b67fbbd Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Fri, 14 Sep 2018 17:10:57 +0100 Subject: [PATCH 3/5] Kill any left overs from previous builds before proceeding --- compile/eclipsebuild/eclipseds5build.gsh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/compile/eclipsebuild/eclipseds5build.gsh b/compile/eclipsebuild/eclipseds5build.gsh index 68bb64a..6cc4c31 100644 --- a/compile/eclipsebuild/eclipseds5build.gsh +++ b/compile/eclipsebuild/eclipseds5build.gsh @@ -7,9 +7,10 @@ def doKillLeftovers() { ps aux | grep "eclipsews" ps aux | grep "make" ps aux | grep "arm-linux" - pkill -9 eclipsews - pkill -9 make - pkill -9 "*arm-linux*" + # Don't return an error if the processes don't exist + pkill -9 eclipsews || true + pkill -9 make || true + pkill -9 "*arm-linux*" || true """ } } From 22605b6677af1c8bb227222d0ffd19905b9e7bcc Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Fri, 14 Sep 2018 17:16:19 +0100 Subject: [PATCH 4/5] Kill any left overs from previous builds before proceeding --- compile/eclipsebuild/eclipseds5build.gsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compile/eclipsebuild/eclipseds5build.gsh b/compile/eclipsebuild/eclipseds5build.gsh index 6cc4c31..c7804fa 100644 --- a/compile/eclipsebuild/eclipseds5build.gsh +++ b/compile/eclipsebuild/eclipseds5build.gsh @@ -10,7 +10,7 @@ def doKillLeftovers() { # Don't return an error if the processes don't exist pkill -9 eclipsews || true pkill -9 make || true - pkill -9 "*arm-linux*" || true + pkill -9 ".*arm-linux.*" || true """ } } From 5d45c483cc479f331d6edf16e52d7f01dba425e9 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Fri, 14 Sep 2018 19:31:17 +0100 Subject: [PATCH 5/5] Register toolchain multiple times --- compile/eclipsebuild/eclipseds5build.gsh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/compile/eclipsebuild/eclipseds5build.gsh b/compile/eclipsebuild/eclipseds5build.gsh index c7804fa..2be3d95 100644 --- a/compile/eclipsebuild/eclipseds5build.gsh +++ b/compile/eclipsebuild/eclipseds5build.gsh @@ -77,6 +77,8 @@ def doBuild(apps, exportfolder = "${WORKSPACE}/bin") { doKillLeftovers() if (isUnix()) { sh """ + # Register toolchain (if it is not already) + "${DS5_FOLDER}/bin/add_toolchain" --non-interactive "${TOOLCHAIN_FOLDER}" echo Start time: `date` ${DS5SHELL} \'${BUILD_COMMAND} ${buildtype} \"${project}/${build_variant}\"\' echo End time: `date`