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

[question] freshly created conan package not in local cache #13881

Closed
1 task done
hoisunng opened this issue May 12, 2023 · 3 comments
Closed
1 task done

[question] freshly created conan package not in local cache #13881

hoisunng opened this issue May 12, 2023 · 3 comments
Assignees
Milestone

Comments

@hoisunng
Copy link

What is your question?

I'm in the process of updating our recipes to conan2 and managed to successfully create the first package according to the output.

$ conan --version
Conan version 2.0.4
$ conan create . --profile:build=clang14 --profile:host=clang14
...
: package(): Packaged 4 '.cmake' files: IrisConfigVersion.cmake, IrisTargets.cmake, IrisConfig.cmake, IrisTargets-release.cmake
iris/0.4.0-1-ga54a15b
: Created package revision 5f9e3ae018a0659b50c4cd6a5d302e9c
iris/0.4.0-1-ga54a15b
: Package 'a223068c264d55f14da7fec81f7c30c9e1ab6883' created
iris/0.4.0-1-ga54a15b
: Full package reference: iris/0.4.0-1-ga54a15b
#65b3954f77030e40540c4af5f80d5379:a223068c264d55f14da7fec81f7c30c9e1ab6883#5f9e3ae018a0659b50c4cd6a5d302e9c
...
======== Testing the package: Executing test ========
iris/0.4.0-1-ga54a15b
 (test package): Running test()
iris/0.4.0-1-ga54a15b
 (test package): RUN: ./test_package

The test_package method successfully builds and links with my library, so I suspected all is well.
However when I try to consume the package from another project it doesn't work.
Here the project is freshly created with conan new and I only added my package to the requirements function.

$ conan install . --profile:build=clang14 --profile:host=clang14 --output-folder=build

======== Input profiles ========
Profile host:
[settings]
arch=x86_64
build_type=Release
compiler=clang
compiler.cppstd=gnu20
compiler.libcxx=libstdc++11
compiler.version=14
os=Linux
[conf]
tools.cmake.cmaketoolchain:generator=Ninja
[buildenv]
CC=/home/hoisun/.conan/data/clang/14.0.4/user/stable/package/f153394db194e4f468f20116e911379c34a765b0/bin/clang
CXX=/home/hoisun/.conan/data/clang/14.0.4/user/stable/package/f153394db194e4f468f20116e911379c34a765b0/bin/clang++

Profile build:
[settings]
arch=x86_64
build_type=Release
compiler=clang
compiler.cppstd=gnu20
compiler.libcxx=libstdc++11
compiler.version=14
os=Linux
[conf]
tools.cmake.cmaketoolchain:generator=Ninja
[buildenv]
CC=/home/hoisun/.conan/data/clang/14.0.4/user/stable/package/f153394db194e4f468f20116e911379c34a765b0/bin/clang
CXX=/home/hoisun/.conan/data/clang/14.0.4/user/stable/package/f153394db194e4f468f20116e911379c34a765b0/bin/clang++


======== Computing dependency graph ========
iris/0.4.0-1-ga54a15b: Not found in local cache, looking in remotes...
iris/0.4.0-1-ga54a15b: Checking remote: conancenter
iris/0.4.0-1-ga54a15b: Checking remote: artifactory
Graph root
    conanfile.py (test/1.0): /home/hoisun/work/test/conanfile.py
ERROR: Package 'iris/0.4.0-1-ga54a15b' not resolved: Unable to find 'iris/0.4.0-1-ga54a15b' in remotes.

And also conan list does not seem to find anything (I suspected it may have to do with the unusual version string, so I made a conventional one as well without success).

$ conan list iris
Local Cache
  iris
    iris/0.4.0-1-ga54a15b

    iris/0.4.1

$ conan list iris/0.4.0-1-ga54a15b
Local Cache
  iris
    iris/0.4.0-1-ga54a15b

$ conan list iris/0.4.0-1-ga54a15b#*
Local Cache
  WARN: There are no matching recipe references
$ conan list iris/0.4.1#*
Local Cache
  WARN: There are no matching recipe references
$ conan list gtest/1.12.1#*
Local Cache
  gtest
    gtest/1.12.1
      revisions
        325be79afab00cf25ea1bac1a8e74c84 (2023-02-14 22:08:33 UTC)

I hope you could give me some hints where to start looking for the problem, because I'm out of ideas.

Have you read the CONTRIBUTING guide?

  • I've read the CONTRIBUTING guide
@memsharded memsharded self-assigned this May 12, 2023
@memsharded memsharded added this to the 2.0.5 milestone May 12, 2023
@memsharded
Copy link
Member

Hi @hoisunng

Thanks for your report.
I think this is very related to an improvement introduced recently, that will be released in next 2.0.5: #13870

Line endings in version field were not being raised as an error, so they could slip into the version definition, and this is the reason it cannot be found later. With Conan 2.0.5 it will be a clear error in the package creation step.

To fix it now, you should be making sure that your version field, which is most likely defined dynamically via set_version or in command line, does not contain a final \n

@hoisunng
Copy link
Author

Adding strip to the output of git describe indeed solved the problem.
Thank you very much! @memsharded

I'm glad this will be improved in the next version, so that I will be warned of such silly mistakes.

@memsharded
Copy link
Member

Yeah, Conan 2.0.X releases contains a lot of this kind of small improvements, so make sure to keep updating. Thanks!

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

2 participants