!10 Update to 0.7.6 for fix build error caused by clang-15

From: @starlet-dx 
Reviewed-by: @caodongxia 
Signed-off-by: @caodongxia
This commit is contained in:
openeuler-ci-bot 2023-07-17 03:18:57 +00:00 committed by Gitee
commit 8cda85b9bb
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
5 changed files with 255 additions and 55 deletions

193
ci.sh Normal file
View File

@ -0,0 +1,193 @@
#!/bin/bash
set -euxo pipefail
# Define variables
HOST_CPU="$(uname -m)"
JOBS="$(nproc)"
# Functions
function _time {
/bin/time -f '=> [%E]' ${@}
}
function _setup {
if ! meson setup "${BUILD_DIR}"; then
cat "${BUILD_DIR}/meson-logs/meson-log.txt"
return 1
fi
}
function _build {
rm -f build.log
if ! _time ninja -C "${BUILD_DIR}" -v -j "${JOBS}" >& build.log; then
cat build.log
return 1
fi
head -4 build.log
tail -3 build.log
}
function _test {
if ! _time meson test -C "${BUILD_DIR}" \
-q --no-rebuild --print-errorlogs; then
return 1
fi
}
function _run_test {
if ! _setup; then
return 1
fi
if ! _build; then
return 2
fi
if ! _test; then
return 3
fi
}
# Print system info.
cat /proc/cpuinfo
cat /proc/meminfo
# Install additional packages.
pip3 install meson==0.55.0
# Run test.
# Customized constants.
#
# If the value is true, the CI returns the exit status zero even if the tests
# fail as a compromised way.
IGNORE_EXIT_STATUS=
# Set true if you want to skip specific tests to save total running time in all
# the CPU cases.
SKIP_ALL_GCC_DEFAULT=
SKIP_ALL_GCC_O2=
SKIP_ALL_GCC_RPM=true
SKIP_ALL_CLANG_DEFAULT=true
SKIP_ALL_CLANG_O2=true
SKIP_ALL_CLANG_RPM=true
# Set true if you want to skip specific tests in the specific CPU cases.
# The host machine CPU name is used in the constant names.
#
# Skip the test as it fails, and the i686 case takes longer running time.
SKIP_i686_GCC_DEFAULT=true
# Generate the current CPU specific skip flags.
SKIP_CPU_GCC_DEFAULT=$(eval echo "\${SKIP_${HOST_CPU}_GCC_DEFAULT:-}")
SKIP_CPU_GCC_O2=$(eval echo "\${SKIP_${HOST_CPU}_GCC_O2:-}")
SKIP_CPU_GCC_RPM=$(eval echo "\${SKIP_${HOST_CPU}_GCC_RPM:-}")
SKIP_CPU_CLANG_DEFAULT=$(eval echo "\${SKIP_${HOST_CPU}_CLANG_DEFAULT:-}")
SKIP_CPU_CLANG_O2=$(eval echo "\${SKIP_${HOST_CPU}_CLANG_O2:-}")
SKIP_CPU_CLANG_RPM=$(eval echo "\${SKIP_${HOST_CPU}_CLANG_RPM:-}")
exit_status=0
result_gcc="skipped"
result_gcc_O2="skipped"
result_gcc_rpm="skipped"
result_clang="skipped"
result_clang_O2="skipped"
result_clang_rpm="skipped"
# Print compiler versions.
gcc --version
g++ --version
clang --version
clang++ --version
echo "== Tests on gcc in a default status =="
if [ "${SKIP_ALL_GCC_DEFAULT}" != true ] && \
[ "${SKIP_CPU_GCC_DEFAULT}" != true ]; then
result_gcc="ok"
if ! BUILD_DIR="build/gcc" CC="gcc" CXX="g++" \
_run_test; then
exit_status=1
result_gcc="not ok"
fi
fi
echo "== Tests on clang in a default status =="
if [ "${SKIP_ALL_CLANG_DEFAULT}" != true ] && \
[ "${SKIP_CPU_CLANG_DEFAULT}" != true ]; then
result_clang="ok"
if ! BUILD_DIR="build/clang" CC="clang" CXX="clang++" \
_run_test; then
exit_status=1
result_clang="not ok"
fi
fi
echo "== Tests on gcc with O2 flag =="
if [ "${SKIP_ALL_GCC_O2}" != true ] && \
[ "${SKIP_CPU_GCC_O2}" != true ]; then
result_gcc_O2="ok"
if ! BUILD_DIR="build/gcc-O2" CC="gcc" CXX="g++" \
CFLAGS="-O2" CXXFLAGS="-O2" \
_run_test; then
exit_status=1
result_gcc_O2="not ok"
fi
fi
echo "== Tests on clang with O2 flag =="
if [ "${SKIP_ALL_CLANG_O2}" != true ] && \
[ "${SKIP_CPU_CLANG_O2}" != true ]; then
result_clang_O2="ok"
if ! BUILD_DIR="build/clang-O2" CC="clang" CXX="clang++" \
CFLAGS="-O2" CXXFLAGS="-O2" \
_run_test; then
exit_status=1
result_clang_O2="not ok"
fi
fi
# This is an advanced test.
echo "== Tests on gcc with flags used in RPM package build =="
if [ "${SKIP_ALL_GCC_RPM}" != true ] && \
[ "${SKIP_CPU_GCC_RPM}" != true ]; then
result_gcc_rpm="ok"
if ! BUILD_DIR="build/gcc-rpm" CC="gcc" CXX="g++" \
CFLAGS="${CI_GCC_RPM_CFLAGS}" CXXFLAGS="${CI_GCC_RPM_CXXFLAGS}" \
LDFLAGS="${CI_GCC_RPM_LDFLAGS}" \
_run_test; then
exit_status=1
result_gcc_rpm="not ok"
fi
fi
# This is an advanced test.
echo "== Tests on clang with flags used in RPM package build =="
if [ "${SKIP_ALL_CLANG_RPM}" != true ] && \
[ "${SKIP_CPU_CLANG_RPM}" != true ]; then
result_clang_rpm="ok"
if ! BUILD_DIR="build/clang-rpm" CC="clang" CXX="clang++" \
CFLAGS="${CI_CLANG_RPM_CFLAGS}" CXXFLAGS="${CI_CLANG_RPM_CXXFLAGS}" \
LDFLAGS="${CI_CLANG_RPM_LDFLAGS}" \
_run_test; then
exit_status=1
result_clang_rpm="not ok"
fi
fi
# Print results.
cat <<EOF
== Results ==
Exit status: ${exit_status}
${result_gcc} gcc without flags
${result_gcc_O2} gcc with -O2 flag
${result_gcc_rpm} gcc with RPM build flags
${result_clang} clang without flags
${result_clang_O2} clang with -O2 flag
${result_clang_rpm} clang with RPM build flags
EOF
if [ "${IGNORE_EXIT_STATUS}" = true ]; then
echo "warning: Exiting always with exit status zero is not ideal."
exit 0
else
exit ${exit_status}
fi

Binary file not shown.

View File

@ -1,20 +1,20 @@
%global commit_munit da8f73412998e4f1adf1100dc187533a51af77fd %global commit_simde fefc7857ff3e785b988a61a8f5f3c5bd5eb24342
%global commit_simde 3378ab337698933ccb2e4068b26acd5c6afe27c5
%global hedley_version 14 %global hedley_version 14
%global debug_package %{nil} %global debug_package %{nil}
Name: simde Name: simde
Version: 0.7.3 Version: 0.7.6
Release: 1 Release: 1
Summary: Implementations of SIMD instruction sets for systems which don't natively support them Summary: Implementations of SIMD instruction sets for systems which don't natively support them
License: MIT and CC0-1.0 License: MIT and CC0-1.0
URL: https://github.com/nemequ/simde URL: https://github.com/simd-everywhere/simde
Source0: https://github.com/simd-everywhere/%{name}/archive/%{commit_simde}.tar.gz Source0: https://github.com/simd-everywhere/%{name}/archive/%{commit_simde}.tar.gz
Source1: https://github.com/nemequ/munit/archive/%{commit_munit}.tar.gz Source1: ci.sh
BuildRequires: clang BuildRequires: clang
BuildRequires: cmake BuildRequires: cmake
BuildRequires: gcc BuildRequires: gcc
BuildRequires: gcc-c++ BuildRequires: gcc-c++
BuildRequires: meson time
# simde/hedley.h # simde/hedley.h
# https://github.com/nemequ/hedley # https://github.com/nemequ/hedley
@ -62,61 +62,65 @@ for file in $(find simde/ -type f); do
fi fi
done done
rm -rf test/munit # Only test the GCC and Clang cases with RPM build flags.
tar xzvf %{SOURCE1} # If you find test failures on the cases, reproduce it in the upstream CI.
mv munit-%{commit_munit} test/munit # in the O2 or RPM build flags cases, and report it.
# See <https://github.com/simd-everywhere/simde/blob/master/.packit/>.
# Copy to use the modified script.
cp -p "%{SOURCE1}" ci.sh
sed -i -e '/^cat \/proc\/cpuinfo/ s/^/#/' ci.sh
sed -i -e '/^cat \/proc\/meminfo/ s/^/#/' ci.sh
sed -i -e '/^pip3 install meson/ s/^/#/' ci.sh
sed -i -e '/^IGNORE_EXIT_STATUS=/,/^SKIP_i686_GCC_DEFAULT=/ s/^/#/' ci.sh
diff -u "%{SOURCE1}" ci.sh || :
echo "== 1. tests on gcc ==" cp -p ci.sh ci_gcc.sh
gcc --version IGNORE_EXIT_STATUS=
g++ --version # Prepare the configuration.
cat > config.txt <<EOF
IGNORE_EXIT_STATUS=${IGNORE_EXIT_STATUS}
SKIP_ALL_GCC_DEFAULT=true
SKIP_ALL_GCC_O2=true
SKIP_ALL_GCC_RPM=
SKIP_ALL_CLANG_DEFAULT=true
SKIP_ALL_CLANG_O2=true
SKIP_ALL_CLANG_RPM=true
EOF
# Insert the configuration.
sed -i -e '/^#SKIP_i686_GCC_DEFAULT=/r config.txt' ci_gcc.sh
# Print the difference on the debugging purpose.
diff -u ci.sh ci_gcc.sh || :
echo "=== 1.1. tests on gcc without flags ===" cp -p ci.sh ci_clang.sh
mkdir test/build-gcc IGNORE_EXIT_STATUS=true
pushd test/build-gcc # Prepare the configuration to be inserted.
CC=gcc CXX=g++ cmake .. cat > config.txt <<EOF
%make_build IGNORE_EXIT_STATUS=${IGNORE_EXIT_STATUS}
./run-tests SKIP_ALL_GCC_DEFAULT=true
popd SKIP_ALL_GCC_O2=true
SKIP_ALL_GCC_RPM=true
echo "=== 1.2. tests on gcc with flags ===" SKIP_ALL_CLANG_DEFAULT=true
mkdir test/build-gcc-with-flags SKIP_ALL_CLANG_O2=true
pushd test/build-gcc-with-flags SKIP_ALL_CLANG_RPM=
CC=gcc CXX=g++ cmake \ EOF
-DCMAKE_VERBOSE_MAKEFILE:BOOL=ON \ # Insert the configuration.
-DCMAKE_C_FLAGS="%{build_cflags}" \ sed -i -e '/^#SKIP_i686_GCC_DEFAULT=/r config.txt' ci_clang.sh
-DCMAKE_CXX_FLAGS="%{build_cxxflags}" \ # Print the difference on the debugging purpose.
.. diff -u ci.sh ci_clang.sh || :
%make_build
./run-tests
popd
%global toolchain clang %global toolchain clang
echo "== 2. tests on clang ==" export CI_CLANG_RPM_CFLAGS="%{build_cflags} -fno-strict-aliasing"
clang --version export CI_CLANG_RPM_CXXFLAGS="%{build_cxxflags} -fno-strict-aliasing"
clang++ --version export CI_CLANG_RPM_LDFLAGS="%{build_ldflags}"
%global toolchain gcc
export CI_GCC_RPM_CFLAGS="%{build_cflags} -fno-strict-aliasing"
export CI_GCC_RPM_CXXFLAGS="%{build_cxxflags} -fno-strict-aliasing"
export CI_GCC_RPM_LDFLAGS="%{build_ldflags}"
echo "=== 2.1. tests on clang without flags ===" # Run tests.
mkdir test/build-clang chmod u+x ./ci_gcc.sh ./ci_clang.sh
pushd test/build-clang /bin/time -f '=> [%E]' ./ci_gcc.sh
CC=clang CXX=clang++ cmake .. /bin/time -f '=> [%E]' ./ci_clang.sh
%make_build
./run-tests
popd
echo "=== 2.2. tests on clang with flags ==="
mkdir test/build-clang-with-flags
pushd test/build-clang-with-flags
%ifnarch %{arm}
CC=clang CXX=clang++ cmake \
-DCMAKE_VERBOSE_MAKEFILE:BOOL=ON \
-DCMAKE_C_FLAGS="%{build_cflags}" \
-DCMAKE_CXX_FLAGS="%{build_cxxflags}" \
..
%make_build
./run-tests
%endif
popd
%files devel %files devel
%license COPYING %license COPYING
@ -124,6 +128,9 @@ popd
%{_includedir}/%{name} %{_includedir}/%{name}
%changelog %changelog
* Sat Jul 15 2023 yaoxin <yao_xin001@hoperun.com> - 0.7.6-1
- Update to 0.7.6 for fix build error caused by clang-15
* Tue Mar 8 2022 yaoxin <yaoxin30@huawei.com> - 0.7.3-1 * Tue Mar 8 2022 yaoxin <yaoxin30@huawei.com> - 0.7.3-1
- Upgrade simde to 0.7.3 to resolve compilation failures. - Upgrade simde to 0.7.3 to resolve compilation failures.