-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
protobuf: simplify test package #23573
protobuf: simplify test package #23573
Conversation
I detected other pull requests that are modifying protobuf/all recipe:
This message is automatically generated by https://github.com/ericLemanissier/conan-center-conflicting-prs so don't hesitate to report issues/improvements there. |
@sophieeihpos @valgur This should help with missing binaries problems we've seen in other PRs |
|
||
int main() | ||
{ | ||
std::cout << "Bincrafters\n"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😥
I'm not a fan of the removing the protobuf-specific function calls in CMake. Their correct functioning is not a given for Conan, where the corresponding CMake modules must be explicitly handled in I updated my PR with the above approach: 02fbd30
Huh. I really appreciate the background info on the build-context requirements failures. Thanks! |
We are currently working on a redesign of the CI pipeline that will take this into account - especially for any package that has a
I'm not sure where the mindset comes from, since that was never the intended purpose of test_packages in Conan.
Anything beyond this is tends to be unnecessary, and is well beyond the scope of what we do in Conan Center: we very explicitly do not want to test the functionality - we want to ensure it builds correctly, and that it can be consumed. As for this PR, I'm confident that it satisfies the 5 points I mention above. And I'm happy to talk to the team and amend documentation if this needs to be clarified. The only one that would be in question is
your proposed approach is likely to fail when you are cross-building protobuf: you are forcing CMake to execute, at build time, the |
A couple of added points:
It is the longstading opinion of the team that test packages like this were already an anti-pattern and against our originally intended best practice.
I've added a comment in the line explaining why If we are concerned that the logic inside |
While, yes, the small test snippets act as a light usage example for the packaged library, that's not at all what I meant. That part is abundantly clear to me by now. It was about the test_package as a usage example for a consuming recipe. The case of having to use a package as both a
I assume you mean the source code in this test_package? Or something else? I don't honestly see what's overly or needlessly complicated in this test_package, tbh? Dropping a couple of lines from the .cpp file is pretty meaningless for a library that takes more than ten minutes to build.
Oh. Good point. Thanks! Might be able to check |
I meant to say, the test package is meant to test the package reference that was just built (during conan create), and not two different package IDs for the same recipe. Either one (as a i'm confident what Im proposing in this PR tests both - if you test the executable of a normal requires, it also acts a proxy for testing it when it is consumed as a tool_requires. |
One of the things we are trying to do is centralise the aspect of "show how it is consumed" in the Conan Center website: e.g. https://conan.io/center/recipes/zlib. At the moment we try to show a best effort in terms of consuming recipes - but we want to add the ability to customise what is visible for each recipe - protobuf is a good example where it would be useful to show how to use the dual requirements. |
Conan v1 pipeline ✔️All green in build 4 (
Conan v2 pipeline ✔️
All green in build 3 (
|
* protobuf: simplify test package * remove test_v1_package
Well, this PR exposes this recipe to regressions. protobuf provides custom cmake macros, which have to be specially handled in this recipe to work properly for consumers, and it's not tested anymore. |
Simplify
test_package
for protobuf such that the only tested reference is the one that was just built.conan graph build-rder
does not take into consideration the build order from thetest_package
, and forcing a build order in our CI pipeline is very suboptimal (we want to build packages in parallel as much as possible, if resources allow).The logic is the one that we should follow in all test_packages: the minimal test such that we ensure what we just built works - it was never meant to be comprehensive nor complex.
Also remove
test_v1_package
, as there is no point in backporting the changes to it.