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] How to develop conan 2.0 packages skipping steps (like source) #13584

Closed
1 task done
gabeblack opened this issue Mar 31, 2023 · 6 comments
Closed
1 task done
Assignees

Comments

@gabeblack
Copy link
Contributor

What is your question?

It seems that with conan 2.0, developing packages differs from conan 1.0. With conan 1.0, you can run conan create and skip steps like the source step, build step, etc. and you get reproducible results from running the conan create command with and without skipping steps.

Conan 2.0 seems to have removed the feature to allow you to skip steps with conan create and now you have to use the steps conan source , conan install, conan build, etc. However, those do not do the same thing as conan create. Specifically, conan create will put the exported sources in the same location as the sources for building whereas it seems conan source does nothing?

How do I develop a recipe targeted for conan create? I want to skip the source step because that step takes a very long time and I don't want to run the separate steps for conan source, conan build, conan install, etc, only to find that conan create behaves differently and stages the files differently.

Have you read the CONTRIBUTING guide?

  • I've read the CONTRIBUTING guide
@memsharded memsharded self-assigned this Mar 31, 2023
@memsharded
Copy link
Member

Conan 2.0 seems to have removed the feature to allow you to skip steps with conan create and now you have to use the steps conan source , conan install, conan build, etc. However, those do not do the same thing as conan create. Specifically, conan create will put the exported sources in the same location as the sources for building whereas it seems conan source does nothing?

Conan 2.0 with the layout() and the new generate() can achieve much better reproducibility in the user folders than 1.X. Actually, with Conan 2.0 conan build you can achieve exactly the same build that you get in the cache with conan create, and there were cases in 1.X that it was not true. Even more, with Conan 2.0, doing conan install + cmake --preset or cmake -DCMAKE_TOOLCHAIN=conan_toolchain.cmake can also achieve the exact same build that is done in the cache, and this was practically impossible in Conan 1.X

Writing the correct layout() is important. You can try the new local flow with the conan new cmake_lib -d name=pkg -d version=0.1 in Conan 2.0, then run the different commands, then finally conan create.

@memsharded
Copy link
Member

Btw, to optimize the download of the sources Conan 2.0.3 will include a backup and caching sources mechanism, so the sources will only be downloaded from server once (and they can be backuped in your own private server too)

@frogarian
Copy link

Btw, to optimize the download of the sources Conan 2.0.3 will include a backup and caching sources mechanism, so the sources will only be downloaded from server once (and they can be backuped in your own private server too)

@memsharded this sounds very interesting, can you provide some reference of how to use this feature?

@memsharded
Copy link
Member

@memsharded this sounds very interesting, can you provide some reference of how to use this feature?

Not yet. We have decided to not publicly document it yet, because we are going to deploy it first ourselves in ConanCenter, test it, etc, and we will document it after. If you want to check the main PR was this one: #13461

@frogarian
Copy link

@memsharded this sounds very interesting, can you provide some reference of how to use this feature?

Not yet. We have decided to not publicly document it yet, because we are going to deploy it first ourselves in ConanCenter, test it, etc, and we will document it after. If you want to check the main PR was this one: #13461

Thanks for the quick reply. This looks like the exact feature we were looking for.

@memsharded
Copy link
Member

I think this ticket was responded and there were no further questions, so it can be closed.

The "backup-sources" feature is being now tested, so hopefully can be publicly documented soon, keep tuned to our blog, we will announce it there.

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

3 participants