From patchwork Tue Feb 19 15:34:08 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Graf X-Patchwork-Id: 158722 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp3800408jaa; Tue, 19 Feb 2019 07:35:29 -0800 (PST) X-Google-Smtp-Source: AHgI3IanFVRcDNnhSeUTgTtnwdII9dHrludIqwJNtoQnfZwYz1UeRjiWIY2R53iUM1HYTmTzAXoF X-Received: by 2002:a25:7085:: with SMTP id l127mr8634837ybc.369.1550590529735; Tue, 19 Feb 2019 07:35:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550590529; cv=none; d=google.com; s=arc-20160816; b=tNwoM43IPVGHQhkryiupam4Le3UtZ/4gxJ6KGOg4fF95ZFWshU6hM4XQunHTPxu1ne M5IV8PEupfZ3uiMpzHsgwoiVZ069iHkoK0hsy6AJCVbCVVTDYM1b3e7Qfr6vmXNMbjEu qKNJfwzBA4TMucSmrOhgS8Da6/efqRvtU2MhfleY3ROkFTFRcb1LBXJT0WeoMDV/HooG iA+8HocdzkAtVTMxyEcGI/h2QRz4IprD1Rk2vSx29/SHO/PPMJrqxoTUIpPOpUclsfgd KGpL7L2SL7S59kwXfpD+2ZDiXDEFFfB9ioUjvmugq3bPecehHld+dKYP/cNDldTiWVbO 5aIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:message-id:date:subject:to:from; bh=S2UfAkBr6zu/d1/nBAXb+MxPGdZnI6sS1LXhFmJcvUU=; b=SR46zCgiRcYzPkmKbzgqKY9zKOftBwgmR/pk0yNJcyrOmg+yf8SsRNJWTjYfUnC15f ymEPedFPBWwmQPsUOiGEUHIPI2+dl1KLAfV9dyjRQjRlWVYfcrkjEUxT6JL0q/a3fBCG Xs65Qz2ASQYA1xgf3iTuzyUjK27+XySb2z9cv2ONGBDsqfynNbryvJKXvF9ftAnNUNl/ u6tBs1EVVzSjd1IG+s0Up6YyXJ/w47svganbJH6WpiId8Jb0UbvyRCWIN1LvaDKl8THz J0Y4XQqrl21O3n4+Ou3Kga39MJpQFz4SXFR5RIwsedvy6VWwMQWZ2YNWJjnjrKy55wcB c4tA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of grub-devel-bounces+patch=linaro.org@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="grub-devel-bounces+patch=linaro.org@gnu.org" Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id l130si10184815ybf.114.2019.02.19.07.35.29 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 19 Feb 2019 07:35:29 -0800 (PST) Received-SPF: pass (google.com: domain of grub-devel-bounces+patch=linaro.org@gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; spf=pass (google.com: domain of grub-devel-bounces+patch=linaro.org@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="grub-devel-bounces+patch=linaro.org@gnu.org" Received: from localhost ([127.0.0.1]:50587 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gw7Qf-0000nr-9g for patch@linaro.org; Tue, 19 Feb 2019 10:35:29 -0500 Received: from eggs.gnu.org ([209.51.188.92]:35149) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gw7PR-00007K-3y for grub-devel@gnu.org; Tue, 19 Feb 2019 10:34:16 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gw7PP-00028x-Pp for grub-devel@gnu.org; Tue, 19 Feb 2019 10:34:13 -0500 Received: from mx2.suse.de ([195.135.220.15]:60866 helo=mx1.suse.de) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gw7PP-000282-Fx for grub-devel@gnu.org; Tue, 19 Feb 2019 10:34:11 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id B001EB031; Tue, 19 Feb 2019 15:34:09 +0000 (UTC) From: Alexander Graf To: grub-devel@gnu.org Subject: [PATCH v3] Add travis-ci config file Date: Tue, 19 Feb 2019 16:34:08 +0100 Message-Id: <20190219153408.43505-1-agraf@suse.de> X-Mailer: git-send-email 2.12.3 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x (no timestamps) [generic] X-Received-From: 195.135.220.15 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: The development of GNU GRUB Cc: Paul Menzel , Daniel Kiper , leif.lindholm@linaro.org MIME-Version: 1.0 Errors-To: grub-devel-bounces+patch=linaro.org@gnu.org Sender: "Grub-devel" There is a really convenient service for open source project from Travis CI: They allow for free CI testing using their infrastructure. Grub has had issues with broken builds for various targets for a long time already. The main reason is a lack of CI to just do smoke tests on whether all targets still at least compile. This patch adds a travis config file which builds (almost) all currently available targets. On top of that, this travis config also runs a small execution test on the x86_64-efi target. All of this config file can easily be extended further on. It probably makes sense to do something similar to the u-boot test infrastructure that communicates with the payload properly. Going forward, we also will want to do more qemu runtime checks for other targets. Currently, with this config alone, I already see about half of the available targets as broken. So it's definitely desperately needed :). Signed-off-by: Alexander Graf --- v1 -> v2: - Fix comment about toolchain variable v2 -> v3: - s/grub/GRUB/ - remove unneeded packages - comment fixes - determine number of jobs dynamically - sort targets alphabetically --- .travis.yml | 117 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 117 insertions(+) create mode 100644 .travis.yml -- 2.12.3 _______________________________________________ Grub-devel mailing list Grub-devel@gnu.org https://lists.gnu.org/mailman/listinfo/grub-devel diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 000000000..9a6f58ff6 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,117 @@ +# SPDX-License-Identifier: GPL-3.0+ +# Originally Copyright Roger Meier +# Adapted for GRUB by Alexander Graf + +# build GRUB on Travis CI - https://travis-ci.org/ + +dist: xenial + +language: c + +addons: + apt: + packages: + - cppcheck + - bc + - build-essential + - libsdl1.2-dev + - python + - python-virtualenv + - swig + - libpython-dev + - wget + - device-tree-compiler + - lzop + - liblz4-tool + - libisl15 + - qemu-system + - ovmf + - unifont + +env: + global: + # Include all cross toolchain paths, so we can just call them later down + - PATH=/tmp/qemu-install/bin:/tmp/grub/bin:/usr/bin:/bin:/tmp/cross/gcc-8.1.0-nolibc/aarch64-linux/bin:/tmp/cross/gcc-8.1.0-nolibc/arm-linux-gnueabi/bin:/tmp/cross/gcc-8.1.0-nolibc/ia64-linux/bin:/tmp/cross/gcc-8.1.0-nolibc/mips64-linux/bin:/tmp/cross/gcc-8.1.0-nolibc/powerpc64-linux/bin:/tmp/cross/gcc-8.1.0-nolibc/riscv32-linux/bin:/tmp/cross/gcc-8.1.0-nolibc/riscv64-linux/bin:/tmp/cross/gcc-8.1.0-nolibc/sparc64-linux/bin + +before_script: + # Install necessary toolchains based on $CROSS_TARGETS variable + - mkdir /tmp/cross + # These give us binaries like /tmp/cross/gcc-8.1.0-nolibc/ia64-linux/bin/ia64-linux-gcc + - for i in $CROSS_TARGETS; do + ( cd /tmp/cross; wget -t 3 -O - https://mirrors.kernel.org/pub/tools/crosstool/files/bin/x86_64/8.1.0/x86_64-gcc-8.1.0-nolibc-$i.tar.xz | tar xJ ); + done + +script: + # Comments must be outside the command strings below, or the Travis parser + # will get confused. + - ./autogen.sh + + # Build all selected GRUB targets: + - for target in $GRUB_TARGETS; do + plat=${target#*-}; + arch=${target%-*}; + [ "$arch" = "arm64" ] && arch=aarch64-linux; + [ "$arch" = "arm" ] && arch=arm-linux-gnueabi; + [ "$arch" = "ia64" ] && arch=ia64-linux; + [ "$arch" = "mipsel" ] && arch=mips64-linux; + [ "$arch" = "powerpc" ] && arch=powerpc64-linux; + [ "$arch" = "riscv32" ] && arch=riscv32-linux; + [ "$arch" = "riscv64" ] && arch=riscv64-linux; + [ "$arch" = "sparc64" ] && arch=sparc64-linux; + echo "Building $target"; + mkdir obj-$target; + JOBS=`getconf _NPROCESSORS_ONLN 2> /dev/null || echo 1`; + [ "$JOBS" == 1 ] || JOBS=$(($JOBS + 1)); + ( cd obj-$target && ../configure --target=$arch --with-platform=$plat --prefix=/tmp/grub && make -j$JOBS && make -j$JOBS install ) &> log || ( cat log; false ); + done + + # Our test canary + - echo -e "insmod echo\\ninsmod reboot\\necho hello world\\nreboot" > grub.cfg + + # Assemble images and possibly run them + - for target in $GRUB_TARGETS; do grub-mkimage -c grub.cfg -p / -O $target -o grub-$target echo reboot normal; done + + # Run images we know how to run + - if [[ "$GRUB_TARGETS" == *"x86_64-efi"* ]]; then qemu-system-x86_64 -bios /usr/share/ovmf/OVMF.fd -m 512 -no-reboot -nographic -net nic -net user,tftp=.,bootfile=grub-x86_64-efi | tee grub.log && grep "hello world" grub.log; fi + +matrix: + include: + # each env setting here is a dedicated build + - name: "x86_64" + env: + - GRUB_TARGETS="x86_64-efi x86_64-xen" + - name: "i386" + env: + - GRUB_TARGETS="i386-coreboot i386-efi i386-ieee1275 i386-multiboot i386-pc i386-qemu i386-xen i386-xen_pvh" + - name: "powerpc" + env: + - GRUB_TARGETS="powerpc-ieee1275" + - CROSS_TARGETS=powerpc64-linux" + - name: "sparc64" + env: + - GRUB_TARGETS="sparc64-ieee1275" + - CROSS_TARGETS=sparc64-linux" + - name: "ia64" + env: + - GRUB_TARGETS="ia64-efi" + - CROSS_TARGETS=ia64-linux" + - name: "mips" + env: + - GRUB_TARGETS="mips-arc mipsel-arc mipsel-qemu_mips mips-qemu_mips" + - CROSS_TARGETS=mips64-linux" + - name: "arm" + env: + - GRUB_TARGETS="arm-coreboot arm-efi arm-uboot" + - CROSS_TARGETS="arm-linux-gnueabi" + - name: "arm64" + env: + - GRUB_TARGETS="arm64-efi" + - CROSS_TARGETS=aarch64-linux" + - name: "riscv32" + env: + - GRUB_TARGETS="riscv32-efi" + - CROSS_TARGETS=riscv32-linux" + - name: "riscv64" + env: + - GRUB_TARGETS="riscv64-efi" + - CROSS_TARGETS=riscv64-linux"