From b6d4e0850bc3951dd981c12d99d3c705d77f8224 Mon Sep 17 00:00:00 2001 From: Tom Rini Date: Tue, 9 Aug 2022 21:08:54 -0400 Subject: [PATCH] CI: Move to Ubuntu 2022.04 "Jammy" for CI base - We now have a new enough sbsigntools in the distro, stop building. - Use the 20220801 tag for Jammy. - Move to pygit2 1.9.2 (current version) as the old one doesn't build on "Jammy". - Add the working directory to the list of safe directories for git. - Move to pytest 6.2.5 to address other issues. - This move exposed a number of minor issues in the existing scripts we used within CI to perform the jobs themselves. The most notable changes here involve using 'set +e / set -e' to enforce when we should or should not make non-zero buildman status be a fatal error. Signed-off-by: Tom Rini Reviewed-by: Simon Glass --- .azure-pipelines.yml | 14 +++++++------- .gitlab-ci.yml | 8 +++++++- test/py/requirements.txt | 4 ++-- tools/docker/Dockerfile | 14 ++------------ 4 files changed, 18 insertions(+), 22 deletions(-) diff --git a/.azure-pipelines.yml b/.azure-pipelines.yml index 4f01598..0fa9247 100644 --- a/.azure-pipelines.yml +++ b/.azure-pipelines.yml @@ -2,7 +2,7 @@ variables: windows_vm: windows-2019 ubuntu_vm: ubuntu-22.04 macos_vm: macOS-12 - ci_runner_image: trini/u-boot-gitlab-ci-runner:focal-20220302-15Mar2022 + ci_runner_image: trini/u-boot-gitlab-ci-runner:jammy-20220801-09Aug2022 # Add '-u 0' options for Azure pipelines, otherwise we get "permission # denied" error when it tries to "useradd -m -u 1001 vsts_azpcontainer", # since our $(ci_runner_image) user is not root. @@ -170,13 +170,11 @@ stages: vmImage: $(ubuntu_vm) steps: - script: | - cat << EOF > build.sh - set -ex - cd ${WORK_DIR} - EOF - cat << "EOF" >> build.sh + cat << "EOF" > build.sh + cd $(work_dir) git config --global user.name "Azure Pipelines" git config --global user.email bmeng.cn@gmail.com + git config --global --add safe.directory $(work_dir) export USER=azure virtualenv -p /usr/bin/python3 /tmp/venv . /tmp/venv/bin/activate @@ -185,6 +183,7 @@ stages: export PYTHONPATH=${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc/pylibfdt export PATH=${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc:${PATH} ./tools/buildman/buildman -T0 -o ${UBOOT_TRAVIS_BUILD_DIR} -w --board sandbox_spl + set -ex ./tools/binman/binman --toolpath ${UBOOT_TRAVIS_BUILD_DIR}/tools test ./tools/buildman/buildman -t ./tools/dtoc/dtoc -t @@ -217,7 +216,7 @@ stages: options: $(container_option) steps: - script: | - cd ${WORK_DIR} + git config --global --add safe.directory $(work_dir) export USER=azure pip install -r test/py/requirements.txt pip install asteval pylint==2.12.2 pyopenssl @@ -226,6 +225,7 @@ stages: echo "load-plugins=pylint.extensions.docparams" >> .pylintrc export UBOOT_TRAVIS_BUILD_DIR=/tmp/sandbox_spl ./tools/buildman/buildman -T0 -o ${UBOOT_TRAVIS_BUILD_DIR} -w --board sandbox_spl + set -ex pylint --version export PYTHONPATH=${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc/pylibfdt make pylint_err diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index a516c5d..5592862 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -2,7 +2,7 @@ # Grab our configured image. The source for this is found at: # https://source.denx.de/u-boot/gitlab-ci-runner -image: trini/u-boot-gitlab-ci-runner:focal-20220302-15Mar2022 +image: trini/u-boot-gitlab-ci-runner:jammy-20220801-09Aug2022 # We run some tests in different order, to catch some failures quicker. stages: @@ -199,6 +199,7 @@ Run binman, buildman, dtoc, Kconfig and patman testsuites: script: - git config --global user.name "GitLab CI Runner"; git config --global user.email trini@konsulko.com; + git config --global --add safe.directory "${CI_PROJECT_DIR}"; export USER=gitlab; virtualenv -p /usr/bin/python3 /tmp/venv; . /tmp/venv/bin/activate; @@ -206,8 +207,10 @@ Run binman, buildman, dtoc, Kconfig and patman testsuites: export UBOOT_TRAVIS_BUILD_DIR=/tmp/sandbox_spl; export PYTHONPATH="${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc/pylibfdt"; export PATH="${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc:${PATH}"; + set +e; ./tools/buildman/buildman -T0 -o ${UBOOT_TRAVIS_BUILD_DIR} -w --board sandbox_spl; + set -e; ./tools/binman/binman --toolpath ${UBOOT_TRAVIS_BUILD_DIR}/tools test; ./tools/buildman/buildman -t; ./tools/dtoc/dtoc -t; @@ -224,14 +227,17 @@ Run tests for Nokia RX-51 (aka N900): Run pylint: stage: testsuites script: + - git config --global --add safe.directory "${CI_PROJECT_DIR}" - pip install -r test/py/requirements.txt - pip install asteval pylint==2.12.2 pyopenssl - export PATH=${PATH}:~/.local/bin - echo "[MASTER]" >> .pylintrc - echo "load-plugins=pylint.extensions.docparams" >> .pylintrc - export UBOOT_TRAVIS_BUILD_DIR=/tmp/sandbox_spl + - set +e - ./tools/buildman/buildman -T0 -o ${UBOOT_TRAVIS_BUILD_DIR} -w --board sandbox_spl + - set -e - pylint --version - export PYTHONPATH="${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc/pylibfdt" - make pylint_err diff --git a/test/py/requirements.txt b/test/py/requirements.txt index 2d0fcc9..ead92ed 100644 --- a/test/py/requirements.txt +++ b/test/py/requirements.txt @@ -12,9 +12,9 @@ pluggy==0.13.0 py==1.10.0 pycryptodomex==3.9.8 pyelftools==0.27 -pygit2==0.28.2 +pygit2==1.9.2 pyparsing==2.4.2 -pytest==5.2.1 +pytest==6.2.5 python-mimeparse==1.6.0 python-subunit==1.3.0 requests==2.25.1 diff --git a/tools/docker/Dockerfile b/tools/docker/Dockerfile index bbdc655..d3292e7 100644 --- a/tools/docker/Dockerfile +++ b/tools/docker/Dockerfile @@ -2,7 +2,7 @@ # This Dockerfile is used to build an image containing basic stuff to be used # to build U-Boot and run our test suites. -FROM ubuntu:focal-20220302 +FROM ubuntu:jammy-20220801 MAINTAINER Tom Rini LABEL Description=" This image is for building U-Boot inside a container" @@ -12,7 +12,7 @@ ENV DEBIAN_FRONTEND=noninteractive # Add LLVM repository RUN apt-get update && apt-get install -y gnupg2 wget xz-utils && rm -rf /var/lib/apt/lists/* RUN wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add - -RUN echo deb http://apt.llvm.org/focal/ llvm-toolchain-focal-13 main | tee /etc/apt/sources.list.d/llvm.list +RUN echo deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-13 main | tee /etc/apt/sources.list.d/llvm.list # Manually install the kernel.org "Crosstool" based toolchains for gcc-11.1.0 RUN wget -O - https://mirrors.edge.kernel.org/pub/tools/crosstool/files/bin/x86_64/11.1.0/x86_64-gcc-11.1.0-nolibc-aarch64-linux.tar.xz | tar -C /opt -xJ @@ -117,16 +117,6 @@ RUN apt-get update && apt-get install -y \ # Make kernels readable for libguestfs tools to work correctly RUN chmod +r /boot/vmlinu* -# Manually install a new enough version of sbsigntools (must be v0.9.4 or later) -RUN git clone https://git.kernel.org/pub/scm/linux/kernel/git/jejb/sbsigntools.git /tmp/sbsigntools && \ - cd /tmp/sbsigntools && \ - git checkout -b latest v0.9.4 && \ - ./autogen.sh && \ - ./configure && \ - make && \ - make install && \ - rm -rf /tmp/sbsigntools - # Build GRUB UEFI targets for ARM & RISC-V, 32-bit and 64-bit RUN git clone git://git.savannah.gnu.org/grub.git /tmp/grub && \ cd /tmp/grub && \ -- 2.7.4