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

[bug] new googleapis recipe (for old version) breaks old grpc recipe #15698

Closed
thejohnfreeman opened this issue Feb 2, 2023 · 3 comments
Closed
Assignees

Comments

@thejohnfreeman
Copy link
Contributor

thejohnfreeman commented Feb 2, 2023

Environment details

  • Operating System+version: any
  • Compiler+version: any
  • Conan version: 1.58
  • Python version: any

Steps to reproduce

Tried to install grpc/1.44.0. It used to work, a few weeks ago. It depends on googleapis/cci.20220531. The recipe for grpc has a _patch_sources() method (called from build()) that tries to access a field on its dependency's cpp_info:

src=os.path.join(self.dependencies["googleapis"].cpp_info.resdirs[0], "google", "rpc")

The old recipe for googleapis did not assign a value to cpp_info.resdirs, but the default is ["res"] if the recipe is not using a layout, otherwise it is []. The old recipe for googleapis did not use a layout, but the new one does. This leads to the error below (just like this one filed two weeks ago):

grpc/1.44.0: Calling build()
grpc/1.44.0: ERROR: Package '413f861a08491344fe9805822a73250fade161cc' build failed
grpc/1.44.0: WARN: Build folder /root/.conan/data/grpc/1.44.0/_/_/build/413f861a08491344fe9805822a73250fade161cc
grpc/1.44.0:
ERROR: grpc/1.44.0: Error in build() method, line 220
        self._patch_sources()
while calling '_patch_sources', line 190
        src=os.path.join(self.dependencies["googleapis"].cpp_info.resdirs[0], "google", "rpc"),
        IndexError: list index out of range

The config.yml for grpc no longer lists version 1.44. Does that mean it is no longer supported?

Logs

No response

@jcar87 jcar87 transferred this issue from conan-io/conan Feb 3, 2023
@jcar87
Copy link
Contributor

jcar87 commented Feb 3, 2023

Hi @thejohnfreeman - thanks for reporting this issue and for the analysis.

The issue is caused by the introduction of components in #14894. When introducing the use of layouts in #15450, the missing resdirs was added to each component, which is what causes self.dependencies["googleapis"].cpp_info.resdirs[0] to fail, as one now needs to reference a component or ask Conan for the aggregated components.

A similar issue was experienced with the grpc-proto recipe due to the same thing, and was fixed promptly.

Does that mean it is no longer supported?

Indeed this is the case. The current versions of the gRPC recipe are not affected to my knowledge.
I'd be happy to restore the previous behaviour in googleapis, we should be more careful with introducing breaking changes in package_info as was the case here, although I need to make sure it doesn't cause issues somewhere else. I will look into this today!

However, for cases like this, if you need to depend on specific versions for production-critical workflows, we advise using recipe revisions / lockfiles or locally hosting your own copies of the recipes, to avoid being exposed to upstream changes.

From my knowledge, libraries like gRPC and protobuf maintained by Google seem to have stable API promises that make it easy for developers to update to newer versions. We'd be very interested to understand what reasons prevent users from updating to newer versions of libraries like gRPC, so that we can make sure our policies ara adapted to meet our users needs.

@manuelnp
Copy link

manuelnp commented Feb 24, 2023

Hi @jcar87

I would like to point out that latest grcp recipe 1.50.1 is "broken" since last week due a misalignment of googleapis between grpc and grpc-proto

image

This is generating the following two lines of logs:

WARN: grpc-proto/cci.20220627: requirement googleapis/cci.20221108 overridden by grpc/1.50.1 to googleapis/cci.20220711
[...]
ERROR: Missing binary: grpc-proto/cci.20220627:de6675bfb705df73d3c699d3bbfc04fbaad72b52

I could, of course, add --build=grpc-proto to my conan install, but I prefer using prebuilt packages.

@thejohnfreeman
Copy link
Contributor Author

Going to close this issue as I accept @jcar87's explanation that this specific version is not supported. The recipes for supported versions have been updated. Hosting our own recipe revisions in our own remote is not an easy option, but it is the only one that would serve our CI use case (that always starts with a fresh machine and does not cache dependencies). It is on our roadmap.

@manuelnp I suggest you open a separate issue for your breakage.

@thejohnfreeman thejohnfreeman closed this as not planned Won't fix, can't repro, duplicate, stale Feb 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants