Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 think this should be moved to
build
and changed in a check: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.
Makes more sense!
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 disagree, because
build()
is not always called, and you probably want that recipe works out of the box.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.
Then the check should (also) be called in
package_info
.The options of
libcurl
are available and it will always be run on consumption.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.
Yes maybe, but anyway I believe that upstream option should be forced if it's a strong requirement of this recipe. What happen if default option of libcurl is not
with_ssl = openssl
? No binary is produced in CCI? Downstream recipes shouldn't rely on upstream default options.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.
Forcing of options is not correct as it will override a user passing e.g.
-o libcurl:with_ssl="gnutls"
. This is surprising behavior for a user.It's better to tell the user that he is wrong about an option then to override it.
Let's not treat the user as an idiot.
This recipe is not relying on libcurl default options as it actively checks the option.
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.
It's even more surprising for a user to have a recipe not building with its default options. This recipe relies on libcurl default option (which is not openssl on Macos by the way) to build out of the box.
If you just launch
conan install somerecipe/x.x.x
and it raises because of some options in transitive dependencies, it's quite surprising.Depending on recipe design, an option could be a feature, or a component which could has been its own recipe.
In conan 2.0, precedence of values should change conan-io/conan#7786
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.
@SpaceIm
Agreed it's not fun for a user when it doesn't work out-of-the box (which it does at the moment), but forcing will ultimately cause problems when 2 recipes require the opposite. As long as the error message is actionable by the user, (s)he isn't puzzled by weird compiler errors.
Thanks for the link to the conan issue.
The proposed
validate
function is nice to write the checks for options of dependencies in only one place instead, but will not solve the matter of (forcing of) default options, I think.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.
On the same topic:
libcurl
recipe (without and withwith_ssl
option): the default value for ssl lib on Macos isdarwinssl
with_openssl=True
didn't have any effect whendarwin_ssl
was already True (which was the case for default options, it waswith_openssl=True
anddarwin_ssl=True
), and on Macos darwin_ssl always had precedence in old design. So CPR was somehow broken on Macos, if openssl is strictly required.with_ssl =openssl
will indeed force usingopenssl
inlibcurl
. But it's not the default value on Macos, so there is no pre build binaries in CCI for such package ids.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.
Okay, let's keep forcing option.