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

MINIFICPP-2189 Fixing gcc-13 compatibility CI #1637

Closed
wants to merge 4 commits into from
Closed
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: 12 additions & 2 deletions .github/workflows/gcc13-compat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
13 changes: 6 additions & 7 deletions libminifi/include/core/Core.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 }) {
Expand All @@ -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{"]"};
Expand All @@ -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>();
Expand Down