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
[libtorrent] update to 1.2.12 #15620
Conversation
@JonLiu1993, why this PR is still Draft? Are there any other changes required? |
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.
@JonLiu1993, why this PR is still Draft? Are there any other changes required?
CI shows that there is a problem with X64-osx, and I haven't taken care of it yet. I will request a review as soon as possible after processing
Hey, I've handled the last few upgrades of libtorrent in the past: https://github.com/microsoft/vcpkg/pulls?q=is%3Apr+libtorrent+is%3Aclosed+author%3AFranciscoPombal There is nothing special about IMO you should take this out of Draft status, rebase on top of the latest |
Sorry, I will modify it immediately and let it run again |
Looks like the build failure persists, unfortunately. I don't have access to macOS hardware, by the way. Relevant logs:
Any way to access these files from the Azure CI?
It would be most convenient. |
@FranciscoPombal ,Please take a look at this: |
Relevant snippet from the logs: -- Performing Test HAVE_CXX_ATOMICS_WITHOUT_LIB
-- Performing Test HAVE_CXX_ATOMICS_WITHOUT_LIB - Failed
-- Performing Test HAVE_CXX_ATOMICS64_WITHOUT_LIB
-- Performing Test HAVE_CXX_ATOMICS64_WITHOUT_LIB - Failed
-- Performing Test HAVE_CXX_ATOMICS_WITH_LIB
-- Performing Test HAVE_CXX_ATOMICS_WITH_LIB - Failed
-- Performing Test HAVE_CXX_ATOMICS64_WITH_LIB
-- Performing Test HAVE_CXX_ATOMICS64_WITH_LIB - Failed
-- Configuring incomplete, errors occurred! Here are the relevant lines from libtorrent's # check if we need to link with libatomic (not needed on MSVC)
if (NOT Windows)
# TODO: migrate to CheckSourceCompiles in CMake >= 3.19
include(CheckCXXSourceCompiles)
set(ATOMICS_TEST_SOURCE [=[
#include <atomic>
#include <cstdint>
std::atomic<int> x{0};
int main() {
x.fetch_add(1, std::memory_order_relaxed);
return 0;
}
]=])
string(REPLACE "std::atomic<int>" "std::atomic<std::int64_t>" ATOMICS64_TEST_SOURCE "${ATOMICS_TEST_SOURCE}")
check_cxx_source_compiles("${ATOMICS_TEST_SOURCE}" HAVE_CXX_ATOMICS_WITHOUT_LIB)
check_cxx_source_compiles("${ATOMICS64_TEST_SOURCE}" HAVE_CXX_ATOMICS64_WITHOUT_LIB)
if((NOT HAVE_CXX_ATOMICS_WITHOUT_LIB) OR (NOT HAVE_CXX_ATOMICS64_WITHOUT_LIB))
set(CMAKE_REQUIRED_LIBRARIES "atomic")
check_cxx_source_compiles("${ATOMICS_TEST_SOURCE}" HAVE_CXX_ATOMICS_WITH_LIB)
check_cxx_source_compiles("${ATOMICS64_TEST_SOURCE}" HAVE_CXX_ATOMICS64_WITH_LIB)
if ((NOT HAVE_CXX_ATOMICS_WITH_LIB) OR (NOT HAVE_CXX_ATOMICS64_WITH_LIB))
message(FATAL_ERROR "No native support for std::atomic, or libatomic not found!")
else()
message(STATUS "Linking with libatomic for atomics support")
unset(CMAKE_REQUIRED_LIBRARIES)
target_link_libraries(torrent-rasterbar PUBLIC atomic)
endif()
endif()
endif() So the question is, why can't AppleClang find the |
And why there are no such errors when building qBittorrent CI? Is it really also because of c++17? Maybe try to force c++17 here? |
What makes you think that? I doubt the problem has to do with the C++ version |
OK, actually I think I know what the problem is. Since AppleClang defaults to C++98, we need to force the atomics test source to be built with C++11. We need to set @JonLiu1993 I would suggest trying out something like this (new lines marked with # .... other code ....
+ if(APPLE)
+ set(CMAKE_REQUIRED_FLAGS "-std=c++11")
+ endif()
check_cxx_source_compiles("${ATOMICS_TEST_SOURCE}" HAVE_CXX_ATOMICS_WITHOUT_LIB)
check_cxx_source_compiles("${ATOMICS64_TEST_SOURCE}" HAVE_CXX_ATOMICS64_WITHOUT_LIB)
if((NOT HAVE_CXX_ATOMICS_WITHOUT_LIB) OR (NOT HAVE_CXX_ATOMICS64_WITHOUT_LIB))
set(CMAKE_REQUIRED_LIBRARIES "atomic")
check_cxx_source_compiles("${ATOMICS_TEST_SOURCE}" HAVE_CXX_ATOMICS_WITH_LIB)
check_cxx_source_compiles("${ATOMICS64_TEST_SOURCE}" HAVE_CXX_ATOMICS64_WITH_LIB)
if ((NOT HAVE_CXX_ATOMICS_WITH_LIB) OR (NOT HAVE_CXX_ATOMICS64_WITH_LIB))
message(FATAL_ERROR "No native support for std::atomic, or libatomic not found!")
else()
message(STATUS "Linking with libatomic for atomics support")
unset(CMAKE_REQUIRED_LIBRARIES)
target_link_libraries(torrent-rasterbar PUBLIC atomic)
endif()
endif()
+ if(APPLE)
+ unset(CMAKE_REQUIRED_FLAGS)
+ endif()
# .... other code .... If this works, this patch can then be submitted upstream. EDIT: capitalize |
LGTM, thanks everyone! |
Fix #15553
Update libtorrent to the latest version 1.2.12
All features are tested successfully in the following triplets: