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

"conan art:build-info upload" is using wrong file path and fails #119

Open
AndreyGranovsky opened this issue Mar 14, 2024 · 3 comments
Open
Assignees
Labels

Comments

@AndreyGranovsky
Copy link

When using the "conan art:build-info upload", according to the documentation, we should provide the repository where the packages were uploaded in Artifactory (which is not the same one as the Conan remote name, which is a virtual repository).

Once we run the "conan art:build-info upload" command, it fails due to the package not being found as it is not stored in the virtual repository location (please note that adding properties is supported only for local and local-cache repositories). This occurs because, during the build upload process, it attempts to use the path of the virtual repository rather than the local repository where the packages were initially uploaded. For example:
image

@danimtb
Copy link
Member

danimtb commented Mar 15, 2024

hi @AndreyGranovsky, thanks for the report.

Indeed, virtual and remote repositories in Artifactory work a bit different and they are not so tested from our side.

Have you tried the local Artifactory repository to create the build info instead of the virtual one?
That might solve the issue.

Thanks

@AndreyGranovsky
Copy link
Author

Hi @danimtb,
The Conan remote that is configured is a Virtual repository on Artifactory that contains a local+remote repositories.

During the "conan art:build-info create" a local repository was passed under the parameter, as the artifacts were uploaded to this repository. However, when running "conan art:build-info create" the command searches under the path of the Virtual repository not the local, and fails.

@czoido czoido self-assigned this Mar 19, 2024
@czoido
Copy link
Contributor

czoido commented Mar 19, 2024

Hi @AndreyGranovsky,

Thanks for reporting. I have been checking this and apparently it works fine for me as long as I pass the local repository to the art:build-info commands. I'm providing here the instructions for a minimal working example with the BuildInfo, can you check if there are any steps that you are doing in a different way?

This is what I did:

  • I have a virtual repo with a remote + local
  • The local repo name in conan is develop, the repo name in Arfifactory is conan-local. So I did:
conan remote add develop http://localhost:8081/artifactory/api/conan/conan-local

# create a package with a dependency for the build info
mkdir liba
cd liba
conan new cmake_lib -d name=liba -d version=1.0
cd ..
mkdir mypkg 
cd mypkg
conan new cmake_lib -d name=mypkg -d version=1.0 -d requires=liba/1.0
cd ..

# start with a clean repo
conan remove "*" -r=develop -c
conan remove "liba*" -c
conan remove "mypkg*" -c

conan create liba -s build_type=Release --build="liba*"
conan upload "liba*" -r=develop -c

# this is just to ensure that it will check for the liba info in the repo
conan remove "liba*" -c

conan create mypkg --format=json -s build_type=Release --build="mypkg*" -r=develop > create_release.json
conan upload "mypkg*" -r=develop -c

# IMPORTANT! It's very important to pass there conan-local, that is the name of the repo in artifactory 
# and will provide the path to set the property, not develop (that is the name of the conan remote)

conan art:build-info create create_release.json release_build 1 conan-local --url=http://localhost:8081/artifactory --user=admin --password=password --with-dependencies > release_build.json

conan art:build-info upload release_build.json --url=http://localhost:8081/artifactory --user=admin --password=password

# the BuildInfo is uploaded fine

Could you please check?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants