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

[aws-crt-cpp] aws-crt-cpp/0.17.23: Builds fails due to using aws-c-common component that no longer exists #17382

Closed
camm73 opened this issue May 3, 2023 · 12 comments · Fixed by #17120
Labels
bug Something isn't working

Comments

@camm73
Copy link
Contributor

camm73 commented May 3, 2023

Description

When including aws-crt-cpp/0.17.23 as a requirement in a conanfile, the conan install command fails with the error:

Error in generator 'CMakeDeps': error generating context for 'aws-crt-cpp/0.17.23': Component 'aws-c-common::aws-c-common-lib' not found in 'aws-c-common' package requirement

Looking at the aws-c-common recipe, there was a commit last week which removed the aws-c-common-lib component: 430521e

However, the aws-crt-cpp recipe still references this component:

"aws-c-common::aws-c-common-lib",

Package and Environment Details

  • Package Name/Version: aws-crt-cpp/0.17.23
  • Operating System+version: Linux Ubuntu 20.04.1
  • Compiler+version: GCC 9.4.0
  • Conan version: conan 1.58.0
  • Python version: Python 3.8.10

Conan profile

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

Steps to reproduce

conan install . -pr:b=default -pr:h=default was run with a custom conanfile that has a requirement aws-crp-cpp/0.17.23 and is using the cmake and CMakeDeps generators

Logs

Click to expand log
conanfile.py (custom-recipe/None): ERROR: Traceback (most recent call last):
  File "/usr/local/lib/python3.8/dist-packages/conan/tools/cmake/cmakedeps/templates/__init__.py", line 42, in render
    context = self.context
  File "/usr/local/lib/python3.8/dist-packages/conan/tools/cmake/cmakedeps/templates/target_data.py", line 32, in context
    components = self._get_required_components_cpp()
  File "/usr/local/lib/python3.8/dist-packages/conan/tools/cmake/cmakedeps/templates/target_data.py", line 173, in _get_required_components_cpp
    public_comp_deps.append(self.get_component_alias(req, cmp_name))
  File "/usr/local/lib/python3.8/dist-packages/conan/tools/cmake/cmakedeps/templates/__init__.py", line 98, in get_component_alias
    raise ConanException("Component '{name}::{cname}' not found in '{name}' "
conans.errors.ConanException: Component 'aws-c-common::aws-c-common-lib' not found in 'aws-c-common' package requirement
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/dist-packages/conans/client/generators/__init__.py", line 187, in write_generators
    generator.generate()
  File "/usr/local/lib/python3.8/dist-packages/conan/tools/cmake/cmakedeps/cmakedeps.py", line 48, in generate
    generator_files = self.content
  File "/usr/local/lib/python3.8/dist-packages/conan/tools/cmake/cmakedeps/cmakedeps.py", line 90, in content
    self._generate_files(require, dep, ret, find_module_mode=False)
  File "/usr/local/lib/python3.8/dist-packages/conan/tools/cmake/cmakedeps/cmakedeps.py", line 103, in _generate_files
    ret[data_target.filename] = data_target.render()
  File "/usr/local/lib/python3.8/dist-packages/conan/tools/cmake/cmakedeps/templates/__init__.py", line 44, in render
    raise ConanException("error generating context for '{}': {}".format(self.conanfile, e))
conans.errors.ConanException: error generating context for 'aws-crt-cpp/0.17.23': Component 'aws-c-common::aws-c-common-lib' not found in 'aws-c-common' package requirement
ERROR: Error in generator 'CMakeDeps': error generating context for 'aws-crt-cpp/0.17.23': Component 'aws-c-common::aws-c-common-lib' not found in 'aws-c-common' package requirement
Conan installation failed. Exitting...
@camm73 camm73 added the bug Something isn't working label May 3, 2023
@jiaoew1991
Copy link
Contributor

+1

@SpaceIm
Copy link
Contributor

SpaceIm commented May 4, 2023

Will be fixed by #17120

@kwach
Copy link
Contributor

kwach commented May 5, 2023

this also impacts: s2n, aws-c-io, aws-c-compression, aws-c-http, aws-c-sdkutils, aws-c-auth

aws-c-io, aws-c-compression, aws-c-http, aws-c-sdkutils, aws-c-auth look for aws-c-common::aws-c-common-lib and/or s2n::s2n-lib

@SpaceIm
Copy link
Contributor

SpaceIm commented May 5, 2023

Yes there is a PR for each impacted recipe to not depend anymore on component of these recipes.

#17125
#17120
#17118
#17118
#17111
#17110
#17109
#17108
#17107
#17104
#17100

@kwach
Copy link
Contributor

kwach commented May 6, 2023 via email

@mattubereckenpr
Copy link

mattubereckenpr commented May 28, 2023

A am running into this as well. We actually rolled back to Conan pre-2.0 due to so many common packages not working. Now it seems that the 2.0 changes have broken the older versions as well. I have tried using recipe revisions with no luck.
Is there any workaround?
Please help as the only one I can see is another package manager? Being totally dead in the water means I will find some way to make it work in very short order.

@kwach
Copy link
Contributor

kwach commented May 29, 2023

@mattubereckenpr Give recipe revisions one more go. It did fix it for me, however you need to remember to turn it on in global settings.

conan config set general.revisions_enabled=1

@SpaceIm
Copy link
Contributor

SpaceIm commented May 29, 2023

There is #17120, which is waiting other PRs, which are waiting team reviews for more than 1 month.

@gbiv
Copy link

gbiv commented Jun 2, 2023

  • aws-crt-cpp

@kwach , which revision did you pin to? I'm having a similar issue with aws-sdk-cpp and it's not very clear how to "rollback"

@kwach
Copy link
Contributor

kwach commented Jun 2, 2023

  • aws-crt-cpp

@kwach , which revision did you pin to? I'm having a similar issue with aws-sdk-cpp and it's not very clear how to "rollback"

That worked for me. I'm using S3, Transfers...

        aws-c-common/0.8.2@\#8dd59e177fd439e4ff7b845497a3cbd9
        aws-c-compression/0.2.15@\#890dd9907d09e3cb01b0a5996fcaad49
        aws-c-sdkutils/0.1.3@\#d19b8a23932e60d48cdbeb93973ceef9
        aws-checksums/0.1.13@\#59218957e8a84d5b13bce117c3ff4081
        s2n/1.3.31@\#77ce27df9f07d4d9be7dcb14d476aca0
        aws-sdk-cpp/1.9.234

@gbiv
Copy link

gbiv commented Jun 5, 2023

  • aws-crt-cpp

@kwach , which revision did you pin to? I'm having a similar issue with aws-sdk-cpp and it's not very clear how to "rollback"

That worked for me. I'm using S3, Transfers...

        aws-c-common/0.8.2@\#8dd59e177fd439e4ff7b845497a3cbd9
        aws-c-compression/0.2.15@\#890dd9907d09e3cb01b0a5996fcaad49
        aws-c-sdkutils/0.1.3@\#d19b8a23932e60d48cdbeb93973ceef9
        aws-checksums/0.1.13@\#59218957e8a84d5b13bce117c3ff4081
        s2n/1.3.31@\#77ce27df9f07d4d9be7dcb14d476aca0
        aws-sdk-cpp/1.9.234

I ended up having to pin to revisions that had required_conan_version < 1.50.x, specifically this for aws-c-common:

[requires]
aws-c-common/0.6.19#cf32a0cdd19ab356dfa6b6d579ed4bc6

and these others:

aws-c-compression/0.2.15#890dd9907d09e3cb01b0a5996fcaad49
aws-c-sdkutils/0.1.3#d19b8a23932e60d48cdbeb93973ceef9
aws-checksums/0.1.13#59218957e8a84d5b13bce117c3ff4081
aws-c-io/0.10.20#9699126d8889135fd1ac22bf097a26c9
aws-c-cal/0.5.13#c30befa067203a92cccdc94e39e8031e
...
libcurl/7.77.0#f1cb07d765d5c63804500a0c36580007
pulseaudio/14.2#9ce65adf8d2b0476ad46f88948cb1a67
s2n/1.3.31#77ce27df9f07d4d9be7dcb14d476aca0

It's possible that the version number could be higher but I started with the versions that worked in our previous build and looked for a package revision that allowed the service to build successfully.

@alanb-sony
Copy link

alanb-sony commented Aug 10, 2023

I made a script to reset the aws packages back to a certain date (note for conan 1)

#!/usr/bin/env python3
import subprocess
import argparse
import datetime
import tempfile
import json

parser = argparse.ArgumentParser()
parser.add_argument('--date', required=True)
parser.add_argument('recipes', nargs='+')

args = parser.parse_args()

max_date = datetime.date.fromisoformat(args.date)
recipes = args.recipes

temp_file = tempfile.mktemp()
for recipe in recipes:
    subprocess.check_call(['conan', 'search', '--revisions', '-r', 'conancenter', '-j', temp_file, recipe + "@"])
    with open(temp_file, 'r') as file:
        revisions = json.load(file)
        downloaded = False
        for revision in revisions:
            time = datetime.datetime.strptime(revision["time"], "%Y-%m-%dT%H:%M:%S.%f%z")
            rev = revision["revision"]
            if time.date() < max_date:
                print(f"downloading revision {rev} from {time} of {recipe}")
                subprocess.check_call(['conan', 'download', '-re', f"{recipe}@#{rev}"])
                downloaded = True
                break
        if not downloaded:
            raise Exception(f"unable to find revision for {recipe}")

Run it something like this:

./download_conan_rev.py --date 2023-04-01 \
  aws-c-common/0.6.19 aws-c-cal/0.5.13 \
  aws-c-http/0.6.13 \
  aws-c-compression/0.2.15 \
  aws-c-io/0.10.20 \
  s2n/1.3.15 \
  aws-crt-cpp/0.17.23 \
  aws-checksums/0.1.13 \
  aws-c-auth/0.6.11 \
  aws-c-sdkutils/0.1.3 \
  aws-c-s3/0.1.37 \
  aws-c-mqtt/0.7.10 \
  aws-c-event-stream/0.2.7

I'd recommend after doing this creating a lock file to stop further updates

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
Development

Successfully merging a pull request may close this issue.

7 participants