Skip to content

Conversation

oxidase
Copy link
Contributor

@oxidase oxidase commented Nov 23, 2024

⬆️ Bump cpm from 0.38.2 to 0.40.2

to fix deprecation warnings

CMake Warning (dev) at /opt/homebrew/share/cmake/Modules/FetchContent.cmake:1953 (message):
  Calling FetchContent_Populate(cicd-repo-infrastructure) is deprecated, call
  FetchContent_MakeAvailable(cicd-repo-infrastructure) instead.  Policy
  CMP0169 can be set to OLD to allow
  FetchContent_Populate(cicd-repo-infrastructure) to be called directly for
  now, but the ability to call it with declared details will be removed
  completely in a future version.

🐛 Allow empty prefix in undefined symbols lines

This should allow parsing strings like

compile-time-init-build/build/test/log/CMakeFiles/catalog2_lib.dir/catalog2a_lib.cpp.o:
__Unwind_Resume
unsigned int module<sc::module_string<sc::undefined<void, char, (char)100, (char)101, (char)102, (char)97, (char)117, (char)108, (char)116>>>()
unsigned int catalog<sc::message<(logging::level)7, sc::undefined<sc::args<int, int>, char, (char)68, (char)32, (char)115, (char)116, (char)114, (char)105, (char)110, (char)103, (char)32, (char)119, (char)105, (char)116, (char)104, (char)32, (char)123, (char)125, (char)32, (char)97, (char)110, (char)100, (char)32, (char)123, (char)125, (char)32, (char)112, (char)108, (char)97, (char)99, (char)101, (char)104, (char)111, (char)108, (char)100, (char)101, (char)114>>>()
std::terminate()
___cxa_begin_catch
___gxx_personality_v0
___stack_chk_fail
___stack_chk_guard
_log_calls

compile-time-init-build/build/test/log/CMakeFiles/catalog2_lib.dir/catalog2b_lib.cpp.o:
__Unwind_Resume
unsigned int module<sc::module_string<sc::undefined<void, char, (char)100, (char)101, (char)102, (char)97, (char)117, (char)108, (char)116>>>()
unsigned int catalog<sc::message<(logging::level)7, sc::undefined<sc::args<ns::E>, char, (char)69, (char)32, (char)115, (char)116, (char)114, (char)105, (char)110, (char)103, (char)32, (char)119, (char)105, (char)116, (char)104, (char)32, (char)123, (char)125, (char)32, (char)112, (char)108, (char)97, (char)99, (char)101, (char)104, (char)111, (char)108, (char)100, (char)101, (char)114>>>()
std::terminate()
___cxa_begin_catch
___gxx_personality_v0
___stack_chk_fail
___stack_chk_guard
_log_calls

⚠️ Fix "suggest braces around initialization of subobject" warnings

Warnings are visible as errors with compiler

g++ --version
Apple clang version 16.0.0 (clang-1600.0.26.4)
Target: arm64-apple-darwin24.1.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin

to fix deprecation warnings

CMake Warning (dev) at /opt/homebrew/share/cmake/Modules/FetchContent.cmake:1953 (message):
  Calling FetchContent_Populate(cicd-repo-infrastructure) is deprecated, call
  FetchContent_MakeAvailable(cicd-repo-infrastructure) instead.  Policy
  CMP0169 can be set to OLD to allow
  FetchContent_Populate(cicd-repo-infrastructure) to be called directly for
  now, but the ability to call it with declared details will be removed
  completely in a future version.

Signed-off-by: Michael Krasnyk <[email protected]>
This should allow parsing strings like

```
compile-time-init-build/build/test/log/CMakeFiles/catalog2_lib.dir/catalog2a_lib.cpp.o:
__Unwind_Resume
unsigned int module<sc::module_string<sc::undefined<void, char, (char)100, (char)101, (char)102, (char)97, (char)117, (char)108, (char)116>>>()
unsigned int catalog<sc::message<(logging::level)7, sc::undefined<sc::args<int, int>, char, (char)68, (char)32, (char)115, (char)116, (char)114, (char)105, (char)110, (char)103, (char)32, (char)119, (char)105, (char)116, (char)104, (char)32, (char)123, (char)125, (char)32, (char)97, (char)110, (char)100, (char)32, (char)123, (char)125, (char)32, (char)112, (char)108, (char)97, (char)99, (char)101, (char)104, (char)111, (char)108, (char)100, (char)101, (char)114>>>()
std::terminate()
___cxa_begin_catch
___gxx_personality_v0
___stack_chk_fail
___stack_chk_guard
_log_calls

compile-time-init-build/build/test/log/CMakeFiles/catalog2_lib.dir/catalog2b_lib.cpp.o:
__Unwind_Resume
unsigned int module<sc::module_string<sc::undefined<void, char, (char)100, (char)101, (char)102, (char)97, (char)117, (char)108, (char)116>>>()
unsigned int catalog<sc::message<(logging::level)7, sc::undefined<sc::args<ns::E>, char, (char)69, (char)32, (char)115, (char)116, (char)114, (char)105, (char)110, (char)103, (char)32, (char)119, (char)105, (char)116, (char)104, (char)32, (char)123, (char)125, (char)32, (char)112, (char)108, (char)97, (char)99, (char)101, (char)104, (char)111, (char)108, (char)100, (char)101, (char)114>>>()
std::terminate()
___cxa_begin_catch
___gxx_personality_v0
___stack_chk_fail
___stack_chk_guard
_log_calls
```

Signed-off-by: Michael Krasnyk <[email protected]>
@elbeno
Copy link
Contributor

elbeno commented Nov 25, 2024

Thanks for the PR. The CPM update and the regex fix are fine.

The missing braces thing we need to fix differently. Adding extra braces everywhere is not easy to read, not easy to get right, and leaks implementation details. That warning is turned off upstream for clang... do we need to turn it off for GCC also?

You appear to be running g++ but it's reporting itself as "Apple clang" - I wonder if that is affecting how CMake views it. We don't have the CI infrastructure to support Apple clang, I'm afraid.

@oxidase
Copy link
Contributor Author

oxidase commented Nov 26, 2024

@elbeno thanks! I have dropped the braces commit.

My toolchain is indeed Apple clang with was installed with brew

/usr/bin/nm --version
llvm-nm, compatible with GNU nm
Apple LLVM version 16.0.0
   (clang-1600.0.26.4)Optimized build.

/usr/bin/g++ --version
Apple clang version 16.0.0 (clang-1600.0.26.4)
Target: arm64-apple-darwin24.1.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin

This explains different output of nm and g++ warnings.

I'll check upstream warnings repo why the warning is not turned in my case.

oxidase added a commit to oxidase/cicd-repo-infrastructure that referenced this pull request Nov 26, 2024
AppleClang complains about missing braces as
```
[ 50%] Building CXX object test/cib/CMakeFiles/cib_nexus_test.dir/nexus.cpp.o
cd "build/Clang 16.0.0 arm64-apple-darwin24.1.0/test/cib" && /usr/bin/clang++ -DFMT_HEADER_ONLY=1 -Iinclude -isystem "build/Clang 16.0.0 arm64-apple-darwin24.1.0/_deps/catch2-src/src/catch2/.." -isystem "build/Clang 16.0.0 arm64-apple-darwin24.1.0/_deps/catch2-build/generated-includes" -isystem "build/Clang 16.0.0 arm64-apple-darwin24.1.0/_deps/rapidcheck-src/include" -isystem "build/Clang 16.0.0 arm64-apple-darwin24.1.0/_deps/rapidcheck-src/extras/catch/include" -isystem "build/Clang 16.0.0 arm64-apple-darwin24.1.0/_deps/mp11-src/include" -isystem "build/Clang 16.0.0 arm64-apple-darwin24.1.0/_deps/cpp-baremetal-concurrency-src/include" -isystem "build/Clang 16.0.0 arm64-apple-darwin24.1.0/_deps/fmt-src/include" -isystem "build/Clang 16.0.0 arm64-apple-darwin24.1.0/_deps/cpp-std-extensions-src/include" -isystem "build/Clang 16.0.0 arm64-apple-darwin24.1.0/_deps/cpp-baremetal-senders-and-receivers-src/include" -g -std=gnu++20 -arch arm64 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX15.1.sdk -Wall -Wcast-align -Wconversion -Wdouble-promotion -Werror -Wextra -Wextra-semi -Wfatal-errors -Wformat=2 -Wold-style-cast -Woverloaded-virtual -Wshadow -Wunused -MD -MT test/cib/CMakeFiles/cib_nexus_test.dir/nexus.cpp.o -MF CMakeFiles/cib_nexus_test.dir/nexus.cpp.o.d -o CMakeFiles/cib_nexus_test.dir/nexus.cpp.o -c test/cib/nexus.cpp
In file included from test/cib/nexus.cpp:1:
In file included from include/cib/cib.hpp:40:
In file included from include/cib/config.hpp:5:
include/cib/detail/config_details.hpp:20:25: fatal error: suggest braces around initialization of subobject [-Wmissing-braces]
   20 |         : configs_tuple{configs...} {}
      |                         ^~~~~~~
      |                         {      }
include/cib/config.hpp:30:12: note: in instantiation of member function 'cib::detail::config<cib::detail::exports<TestCallback<0>>, cib::detail::extend<TestCallback<0>, SimpleConfig::(lambda at test/cib/nexus.cpp:22:38)>>::config' requested here
   30 |     return detail::config{configs...};
      |            ^
test/cib/nexus.cpp:20:41: note: in instantiation of function template specialization 'cib::config<cib::detail::exports<TestCallback<0>>, cib::detail::extend<TestCallback<0>, SimpleConfig::(lambda at test/cib/nexus.cpp:22:38)>>' requested here
   20 |     constexpr static auto config = cib::config(
      |                                         ^
1 error generated.
```

with the change compilation passes
```
[ 50%] Building CXX object test/cib/CMakeFiles/cib_nexus_test.dir/nexus.cpp.o
cd "build/Clang 16.0.0 arm64-apple-darwin24.1.0/test/cib" && /usr/bin/clang++ -DFMT_HEADER_ONLY=1 -Iinclude -isystem "build/Clang 16.0.0 arm64-apple-darwin24.1.0/_deps/catch2-src/src/catch2/.." -isystem "build/Clang 16.0.0 arm64-apple-darwin24.1.0/_deps/catch2-build/generated-includes" -isystem "build/Clang 16.0.0 arm64-apple-darwin24.1.0/_deps/rapidcheck-src/include" -isystem "build/Clang 16.0.0 arm64-apple-darwin24.1.0/_deps/rapidcheck-src/extras/catch/include" -isystem "build/Clang 16.0.0 arm64-apple-darwin24.1.0/_deps/mp11-src/include" -isystem "build/Clang 16.0.0 arm64-apple-darwin24.1.0/_deps/cpp-baremetal-concurrency-src/include" -isystem "build/Clang 16.0.0 arm64-apple-darwin24.1.0/_deps/fmt-src/include" -isystem "build/Clang 16.0.0 arm64-apple-darwin24.1.0/_deps/cpp-std-extensions-src/include" -isystem "build/Clang 16.0.0 arm64-apple-darwin24.1.0/_deps/cpp-baremetal-senders-and-receivers-src/include" -g -std=gnu++20 -arch arm64 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX15.1.sdk -Wall -Wcast-align -Wconversion -Wdouble-promotion -Werror -Wextra -Wextra-semi -Wfatal-errors -Wformat=2 -Wold-style-cast -Woverloaded-virtual -Wshadow -Wunused -Wno-missing-braces -MD -MT test/cib/CMakeFiles/cib_nexus_test.dir/nexus.cpp.o -MF CMakeFiles/cib_nexus_test.dir/nexus.cpp.o.d -o CMakeFiles/cib_nexus_test.dir/nexus.cpp.o -c test/cib/nexus.cpp
```

@elbeno related PR intel/compile-time-init-build#651
@elbeno elbeno merged commit 099d638 into intel:main Nov 26, 2024
44 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants