-
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
libgit2/1.0.1: add an option to specify the regex backend to use #3685
libgit2/1.0.1: add an option to specify the regex backend to use #3685
Conversation
All green in build 1 (
|
recipes/libgit2/all/conanfile.py
Outdated
@@ -22,6 +22,7 @@ class LibGit2Conan(ConanFile): | |||
"with_https": [False, "openssl", "mbedtls", "winhttp", "security"], | |||
"with_sha1": ["collisiondetection", "commoncrypto", "openssl", "mbedtls", "generic", "win32"], | |||
"with_ntlmclient": [True, False], | |||
"with_regex": ["default", "builtin", "pcre", "pcre2"], |
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.
What is the default? builtin
?
Using default
is ambiguous. Use builtin
instead.
"with_regex": ["default", "builtin", "pcre", "pcre2"], | |
"with_regex": ["builtin", "pcre", "pcre2"], |
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.
Thank you for the review. In fact, this is how libgit2 works: https://github.com/libgit2/libgit2/blob/v1.0.1/src/CMakeLists.txt#L107-L157
default
doesn't have the same behavior as builtin
. Maybe default
isn't very appropriate. What do you think about auto
?
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.
Thanks for the link.
If I read it correctly, then auto
will result in a package equal to builtin
, pcre
or pcre2
depending on the build machine.
I don't think auto
will give us reproducible packages.
Maybe the safest would be to set the default to pcre
, as we have a conan package for it.
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 see. The builtin backend is pcre
. But as you said, it may be preferable to set the default to conan pcre
so that the dependency is explicit.
Originaly, I made default
\ auto
the default option so that the actual behavior isn't changed (withtout thinking about build reproductibility).
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.
What you can do instead, is keep the auto
option and do something like the cmake
recipe instead (for the ssl backend).
It has an auto
option that aliases to winssl
on Windows and openssl
on others.
This requires some knowledge of you (=the recipe editor) to know what option is selected on the different platforms.
By reading the c3i build logs on clang@Linux, gcc@Linux, clang@Macos and MSVC@Windows, you can deduce what default options is selected on each platform.
recipes/libgit2/all/conanfile.py
Outdated
@@ -32,6 +33,7 @@ class LibGit2Conan(ConanFile): | |||
"with_https": "openssl", | |||
"with_sha1": "collisiondetection", | |||
"with_ntlmclient": True, | |||
"with_regex": "default", |
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.
"with_regex": "default", | |
"with_regex": "builtin", |
recipes/libgit2/all/conanfile.py
Outdated
cmake.definitions["USE_HTTP_PARSER"] = "system" | ||
|
||
if self.options.with_regex != "default": | ||
cmake.definitions["REGEX_BACKEND"] = self.options.with_regex | ||
|
||
if self.settings.compiler == "Visual Studio": |
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.
cmake.definitions["USE_HTTP_PARSER"] = "system" | |
if self.options.with_regex != "default": | |
cmake.definitions["REGEX_BACKEND"] = self.options.with_regex | |
if self.settings.compiler == "Visual Studio": | |
cmake.definitions["USE_HTTP_PARSER"] = "system" | |
cmake.definitions["REGEX_BACKEND"] = self.options.with_regex | |
if self.settings.compiler == "Visual Studio": |
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.
Thanks for your contribution, please @remiburtin, follow MadeBR's suggestions.
Sorry for the delay. |
All green in build 3 (
|
@uilianries This is the oldest PR you are blocking, the changes you requested have been applied, if you have a change to take a second look that would be appreciated as always! It has sufficient reviews otherwise
|
@prince-chrismc Thank you for pinging me! |
You are very welcome! 🤗 You can take a peek at prince-chrismc/conan-center-index-pending-review#1 there's three others you are blocking. |
Specify library name and version: libgit2/1.0.1
conan-center hook activated.
Since version 1.0, libgit2 expose an option to specify the regex backend to use. This option isn't currently exposed in the conan recipe.