Fix broken CI

Backport a few fixes from rawhide concerning tests setup and CI integration.
This commit is contained in:
Tom Stellard 2020-08-19 14:39:12 +00:00 committed by serge-sans-paille
parent 96b053653f
commit ece4019ae8
7 changed files with 68 additions and 9 deletions

View file

@ -0,0 +1,26 @@
From bab5908df544680ada0a3cf431f55aeccfbdb321 Mon Sep 17 00:00:00 2001
From: serge-sans-paille <sguelton@redhat.com>
Date: Mon, 13 Apr 2020 13:44:15 +0200
Subject: [PATCH] Normalize working directory when running llvm-mc in test
Otherwise, depending on the lit location used to run the test, llvm-mc adds an
include_directories entry in the dwarf output, which breaks tests in some setup.
Differential Revision: https://reviews.llvm.org/D77876
---
llvm/test/MC/MachO/gen-dwarf.s | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/llvm/test/MC/MachO/gen-dwarf.s b/llvm/test/MC/MachO/gen-dwarf.s
index 0813856d625..6d39d278e81 100644
--- a/llvm/test/MC/MachO/gen-dwarf.s
+++ b/llvm/test/MC/MachO/gen-dwarf.s
@@ -1,4 +1,4 @@
-// RUN: llvm-mc -g -triple i386-apple-darwin10 %s -filetype=obj -o %t
+// RUN: mkdir -p %t0 && cd %t0 && llvm-mc -g -triple i386-apple-darwin10 %s -filetype=obj -o %t
// RUN: llvm-dwarfdump -all %t | FileCheck %s
.globl _bar
--
2.25.2

View file

@ -1,5 +1,6 @@
config.llvm_tools_dir = '/usr/bin'
config.llvm_src_root = '/usr/share/llvm/src'
config.llvm_shlib_dir = '%(llvm_shlib_dir)s' % lit_config.params
if hasattr(config, 'host_triple'):

View file

@ -65,6 +65,8 @@ Patch1: 0001-CMake-Split-test-binary-exports-into-their-own-expor.patch
# https://bugzilla.redhat.com/show_bug.cgi?id=1862012
Patch2: 0001-PowerPC-PPCBoolRetToInt-Don-t-translate-Constant-s-o.patch
Patch4: 0001-Normalize-working-directory-when-running-llvm-mc-in-.patch
BuildRequires: gcc
BuildRequires: gcc-c++
BuildRequires: cmake
@ -296,10 +298,21 @@ install -d %{install_srcdir}
install -d %{install_srcdir}/utils/
cp -R utils/unittest %{install_srcdir}/utils/
# Generate lit config files. Strip off the last line that initiates the
# Clang needs these for running lit tests.
for f in utils/*.py; do
sed '1 s|^.*$|#!/usr/bin/env python3|' $f > %{install_srcdir}/$f
done
cp -R utils/UpdateTestChecks %{install_srcdir}/utils/
# One of the lit tests references this file
install -d %{install_srcdir}/docs/CommandGuide/
install -m 0644 docs/CommandGuide/dsymutil.rst %{install_srcdir}/docs/CommandGuide/
# Generate lit config files. Strip off the last lines that initiates the
# test run, so we can customize the configuration.
head -n -1 _build/test/lit.site.cfg.py >> %{lit_cfg}
head -n -1 _build/test/Unit/lit.site.cfg.py >> %{lit_unit_cfg}
head -n -2 _build/test/lit.site.cfg.py >> %{lit_cfg}
head -n -2 _build/test/Unit/lit.site.cfg.py >> %{lit_unit_cfg}
# Install custom fedora config file
cp %{SOURCE2} %{buildroot}%{lit_fedora_cfg}
@ -472,6 +485,7 @@ fi
%{_datadir}/llvm/src/unittests
%{_datadir}/llvm/src/test.tar.gz
%{_datadir}/llvm/lit.fedora.cfg.py
%{_datadir}/llvm/src/docs/CommandGuide/dsymutil.rst
%{_bindir}/not
%{_bindir}/count
%{_bindir}/yaml-bench

View file

@ -48,6 +48,7 @@ esac
cd $(mktemp -d)
ln -s /usr/include include
ln -s /usr/share/llvm/src/docs docs
tar -xzf /usr/share/llvm/src/test.tar.gz
ln -s $ARCH.site.cfg.py test/lit.site.cfg.py
ln -s $ARCH.site.cfg.py test/Unit/lit.site.cfg.py

View file

@ -0,0 +1,5 @@
#!/bin/bash
set -ex
test `stat -L -c %s /usr/lib64/libLLVM.so` -lt 100000000

View file

@ -0,0 +1,16 @@
#!/bin/bash
set -ex
cmd='/usr/libexec/tests/llvm/run-lit-tests --threads 1'
if [ `id -u` -eq 0 ]; then
# lit tests can't be run as root, so we need to run as a different user
user='llvm-regression-tests'
if ! id -u $user; then
useradd $user
fi
su $user -c "$cmd"
cmd="su $user -c $cmd"
else
exec $cmd
fi

View file

@ -8,9 +8,7 @@
- rust
- cargo
tests:
- regression-tests:
dir: ./
run: /usr/libexec/tests/llvm/run-lit-tests --threads 1
- regression-tests
- rust-sanity:
dir: ./
run: cargo new hello && cd hello && cargo run
@ -20,9 +18,7 @@
# which breaks the nightly compose. So this test checks that libLLVM.so
# is less than 100MB to ensure it was successfully stripped.
# https://bugzilla.redhat.com/show_bug.cgi?id=1793250
- libllvm-size:
dir: ./
run: test `stat -L -c %s /usr/lib64/libLLVM.so` -lt 100000000
- libllvm-size
# This test ensures that the spec file still builds correctly with
# %global compat_build 1
# FIXME: This fails, because the CI system has a hard-coded timeout of 4