Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A few CI patches #2516

Merged
merged 3 commits into from
Feb 1, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions .cci.jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,24 @@ codestyle: {
}
},
unit: {
// this branch runs unit tests (both Rust-based and C-based) and makes sure we compile
// fine against the MSRV
// this branch runs unit tests (both Rust-based and C-based)
def n = 5
cosaPod(buildroot: true, runAsUser: 0, memory: "2Gi", cpu: "${n}") {
checkout scm
shwrap("""
MAKE_JOBS=${n} CARGO_BUILD_JOBS=${n} ci/unit.sh
""")
}
}}
},
clang: {
// Build with clang/clang++
def n = 5
cosaPod(buildroot: true, runAsUser: 0, memory: "2Gi", cpu: "${n}") {
checkout scm
shwrap("ci/clang-build-check.sh")
}
}
}

stage("Test") {
parallel insttests: {
Expand Down
6 changes: 6 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ name = "rpmostree-rust"
version = "0.1.0"
authors = ["Colin Walters <walters@verbum.org>", "Jonathan Lebon <jonathan@jlebon.com>"]
edition = "2018"
# See https://rust-lang.github.io/rfcs/2495-min-rust-version.html
# Usually, we try to keep this to no newer than current RHEL8 rust-toolset version.
# You can find the current versions from here:
# https://access.redhat.com/documentation/en-us/red_hat_developer_tools/1/
# However, right now we are bumping to 1.48 so we can use https://cxx.rs
#rust = "1.48"
links = "rpmostreeinternals"

# This currently needs to duplicate the libraries in configure.ac
Expand Down
23 changes: 0 additions & 23 deletions ci/build-check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,26 +14,3 @@ export PATH="$HOME/.cargo/bin:$PATH"
${dn}/build.sh
make check
make install

# And now a clang build with -Werror turned on. We can't do this with gcc (in
# build.sh) because it doesn't support -Wno-error=macro-redefined, (and neither
# does clang on CentOS). Anyway, all we want is at least one clang run.
if test -x /usr/bin/clang; then
if grep -q -e 'static inline.*_GLIB_AUTOPTR_LIST_FUNC_NAME' /usr/include/glib-2.0/glib/gmacros.h; then
echo 'Skipping clang check, see https://bugzilla.gnome.org/show_bug.cgi?id=796346'
else
# Except unused-command-line-argument:
# error: argument unused during compilation: '-specs=/usr/lib/rpm/redhat/redhat-hardened -cc1' [-Werror,-Wunused-command-line-argument]
# Except for macro-redefined:
# /usr/include/python2.7/pyconfig-64.h:1199:9: error: '_POSIX_C_SOURCE' macro redefined
# Except for deprecated-declarations: libdnf python bindings uses deprecated
# functions
export CFLAGS="-Wall -Werror -Wno-error=deprecated-declarations -Wno-error=macro-redefined -Wno-error=unused-command-line-argument ${CFLAGS:-}"
export CC=clang
git clean -dfx && git submodule foreach git clean -dfx
# XXX: --disable-introspection because right now we're always building the
# introspection bits with gcc, which doesn't understand some of the flags
# above (see Makefile-lib.am)
build ${CONFIGOPTS:-} --disable-introspection
fi
fi
5 changes: 0 additions & 5 deletions ci/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,6 @@ dn=$(dirname $0)
${dn}/install-extra-builddeps.sh
${dn}/installdeps.sh

# create an unprivileged user for testing
if ! getent passwd testuser; then
adduser testuser
fi

# make it clear what rustc version we're compiling with (this is grepped in CI)
rustc --version

Expand Down
16 changes: 16 additions & 0 deletions ci/clang-build-check.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/usr/bin/bash
# Install build dependencies, run unit tests and installed tests.

# This script is what Prow runs.

set -xeuo pipefail

dn=$(dirname $0)
. ${dn}/libbuild.sh

# add cargo's directory to the PATH like we do in CoreOS CI
export PATH="$HOME/.cargo/bin:$PATH"

export CC=clang CXX=clang++
${dn}/build.sh
make check
10 changes: 1 addition & 9 deletions ci/unit.sh
Original file line number Diff line number Diff line change
@@ -1,15 +1,7 @@
#!/bin/bash
set -euo pipefail

# Usually, we try to keep this to no newer than current RHEL8 rust-toolset version.
# You can find the current versions from here:
# https://access.redhat.com/documentation/en-us/red_hat_developer_tools/1/
# However, right now we are bumping to 1.48 so we can use https://cxx.rs
MINIMUM_SUPPORTED_RUST_VERSION=1.48

ci/installdeps.sh
dnf remove -y cargo rust
curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain ${MINIMUM_SUPPORTED_RUST_VERSION} -y
ci/install-extra-builddeps.sh
export PATH="$HOME/.cargo/bin:$PATH"
ci/build.sh
cargo +${MINIMUM_SUPPORTED_RUST_VERSION} test