Skip to content

Commit

Permalink
[CMake & CI] Upgrade build dependencies
Browse files Browse the repository at this point in the history
Signed-off-by: AeroStun <[email protected]>
  • Loading branch information
AeroStun committed Nov 5, 2022
1 parent 6063ca8 commit be750e6
Show file tree
Hide file tree
Showing 7 changed files with 48 additions and 78 deletions.
67 changes: 34 additions & 33 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
coverage-linux:
name: libSMCE (coverage) - Linux
runs-on: ubuntu-latest
container: ubuntu:hirsute
container: ubuntu:jammy
env:
DEBIAN_FRONTEND: "noninteractive"
steps:
Expand All @@ -40,7 +40,7 @@ jobs:
apt-get install -y lcov curl wget git cmake ninja-build g++ libmosquitto-dev pkg-config jq perl-base
ninja --version
cmake --version
wget -O Juniper.deb https://www.juniper-lang.org/installers/Juniper-3.0.0.deb
wget -O Juniper.deb https://www.juniper-lang.org/installers/Juniper-3.1.0.deb
apt-get install ./Juniper.deb
- name: Setup global CMake interceptor
run: ci/setup-cmake-interceptor.sh
Expand Down Expand Up @@ -88,10 +88,10 @@ jobs:
os: ubuntu-latest
c: gcc-10
cxx: g++-10
- lib: libc++
os: ubuntu-latest
c: clang-14
cxx: clang++-14 -stdlib=libc++
# - lib: libc++
# os: ubuntu-latest
# c: clang-15
# cxx: clang++-15 -stdlib=libc++
env:
CC: ${{ matrix.c }}
CXX: ${{ matrix.cxx }}
Expand All @@ -100,7 +100,7 @@ jobs:
if: matrix.lib == 'libc++'
run: |
sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)"
sudo apt-get update && sudo apt-get install -y clang-14 libc++-14-dev libc++abi-14-dev
sudo apt-get update && sudo apt-get install -y clang-15 libc++-15-dev libc++abi-15-dev
- uses: actions/checkout@v3
- run: ci/setup-cmake-interceptor.sh
- run: cmake -DSMCE_BUILD_PROFILE=CxxStdLibDebug -S . -B build
Expand Down Expand Up @@ -176,22 +176,27 @@ jobs:
fail-fast: false
matrix:
compiler:
- name: GCC 11
- name: GCC 12
release: true
slug: gcc
c: gcc-12
cxx: g++-12
- name: GCC 11
release: false
slug: gcc
c: gcc-11
cxx: g++-11
- name: GCC 10
release: false
slug: gcc
c: gcc-10
cxx: g++-10
- name: Clang/LLVM 13
- name: Clang/LLVM 15
release: true
slug: clang
c: clang-13
cxx: clang++-13
- name: AppleClang 12
c: clang-15
cxx: clang++-15
- name: AppleClang 14
release: true
slug: appleclang
c: clang
Expand All @@ -204,6 +209,7 @@ jobs:
- name: Check deps
run: |
brew install ninja openssl@3 bash
[ "${{ matrix.compiler.slug }}" = "clang" ] && brew install llvm
curl -sL https://github.com/AeroStun/brew-lipo/raw/master/brew-lipo.sh | bash -s openssl@3
ninja --version
cmake --version
Expand All @@ -225,8 +231,8 @@ jobs:
if: matrix.compiler.slug != 'appleclang'
run: |
export OPENSSL_ROOT_DIR=$(brew --prefix openssl@3)
[ "${{ matrix.compiler.slug }}" = "clang" ] && export CC="$(brew --prefix llvm)/bin/clang -stdlib=libc++ -nostdinc++ -I/usr/local/opt/llvm/include/c++/v1 -L/usr/local/opt/llvm/lib -Wl,-rpath,/usr/local/opt/llvm/lib -Wno-unused-command-line-argument"
[ "${{ matrix.compiler.slug }}" = "clang" ] && export CXX="$(brew --prefix llvm)/bin/clang++ -stdlib=libc++ -nostdinc++ -I/usr/local/opt/llvm/include/c++/v1 -L/usr/local/opt/llvm/lib -Wl,-rpath,/usr/local/opt/llvm/lib -Wno-unused-command-line-argument"
[ "${{ matrix.compiler.slug }}" = "clang" ] && export CC="$(brew --prefix llvm)/bin/clang"
[ "${{ matrix.compiler.slug }}" = "clang" ] && export CXX="$(brew --prefix llvm)/bin/clang++" CXXFLAGS="-stdlib=libc++ -nostdinc++ -I/usr/local/opt/llvm/include/c++/v1 -L/usr/local/opt/llvm/lib -Wl,-rpath,/usr/local/opt/llvm/lib -Wno-unused-command-line-argument"
mkdir build
cmake -G Ninja \
-DCMAKE_BUILD_TYPE=Release \
Expand All @@ -237,8 +243,8 @@ jobs:
run: cmake --build ./build
- name: Build & Run tests
run: |
[ "${{ matrix.compiler.slug }}" = "clang" ] && export CC="$(brew --prefix llvm)/bin/clang -stdlib=libc++ -nostdinc++ -I/usr/local/opt/llvm/include/c++/v1 -L/usr/local/opt/llvm/lib -Wl,-rpath,/usr/local/opt/llvm/lib -Wno-unused-command-line-argument"
[ "${{ matrix.compiler.slug }}" = "clang" ] && export CXX="$(brew --prefix llvm)/bin/clang++ -stdlib=libc++ -nostdinc++ -I/usr/local/opt/llvm/include/c++/v1 -L/usr/local/opt/llvm/lib -Wl,-rpath,/usr/local/opt/llvm/lib -Wno-unused-command-line-argument"
[ "${{ matrix.compiler.slug }}" = "clang" ] && export CC="$(brew --prefix llvm)/bin/clang"
[ "${{ matrix.compiler.slug }}" = "clang" ] && export CXX="$(brew --prefix llvm)/bin/clang++" CXXFLAGS="-stdlib=libc++ -nostdinc++ -I/usr/local/opt/llvm/include/c++/v1 -L/usr/local/opt/llvm/lib -Wl,-rpath,/usr/local/opt/llvm/lib -Wno-unused-command-line-argument"
cmake --build ./build --target SMCE_Tests
(cd build/test/; ctest --output-on-failure)
- name: Package
Expand Down Expand Up @@ -477,12 +483,6 @@ jobs:
run: |
dnf -y install curl git cmake ninja ${{ matrix.compiler.pkg }} glibc-devel lib64openssl-devel
ninja --version
if [[ -f /usr/lib64/librt.so ]]; then
echo "This hotfix is no longer needed" && exit 255
else
ln -s /lib64/librt.so.1 /usr/lib64/librt.so
fi
- name: CMake configure
run: |
cmake -G Ninja \
Expand Down Expand Up @@ -548,19 +548,16 @@ jobs:
image: debian:bookworm
- name: Debian
codename: Bullseye
image: gcc:11-bullseye
image: gcc:12-bullseye
- name: Debian
codename: Buster
image: gcc:10-buster
- name: Ubuntu
codename: Kinetic
image: ubuntu:kinetic
- name: Ubuntu
codename: Jammy
image: ubuntu:jammy
- name: Ubuntu
codename: Impish
image: ubuntu:impish
- name: Ubuntu
codename: Hirsute
image: ubuntu:hirsute
- name: Ubuntu
codename: Focal
image: ubuntu:focal
Expand All @@ -569,7 +566,7 @@ jobs:
options: --security-opt seccomp=unconfined
env:
DEBIAN_FRONTEND: "noninteractive"
CMAKE_VERSION: 3.23.1
CMAKE_VERSION: 3.24.3
steps:
- name: Setup workdir
run: mkdir /tmp/wk && cd /tmp/wk
Expand Down Expand Up @@ -633,6 +630,10 @@ jobs:
codename: 35
image: fedora:35
profile: FedoraHost
- name: Fedora
codename: 36
image: fedora:36
profile: FedoraHost
# - name: Fedora
# codename: Rawhide
# image: fedora:rawhide
Expand All @@ -641,8 +642,8 @@ jobs:
codename: Leap
image: opensuse/leap
profile: OpenSuseLeap
c: gcc-10
cxx: g++-10
c: gcc-11
cxx: g++-11
# - name: OpenMandriva
# codename: Lx4.2
# image: openmandriva/4.2
Expand All @@ -659,7 +660,7 @@ jobs:
- name: Fetch deps
run: |
[[ '${{ matrix.os.name }}' == 'Fedora' ]] && dnf install -y perl jq which tar git cmake rpmdevtools rpmlint ninja-build gcc-c++ openssl-devel || true
[[ '${{ matrix.os.name }}' == 'openSUSE' ]] && zypper install -y perl jq which tar git cmake rpmdevtools rpm-build rpmlint ninja gcc10-c++ libopenssl-devel || true
[[ '${{ matrix.os.name }}' == 'openSUSE' ]] && zypper install -y perl jq which tar git cmake rpmdevtools rpm-build rpmlint ninja gcc11-c++ libopenssl-devel || true
[[ '${{ matrix.os.name }}' == 'OpenMandriva' ]] && dnf install -y perl jq which tar git cmake rpmdevtools rpm-build rpmlint ninja clang glibc-devel lib64openssl-devel || true
- uses: actions/checkout@v3
- name: Setup global CMake interceptor
Expand Down
33 changes: 0 additions & 33 deletions CMake/BuildProfiles/UbuntuImpish.cmake

This file was deleted.

2 changes: 1 addition & 1 deletion CMake/BuildProfiles/UbuntuJammy.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# BuildProfiles/UbuntuImpish.cmake
# BuildProfiles/UbuntuJammy.cmake
# Copyright 2021-2022 ItJustWorksTM
#
# Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# BuildProfiles/UbuntuHirsute.cmake
# BuildProfiles/UbuntuKinetic.cmake
# Copyright 2021-2022 ItJustWorksTM
#
# Licensed under the Apache License, Version 2.0 (the "License");
Expand Down Expand Up @@ -29,5 +29,5 @@ set (SMCE_MOSQUITTO_LINKING AUTO)
set (SMCE_OPENSSL_LINKING SHARED)
set (SMCE_ARDRIVO_OV767X On)

set (SMCE_OS_RELEASE "ubuntu2104")
set (SMCE_OS_RELEASE "ubuntu2210")
set (SMCE_CPACK_PROFILE "Templates/Debian")
12 changes: 6 additions & 6 deletions CMake/Modules/SetupBoost.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,19 @@ else ()
if (NOT BOOST_SOURCE_USE_GIT)
if (NOT WIN32)
FetchContent_Declare (Boost
URL "https://boostorg.jfrog.io/artifactory/main/release/1.79.0/source/boost_1_79_0.tar.gz"
URL_HASH SHA256=273f1be93238a068aba4f9735a4a2b003019af067b9c183ed227780b8f36062c
URL "https://boostorg.jfrog.io/artifactory/main/release/1.80.0/source/boost_1_80_0.tar.gz"
URL_HASH SHA256=4b2136f98bdd1f5857f1c3dea9ac2018effe65286cf251534b6ae20cc45e1847
)
else ()
FetchContent_Declare (Boost
URL "https://boostorg.jfrog.io/artifactory/main/release/1.79.0/source/boost_1_79_0.7z"
URL_HASH SHA256=6c97cf4f4a0eb00ed776c88065ab3f59e183fa5e65f6464ff94f92328352d9d6
URL "https://boostorg.jfrog.io/artifactory/main/release/1.80.0/source/boost_1_80_0.7z"
URL_HASH SHA256=d12a2af721e22dbfb984ef061ee4c4ab2387f1904f6d65bc5acebaa34d6366ec
)
endif ()
else ()
FetchContent_Declare (Boost
GIT_REPOSITORY "https://github.com/boostorg/boost"
GIT_TAG "boost-1.79.0"
GIT_TAG "boost-1.80.0"
GIT_SHALLOW On
GIT_PROGRESS On
)
Expand All @@ -52,7 +52,7 @@ else ()
FetchContent_Populate (Boost)

if (NOT EXISTS "${boost_SOURCE_DIR}/CMakeLists.txt")
file (DOWNLOAD "https://github.com/boostorg/boost/raw/boost-1.79.0/CMakeLists.txt" "${boost_SOURCE_DIR}/CMakeLists.txt")
file (DOWNLOAD "https://github.com/boostorg/boost/raw/boost-1.80.0/CMakeLists.txt" "${boost_SOURCE_DIR}/CMakeLists.txt")
endif ()
message ("Download complete")
endif ()
Expand Down
2 changes: 1 addition & 1 deletion CMake/Modules/SetupMosquitto.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ elseif ("${SMCE_MOSQUITTO_LINKING}" STREQUAL "SOURCE")
include (FetchContent)
FetchContent_Declare (mosquitto
GIT_REPOSITORY "https://github.com/eclipse/mosquitto"
GIT_TAG v2.0.10
GIT_TAG v2.0.15
)
FetchContent_GetProperties (mosquitto)
if (NOT mosquitto_POPULATED)
Expand Down
6 changes: 4 additions & 2 deletions src/Ardrivo/String.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ String::String(ConvTag, long double val) : m_u{std::to_string(val)} {}

String::String(ConvTag, std::uintmax_t val, SMCE__BIN) {
if (val == 0) {
m_u = "0";
m_u.reserve(1);
m_u.push_back('0');
return;
}
m_u.resize(bit_width(val));
Expand All @@ -62,7 +63,8 @@ String::String(ConvTag, std::uintmax_t val, SMCE__BIN) {

String::String(ConvTag, std::uintmax_t val, SMCE__HEX) {
if (val == 0) {
m_u = "0";
m_u.reserve(1);
m_u.push_back('0');
return;
}
const auto bits = bit_width(val);
Expand Down

0 comments on commit be750e6

Please sign in to comment.