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

[package] grpc-proto/cci.20220627: Can't get resdirs from googleapis #15599

Closed
kbarry-aurora opened this issue Jan 31, 2023 · 5 comments · Fixed by #15451
Closed

[package] grpc-proto/cci.20220627: Can't get resdirs from googleapis #15599

kbarry-aurora opened this issue Jan 31, 2023 · 5 comments · Fixed by #15451
Labels
bug Something isn't working

Comments

@kbarry-aurora
Copy link

Description

As of early yesterday (prior to #15571, as well as today after the GitHub hashing rollback happened), grpc-proto/cci.20220627 fails to build with the following error:

ERROR: grpc-proto/cci.20220627: Error in build() method, line 97
	cmake = self._configure_cmake()
while calling '_configure_cmake', line 63
	cmake.definitions["GOOGLEAPIS_PROTO_DIRS"] = self.dependencies["googleapis"].cpp_info.resdirs[0].replace("\\", "/")
	IndexError: list index out of range
The command '/bin/sh -c conan install --build=missing --settings="compiler.cppstd=20" ..' returned a non-zero code: 1

Maybe this is a result of #15450, since there were no recent changes to grpc-proto.

Package and Environment Details

  • Package Name/Version: grpc-proto/cci.20220627
  • Operating System+version: Linux Ubuntu 22.04
  • Compiler+version: GCC 11
  • Docker image: ubuntu-2204:2022.04.2
  • Conan version: (unknown)
  • Python version: Python 3.8.2

Conan profile

[settings]
arch=x86_64
arch_build=x86_64
build_type=Release
compiler=gcc
compiler.cppstd=20
compiler.libcxx=libstdc++
compiler.version=11
os=Linux
os_build=Linux
[options]
[build_requires]
[env]

Steps to reproduce

conan install --build=missing --settings="compiler.cppstd=20" ..

Logs

Click to expand log for googleapis
googleapis/cci.20220711: Configuring sources in /root/.conan/data/googleapis/cci.20220711/_/_/source/src
googleapis/cci.20220711: 
googleapis/cci.20220711: Unzipping 43.6MB, this can take a while
googleapis/cci.20220711: 
googleapis/cci.20220711: Copying sources to build folder
googleapis/cci.20220711: Building your package in /root/.conan/data/googleapis/cci.20220711/_/_/build/39a8be39fdd8b214d603417f8ca733c459475eda
googleapis/cci.20220711: Generator 'CMakeToolchain' calling 'generate()'
googleapis/cci.20220711: WARN: Using the new toolchains and generators without specifying a build profile (e.g: -pr:b=default) is discouraged and might cause failures and unexpected behavior
googleapis/cci.20220711: Preset 'release' added to CMakePresets.json. Invoke it manually using 'cmake --preset release'
googleapis/cci.20220711: If your CMake version is not compatible with CMakePresets (<3.19) call cmake like: 'cmake <path> -G "Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE=/root/.conan/data/googleapis/cci.20220711/_/_/build/39a8be39fdd8b214d603417f8ca733c459475eda/build/Release/generators/conan_toolchain.cmake -DCMAKE_POLICY_DEFAULT_CMP0091=NEW -DCMAKE_BUILD_TYPE=Release'
googleapis/cci.20220711: Generator 'CMakeDeps' calling 'generate()'
googleapis/cci.20220711: WARN: Using the new toolchains and generators without specifying a build profile (e.g: -pr:b=default) is discouraged and might cause failures and unexpected behavior
googleapis/cci.20220711: Aggregating env generators
googleapis/cci.20220711: Calling build()
googleapis/cci.20220711: Apply patch (bugfix): Fix incorrect dependency name in BUILD.bazel file
googleapis/cci.20220711: CMake command: cmake -G "Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE="/root/.conan/data/googleapis/cci.20220711/_/_/build/39a8be39fdd8b214d603417f8ca733c459475eda/build/Release/generators/conan_toolchain.cmake" -DCMAKE_INSTALL_PREFIX="/root/.conan/data/googleapis/cci.20220711/_/_/package/39a8be39fdd8b214d603417f8ca733c459475eda" -DCMAKE_POLICY_DEFAULT_CMP0091="NEW" -DCMAKE_BUILD_TYPE="Release" "/root/.conan/data/googleapis/cci.20220711/_/_/build/39a8be39fdd8b214d603417f8ca733c459475eda/src"
-- Using Conan toolchain: /root/.conan/data/googleapis/cci.20220711/_/_/build/39a8be39fdd8b214d603417f8ca733c459475eda/build/Release/generators/conan_toolchain.cmake
-- Conan toolchain: Setting CMAKE_POSITION_INDEPENDENT_CODE=ON (options.fPIC)
-- Conan toolchain: C++ Standard 20 with extensions OFF
-- Conan toolchain: Setting BUILD_SHARED_LIBS = OFF
-- The C compiler identification is GNU 11.2.0
-- The CXX compiler identification is GNU 11.2.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/local/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Conan: Component target declared 'protobuf::libprotobuf'
-- Conan: Component target declared 'protobuf::libprotoc'
-- Conan: Target declared 'protobuf::protobuf'
-- Conan: Target declared 'ZLIB::ZLIB'
-- Conan: Including build module from '/root/.conan/data/protobuf/3.21.4/_/_/package/0bdfe3d6d6b4b63398455efa85b0df26040ea510/lib/cmake/protobuf/protobuf-generate.cmake'
-- Conan: Including build module from '/root/.conan/data/protobuf/3.21.4/_/_/package/0bdfe3d6d6b4b63398455efa85b0df26040ea510/lib/cmake/protobuf/protobuf-module.cmake'
-- Conan: Including build module from '/root/.conan/data/protobuf/3.21.4/_/_/package/0bdfe3d6d6b4b63398455efa85b0df26040ea510/lib/cmake/protobuf/protobuf-options.cmake'
-- Configuring done
-- Generating done
CMake Warning:
  Manually-specified variables were not used by the project:

    CMAKE_POLICY_DEFAULT_CMP0091


-- Build files have been written to: /root/.conan/data/googleapis/cci.20220711/_/_/build/39a8be39fdd8b214d603417f8ca733c459475eda/build/Release
googleapis/cci.20220711: CMake command: cmake --build "/root/.conan/data/googleapis/cci.20220711/_/_/build/39a8be39fdd8b214d603417f8ca733c459475eda/build/Release" '--' '-j8'


########## BUILD OUTPUT TRIMMED DUE TO COMMENT SIZE LIMIT ##########


googleapis/cci.20220711: Package '39a8be39fdd8b214d603417f8ca733c459475eda' built
googleapis/cci.20220711: Build folder /root/.conan/data/googleapis/cci.20220711/_/_/build/39a8be39fdd8b214d603417f8ca733c459475eda/build/Release
googleapis/cci.20220711: Generated conaninfo.txt
googleapis/cci.20220711: Generated conanbuildinfo.txt
googleapis/cci.20220711: Generating the package
googleapis/cci.20220711: Package folder /root/.conan/data/googleapis/cci.20220711/_/_/package/39a8be39fdd8b214d603417f8ca733c459475eda
googleapis/cci.20220711: Calling package()
googleapis/cci.20220711: Copied 1 file: LICENSE
googleapis/cci.20220711: Copied 4519 '.proto' files
googleapis/cci.20220711: Copied 1055 '.h' files
googleapis/cci.20220711: Copied 295 '.a' files
googleapis/cci.20220711 package(): Packaged 1055 '.h' files
googleapis/cci.20220711 package(): Packaged 1 file: LICENSE
googleapis/cci.20220711 package(): Packaged 295 '.a' files
googleapis/cci.20220711 package(): Packaged 1 '.deps' file: generated_targets.deps
googleapis/cci.20220711 package(): Packaged 4519 '.proto' files
googleapis/cci.20220711: Package '39a8be39fdd8b214d603417f8ca733c459475eda' created
googleapis/cci.20220711: Created package revision 8e8d0adadfe1a618c0fe3e10f93f02ab
Click to expand log for grpc-proto
grpc-proto/cci.20220627: Configuring sources in /root/.conan/data/grpc-proto/cci.20220627/_/_/source
grpc-proto/cci.20220627: 
grpc-proto/cci.20220627: Unzipping 177.6KB, this can take a while
grpc-proto/cci.20220627: 
grpc-proto/cci.20220627: Copying sources to build folder
grpc-proto/cci.20220627: Building your package in /root/.conan/data/grpc-proto/cci.20220627/_/_/build/64b96564c5f56f9279ec23b7a58ac58cfadeba6a
grpc-proto/cci.20220627: Generator cmake created conanbuildinfo.cmake
grpc-proto/cci.20220627: Generator cmake_find_package_multi created googleapis-config-version.cmake
grpc-proto/cci.20220627: Generator cmake_find_package_multi created googleapisTarget-release.cmake
grpc-proto/cci.20220627: Generator cmake_find_package_multi created googleapisTargets.cmake
grpc-proto/cci.20220627: Generator cmake_find_package_multi created googleapis-config.cmake
grpc-proto/cci.20220627: Generator cmake_find_package_multi created protobuf-config-version.cmake
grpc-proto/cci.20220627: Generator cmake_find_package_multi created protobufTarget-release.cmake
grpc-proto/cci.20220627: Generator cmake_find_package_multi created protobufTargets.cmake
grpc-proto/cci.20220627: Generator cmake_find_package_multi created protobuf-config.cmake
grpc-proto/cci.20220627: Generator cmake_find_package_multi created ZLIBConfigVersion.cmake
grpc-proto/cci.20220627: Generator cmake_find_package_multi created ZLIBConfig.cmake
grpc-proto/cci.20220627: Generator cmake_find_package_multi created ZLIBTargets.cmake
grpc-proto/cci.20220627: Generator cmake_find_package_multi created ZLIBTarget-release.cmake
grpc-proto/cci.20220627: Aggregating env generators
grpc-proto/cci.20220627: Calling build()
grpc-proto/cci.20220627: 
grpc-proto/cci.20220627: ERROR: Package '64b96564c5f56f9279ec23b7a58ac58cfadeba6a' build failed
grpc-proto/cci.20220627: WARN: Build folder /root/.conan/data/grpc-proto/cci.20220627/_/_/build/64b96564c5f56f9279ec23b7a58ac58cfadeba6a
ERROR: grpc-proto/cci.20220627: Error in build() method, line 97
	cmake = self._configure_cmake()
while calling '_configure_cmake', line 63
	cmake.definitions["GOOGLEAPIS_PROTO_DIRS"] = self.dependencies["googleapis"].cpp_info.resdirs[0].replace("\\", "/")
	IndexError: list index out of range
The command '/bin/sh -c conan install --build=missing --settings="compiler.cppstd=20" ..' returned a non-zero code: 1
@kbarry-aurora kbarry-aurora added the bug Something isn't working label Jan 31, 2023
@SpaceIm
Copy link
Contributor

SpaceIm commented Jan 31, 2023

Indeed, it comes from #15450, because when layout() method is added to a recipe, cpp_info.resdirs is empty by default.

I think a new post package info hook should be added to verify whether cpp_info.resdirs is properly populated when there is a res or share folder, since it's easy to forget this kind of detail while migrating a recipe to conan v2.

/cc @jcar87 @uilianries

@SpaceIm
Copy link
Contributor

SpaceIm commented Jan 31, 2023

Actually resdirs is defined in #15450, so the problem is in grpc-proto not aggregating components (should be self.dependencies["googleapis"].cpp_info.aggregated_components().resdirs[0].replace("\\", "/")), but yes in a sense it's a side effect of #15450 and how conan v2 works.

@kbarry-aurora
Copy link
Author

Is it possible to put in a PR with just that change? Our build is completely blocked by this. Thanks!

(I'd put in a PR myself but it seems like onboarding with the project could take a while.)

@SpaceIm
Copy link
Contributor

SpaceIm commented Jan 31, 2023

#15603 should fix this issue, but it needs validation of 2 reviewers, 1 at least from conan team, so it won't be for today.

@kbarry-aurora
Copy link
Author

It builds again! Thanks for the fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
2 participants