This is an automated email from the ASF dual-hosted git repository. szaszm pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/nifi-minifi-cpp.git
commit 218fd0b307dda513b94aaf8fba16a1b1044c45b0 Author: Martin Zink <[email protected]> AuthorDate: Fri Aug 25 19:20:55 2023 +0200 MINIFICPP-2189 Fixing gcc-13 compatibility in CI Closes #1637 Signed-off-by: Marton Szasz <[email protected]> --- .github/workflows/gcc13-compat.yml | 14 ++++++++++++-- libminifi/include/core/Core.h | 13 ++++++------- 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/.github/workflows/gcc13-compat.yml b/.github/workflows/gcc13-compat.yml index 0c56d2b00..7ea37a5f6 100644 --- a/.github/workflows/gcc13-compat.yml +++ b/.github/workflows/gcc13-compat.yml @@ -4,15 +4,25 @@ jobs: ubuntu_22_04: name: "ubuntu-22.04-gcc-13" runs-on: ubuntu-22.04 - timeout-minutes: 120 + timeout-minutes: 300 steps: + - id: free_disk_space + run: | + # We can gain additional disk space on the Ubuntu runners thanks to these suggestions: + # https://github.com/actions/runner-images/issues/2840#issuecomment-790492173 + # https://github.com/actions/runner-images/issues/2606#issuecomment-772683150 + sudo rm -rf /usr/share/dotnet + sudo rm -rf /usr/local/lib/android + sudo rm -rf /opt/ghc + sudo rm -rf "/usr/local/share/boost" + sudo rm -rf "$AGENT_TOOLSDIRECTORY" - id: checkout uses: actions/checkout@v3 - id: install_deps run: | sudo add-apt-repository ppa:ubuntu-toolchain-r/test sudo apt update - sudo apt install -y ccache libfl-dev libpcap-dev libboost-all-dev openjdk-8-jdk maven libusb-1.0-0-dev libpng-dev libgps-dev libsqliteodbc lua5.3 liblua5.3-dev flake8 parallel gcc-13 + sudo apt install -y ccache libfl-dev libpcap-dev libboost-all-dev openjdk-8-jdk maven libusb-1.0-0-dev libpng-dev libgps-dev libsqliteodbc lua5.3 liblua5.3-dev flake8 parallel gcc-13 g++-13 echo "PATH=/usr/lib/ccache:$PATH" >> $GITHUB_ENV echo -e "127.0.0.1\t$HOSTNAME" | sudo tee -a /etc/hosts > /dev/null - name: build diff --git a/libminifi/include/core/Core.h b/libminifi/include/core/Core.h index 3d96ec71a..5f48dac1d 100644 --- a/libminifi/include/core/Core.h +++ b/libminifi/include/core/Core.h @@ -71,11 +71,7 @@ #include "properties/Configure.h" #include "utils/StringUtils.h" -/** - * namespace aliasing - */ -namespace org::apache::nifi::minifi::core { - +#if defined(_MSC_VER) constexpr std::string_view removeStructOrClassPrefix(std::string_view input) { using namespace std::literals; for (auto prefix : { "struct "sv, "class "sv }) { @@ -85,10 +81,11 @@ constexpr std::string_view removeStructOrClassPrefix(std::string_view input) { } return input; } +#endif // based on https://bitwizeshift.github.io/posts/2021/03/09/getting-an-unmangled-type-name-at-compile-time/ template<typename T> -constexpr auto typeNameArray() { +constexpr auto typeNameArray() { // In root namespace to avoid gcc-13 optimizing out namespaces from __PRETTY_FUNCTION__ #if defined(__clang__) constexpr auto prefix = std::string_view{"[T = "}; constexpr auto suffix = std::string_view{"]"}; @@ -115,9 +112,11 @@ constexpr auto typeNameArray() { constexpr auto name = function.substr(start, end - start); #endif - return utils::string_view_to_array<name.length()>(name); + return org::apache::nifi::minifi::utils::string_view_to_array<name.length()>(name); } +namespace org::apache::nifi::minifi::core { + template<typename T> struct TypeNameHolder { static constexpr auto value = typeNameArray<T>();
