Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
setvisible committed Jan 2, 2023
2 parents 881554e + 29e9499 commit 3ecb5b1
Show file tree
Hide file tree
Showing 212 changed files with 9,959 additions and 7,828 deletions.
82 changes: 55 additions & 27 deletions .github/workflows/deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ on:
- "gha-*"

env:
CXX_FLAGS: "-Wall -Wextra -Wpedantic -Wvla -Wno-noexcept-type -Wno-format-zero-length -ftemplate-depth=512 -Wno-attributes -Wno-narrowing -Wno-overflow -Wno-redundant-move -Wno-maybe-uninitialized" # -Wa,-mbig-obj"
# We want to see all warnings for the project, but hide them for Libtorrent:
CXX_FLAGS_Libtorrent: "-Wall -Wextra -Wpedantic -Wvla -Wno-noexcept-type -Wno-format-zero-length -ftemplate-depth=512 -Wno-attributes -Wno-narrowing -Wno-overflow -Wno-redundant-move -Wno-maybe-uninitialized" # -Wa,-mbig-obj"
CXX_FLAGS_Project: "-Wall -Wextra -Wpedantic -Wvla -ftemplate-depth=512"

BUILD_TYPE: "Release" # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BOOST_VERSION: 1.77.0
BOOST_PATH: ${{github.workspace}}/../install/boost/
Expand Down Expand Up @@ -81,6 +84,7 @@ jobs:
name: "Build Project on ${{matrix.os}}"

strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
include:
Expand Down Expand Up @@ -123,16 +127,16 @@ jobs:
# print("Relative pathing '.' and '..' is not allowed.")
#
# output_pairs = {
# 'LibtorrentRasterbar_SOURCE_DIR': "${{env.LibtorrentRasterbar_SOURCE_DIR}}",
# 'LibtorrentRasterbar_BUILD_DIR': "${{env.LibtorrentRasterbar_BUILD_DIR}}",
# 'LibtorrentRasterbar_INSTALL_DIR': "${{env.LibtorrentRasterbar_INSTALL_DIR}}",
# 'LibtorrentRasterbar_VERSION_FILE': "${{env.LibtorrentRasterbar_VERSION_FILE}}",
# 'Application_VERSION_FILE': "${{env.Application_VERSION_FILE}}",
# 'Changelog_FILE_NAME': "${{env.Changelog_FILE_NAME}}",
# 'Project_SOURCE_DIR': "${{env.Project_SOURCE_DIR}}",
# 'Project_BUILD_DIR': "${{env.Project_BUILD_DIR}}",
# 'Project_INSTALL_DIR': "${{env.Project_INSTALL_DIR}}",
# 'Project_RELEASE_DIR': "${{env.Project_RELEASE_DIR}}",
# 'LibtorrentRasterbar_SOURCE_DIR': r"${{env.LibtorrentRasterbar_SOURCE_DIR}}",
# 'LibtorrentRasterbar_BUILD_DIR': r"${{env.LibtorrentRasterbar_BUILD_DIR}}",
# 'LibtorrentRasterbar_INSTALL_DIR': r"${{env.LibtorrentRasterbar_INSTALL_DIR}}",
# 'LibtorrentRasterbar_VERSION_FILE': r"${{env.LibtorrentRasterbar_VERSION_FILE}}",
# 'Application_VERSION_FILE': r"${{env.Application_VERSION_FILE}}",
# 'Changelog_FILE_NAME': r"${{env.Changelog_FILE_NAME}}",
# 'Project_SOURCE_DIR': r"${{env.Project_SOURCE_DIR}}",
# 'Project_BUILD_DIR': r"${{env.Project_BUILD_DIR}}",
# 'Project_INSTALL_DIR': r"${{env.Project_INSTALL_DIR}}",
# 'Project_RELEASE_DIR': r"${{env.Project_RELEASE_DIR}}",
# }
#
# if "GITHUB_OUTPUT" in os.environ:
Expand Down Expand Up @@ -269,7 +273,10 @@ jobs:

- name: List files in Qt
shell: bash
run: cd "${{env.Qt6_DIR}}" && ls -al
run: cd "${{env.Qt6_DIR}}/../../" && ls -alR
# env.Qt6_DIR
# "/home/runner/work/DownZemAll/qt/Qt/6.3.1/gcc_64"
# "D:\a\DownZemAll\qt\Qt\6.3.1\mingw_64"

- name: Find OpenSSL in Qt6
# The thing is that "env.Qt6_DIR" is defined only at runtime, *after* install-qt-action has run.
Expand All @@ -278,29 +285,32 @@ jobs:
run: |
import os
# OLD NAME -> NEW NAME
# libeay32 -> libcrypto
# ssleay32 -> libssl
if "${{ matrix.os }}" == "windows-latest":
openssl_dir = os.path.normpath(os.path.join(r"${{env.Qt6_DIR}}", "..", "..", "Tools", "OpenSSL", "Win_x64"))
openssl_lib_eay = os.path.normpath(os.path.join(openssl_dir, "lib", "libcrypto.lib"))
openssl_ssl_eay = os.path.normpath(os.path.join(openssl_dir, "lib", "libssl.lib"))
if "${{ matrix.os }}" == "ubuntu-latest":
openssl_dir = os.path.normpath(os.path.join(r"${{env.Qt6_DIR}}", "..", "..", "Tools", "OpenSSL", "binary"))
openssl_lib_eay = os.path.normpath(os.path.join(openssl_dir, "lib", "libcrypto.a"))
openssl_ssl_eay = os.path.normpath(os.path.join(openssl_dir, "lib", "libssl.a"))
if "GITHUB_OUTPUT" in os.environ:
with open(os.environ["GITHUB_OUTPUT"], "a") as f:
print(f"OpenSSL_ROOT_DIR={ openssl_dir }", file=f)
print(f"OpenSSL_LIB_EAY={ openssl_lib_eay }", file=f)
print(f"OpenSSL_SSL_EAY={ openssl_ssl_eay }", file=f)
- name: List files in OpenSSL
shell: bash
env:
OpenSSL_ROOT_DIR: ${{ steps.qt6openssl.outputs.OpenSSL_ROOT_DIR }}
run: |
cd "${{env.OpenSSL_ROOT_DIR}}"
ls -al
cd "${{env.OpenSSL_ROOT_DIR}}/lib/"
ls -al
cd "${{env.OpenSSL_ROOT_DIR}}/include/"
ls -al
cd "${{env.OpenSSL_ROOT_DIR}}/bin/"
ls -al
run: cd "${{env.OpenSSL_ROOT_DIR}}" && ls -alR


- name: Configure Libtorrent
if: ${{ steps.cache-libtorrent.outputs.cache-hit != 'true' }}
Expand All @@ -309,20 +319,26 @@ jobs:
Qt6_Dir2: ${{env.Qt6_DIR}}
DIRECTIVE_CMAKE_GENERATOR: ${{matrix.DIRECTIVE_CMAKE_GENERATOR}}
BUILD_TESTS: "OFF" # OFF because they take 10+ minutes to build and 776.74 sec to run tests on Ubuntu
DEPRECATED_FUNCTIONS: "ON" # OFF disables deprecated functions
DEPRECATED_FUNCTIONS: "OFF" # OFF to remove deprecated functions
OPENSSL_INCLUDE_DIR: "${{ steps.qt6openssl.outputs.OpenSSL_ROOT_DIR }}/include"
OpenSSL_LIB_EAY: ${{ steps.qt6openssl.outputs.OpenSSL_LIB_EAY }}
OpenSSL_SSL_EAY: ${{ steps.qt6openssl.outputs.OpenSSL_SSL_EAY }}
working-directory: "${{env.LibtorrentRasterbar_BUILD_DIR}}"
run:
cmake "${{env.LibtorrentRasterbar_SOURCE_DIR}}"
${{env.DIRECTIVE_CMAKE_GENERATOR}}
-DCMAKE_PREFIX_PATH="${{env.Qt6_Dir2}}"
-DCMAKE_CXX_FLAGS="${{env.CXX_FLAGS}}"
-DCMAKE_CXX_FLAGS="${{env.CXX_FLAGS_Libtorrent}}"
-DCMAKE_INSTALL_PREFIX="${{env.LibtorrentRasterbar_INSTALL_DIR}}"
-DBoost_ROOT:PATH="${{env.Boost_ROOT}}"
-DBUILD_SHARED_LIBS=OFF
-Dstatic_runtime=ON
-Dbuild_tests=${{env.BUILD_TESTS}}
-Ddeprecated-functions=${{env.DEPRECATED_FUNCTIONS}}
-DCMAKE_BUILD_TYPE="${{env.BUILD_TYPE}}"
-DOPENSSL_INCLUDE_DIR="${{env.OPENSSL_INCLUDE_DIR}}"
-DLIB_EAY="${{env.OpenSSL_LIB_EAY}}"
-DSSL_EAY="${{env.OpenSSL_SSL_EAY}}"

- name: Build Libtorrent
if: ${{ steps.cache-libtorrent.outputs.cache-hit != 'true' }}
Expand All @@ -343,7 +359,7 @@ jobs:

- name: List files in Libtorrent
shell: bash
run: cd "${{env.LibtorrentRasterbar_INSTALL_DIR}}" && ls -al
run: cd "${{env.LibtorrentRasterbar_INSTALL_DIR}}" && ls -alR

- name: Configure Project
env:
Expand All @@ -356,7 +372,7 @@ jobs:
cmake "${{env.Project_SOURCE_DIR}}"
${{env.DIRECTIVE_CMAKE_GENERATOR}}
-DCMAKE_PREFIX_PATH="${{env.Qt6_Dir2}}"
-DCMAKE_CXX_FLAGS="${{env.CXX_FLAGS}}"
-DCMAKE_CXX_FLAGS="${{env.CXX_FLAGS_Project}}"
-DCMAKE_INSTALL_PREFIX="${{env.Project_INSTALL_DIR}}"
-DOpenSSL_ROOT_DIR="${{env.OpenSSL_ROOT_DIR}}"
-DBoost_ROOT:PATH="${{env.Boost_ROOT}}"
Expand Down Expand Up @@ -395,6 +411,18 @@ jobs:
echo "After:"
ls -al
- name: List Dynamic Dependencies (Linux Only)
if: ${{ matrix.os == 'ubuntu-latest' }}
working-directory: "${{env.Project_INSTALL_DIR}}"
continue-on-error: true
shell: bash
run: |
echo "Run 'ldd' to find missing Qt libraries or missing plugins."
echo "Tips: If missing, add directive install(FILE [..]) in 'src/CMakeLists.txt'."
ldd --verbose ./launcher
ldd --verbose ./DownZemAll
ls -R
- name: Zip (Linux Portable)
if: ${{ matrix.os == 'ubuntu-latest' }}
working-directory: "${{env.Project_RELEASE_DIR}}"
Expand Down Expand Up @@ -424,7 +452,7 @@ jobs:
run: |
import os
from shutil import make_archive
root_dir = os.path.normpath("${{env.Project_INSTALL_DIR}}")
root_dir = os.path.normpath(r"${{env.Project_INSTALL_DIR}}")
print(f"Archiving {root_dir}")
full_name = make_archive(
base_name="${{env.ZIP_NAME}}",
Expand Down Expand Up @@ -455,7 +483,7 @@ jobs:
- name: List files in Project
if: ${{ matrix.os == 'windows-latest' }}
shell: bash
run: cd "${{env.Project_INSTALL_DIR}}" && ls -al
run: cd "${{env.Project_INSTALL_DIR}}" && ls -alR

- name: Rename NSIS installer
if: ${{ matrix.os == 'windows-latest' }}
Expand Down
8 changes: 7 additions & 1 deletion 3rd/libtorrent-rasterbar/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ set(libtorrent_include_files
extensions.hpp
file.hpp
file_storage.hpp
file_layout.hpp
fingerprint.hpp
flags.hpp
fwd.hpp
Expand Down Expand Up @@ -218,10 +219,12 @@ set(libtorrent_aux_include_files
disk_io_thread_pool.hpp
disk_job_fence.hpp
disk_job_pool.hpp
drive_info.hpp
ed25519.hpp
escape_string.hpp
export.hpp
ffs.hpp
file_descriptor.hpp
file_progress.hpp
file_view_pool.hpp
has_block.hpp
Expand All @@ -236,6 +239,7 @@ set(libtorrent_aux_include_files
lsd.hpp
merkle.hpp
merkle_tree.hpp
netlink_utils.hpp
noexcept_movable.hpp
numeric_cast.hpp
packet_buffer.hpp
Expand Down Expand Up @@ -275,6 +279,7 @@ set(libtorrent_aux_include_files
utp_stream.hpp
vector.hpp
win_crypto_provider.hpp
win_file_handle.hpp
win_util.hpp
)

Expand Down Expand Up @@ -314,6 +319,7 @@ set(sources
disk_io_thread_pool.cpp
disk_job_fence.cpp
disk_job_pool.cpp
drive_info.cpp
entry.cpp
enum_net.cpp
error_code.cpp
Expand Down Expand Up @@ -802,7 +808,7 @@ endif()
find_public_dependency(Boost REQUIRED)
target_link_libraries(torrent-rasterbar PUBLIC Boost::headers)
if (Boost_MAJOR_VERSION LESS_EQUAL 1 AND Boost_MINOR_VERSION LESS 69)
find_package(Boost REQUIRED COMPONENTS system)
find_public_dependency(Boost REQUIRED COMPONENTS system)
target_link_libraries(torrent-rasterbar PUBLIC Boost::system)
endif()

Expand Down
41 changes: 41 additions & 0 deletions 3rd/libtorrent-rasterbar/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,32 @@
* fix uTP streams timing out instead of closing cleanly

2.0.8 released

* add write_torrent_file_buf() overload for generating .torrent files
* add create_torrent::generate_buf() function to generate into a buffer
* fix copy_file when the file ends with a sparse region
* uTP performance, fix packet loss when sending is stalled
* fix trackers being stuck after session pause/resume
* fix bug in hash_picker with empty files
* uTP performance, prevent premature timeouts/resends
* add option to not memory map files below a certain size
* settings_pack now returns default values when queried for missing settings
* fix copy_file fall-back when SEEK_HOL/SEEK_DATA is not supported
* improve error reporting from file copy and move
* tweak pad file placement to match reference implementation (tail-padding)
* uTP performance, more lenient nagle's algorithm to always allow one outstanding undersized packet
* uTP performance, piggy-back held back undersized packet with ACKs
* uTP performance, don't send redundant deferred ACKs
* support incoming SOCKS5 packets with hostnames as source address, for UDP trackers
* ignore duplicate network interface change notifications on linux
* fix total_want/want accounting when forcing a recheck
* fix merging metadata with magnet links added on top of existing torrents
* add torrent_flag to default all file priorities to dont_download
* fix &so= feature in magnet links
* improve compatibility of SOCKS5 UDP ASSOCIATE
* fix madvise range for flushing cache in mmap_storage
* open files with no_cache set in O_SYNC mode

* 2.0.7 released

* fix issue in use of copy_file_range() on linux
Expand Down Expand Up @@ -120,6 +149,18 @@
* libtorrent now requires C++14 to build
* added support for GnuTLS for HTTPS and torrents over SSL


* fix issue where stop-when-ready would not close files
* uTP performance, fix packet loss when sending is stalled
* uTP performance, prevent premature timeouts/resends
* uTP performance, more lenient nagle's algorithm to always allow one outstanding undersized packet
* uTP performance, piggy-back held back undersized packet with ACKs
* uTP performance, don't send redundant deferred ACKs
* fix wanted_done/done accounting when force-rechecking
* expose userdata via torrent_handle (back-port from 2.0)
* fix renaming of filenames that are too long for the filesystem
* made UPnP and LSD code avoid using select_reactor (to work around an issue on windows in boost.asio < 1.80)

1.2.17 released

* fixed tracker connections spinning when hostname lookups stall
Expand Down
25 changes: 17 additions & 8 deletions 3rd/libtorrent-rasterbar/Jamfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import cast ;

# we need version numbers in the form X.Y.Z in order to trigger the built-in
# support for generating symlinks to the installed library
VERSION = 2.0.7 ;
VERSION = 2.0.8 ;

BOOST_ROOT = [ modules.peek : BOOST_ROOT ] ;
CXXFLAGS = [ modules.peek : CXXFLAGS ] ;
Expand All @@ -22,6 +22,8 @@ ECHO "CXXFLAGS =" $(CXXFLAGS) ;
ECHO "LDFLAGS =" $(LDFLAGS) ;
ECHO "OS =" [ os.name ] ;

jam-version = [ modules.peek : JAM_VERSION ] ;

if $(BOOST_ROOT)
{
ECHO "building boost from source directory: " $(BOOST_ROOT) ;
Expand Down Expand Up @@ -163,10 +165,11 @@ rule linking ( properties * )
# which only works on ELF targets with gcc
result += <linkflags>-Wl,--export-dynamic <linkflags>-rdynamic ;
}
else
else if [ version.version-less $(jam-version) : 1990 0 ]
{
# backtraces don't work with visibility=hidden, so we only add that in
# the else-block
# the visibility feature was introduced in boost-1.69. This was close to
# when the verisoning scheme changed from year to (low) version numbers.
# in boost-1.70
result += <visibility>hidden ;
}

Expand Down Expand Up @@ -300,8 +303,8 @@ rule building ( properties * )
result += <build>no ;
}

local VERSION = [ feature.get-values <cxxstd> : $(properties) ] ;
if ! $(VERSION) || $(VERSION) < 14
local CXXVER = [ feature.get-values <cxxstd> : $(properties) ] ;
if ! $(CXXVER) || $(CXXVER) < 14
{
ECHO "libtorrent requires at least C++14. Specify cxxstd=14 or higher" ;
result += <build>no ;
Expand Down Expand Up @@ -575,6 +578,9 @@ feature.compose <utp-log>on : <define>TORRENT_UTP_LOG_ENABLE ;
feature simulate-slow-read : off on : composite propagated ;
feature.compose <simulate-slow-read>on : <define>TORRENT_SIMULATE_SLOW_READ ;

feature simulate-slow-write : off on : composite propagated ;
feature.compose <simulate-slow-write>on : <define>TORRENT_SIMULATE_SLOW_WRITE ;

feature logging : on off : composite propagated link-incompatible ;
feature.compose <logging>off : <define>TORRENT_DISABLE_LOGGING ;

Expand Down Expand Up @@ -724,6 +730,7 @@ SOURCES =
disabled_disk_io
disk_job_fence
disk_job_pool
drive_info
entry
error_code
file_storage
Expand Down Expand Up @@ -941,8 +948,10 @@ rule install-paths ( properties * )
# package.paths was introduced in boost-1.70 (2018.02)
# however, boost build's versioning scheme changed in boost-1.71 to version
# 4.0
local boost-build-version = [ SPLIT_BY_CHARACTERS [ version.boost-build ] : "-" ] ;
if [ version.version-less [ SPLIT_BY_CHARACTERS $(boost-build-version[1]) : "." ] : 2018 03 ]
# so, if versions are 4.0+ we want to use package.paths, but if it's a year,
# say 2018, that means it's old and we use the fallback below. Any version <
# 1990 is considered the 4.0 and later numbering scheme.
if [ version.version-less 1990 0 : $(jam-version) ]
{
import option ;
import property ;
Expand Down
Loading

0 comments on commit 3ecb5b1

Please sign in to comment.