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] CMake version in Conan v1/v2 Pipeline #21358

Closed
utelle opened this issue Nov 25, 2023 · 6 comments
Closed

[question] CMake version in Conan v1/v2 Pipeline #21358

utelle opened this issue Nov 25, 2023 · 6 comments
Labels
question Further information is requested

Comments

@utelle
Copy link
Contributor

utelle commented Nov 25, 2023

What is your question?

I tried to add a new recipe in PR #21354. However, some checks for the Conan v1/v2 Pipeline fail, because my recipe asks for CMake version 3.24, but only CMake version 3.15.7 is provided by the pipeline.

I could try to downgrade the requirements of my project, but IMHO the better approach would be to upgrade the version used by the Conan Pipeline.

How should I proceed with the recipe for my project?

Then the Conan v1 Pipeline fails, because my recipe asks for Conan version >= 2.0. I don't see this as an error in my recipe, because recipes should be using Conan version 2.0, shouldn't they?

@utelle utelle added the question Further information is requested label Nov 25, 2023
@SpaceIm
Copy link
Contributor

SpaceIm commented Nov 25, 2023

because my recipe asks for CMake version 3.24, but only CMake version 3.15.7 is provided by the pipeline.

Add:

def build_requirements(self):
    self.tool_requires("cmake/[>=3.24 <4]")

recipes should be using Conan version 2.0, shouldn't they?

conancenter recipes must be compatible with conan v1 and conanv2, and there is no reason to use such high min version in your conanfile, it can work with conan>=1.53.0

@utelle
Copy link
Contributor Author

utelle commented Nov 25, 2023

because my recipe asks for CMake version 3.24, but only CMake version 3.15.7 is provided by the pipeline.

Add:

def build_requirements(self):
    self.tool_requires("cmake/[>=3.24 <4]")

Thanks for the information. I had to add it in 2 places (library and test), but now it seems to work. As of this writing the Conan v2 Pipeline check is still running.

recipes should be using Conan version 2.0, shouldn't they?

conancenter recipes must be compatible with conan v1 and conanv2,

Must??? This is ridiculous, because this effectively forbids to use any conanv2-only features.

and there is no reason to use such high min version in your conanfile, it can work with conan>=1.53.0

I tried to change the conan version requirement accordingly, but the Conan v1 Pipeline still fails, now with this error message:

[HOOK - conan-center.py] pre_export(): ERROR: [CONANDATA.YML FORMAT (KB-H030)] Exception raised from hook: 'bool' object is not iterable (type=TypeError) (https://github.com/conan-io/conan-center-index/blob/master/docs/error_knowledge_base.md#KB-H030-CONANDATA.YML-FORMAT) 
ERROR: [HOOK - conan-center.py] pre_export(): 'bool' object is not iterable

The information in the knowledge base didn't help me to understand what I should do to get rid of this error. It seems to be a version 1 issue, because the Conan v2 Pipeline didn't complain.

@SpaceIm
Copy link
Contributor

SpaceIm commented Nov 26, 2023

recipes should be using Conan version 2.0, shouldn't they?

conancenter recipes must be compatible with conan v1 and conanv2,

Must??? This is ridiculous, because this effectively forbids to use any conanv2-only features.

What kind of conanv2-only feature do you have in mind? Even if there was a specific feature not available in conan v1, a recipe can conditionally use a feature depending on conan client version.

and there is no reason to use such high min version in your conanfile, it can work with conan>=1.53.0

I tried to change the conan version requirement accordingly, but the Conan v1 Pipeline still fails, now with this error message:

[HOOK - conan-center.py] pre_export(): ERROR: [CONANDATA.YML FORMAT (KB-H030)] Exception raised from hook: 'bool' object is not iterable (type=TypeError) (https://github.com/conan-io/conan-center-index/blob/master/docs/error_knowledge_base.md#KB-H030-CONANDATA.YML-FORMAT) 
ERROR: [HOOK - conan-center.py] pre_export(): 'bool' object is not iterable

The information in the knowledge base didn't help me to understand what I should do to get rid of this error. It seems to be a version 1 issue, because the Conan v2 Pipeline didn't complain.

I've left some reviews in your PR. v1 pipeline runs several hooks which have not been ported yet to v2 pipeline. It allows to catch mistakes in packages or practices forbidden in conancenter.

@utelle
Copy link
Contributor Author

utelle commented Nov 26, 2023

conancenter recipes must be compatible with conan v1 and conanv2,
Must??? This is ridiculous, because this effectively forbids to use any conanv2-only features.

What kind of conanv2-only feature do you have in mind?

I don't have anything specific in mind. My expectation is that I get a valid recipe if I follow the v2 documentation, without having to check whether something might or might not work in a v1 recipe.

I've left some reviews in your PR. v1 pipeline runs several hooks which have not been ported yet to v2 pipeline. It allows to catch mistakes in packages or practices forbidden in conancenter.

I applied your suggested changes and ... 💥 ... v1 pipeline fails again ...

[HOOK - conan-center.py] pre_export(): ERROR: [NO AUTHOR (KB-H037)] Conanfile should not contain author. Remove 'author = "utelle(GitHub)"' (https://github.com/conan-io/conan-center-index/blob/master/docs/error_knowledge_base.md#KB-H037-NO-AUTHOR) 
[HOOK - conan-center.py] pre_export(): ERROR: [NO FINAL ENDLINE (KB-H041)] File '/home/conan/w/prod-v1_cci_PR-21354/recipes/sqlite3mc/all/test_package/CMakeLists.txt' does not end with an endline (https://github.com/conan-io/conan-center-index/blob/master/docs/error_knowledge_base.md#KB-H041-NO-FINAL-ENDLINE) 
ERROR: [HOOK - conan-center.py] pre_export(): Some checks failed running the hook, check the output

The recipe was developed with Conan v2 (as the Conan website recommends AFAICR) and it worked (after a few minor modifications). And now I'm the "bad guy" if I request v2 in the recipe?

@SpaceIm
Copy link
Contributor

SpaceIm commented Nov 26, 2023

v1 pipeline fails because it runs some hooks which have not been ported to v2 pipeline as I already explained. There errors are orthogonal to conan version, it turns out that they are detected in v1 pipeline because conan team didn't have the time to migrate these checks to v2 pipeline.
Just fix them, it's easy (remove author field and add final endline in CMakeLists.txt).

@utelle
Copy link
Contributor Author

utelle commented Nov 26, 2023

v1 pipeline fails because it runs some hooks which have not been ported to v2 pipeline as I already explained. There errors are orthogonal to conan version, it turns out that they are detected in v1 pipeline because conan team didn't have the time to migrate these checks to v2 pipeline. Just fix them, it's easy (remove author field and add final endline in CMakeLists.txt).

Done. Finally, both pipelines succeeded.

@utelle utelle closed this as completed Nov 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants