[PATCH 0/2] Travis: Optimize and improve

1 view
Skip to first unread message

claudius....@siemens.com

unread,
Oct 4, 2017, 4:44:02 AM10/4/17
to efibootg...@googlegroups.com, Claudius Heine
From: Claudius Heine <c...@denx.de>

Hi,

here are some patches that further improve the travis build.

Cheers,
Claudius

Claudius Heine (2):
travis: added log output in case of wrong choosen target
travis: moved dependency installation into script

.travis-build.sh | 37 +++++++++++++++++++++++++++++++++++--
.travis.yml | 6 ------
2 files changed, 35 insertions(+), 8 deletions(-)

--
2.14.1

claudius....@siemens.com

unread,
Oct 4, 2017, 4:44:03 AM10/4/17
to efibootg...@googlegroups.com, Claudius Heine
From: Claudius Heine <c...@denx.de>

Signed-off-by: Claudius Heine <c...@denx.de>
---
.travis-build.sh | 2 ++
1 file changed, 2 insertions(+)

diff --git a/.travis-build.sh b/.travis-build.sh
index fb26660..76629a8 100755
--- a/.travis-build.sh
+++ b/.travis-build.sh
@@ -117,6 +117,8 @@ case "$TARGET_EFFECTIVE" in
exit 0
;;
*)
+ echo "No or not existing targen choosen." \
+ "($TARGET, $TARGET_EFFECTIVE)" >&2
exit -1
;;
esac
--
2.14.1

claudius....@siemens.com

unread,
Oct 4, 2017, 4:44:03 AM10/4/17
to efibootg...@googlegroups.com, Claudius Heine
From: Claudius Heine <c...@denx.de>

This way it can be handled more flexibly and the build time should be
shorter.

Signed-off-by: Claudius Heine <c...@denx.de>
---
.travis-build.sh | 35 +++++++++++++++++++++++++++++++++--
.travis.yml | 6 ------
2 files changed, 33 insertions(+), 8 deletions(-)

diff --git a/.travis-build.sh b/.travis-build.sh
index 76629a8..2e00edc 100755
--- a/.travis-build.sh
+++ b/.travis-build.sh
@@ -18,6 +18,31 @@ else
TARGET_EFFECTIVE="${PARAM:-"${TARGET}"}"
fi

+install_common_deps()
+{
+ sudo apt-get install gcc-multilib gnu-efi libpci-dev
+}
+
+install_native_deps()
+{
+ sudo apt-add-repository \
+ 'deb http://archive.ubuntu.com/ubuntu xenial universe'
+ sudo apt-get update -qq
+ sudo apt-get install --no-install-recommends \
+ --target-release xenial libcmocka-dev
+}
+
+install_i586_deps()
+{
+ sudo apt-get install --no-install-recommends \
+ libz-dev:i386
+ sudo apt-add-repository \
+ 'deb http://archive.ubuntu.com/ubuntu xenial universe'
+ sudo apt-get update -qq
+ sudo apt-get install --no-install-recommends \
+ --target-release xenial libcmocka-dev:i386
+}
+
prepare_build()
{
autoreconf -fi
@@ -48,6 +73,8 @@ install_cppcheck()

case "$TARGET_EFFECTIVE" in
native)
+ install_common_deps
+ install_native_deps
prepare_build
enter_build
../configure
@@ -55,8 +82,8 @@ case "$TARGET_EFFECTIVE" in
;;

i586)
- sudo apt-get install --no-install-recommends \
- --target-release xenial libcmocka-dev:i386
+ install_common_deps
+ install_i586_deps
prepare_build
enter_build
../configure --with-gnuefi-lib-dir=/usr/lib32 CFLAGS=-m32 \
@@ -65,6 +92,8 @@ case "$TARGET_EFFECTIVE" in
;;

cppcheck)
+ install_common_deps
+ install_native_deps
echo "Building and installing cppcheck..."
if ! install_cppcheck >cppcheck_build.log 2>&1
then
@@ -103,6 +132,8 @@ case "$TARGET_EFFECTIVE" in
$enable $suppress $cpp_conf $includes .
;;
coverity_prepare)
+ install_common_deps
+ install_native_deps
prepare_build
enter_build
../configure
diff --git a/.travis.yml b/.travis.yml
index af6e354..69ad4c4 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -25,12 +25,6 @@ sudo: required
before_install:
- echo -n | openssl s_client -connect scan.coverity.com:444 | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' | sudo tee -a /etc/ssl/certs/ca-certificates.crt

-install:
- - sudo apt-get install gcc-multilib gnu-efi libpci-dev libz-dev:i386
- - sudo apt-add-repository 'deb http://archive.ubuntu.com/ubuntu xenial universe'
- - sudo apt-get update -qq
- - sudo apt-get install --no-install-recommends --target-release xenial libcmocka-dev
-
addons:
coverity_scan:
project:
--
2.14.1

Jan Kiszka

unread,
Oct 4, 2017, 4:48:22 AM10/4/17
to [ext] claudius.heine.ext@siemens.com, efibootg...@googlegroups.com, Claudius Heine
On 2017-10-04 10:43, [ext] claudius....@siemens.com wrote:
> From: Claudius Heine <c...@denx.de>
>
> This way it can be handled more flexibly and the build time should be
> shorter.

Why should the build time be shorter?

Jan

Claudius Heine

unread,
Oct 4, 2017, 4:52:39 AM10/4/17
to Jan Kiszka, efibootg...@googlegroups.com, Claudius Heine
Hi,

On 10/04/2017 10:48 AM, Jan Kiszka wrote:
> On 2017-10-04 10:43, [ext] claudius....@siemens.com wrote:
>> From: Claudius Heine <c...@denx.de>
>>
>> This way it can be handled more flexibly and the build time should be
>> shorter.
>
> Why should the build time be shorter?

Should I anwser here or should I improve my commit message?

Short anwser. Only the needed dependencies are installed not all of them
all the time (i586 build etc.). Also for some reason java was downloaded
an installed on every build. With this patch no longer.

Maybe its possible to do this via the travis build matrix. If you prefer it.

Cheers,
Claudius
--
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-54 Fax: (+49)-8142-66989-80 Email: c...@denx.de

Jan Kiszka

unread,
Oct 4, 2017, 6:34:17 AM10/4/17
to Claudius Heine, efibootg...@googlegroups.com, Claudius Heine
On 2017-10-04 10:52, Claudius Heine wrote:
> Hi,
>
> On 10/04/2017 10:48 AM, Jan Kiszka wrote:
>> On 2017-10-04 10:43, [ext] claudius....@siemens.com wrote:
>>> From: Claudius Heine <c...@denx.de>
>>>
>>> This way it can be handled more flexibly and the build time should be
>>> shorter.
>>
>> Why should the build time be shorter?
>
> Should I anwser here or should I improve my commit message?
>
> Short anwser. Only the needed dependencies are installed not all of them
> all the time (i586 build etc.). Also for some reason java was downloaded
> an installed on every build. With this patch no longer.

That should go into the commit log, specifically as that "for some
reason" is not visible.

>
> Maybe its possible to do this via the travis build matrix. If you prefer
> it.

Generally, I'm fine with having CI platform independent stuff also in in
scripts (could be resused when do some, say, .gitlab-ci.yml), but
pushing everything over seems overdesigned.

Jan

Jan Kiszka

unread,
Oct 4, 2017, 8:17:09 AM10/4/17
to [ext] claudius.heine.ext@siemens.com, efibootg...@googlegroups.com, Claudius Heine
On 2017-10-04 10:43, [ext] claudius....@siemens.com wrote:
Thanks, applied to next. Awaiting v2 of the other.

Jan

claudius....@siemens.com

unread,
Oct 4, 2017, 8:32:07 AM10/4/17
to efibootg...@googlegroups.com, Claudius Heine
From: Claudius Heine <c...@denx.de>

Having the dependency setup in the travis-build script offers some
advantages:

- more flexibility without relying on travis specific configurations
- faster build:
- for each job, only necessary packages are installed
- some uncessasary packages will not be installed (for example
oracle-java9-installer)

Signed-off-by: Claudius Heine <c...@denx.de>
---

Changes in v2:
- expanded patch description

I tried converting it to the build matrix, but thats not as convenient as doing it in this script:

- Defining job local apt addon parameter always overwrites global apt addon parameter, so each job has to specify all packages. No distiction between common and job specific packages.
- All apt source lines are added before any packages are installed. Not possible to install just some packages from a repository of a newer distribution without updating any other packages.

It might be possible to put all the commands in a environment variable and evaluate this variable in the 'install' step. But I would prefer using a shell script directly instead.

Claudis

.travis-build.sh | 35 +++++++++++++++++++++++++++++++++--
.travis.yml | 6 ------
2 files changed, 33 insertions(+), 8 deletions(-)

diff --git a/.travis-build.sh b/.travis-build.sh
index 76629a8..2e00edc 100755
--- a/.travis-build.sh
+++ b/.travis-build.sh
2.14.1

Jan Kiszka

unread,
Oct 4, 2017, 8:56:08 AM10/4/17
to [ext] claudius.heine.ext@siemens.com, efibootg...@googlegroups.com, Claudius Heine
On 2017-10-04 14:31, [ext] claudius....@siemens.com wrote:
> From: Claudius Heine <c...@denx.de>
>
> Having the dependency setup in the travis-build script offers some
> advantages:
>
> - more flexibility without relying on travis specific configurations

Well, the installation script remains travis-specific, but
if that helps reducing the installation footprint, it's fine.

Merged to next, thanks.
Jan
Reply all
Reply to author
Forward
0 new messages