From aea20704b5b7a246cef3358662b4ae6e02763b92 Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Tue, 31 May 2022 10:49:09 -0400 Subject: [PATCH 1/3] ci: Drop an unused files Cruft from previous CI flows. --- ci/fah29-insttests.sh | 8 -------- ci/provision-prep.sh | 16 ---------------- 2 files changed, 24 deletions(-) delete mode 100755 ci/fah29-insttests.sh delete mode 100755 ci/provision-prep.sh diff --git a/ci/fah29-insttests.sh b/ci/fah29-insttests.sh deleted file mode 100755 index a045cf52..00000000 --- a/ci/fah29-insttests.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/usr/bin/bash -set -xeuo pipefail - -./tests/installed/provision.sh -# TODO: enhance papr to have caching, a bit like https://docs.travis-ci.com/user/caching/ -cd tests/installed -curl -Lo fedora-atomic-host.qcow2 https://getfedora.org/atomic_qcow2_latest -exec env "TEST_SUBJECTS=$(pwd)/fedora-atomic-host.qcow2" ./run.sh diff --git a/ci/provision-prep.sh b/ci/provision-prep.sh deleted file mode 100755 index 96a2041e..00000000 --- a/ci/provision-prep.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/usr/bin/bash -# Prepare the current environment - -set -xeuo pipefail - -dn=$(dirname $0) -. ${dn}/libbuild.sh -pkg_upgrade -pkg_install_buildroot -pkg_install sudo which attr fuse strace \ - libubsan libasan libtsan PyYAML elfutils -pkg_install_if_os fedora gjs gnome-desktop-testing parallel coccinelle clang - -if test -n "${CI_PKGS:-}"; then - pkg_install ${CI_PKGS} -fi From 199ef821c8272b2ca6dc125c68029310fc97ec29 Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Tue, 31 May 2022 10:57:00 -0400 Subject: [PATCH 2/3] ci: Add a codestyle.sh This matches what we do in rpm-ostree. Move the `glnx_fd_close` bits out of `make syntax-check` in preparation for dropping that. --- .cci.jenkinsfile | 3 +++ cfg.mk | 4 ---- ci/codestyle.sh | 26 ++++++++++++++++++++++++++ ci/gh-build.sh | 3 +++ 4 files changed, 32 insertions(+), 4 deletions(-) create mode 100755 ci/codestyle.sh diff --git a/.cci.jenkinsfile b/.cci.jenkinsfile index ff941249..af9faed5 100644 --- a/.cci.jenkinsfile +++ b/.cci.jenkinsfile @@ -4,6 +4,9 @@ stage("Build") { def n = 5 buildPod(memory: "2Gi", cpu: "${n}") { checkout scm + stage("Static analysis") { + shwrap("./ci/codestyle.sh") + } stage("Core build") { shwrap(""" # fetch tags so `git describe` gives a nice NEVRA when building the RPM diff --git a/cfg.mk b/cfg.mk index 471ccbc9..51e1833d 100644 --- a/cfg.mk +++ b/cfg.mk @@ -31,10 +31,6 @@ sc_glnx_errno_prefix_colon: @prohibit='\/dev/null; then +echo -n "checking rustfmt... " +for crate in $(find -iname Cargo.toml); do + if ! cargo fmt --manifest-path ${crate} -- --check; then + echo "cargo fmt failed; run: cd $(dirname ${crate}) && cargo fmt" 1>&2 + exit 1 + fi +done +echo "ok" +fi + +echo -n 'grep-based static analysis... ' +patterns=(glnx_fd_close) +for pat in "${patterns[@]}"; do + if git grep "${pat}" | grep -v codestyle\.sh; then + echo "Files matched prohibited pattern: ${pat}" 1>&2 + exit 1 + fi +done +echo ok diff --git a/ci/gh-build.sh b/ci/gh-build.sh index fdc79569..48c16cda 100755 --- a/ci/gh-build.sh +++ b/ci/gh-build.sh @@ -26,6 +26,9 @@ set -euo pipefail set -x +# First, basic static analysis +./ci/codestyle.sh + NOCONFIGURE=1 ./autogen.sh srcdir="$(pwd)" From e69321176dcc083b1186fe066daee9a957257f08 Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Tue, 31 May 2022 10:58:26 -0400 Subject: [PATCH 3/3] gitignore: Add ci-build/ Generated by our scripts. --- Makefile.am | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Makefile.am b/Makefile.am index 6eb88388..4e669164 100644 --- a/Makefile.am +++ b/Makefile.am @@ -41,6 +41,9 @@ AM_DISTCHECK_CONFIGURE_FLAGS += \ GITIGNOREFILES = aclocal.m4 build-aux/ buildutil/*.m4 config.h.in gtk-doc.make +# Generated by ci/gh-build.sh +GITIGNOREFILES += ci-build/ + # Generated by coreos-assembler build-fast and kola GITIGNOREFILES += fastbuild-*.qcow2 _kola_temp/