-
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
Add geographiclib/1.51 #4291
Add geographiclib/1.51 #4291
Conversation
Failure in build 1 (
|
36b80c6
to
ff5e8d8
Compare
Some configurations of 'geographiclib/1.51' failed in build 2 (
|
ff5e8d8
to
990252a
Compare
You have also to raise ConanInvalidConfiguration if version >= 1.51 and clang < 4 I guess. |
All green in build 3 (
|
I've added a |
No, because it prevents to build with compilers versions for which default C++ standard is not 11 or higher (and cppstd 11+ not set in profile), like gcc 4.9 or 5. cppstd check should be: if tools.Version(self.version) >= "1.51" and self.settings.compiler.get_safe("cppstd"):
tools.check_min_cppstd(self, 11) Then raise for specific compilers versions. |
You can adopt _min_compiler_version_default_cxx11 from the boost recipe |
990252a
to
e38bec0
Compare
Failure in build 4 (
|
e38bec0
to
81df2f5
Compare
Failure in build 5 (
|
"gcc": 6, | ||
"clang": 6, | ||
"Visual Studio": 14, # guess |
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.
"gcc": 6, | |
"clang": 6, | |
"Visual Studio": 14, # guess | |
"gcc": 4.9, | |
"clang": 6, | |
"Visual Studio": 14, # guess |
I'm able to build with gcc 4.9 and 5
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.
"gcc": 4.9 -> "gcc": 6.1
The default mode is C++98 for GCC versions prior to 6.1, and C++14 for GCC 6.1 and above.
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 supports C++11 even if it's not the 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.
it doesn't matter, the important thing is that it has only c++03 default mode.
Also c++11 support in gcc 4.9 is quite buggy. And anyway, what's the point of using almost EOL compiler?
- Use compiler.cppstd if set ( On CCI cppstd is not set anywhere)
- Use C++ standard compiler default mode, if cppstd not set
Upvote conan-io/conan#8304 :-)
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.
Most underlying build files of open source libraries don't follow default standard, they force any standard allowing to properly build if user didn't ask for a specific one.
So if cppstd is not set, I think that it should not be default standard of the compiler, but any standard supported by the compiler and allowing to build the library. It's the behaviour currently implemented in all CCI recipes.
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 a different issue. Like most libraries, geographiclib doesn't conditionnally disable build of components depending on C++ standard, boost is an edge case.
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 a different issue.
for the same reason. apple-clang (with c++17 support) was used in C++03 default mode to build the boost.
conditionnally disable build of components depending on C++ standard, boost is an edge case.
but what about the conditional compilation depending on C++ standard or other c++ funny things?
Why not follow the official Conan guide ,don't modify the c++ standard in recipe, bump gcc to 6.1 and profit. :-)
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.
There is no official Conan guide about cppstd AFAIK, and cppstd in profile is experimental.
Visual Studio 2019 default standard is C++14 for example. Do you want to not provide or test in CCI binaries for Visual Studio if library requires C++17?
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.
VS2019 IDE pass the c++14 flag to cl.exe by default. :-) Xcode 12 does for apple-clang too but CCI uses apple-clang in C++03 mode on the command line.
Do you want to not provide or test in CCI binaries for Visual Studio if library requires C++17?
Why not, if the underlying build system do right thing ( cmake for example target_compile_features(xxxx PUBLIC cxx_std_17)? But not by force cppstd in the recipe.
There is no official Conan guide about cppstd AFAIK, and cppstd in profile is experimental.
IMHO https://docs.conan.io/en/latest/howtos/manage_cpp_standard.html
No matter simply never use the binaries generated by Conan in the production.
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.
Do you want to not provide or test in CCI binaries for Visual Studio if library requires C++17?
Why not, if the underlying build system do right thing ( cmake for example target_compile_features(xxxx PUBLIC cxx_std_17)? But not by force cppstd in the recipe.
Yes and it's what most recipes do (including this one, recipe itself doesn't inject C++11 at all) , they rely on underlying build system to set a minimum standard if default one is not sufficient, so they don't honor default standard of compiler.
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.
Don't raise for compilers you have not listed in _min_compiler_version_default_cxx11()
"gcc": 6, | ||
"clang": 6, | ||
"Visual Studio": 14, # guess | ||
}.get(str(self.settings.compiler)) |
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.
}.get(str(self.settings.compiler)) | |
}.get(str(self.settings.compiler), False) |
elif tools.Version(self.settings.compiler.version) < self._min_compiler_version_default_cxx11: | ||
raise ConanInvalidConfiguration("C++11 support needed for version >= 1.51") |
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.
elif tools.Version(self.settings.compiler.version) < self._min_compiler_version_default_cxx11: | |
raise ConanInvalidConfiguration("C++11 support needed for version >= 1.51") | |
def lazy_lt_semver(v1, v2): | |
lv1 = [int(v) for v in v1.split(".")] | |
lv2 = [int(v) for v in v2.split(".")] | |
min_length = min(len(lv1), len(lv2)) | |
return lv1[:min_length] < lv2[:min_length] | |
minimum_version = self._min_compiler_version_default_cxx11 | |
if not minimum_version: | |
self.output.warn("geographiclib {} requires C++11 math functions. Your compiler is unknown. Assuming it supports this feature.".format(self.version)) | |
elif lazy_lt_semver(str(self.settings.compiler.version), minimum_version): | |
raise ConanInvalidConfiguration("geographiclib {} requires C++11 math functions, which your compiler does not support.".format(self.version)) |
Some configurations of 'geographiclib/1.51' failed in build 6 (
|
I detected other pull requests that are modifying geographiclib/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. |
3a5488d
to
239e31b
Compare
Failure in build 7 (
|
Does anyone know what might have gone wrong here? Clicking the details link gives me a 403 error. @SpaceIm @dmn-star |
try to close the PR and reopen it after ~20--30 sec. |
if tools.Version(self.version) >= "1.51": | ||
if self.settings.compiler.get_safe("cppstd"): | ||
tools.check_min_cppstd(self, 11) | ||
elif self._compiler_supports_cxx11: | ||
self._cmake.definitions["CONAN_CMAKE_CXX_STANDARD"] = 11 | ||
else: | ||
raise ConanInvalidConfiguration("C++11 support needed for version >= 1.51") | ||
|
||
self._cmake.definitions["GEOGRAPHICLIB_LIB_TYPE"] = "SHARED" if self.options.shared else "STATIC" | ||
self._cmake.configure(build_folder=self._build_subfolder) |
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.
useless ;) (and the last 2 lines have lost one level of indentation)
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.
Oops! I'll fix that indentation error. Am I missing something tho? Wouldn't this achieve what we want? The first case will make sure we get a ConanInvalidConfiguration exception if settings.compiler.cppstd
is set too low, and the second will make sure we use C++11 if it isn't set and the compiler supports 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.
It's already handled in underlying build files. Your errors come from test_package, you need to set CXX_STANDARD 11.
I've proposed modifications far above, handling all this thing in a "graceful" way (and used in most others recipes with this kind of issue), you wan still use them ;)
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.
Alright! Thanks :) I'll try to make those changes then
239e31b
to
5a44f47
Compare
@@ -8,6 +8,7 @@ class TestPackageConan(ConanFile): | |||
def build(self): | |||
cmake = CMake(self) | |||
cmake.configure() | |||
cmake.definitions["CONAN_CMAKE_CXX_STANDARD"] = 11 |
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["CONAN_CMAKE_CXX_STANDARD"] = 11 |
and add those lines at the end of test_package's CMakeLists.txt:
if(geographiclib_VERSION VERSION_GREATER_EQUAL "1.51")
set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11)
endif()
self._cmake.definitions["GEOGRAPHICLIB_LIB_TYPE"] = "SHARED" if self.options.shared else "STATIC" | ||
self._cmake.configure(build_folder=self._build_subfolder) | ||
return self._cmake | ||
return self._cmake |
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.
return self._cmake | |
return self._cmake |
undo modifications
Some configurations of 'geographiclib/1.50.1' failed in build 8 (
|
5a44f47
to
f6b2586
Compare
All green in build 9 (
|
if self.settings.compiler.cppstd: | ||
tools.min_cppstd(self, 11) | ||
|
||
def lazy_lt_semver(v1, v2): |
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.
Another variant conan-io/conan#8002 (just to keep track of all of them)
conan-center hook activated.