fix(boost)!: migrate boost to 1.86 (#3256)

This commit is contained in:
Lukas Senionis
2024-10-04 04:42:16 +03:00
committed by GitHub
parent 2c050d1cb0
commit e90b71ce62
11 changed files with 31 additions and 29 deletions

View File

@@ -7,6 +7,7 @@ pacman --noconfirm -Syu
# install dependencies # install dependencies
dependencies=( dependencies=(
"git" "git"
"mingw-w64-ucrt-x86_64-boost"
"mingw-w64-ucrt-x86_64-cmake" "mingw-w64-ucrt-x86_64-cmake"
"mingw-w64-ucrt-x86_64-cppwinrt" "mingw-w64-ucrt-x86_64-cppwinrt"
"mingw-w64-ucrt-x86_64-curl-winssl" "mingw-w64-ucrt-x86_64-curl-winssl"

View File

@@ -1021,6 +1021,7 @@ jobs:
update: true update: true
install: >- install: >-
git git
mingw-w64-ucrt-x86_64-boost
mingw-w64-ucrt-x86_64-cmake mingw-w64-ucrt-x86_64-cmake
mingw-w64-ucrt-x86_64-cppwinrt mingw-w64-ucrt-x86_64-cppwinrt
mingw-w64-ucrt-x86_64-curl-winssl mingw-w64-ucrt-x86_64-curl-winssl

View File

@@ -3,7 +3,7 @@
# #
include_guard(GLOBAL) include_guard(GLOBAL)
set(BOOST_VERSION 1.85) set(BOOST_VERSION 1.86)
set(BOOST_COMPONENTS set(BOOST_COMPONENTS
filesystem filesystem
locale locale
@@ -15,7 +15,7 @@ if(BOOST_USE_STATIC)
set(Boost_USE_STATIC_LIBS ON) # cmake-lint: disable=C0103 set(Boost_USE_STATIC_LIBS ON) # cmake-lint: disable=C0103
endif() endif()
find_package(Boost ${BOOST_VERSION} COMPONENTS ${BOOST_COMPONENTS}) find_package(Boost CONFIG ${BOOST_VERSION} COMPONENTS ${BOOST_COMPONENTS})
if(NOT Boost_FOUND) if(NOT Boost_FOUND)
message(STATUS "Boost v${BOOST_VERSION}.x package not found in the system. Falling back to FetchContent.") message(STATUS "Boost v${BOOST_VERSION}.x package not found in the system. Falling back to FetchContent.")
include(FetchContent) include(FetchContent)
@@ -39,9 +39,9 @@ if(NOT Boost_FOUND)
set(BOOST_INCLUDE_LIBRARIES set(BOOST_INCLUDE_LIBRARIES
${BOOST_COMPONENTS}) ${BOOST_COMPONENTS})
set(BOOST_URL set(BOOST_URL
"https://github.com/boostorg/boost/releases/download/boost-1.85.0/boost-1.85.0-cmake.tar.xz") "https://github.com/boostorg/boost/releases/download/boost-1.86.0/boost-1.86.0-cmake.tar.xz")
set(BOOST_HASH set(BOOST_HASH
"MD5=BADEA970931766604D4D5F8F4090B176") "MD5=D02759931CEDC02ADED80402906C5EB6")
if(CMAKE_VERSION VERSION_LESS "3.24.0") if(CMAKE_VERSION VERSION_LESS "3.24.0")
FetchContent_Declare( FetchContent_Declare(

View File

@@ -47,13 +47,13 @@ namespace boost {
namespace filesystem { namespace filesystem {
class path; class path;
} }
namespace process { namespace process::inline v1 {
class child; class child;
class group; class group;
template <typename Char> template <typename Char>
class basic_environment; class basic_environment;
typedef basic_environment<char> environment; typedef basic_environment<char> environment;
} // namespace process } // namespace process::inline v1
} // namespace boost } // namespace boost
#endif #endif
namespace video { namespace video {
@@ -597,8 +597,8 @@ namespace platf {
bool bool
needs_encoder_reenumeration(); needs_encoder_reenumeration();
boost::process::child boost::process::v1::child
run_command(bool elevated, bool interactive, const std::string &cmd, boost::filesystem::path &working_dir, const boost::process::environment &env, FILE *file, std::error_code &ec, boost::process::group *group); run_command(bool elevated, bool interactive, const std::string &cmd, boost::filesystem::path &working_dir, const boost::process::v1::environment &env, FILE *file, std::error_code &ec, boost::process::v1::group *group);
enum class thread_priority_e : int { enum class thread_priority_e : int {
low, ///< Low priority low, ///< Low priority

View File

@@ -15,7 +15,7 @@
// lib includes // lib includes
#include <arpa/inet.h> #include <arpa/inet.h>
#include <boost/asio/ip/address.hpp> #include <boost/asio/ip/address.hpp>
#include <boost/process.hpp> #include <boost/process/v1.hpp>
#include <dlfcn.h> #include <dlfcn.h>
#include <fcntl.h> #include <fcntl.h>
#include <ifaddrs.h> #include <ifaddrs.h>
@@ -269,7 +269,7 @@ namespace platf {
auto working_dir = boost::filesystem::path(std::getenv("HOME")); auto working_dir = boost::filesystem::path(std::getenv("HOME"));
std::string cmd = R"(xdg-open ")" + url + R"(")"; std::string cmd = R"(xdg-open ")" + url + R"(")";
boost::process::environment _env = boost::this_process::environment(); boost::process::v1::environment _env = boost::this_process::environment();
std::error_code ec; std::error_code ec;
auto child = run_command(false, false, cmd, working_dir, _env, nullptr, ec, nullptr); auto child = run_command(false, false, cmd, working_dir, _env, nullptr, ec, nullptr);
if (ec) { if (ec) {

View File

@@ -23,7 +23,7 @@
#include "src/platform/common.h" #include "src/platform/common.h"
#include <boost/asio/ip/address.hpp> #include <boost/asio/ip/address.hpp>
#include <boost/process.hpp> #include <boost/process/v1.hpp>
using namespace std::literals; using namespace std::literals;
namespace fs = std::filesystem; namespace fs = std::filesystem;
@@ -197,7 +197,7 @@ namespace platf {
boost::filesystem::path working_dir; boost::filesystem::path working_dir;
std::string cmd = R"(open ")" + url + R"(")"; std::string cmd = R"(open ")" + url + R"(")";
boost::process::environment _env = boost::this_process::environment(); boost::process::v1::environment _env = boost::this_process::environment();
std::error_code ec; std::error_code ec;
auto child = run_command(false, false, cmd, working_dir, _env, nullptr, ec, nullptr); auto child = run_command(false, false, cmd, working_dir, _env, nullptr, ec, nullptr);
if (ec) { if (ec) {

View File

@@ -7,9 +7,9 @@
#include <thread> #include <thread>
#include <boost/algorithm/string/join.hpp> #include <boost/algorithm/string/join.hpp>
#include <boost/process.hpp> #include <boost/process/v1.hpp>
// We have to include boost/process.hpp before display.h due to WinSock.h, // We have to include boost/process/v1.hpp before display.h due to WinSock.h,
// but that prevents the definition of NTSTATUS so we must define it ourself. // but that prevents the definition of NTSTATUS so we must define it ourself.
typedef long NTSTATUS; typedef long NTSTATUS;

View File

@@ -10,7 +10,7 @@
#include <boost/algorithm/string.hpp> #include <boost/algorithm/string.hpp>
#include <boost/asio/ip/address.hpp> #include <boost/asio/ip/address.hpp>
#include <boost/process.hpp> #include <boost/process/v1.hpp>
#include <boost/program_options/parsers.hpp> #include <boost/program_options/parsers.hpp>
// prevent clang format from "optimizing" the header include order // prevent clang format from "optimizing" the header include order
@@ -1071,7 +1071,7 @@ namespace platf {
*/ */
void void
open_url(const std::string &url) { open_url(const std::string &url) {
boost::process::environment _env = boost::this_process::environment(); boost::process::v1::environment _env = boost::this_process::environment();
auto working_dir = boost::filesystem::path(); auto working_dir = boost::filesystem::path();
std::error_code ec; std::error_code ec;

View File

@@ -57,7 +57,7 @@ namespace proc {
} }
void void
terminate_process_group(boost::process::child &proc, boost::process::group &group, std::chrono::seconds exit_timeout) { terminate_process_group(boost::process::v1::child &proc, boost::process::v1::group &group, std::chrono::seconds exit_timeout) {
if (group.valid() && platf::process_group_running((std::uintptr_t) group.native_handle())) { if (group.valid() && platf::process_group_running((std::uintptr_t) group.native_handle())) {
if (exit_timeout.count() > 0) { if (exit_timeout.count() > 0) {
// Request processes in the group to exit gracefully // Request processes in the group to exit gracefully
@@ -98,7 +98,7 @@ namespace proc {
} }
boost::filesystem::path boost::filesystem::path
find_working_directory(const std::string &cmd, boost::process::environment &env) { find_working_directory(const std::string &cmd, boost::process::v1::environment &env) {
// Parse the raw command string into parts to get the actual command portion // Parse the raw command string into parts to get the actual command portion
#ifdef _WIN32 #ifdef _WIN32
auto parts = boost::program_options::split_winmain(cmd); auto parts = boost::program_options::split_winmain(cmd);
@@ -120,7 +120,7 @@ namespace proc {
// If the cmd path is not an absolute path, resolve it using our PATH variable // If the cmd path is not an absolute path, resolve it using our PATH variable
boost::filesystem::path cmd_path(parts.at(0)); boost::filesystem::path cmd_path(parts.at(0));
if (!cmd_path.is_absolute()) { if (!cmd_path.is_absolute()) {
cmd_path = boost::process::search_path(parts.at(0)); cmd_path = boost::process::v1::search_path(parts.at(0));
if (cmd_path.empty()) { if (cmd_path.empty()) {
BOOST_LOG(error) << "Unable to find executable ["sv << parts.at(0) << "]. Is it in your PATH?"sv; BOOST_LOG(error) << "Unable to find executable ["sv << parts.at(0) << "]. Is it in your PATH?"sv;
return boost::filesystem::path(); return boost::filesystem::path();
@@ -301,8 +301,8 @@ namespace proc {
std::error_code ec; std::error_code ec;
placebo = false; placebo = false;
terminate_process_group(_process, _process_group, _app.exit_timeout); terminate_process_group(_process, _process_group, _app.exit_timeout);
_process = boost::process::child(); _process = boost::process::v1::child();
_process_group = boost::process::group(); _process_group = boost::process::v1::group();
for (; _app_prep_it != _app_prep_begin; --_app_prep_it) { for (; _app_prep_it != _app_prep_begin; --_app_prep_it) {
auto &cmd = *(_app_prep_it - 1); auto &cmd = *(_app_prep_it - 1);
@@ -403,7 +403,7 @@ namespace proc {
} }
std::string std::string
parse_env_val(boost::process::native_environment &env, const std::string_view &val_raw) { parse_env_val(boost::process::v1::native_environment &env, const std::string_view &val_raw) {
auto pos = std::begin(val_raw); auto pos = std::begin(val_raw);
auto dollar = std::find(pos, std::end(val_raw), '$'); auto dollar = std::find(pos, std::end(val_raw), '$');

View File

@@ -11,7 +11,7 @@
#include <optional> #include <optional>
#include <unordered_map> #include <unordered_map>
#include <boost/process.hpp> #include <boost/process/v1.hpp>
#include "config.h" #include "config.h"
#include "platform/common.h" #include "platform/common.h"
@@ -68,7 +68,7 @@ namespace proc {
KITTY_DEFAULT_CONSTR_MOVE_THROW(proc_t) KITTY_DEFAULT_CONSTR_MOVE_THROW(proc_t)
proc_t( proc_t(
boost::process::environment &&env, boost::process::v1::environment &&env,
std::vector<ctx_t> &&apps): std::vector<ctx_t> &&apps):
_app_id(0), _app_id(0),
_env(std::move(env)), _env(std::move(env)),
@@ -99,7 +99,7 @@ namespace proc {
private: private:
int _app_id; int _app_id;
boost::process::environment _env; boost::process::v1::environment _env;
std::vector<ctx_t> _apps; std::vector<ctx_t> _apps;
ctx_t _app; ctx_t _app;
std::chrono::steady_clock::time_point _app_launch_time; std::chrono::steady_clock::time_point _app_launch_time;
@@ -107,8 +107,8 @@ namespace proc {
// If no command associated with _app_id, yet it's still running // If no command associated with _app_id, yet it's still running
bool placebo {}; bool placebo {};
boost::process::child _process; boost::process::v1::child _process;
boost::process::group _process_group; boost::process::v1::group _process_group;
file_t _pipe; file_t _pipe;
std::vector<cmd_t>::const_iterator _app_prep_it; std::vector<cmd_t>::const_iterator _app_prep_it;
@@ -143,7 +143,7 @@ namespace proc {
* @param exit_timeout The timeout to wait for the process group to gracefully exit. * @param exit_timeout The timeout to wait for the process group to gracefully exit.
*/ */
void void
terminate_process_group(boost::process::child &proc, boost::process::group &group, std::chrono::seconds exit_timeout); terminate_process_group(boost::process::v1::child &proc, boost::process::v1::group &group, std::chrono::seconds exit_timeout);
extern proc_t proc; extern proc_t proc;
} // namespace proc } // namespace proc

View File

@@ -33,7 +33,7 @@
// lib includes // lib includes
#include "tray/src/tray.h" #include "tray/src/tray.h"
#include <boost/filesystem.hpp> #include <boost/filesystem.hpp>
#include <boost/process/environment.hpp> #include <boost/process/v1/environment.hpp>
// local includes // local includes
#include "confighttp.h" #include "confighttp.h"