-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Merged
conan-center-bot
merged 3 commits into
conan-io:master
from
remiburtin:package/libgit2-regex-backend
Jan 4, 2021
Merged
Changes from 1 commit
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -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"], | ||||||||||||||||||||||
} | ||||||||||||||||||||||
default_options = { | ||||||||||||||||||||||
"shared": False, | ||||||||||||||||||||||
|
@@ -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 commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||||||||
} | ||||||||||||||||||||||
|
||||||||||||||||||||||
@property | ||||||||||||||||||||||
|
@@ -84,6 +86,10 @@ def requirements(self): | |||||||||||||||||||||
self.requires("mbedtls/2.16.3-gpl") | ||||||||||||||||||||||
if tools.is_apple_os(self.settings.os) and self.options.with_iconv: | ||||||||||||||||||||||
self.requires("libiconv/1.16") | ||||||||||||||||||||||
if self.options.with_regex == "pcre": | ||||||||||||||||||||||
self.requires("pcre/8.44") | ||||||||||||||||||||||
elif self.options.with_regex == "pcre2": | ||||||||||||||||||||||
self.requires("pcre2/10.35") | ||||||||||||||||||||||
|
||||||||||||||||||||||
def source(self): | ||||||||||||||||||||||
tools.get(**self.conan_data["sources"][self.version]) | ||||||||||||||||||||||
|
@@ -124,6 +130,9 @@ def _configure_cmake(self): | |||||||||||||||||||||
cmake.definitions["BUILD_EXAMPLES"] = False | ||||||||||||||||||||||
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 commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||||||||
cmake.definitions["STATIC_CRT"] = "MT" in str(self.settings.compiler.runtime) | ||||||||||||||||||||||
|
||||||||||||||||||||||
|
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.
What is the default?
builtin
?Using
default
is ambiguous. Usebuiltin
instead.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 asbuiltin
. Maybedefault
isn't very appropriate. What do you think aboutauto
?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 tobuiltin
,pcre
orpcre2
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 conanpcre
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 thecmake
recipe instead (for the ssl backend).It has an
auto
option that aliases towinssl
on Windows andopenssl
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.