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

NO_CRTP mode enabled but explicit this parameter is not supported #623

Open
Becheler opened this issue Oct 11, 2024 · 3 comments
Open

NO_CRTP mode enabled but explicit this parameter is not supported #623

Becheler opened this issue Oct 11, 2024 · 3 comments
Labels
not a bug Shit happens... support Technical support (i.e. conan, development env)

Comments

@Becheler
Copy link

Hello people!

I am having this error when installing mp-units:

  • in gitlab CI
  • on a Ubuntu-24.04 docker image
  • with Conan 2,
  • in Debug mode
  • gcc-14 with C++23 enabled

NO_CRTP mode enabled but explicit this parameter is not supported

Any idea what is going on ? :)
Thanks!

Here is the full log:

mp-units/2.2.1: Calling source() in /root/.conan2/p/mp-un083d9aa103ca4/s/src
mp-units/2.2.1: Unzipping v2.2.1.tar.gz to .
-------- Installing package mp-units/2.2.1 (8 of 8) --------
mp-units/2.2.1: Building from source
mp-units/2.2.1: Package mp-units/2.2.1:da39a3ee5e6b4b0d3255bfef95601890afd80709
mp-units/2.2.1: Building your package in /root/.conan2/p/b/mp-uncfde0d364fde4/b
mp-units/2.2.1: Calling generate()
mp-units/2.2.1: Generators folder: /root/.conan2/p/b/mp-uncfde0d364fde4/b/build/Debug/generators
mp-units/2.2.1: CMakeToolchain generated: conan_toolchain.cmake
mp-units/2.2.1: CMakeToolchain generated: /root/.conan2/p/b/mp-uncfde0d364fde4/b/build/Debug/generators/CMakePresets.json
mp-units/2.2.1: CMakeToolchain generated: /root/.conan2/p/mp-un083d9aa103ca4/s/src/CMakeUserPresets.json
mp-units/2.2.1: Generating aggregated env files
mp-units/2.2.1: Generated aggregated env files: ['conanbuild.sh', 'conanrun.sh']
mp-units/2.2.1: Calling build()
mp-units/2.2.1: Running CMake.configure()
mp-units/2.2.1: RUN: cmake -G "Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE="generators/conan_toolchain.cmake" -DCMAKE_INSTALL_PREFIX="/root/.conan2/p/b/mp-uncfde0d364fde4/p" -DMP_UNITS_API_STD_FORMAT="ON" -DMP_UNITS_API_STRING_VIEW_RET="ON" -DMP_UNITS_API_NO_CRTP="ON" -DMP_UNITS_API_CONTRACTS="GSL-LITE" -DCMAKE_POLICY_DEFAULT_CMP0091="NEW" -DCMAKE_BUILD_TYPE="Debug" "/root/.conan2/p/mp-un083d9aa103ca4/s/src/src"
-- Using Conan toolchain: /root/.conan2/p/b/mp-uncfde0d364fde4/b/build/Debug/generators/conan_toolchain.cmake
-- Conan toolchain: Defining architecture flag: -m64
-- Conan toolchain: C++ Standard 23 with extensions OFF
-- The CXX compiler identification is GNU 13.2.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- MP_UNITS_BUILD_AS_SYSTEM_HEADERS: OFF
-- MP_UNITS_BUILD_CXX_MODULES: OFF
-- Checking C++ feature test macro '__cpp_lib_format'
-- Checking C++ feature test macro '__cpp_lib_format' - SUCCESS
-- Checking C++ feature test macro '__cpp_constexpr >= 202211L'
-- Checking C++ feature test macro '__cpp_constexpr >= 202211L' - SUCCESS
-- Checking C++ feature test macro '__cpp_explicit_this_parameter'
-- Checking C++ feature test macro '__cpp_explicit_this_parameter' - FAIL
-- MP_UNITS_API_STD_FORMAT: ON
-- MP_UNITS_API_STRING_VIEW_RET: ON
-- MP_UNITS_API_NO_CRTP: ON
-- MP_UNITS_API_FREESTANDING: OFF
-- MP_UNITS_API_CONTRACTS: GSL-LITE
CMake Error at CMakeLists.txt:115 (message):
  `NO_CRTP` mode enabled but explicit `this` parameter is not supported
-- Configuring incomplete, errors occurred!
mp-units/2.2.1: ERROR: 
Package 'da39a3ee5e6b4b0d3255bfef95601890afd80709' build failed
mp-units/2.2.1: WARN: Build folder /root/.conan2/p/b/mp-uncfde0d364fde4/b/build/Debug
ERROR: mp-units/2.2.1: Error in build() method, line 222
	cmake.configure(build_script_folder="src")
	ConanException: Error 1 while executing
@mpusz
Copy link
Owner

mpusz commented Oct 11, 2024

It seems that Conan (and also you 😉) thought you used gcc-14. But CMake actually reports gcc-13 being used.

Could you please check your Conan profile or conan install command line.

@Becheler
Copy link
Author

Becheler commented Oct 11, 2024

Conan detects indeed gcc13 but I overwrite the settings when invoking install

$ conan profile detect
detect_api: Found cc=gcc- 13.2.0
detect_api: gcc>=5, using the major as version
detect_api: gcc C++ standard library: libstdc++11
Detected profile:
WARN: This profile is a guess of your environment, please check it.
WARN: The output of this command is not guaranteed to be stable and can change in future Conan versions.
WARN: Use your own profile files for stability.
Saving detected profile to /root/.conan2/profiles/default
[settings]
arch=x86_64
build_type=Release
compiler=gcc
compiler.cppstd=gnu17
compiler.libcxx=libstdc++11
compiler.version=13
os=Linux
$ conan install . -b=missing -of=build/conan -s="compiler=gcc" -s="compiler.version=14" -s="build_type=$build_type" -s="compiler.cppstd=$std"
======== Input profiles ========
Profile host:
[settings]
arch=x86_64
build_type=Debug
compiler=gcc
compiler.cppstd=23
compiler.libcxx=libstdc++11
compiler.version=14
os=Linux
Profile build:
[settings]
arch=x86_[64](https:blabla/-/jobs/202154#L64)
build_type=Release
compiler=gcc
compiler.cppstd=gnu17
compiler.libcxx=libstdc++11
compiler.version=13
os=Linux

It looks like the build profile is not updated correctly 🤔

@mpusz
Copy link
Owner

mpusz commented Oct 11, 2024

Overriding the compiler version does nothing. Conan does not know the path to the compiler to run. You need to provide proper path to executables. See the profile example in the "Conan quick intro" here: https://mpusz.github.io/mp-units/latest/getting_started/installation_and_usage/#obtaining-dependencies.

@mpusz mpusz added support Technical support (i.e. conan, development env) not a bug Shit happens... labels Oct 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
not a bug Shit happens... support Technical support (i.e. conan, development env)
Projects
None yet
Development

No branches or pull requests

2 participants