conan-io / conan-center-index

Recipes for the ConanCenter repository
https://conan.io/center
MIT License
921 stars 1.66k forks source link

[package] oatpp-swagger/1.3.0: Test package does not find oatpp includes #22205

Open Inujel opened 5 months ago

Inujel commented 5 months ago

Description

The test package of oatpp-swagger fails to build because it does not find oatpp/core/data/mapping/type/Type.hpp, a header file of oatpp (tested on Linux and Windows).

I'm not sure what's the good way of fixing this:

  1. In the recipe of oatpp-swagger, use
    self.requires(f"oatpp/{self.version}", transitive_headers=True)
  2. Add a dependency to oatpp in the test package recipe of oatpp-swagger (and CMakeLists.txt).

There are other packages in a similar situation:

Shall I propose a PR that applies solution 1 to these packages?

Package and Environment Details

Conan profile

[settings] arch=x86_64 build_type=Release compiler=msvc compiler.cppstd=20 compiler.runtime=dynamic compiler.runtime_type=Release compiler.version=193 os=Windows [conf] tools.cmake.cmaketoolchain:generator=Ninja tools.microsoft.msbuild:vs_version=17 tools.microsoft.msbuild:max_cpu_count=8

Steps to reproduce

conan export --version 1.3.0 recipes/oatpp/all conan export --version 1.3.0 recipes/oatpp-swagger/all conan create -b missing --version 1.3.0 recipes/oatpp-swagger/all

Logs

Click to expand log ``` ... ======== Testing the package: Building ======== oatpp-swagger/1.3.0 (test package): Calling build() oatpp-swagger/1.3.0 (test package): Running CMake.configure() oatpp-swagger/1.3.0 (test package): RUN: cmake -G "Ninja" -DCMAKE_TOOLCHAIN_FILE="/builds/cc/devops/conan-center-index/recipes/oatpp-swagger/all/test_package/build/gcc-11-x86_64-release/generators/conan_toolchain.cmake" -DCMAKE_INSTALL_PREFIX="/builds/cc/devops/conan-center-index/recipes/oatpp-swagger/all/test_package" -DCMAKE_POLICY_DEFAULT_CMP0091="NEW" -DCMAKE_BUILD_TYPE="Release" "/builds/cc/devops/conan-center-index/recipes/oatpp-swagger/all/test_package" -- Using Conan toolchain: /builds/cc/devops/conan-center-index/recipes/oatpp-swagger/all/test_package/build/gcc-11-x86_64-release/generators/conan_toolchain.cmake -- The CXX compiler identification is GNU 11.4.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 -- Conan: Component target declared 'oatpp::oatpp-swagger' -- Conan: Component target declared 'oatpp::oatpp' -- Conan: Component target declared 'oatpp-test::oatpp-test' -- Conan: Target declared 'oatpp::oatpp-test' -- Configuring done -- Generating done -- Build files have been written to: /builds/cc/devops/conan-center-index/recipes/oatpp-swagger/all/test_package/build/gcc-11-x86_64-release oatpp-swagger/1.3.0 (test package): Running CMake.build() oatpp-swagger/1.3.0 (test package): RUN: cmake --build "/builds/cc/devops/conan-center-index/recipes/oatpp-swagger/all/test_package/build/gcc-11-x86_64-release" -- -j32 [1/2] Building CXX object CMakeFiles/test_package.dir/test_package.cpp.o FAILED: CMakeFiles/test_package.dir/test_package.cpp.o /usr/bin/c++ -isystem /root/.conan2/p/b/oatppd91237ff96d15/p/include/oatpp-1.3.0/oatpp-swagger -m64 -O3 -DNDEBUG -MD -MT CMakeFiles/test_package.dir/test_package.cpp.o -MF CMakeFiles/test_package.dir/test_package.cpp.o.d -o CMakeFiles/test_package.dir/test_package.cpp.o -c /builds/cc/devops/conan-center-index/recipes/oatpp-swagger/all/test_package/test_package.cpp In file included from /builds/cc/devops/conan-center-index/recipes/oatpp-swagger/all/test_package/test_package.cpp:2: /root/.conan2/p/b/oatppd91237ff96d15/p/include/oatpp-1.3.0/oatpp-swagger/oatpp-swagger/Types.hpp:28:10: fatal error: oatpp/core/data/mapping/type/Type.hpp: No such file or directory 28 | #include "oatpp/core/data/mapping/type/Type.hpp" | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ compilation terminated. ninja: build stopped: subcommand failed. ********************************************************* Recipe 'oatpp-swagger/1.3.0 (test package)' cannot build its binary It is possible that this recipe is not Conan 2.0 ready If the recipe comes from ConanCenter, report it at https://github.com/conan-io/conan-center-index/issues If it is your recipe, check if it is updated to 2.0 ********************************************************* ERROR: oatpp-swagger/1.3.0 (test package): Error in build() method, line 21 cmake.build() ConanException: Error 1 while executing ```
Inujel commented 5 months ago

About oatpp-openssl: the test package compiles and runs fine when adding transitive_headers to both dependencies:

    def requirements(self):
        self.requires(f"oatpp/{self.version}", transitive_headers=True)
        self.requires("openssl/[>=1.1 <4]", transitive_headers=True)