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

googleapis: use modern CMake integrations #15450

Merged

Conversation

jcar87
Copy link
Contributor

@jcar87 jcar87 commented Jan 24, 2023

Specify library name and version: googleapis/all

Summary of changes

This PR updates the googleapis recipe to use functionality that is compatible with both Conan 1.x and Conan 2.0

  • Use CMakeDeps and CMakeToolchain instead of legacy integrations
  • Add transitive headers trait to the protobuf dependency - this is for Conan 2.0. .pb.h headers inside this package have transitive public header dependencies on Protobuf
  • Minor changes to use new functions from conan.tools
  • Add resdirs cpp_info attribute - it needs to be explicitly set in Conan 2.0 as there is no default.
  • Add package_type attribute

Shorten build paths in CMake-generated files:

  • Modify the logic in the CMake code generation such that the target names do not start with google_ or end with _proto - this is in an attempt to get cmake to generate shorter vcxproj files, such that the path to the build-time-only .dir directory and all temporary files generated by MSBuild have shorter names, to work around the following error:
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.CppBuild.targets(321,5): error MSB3491: Could not write lines to file "google_cloud_beyondcorp_clientconnectorservices_v1_clientconnectorservices_proto.dir\Release\google_c.96C68757.tlog\google_cloud_beyondcorp_clientconnectorservices_v1_clientconnectorservices_proto.lastbuildstate". The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters. [C:\J\w\prod\BuildSingleReference@5\s\495e34\1\build\google_cloud_beyondcorp_clientconnectorservices_v1_clientconnectorservices_proto.vcxproj]

The file names of the built libraries are preserved, as well as the target names that we are parsing in package_info.

@ghost
Copy link

ghost commented Jan 24, 2023

I detected other pull requests that are modifying googleapis/all recipe:

This message is automatically generated by https://github.com/ericLemanissier/conan-center-conflicting-prs so don't hesitate to report issues/improvements there.

@conan-center-bot

This comment has been minimized.

@jcar87 jcar87 force-pushed the lcc/maintenance/googleapis-modernize branch from b1ea37d to f900ac0 Compare January 25, 2023 14:43
franramirez688
franramirez688 previously approved these changes Jan 25, 2023
from conan.errors import ConanInvalidConfiguration
from conan.tools.build import check_min_cppstd
from conan.tools.cmake import cmake_layout, CMake
from conan.tools.files import apply_conandata_patches, copy, get, export_conandata_patches, copy
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
from conan.tools.files import apply_conandata_patches, copy, get, export_conandata_patches, copy
from conan.tools.files import apply_conandata_patches, copy, get, export_conandata_patches

@conan-center-bot

This comment has been minimized.

@jcar87
Copy link
Contributor Author

jcar87 commented Jan 27, 2023

C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.CppBuild.targets(321,5): error MSB3491: Could not write lines to file "google_cloud_beyondcorp_clientconnectorservices_v1_clientconnectorservices_proto.dir\Release\google_c.96C68757.tlog\google_cloud_beyondcorp_clientconnectorservices_v1_clientconnectorservices_proto.lastbuildstate". The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters. [C:\J\w\prod\BuildSingleReference@5\s\495e34\1\build\google_cloud_beyondcorp_clientconnectorservices_v1_clientconnectorservices_proto.vcxproj]
  Running cpp protocol buffer compiler on C:/J/w/prod/BuildSingleReference@5/s/495e34/1/src/google/cloud/beyondcorp/clientgateways/v1/client_gateways_service.proto

@conan-center-bot
Copy link
Collaborator

Conan v1 pipeline ✔️

All green in build 9 (3d797978d096c43818e5b9298ffdde0fb1942ed6):

  • googleapis/cci.20220531@:
    All packages built successfully! (All logs)

  • googleapis/cci.20220711@:
    All packages built successfully! (All logs)

  • googleapis/cci.20210730@:
    All packages built successfully! (All logs)

  • googleapis/cci.20211122@:
    All packages built successfully! (All logs)

Copy link
Member

@AbrilRBS AbrilRBS left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:)

Copy link
Member

@uilianries uilianries left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@conan-center-bot conan-center-bot merged commit 97721f5 into conan-io:master Jan 30, 2023
@kbarry-aurora
Copy link

Is it possible that this broke grpc-proto?

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

@prince-chrismc
Copy link
Contributor

StellaSmith pushed a commit to StellaSmith/conan-center-index that referenced this pull request Feb 2, 2023
* googleapis: use modern CMake integrations

* Add package_type attribute

* Fix applying patches

* google-apis: modernise test package

* googleapis: use resdirs in components and use shorten cmake target names when building

* Apply conandata patches
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.

7 participants