-
Notifications
You must be signed in to change notification settings - Fork 993
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
initial draft of conan search_binary command #6933
Conversation
Started testing this now @solvingj
to trigger build missing, that works:
So inconsitency there. Second, same with Then onto actual use case.
Good luck. |
This is a draft that we will consider to improve for new Conan 2.0. There is no inconsistency, but the error message should be raising that |
👍 It is certainly inconsistent with
@fulara @sztomi @dzolee @Marcin-Radecki the major question here is: is the output reasonably close to what you imagined, and suitable for the process of debugging a missing |
@memsharded the original description of the work states clearly:
And as I've shown above it is not the case. based on reading that statement I expected it to be a drop in command for the same place where I invoked the @solvingj unfortunatelly with the output of the command at the moment I am not able to say whether the output of the command would fulfill my needs. re 2) Going by conan approved way there is no way to change requires when invoking the At the moment search_binary does not provide any ability to improve my workflow. |
From my point of view, this would be useful even if it wasn't 100% compatible with the install invocation (that certainly helps though). Very grateful that you are tackling this @solvingj ! |
I like the UI with the colors and the concept of distance. If there's a way to make it more compact as a table that would be great, though you might need to go to HTML for that. Ideally you would use pass both reference and path_to_conanfile to pull to get the options that are set in the Conanfile, so you don't have to figure them out and pass then to this command. That would be a hybrid of what @fulara is proposing but limited to one reference to diagnose at a time. If you did a drop-in replacement for |
@sourcedelica thanks for the feedback. There are many ways to approach improving the experience of dealing with this error. Please let us know if you think that this approach of a command which takes arguments mirroring the command that fails and provides a heuristic list of results in the terminal sorted by distance is intuitive and improves the experience of diagnosing the error in a straightforward way for cases you've had. @fulara pointed out some potential bugs in the implementation under certain conditions, so obviously assume that all those bugs were worked out and the arguments and results were always as described and demonstrated in the example. |
Yes - it would be very useful as it stands. Just painting the old bikeshed above :) |
|
@derived-coder good questions.
Timing: This draft was submitted while Conan 2.0 was just starting to be developed, and all hands needed to be devoted to it. It just didn't make sense to add such a significant new feature under the 1.0 CLI at that time. Also, there was a lot of optimism about the new feature of "Custom Commands" , but it was unclear how it would pan out and what it's use-cases might be. Since this feature is in some ways a "wrapper" with extra processing around the existing search command, perhaps it could be left out of Conan core and implemented as a custom command. That still might be the decision. Cost: This feature is actually very "expensive". This is because it requires somewhat tight coupling to details about how profiles, settings, and options are implemented, and those are things that have been in significant flux due to the changes in the cross compilation model over the past 4 years. If it had been implemented, it would have broken every time they made a major change and need to be seriously refactored, and that would have annoyed a lot of people, and complicated new feature discussions. Again, it was just a bad time to add this feature. As much as I was excited for this feature, it was not the right time. |
This PR became obsolete, all the internal classes and architecture it is following has changed a lot in the already released 2.0-alpha. Good news is that Conan 2.0 features a PythonAPI and a user-commands framework. Implementing and maintaining any custom binary search with that will be trivial, and we will reconsidering something like this after 2.0 (2.X), but at the moment it is better to close this PR, as the new solution will be architecturally very different. |
Changelog: Feature: Add conan search_binary command which takes "conan install" arguments and identifies binaries which are exact or close matches. #4089 #6770 #6364
Docs: https://github.com/conan-io/docs/pull/XXXX
Note: Waiting to add docs until this feature until implementation has been reviewed.
#3316
#4089
#6770
#6364
Based upon the feature requests, this command's arguments supports all the same arguments as
conan install
(settings
,options
,profiles
, etc). It has a few extra arguments related to the search results.Here is an example of the command usage, using my default profile just as
conan install
would:conan search_binary bzip2/1.0.8@ -r conan-center --closest-match --limit 3
The "effective configuration" is also resolved in the same way as
conan install
, including the traversal of the entire dependency graph. This resolved configuration is printed at the start of the output for reference.Similar to
conan search
, this command will only look in local cache by default, unless-r
/--remote
is passed.Here is a preview of the ouptut of the above command.
We are looking for as much feedback on this command as possible from as many users as possible. Thanks in advance!
develop
branch, documenting this one.Note: By default this PR will skip the slower tests and will use a limited set of python versions. Check here how to increase the testing level by writing some tags in the current PR body text.