-
Notifications
You must be signed in to change notification settings - Fork 2k
[libdb] Conan 2.0 migration #17806
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
Merged
conan-center-bot
merged 13 commits into
conan-io:master
from
samuel-emrys:recipe/libdb-conan2
Oct 23, 2023
Merged
[libdb] Conan 2.0 migration #17806
Changes from 11 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
dca8803
[libdb] Uplift to be conan 2.0 compatible
samuel-emrys 9c95aae
[libdb] Disable legacy build methods
samuel-emrys 0f4a7d5
[libdb] Patch visual studio project files to use msbuild toolchain props
samuel-emrys 5ac16bd
[libd] Add apple-clang >= 12 functionality
samuel-emrys fffba58
[libdb] Add fix_apple_shared_install_name for shared compatibility on…
samuel-emrys 6509ea4
[libdb] Upgrade platform toolset and fix build type string quotation
samuel-emrys 2cd8d7d
[libdb] Add WindowsTargetPlatformVersion definition to visual studio …
samuel-emrys c1fd54c
[libdb] Disable vs2019+ builds, remove unnecessary patches
samuel-emrys ac9b229
[libdb] Fix linting issues
samuel-emrys b1c2474
[libdb] Improve comment clarity
samuel-emrys 7f134c9
[libdb] Allow vs2017 to pass validation
samuel-emrys b92bb29
[libdb] Re-organise all patches into _patch_sources for readability
samuel-emrys f1ea445
[libdb] Add clang 15+ compatibility
samuel-emrys 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 hidden or 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
This file contains hidden or 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
9 changes: 0 additions & 9 deletions
9
recipes/libdb/all/patches/0004-msvc-tcl-include-conanbuildinfo-props.patch
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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 |
---|---|---|
@@ -1,8 +1,7 @@ | ||
cmake_minimum_required(VERSION 3.1) | ||
project(test_package C) | ||
cmake_minimum_required(VERSION 3.15) | ||
project(PackageTest C) | ||
|
||
include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) | ||
conan_basic_setup() | ||
find_package(libdb CONFIG REQUIRED) | ||
|
||
add_executable(${PROJECT_NAME} test_package.c) | ||
target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) | ||
add_executable(example src/test_package.c) | ||
target_link_libraries(example libdb::libdb) |
This file contains hidden or 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 |
---|---|---|
@@ -1,16 +1,26 @@ | ||
from conans import ConanFile, CMake, tools | ||
import os | ||
|
||
from conan import ConanFile | ||
from conan.tools.cmake import CMake, cmake_layout | ||
from conan.tools.build import can_run | ||
|
||
class TestPackageConan(ConanFile): | ||
settings = "os", "arch", "compiler", "build_type" | ||
generators = "cmake" | ||
|
||
class fooTestConan(ConanFile): | ||
settings = "os", "compiler", "build_type", "arch" | ||
generators = "CMakeDeps", "CMakeToolchain" | ||
|
||
def requirements(self): | ||
self.requires(self.tested_reference_str) | ||
|
||
def build(self): | ||
cmake = CMake(self) | ||
cmake.configure() | ||
cmake.build() | ||
|
||
def layout(self): | ||
cmake_layout(self) | ||
|
||
def test(self): | ||
if not tools.cross_building(self): | ||
self.run(os.path.join("bin", "test_package"), run_environment=True) | ||
if can_run(self): | ||
cmd = os.path.join(self.cpp.build.bindir, "example") | ||
self.run(cmd, env="conanrun") |
This file contains hidden or 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
Oops, something went wrong.
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.
This concerns me a little bit. "10.0" for the "latest available" is the documented behaviour: https://learn.microsoft.com/en-us/cpp/build/reference/general-property-page-project?view=msvc-170, and from what I can see this applies to versions 2015-2022.
Is this not the case? it would be good to document when this is a problem. Visual Studio 2015 has a maximum version, but apart from this I dont think there is an issue? https://cmake.org/cmake/help/latest/generator/Visual%20Studio%2014%202015.html#windows-10-sdk-maximum-version-for-vs-2015
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.
so, with this definition locally, I get the following error
My understanding is the same as yours - this should work. You'll note that the previous implementation uses a specific SDK value - this was an improvement i tried to make, because if the specific SDK isn't installed on the build system then this will fail. My hope is that using
10.0
will work on someones system, but this is an artifact of my specific environment. Using either of the following resolves this error:This is the only reason these are here as comment - they're what works for me locally. Obviously, since this PR only presents VS2017 compatibility (not 2019 or 2022), this won't be exercised by the CI anyway. I banged my head on a wall for a while with this one and this is far as I could take it without someone more experienced taking a look. If anybody has a suggestion for how to generalise this more, I'm happy to take it. Otherwise, we should compromise to get this recipe updated and iterate as necessary.
Logs for failure:
Uh oh!
There was an error while loading. Please reload this page.
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.
@conan-io/barbarians has anybody got any ideas on how to get the windows build to pass/to upgrade the project successfully?
Edit: doesn't look like the suggested ping does anything
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.
@samuel-emrys We have a template for MSBuild projects, including dealing with sdk version: https://github.com/conan-io/conan-center-index/blob/master/docs/package_templates/msbuild_package/all/conanfile.py#L106. This is not the first recipe here in CCI that needs to change the toolset, according to the profile. If you do a grep PlatformToolset you will find several other recipes doing the same.
Uh oh!
There was an error while loading. Please reload this page.
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 @uilianries. This is something that I've already experimented with/implemented and does not appear to influence the above error: https://github.com/conan-io/conan-center-index/pull/17806/files#diff-b153d74e53befdfc8efd529e900c2626fc8949f9453e701118ad5ba7fdcf2f12R193-R205
It doesn't match what you've posted exactly, so I'll do some more experimentation to further rule it out as the cause, but I'm not confident that it will resolve the issue. The issue as it's currently presenting is with the
<WindowsTargetPlatformVersion>
directive, not the<PlatformToolset>
directive.Uh oh!
There was an error while loading. Please reload this page.
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.
@uilianries I've re-organised the changes to consolidate all patches into
_patch_sources
(probably why you missed thePlatformToolset
implementation, it was inbuild()
). I've also confirmed that patching the toolset (whilst necessary) doesn't impact the above error. I suspect that this is an issue with the source vcxproj files, because I can't upgrade the project manually (to use<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
) and achieve successful builds from within visual studio either. I still have to select a more specific SDK version, which may or may not be available on any given build agent/user computer.Note that the previous author must have identified the same limitation given the previous implementation assumed
<WindowsTargetPlatformVersion>10.0.17763.0</WindowsTargetPlatformVersion>
, which didn't work for me locally either.