testing something on CI

This commit is contained in:
dr7ana 2024-06-04 06:30:35 -07:00
parent 6a7e973014
commit d455a36a8b
12 changed files with 60 additions and 87 deletions

View File

@ -409,8 +409,7 @@ local docs_pipeline(name, image, extra_cmds=[], allow_fail=false) = {
docker_base + 'ubuntu-focal',
deps=['g++-10'] + default_deps_nocxx,
extra_setup=kitware_repo('focal') + local_gnutls(),
cmake_extra='-DCMAKE_C_COMPILER=gcc-10 -DCMAKE_CXX_COMPILER=g++-10',
oxen_repo=true),
cmake_extra='-DCMAKE_C_COMPILER=gcc-10 -DCMAKE_CXX_COMPILER=g++-10'),
// ARM builds (ARM64 and armhf)
debian_pipeline('Debian sid (ARM64)', docker_base + 'debian-sid', arch='arm64', jobs=4),

View File

@ -1,57 +0,0 @@
set(LIBCURL_PREFIX ${CMAKE_BINARY_DIR}/libcurl)
set(LIBCURL_URL https://github.com/curl/curl/releases/download/curl-7_67_0/curl-7.67.0.tar.xz)
set(LIBCURL_HASH SHA256=f5d2e7320379338c3952dcc7566a140abb49edb575f9f99272455785c40e536c)
if(CURL_TARBALL_URL)
# make a build time override of the tarball url so we can fetch it if the original link goes away
set(LIBCURL_URL ${CURL_TARBALL_URL})
endif()
file(MAKE_DIRECTORY ${LIBCURL_PREFIX}/include)
include(ExternalProject)
include(ProcessorCount)
ProcessorCount(PROCESSOR_COUNT)
if(PROCESSOR_COUNT EQUAL 0)
set(PROCESSOR_COUNT 1)
endif()
set(libcurl_cc ${CMAKE_C_COMPILER})
if(CCACHE_PROGRAM)
set(libcurl_cc "${CCACHE_PROGRAM} ${libcurl_cc}")
endif()
set(CURL_CONFIGURE ./configure --prefix=${LIBCURL_PREFIX}
--without-ssl --without-nss --without-gnutls --without-mbedtls --without-wolfssl --without-mesalink
--without-bearssl --without-ca-bundle --without-libidn2 --without-zlib --without-nghttp2 --without-nghttp3
--without-quiche --without-zsh-functions-dir --without-fish-functions-dir
--without-librtmp --without-ca-fallback --without-ca-path --without-brotli --without-libpsl
--disable-manual --disable-dict --disable-file --disable-ftp --disable-gopher --disable-imap --disable-ldap --disable-ldaps
--disable-pop3 --disable-rtsp --disable-smtp --disable-telnet --disable-tftp
--enable-static --disable-shared CC=${libcurl_cc})
if (CMAKE_C_COMPILER_ARG1)
set(CURL_CONFIGURE ${CURL_CONFIGURE} CPPFLAGS=${CMAKE_C_COMPILER_ARG1})
endif()
if (CROSS_TARGET)
set(CURL_CONFIGURE ${CURL_CONFIGURE} --target=${CROSS_TARGET} --host=${CROSS_TARGET})
endif()
ExternalProject_Add(libcurl_external
BUILD_IN_SOURCE ON
PREFIX ${LIBCURL_PREFIX}
URL ${LIBCURL_URL}
URL_HASH ${LIBCURL_HASH}
CONFIGURE_COMMAND ${CURL_CONFIGURE}
BUILD_COMMAND make -j${PROCESSOR_COUNT}
BUILD_BYPRODUCTS ${LIBCURL_PREFIX}/lib/libcurl.a ${LIBCURL_PREFIX}/include
)
add_library(curl_vendor STATIC IMPORTED GLOBAL)
add_dependencies(curl_vendor curl_external)
set_target_properties(curl_vendor PROPERTIES
IMPORTED_LOCATION ${LIBCURL_PREFIX}/lib/libcurl.a
INTERFACE_INCLUDE_DIRECTORIES ${LIBCURL_PREFIX}/include
)

View File

@ -87,17 +87,40 @@ add_subdirectory(oxen-libquic)
# 3.15+, and we target lower than that (and this is fairly simple to build).
if(WITH_BOOTSTRAP)
if(NOT BUILD_STATIC_DEPS)
find_package(CURL REQUIRED COMPONENTS HTTP HTTPS SSL)
find_package(CURL "7.71.0" COMPONENTS HTTP HTTPS SSL)
if(CURL_FOUND)
if(NOT (CURL_VERSION_STRING VERSION_GREATER_EQUAL "7.71.0"))
message(STATUS "System curl version (${CURL_VERSION_STRING}) is too old; using submodule...")
set(USE_CURL_SUBMODULE TRUE)
else()
set(USE_CURL_SUBMODULE FALSE)
endif()
else()
message(STATUS "Could not find system curl; using submodule...")
set(USE_CURL_SUBMODULE TRUE)
endif()
if(USE_CURL_SUBMODULE)
SET(CURL_ZLIB OFF CACHE STRING "" FORCE)
set(HTTP_ONLY ON CACHE INTERNAL "" FORCE)
set(BUILD_CURL_EXE OFF CACHE INTERNAL "" FORCE)
set(BUILD_TESTING OFF)
set(CURL_ENABLE_SSL OFF CACHE INTERNAL "" FORCE)
set(CURL_CA_PATH "none" CACHE INTERNAL "" FORCE)
set(CURL_USE_SCHANNEL OFF CACHE INTERNAL "" FORCE)
set(CURL_WINDOWS_SSPI OFF CACHE INTERNAL "" FORCE)
set(CURL_USE_OPENSSL OFF CACHE INTERNAL "" FORCE)
set(CURL_USE_SECTRANSP OFF CACHE INTERNAL "" FORCE)
set(CURL_USE_MBEDTLS OFF CACHE INTERNAL "" FORCE)
FetchContent_Declare(curl
URL https://github.com/curl/curl/releases/download/curl-8_4_0/curl-8.4.0.tar.xz
URL_HASH SHA256=16c62a9c4af0f703d28bda6d7bbf37ba47055ad3414d70dec63e2e6336f2a82d # the file hash for curl-8.4.0.tar.xz
USES_TERMINAL_DOWNLOAD TRUE) # <---- This is needed only for Ninja to show download progress
FetchContent_MakeAvailable(curl)
# CURL::libcurl wasn't added to FindCURL until cmake 3.12, so add it if necessary
if (CMAKE_VERSION VERSION_LESS 3.12 AND NOT TARGET CURL::libcurl)
add_library(libcurl UNKNOWN IMPORTED GLOBAL)
set_target_properties(libcurl PROPERTIES
IMPORTED_LOCATION ${CURL_LIBRARIES}
INTERFACE_INCLUDE_DIRECTORIES "${CURL_INCLUDE_DIRS}")
add_library(CURL_libcurl INTERFACE)
target_link_libraries(CURL_libcurl INTERFACE libcurl)
add_library(CURL::libcurl ALIAS CURL_libcurl)
endif()
endif()

@ -1 +1 @@
Subproject commit 766e3dc44b539bd9e5ba83c7d20a631ea3975aab
Subproject commit 7de390ca827cd457bd600c5d4517dc8de6a472c5

View File

@ -34,10 +34,15 @@ namespace llarp
assert(p == 0);
_addr = oxen::quic::Address{host, p};
if (parse_int(arg.substr(pos), _mask))
range = IPRange{std::move(_addr), std::move(_mask)};
if (parse_int(arg.substr(pos + 1), _mask))
range = IPRange{std::move(_addr), _mask};
else
log::warning(logcat, "Failed to construct IPRange from string input:{}", arg);
log::warning(
logcat,
"Failed to construct IPRange from string input:{} parsed into addr:{}, mask:{}",
arg,
_addr,
arg.substr(pos + 1));
}
catch (const std::exception& e)
{

View File

@ -99,10 +99,12 @@ namespace llarp
bool operator==(const ip_range_v& other) const
{
if (std::holds_alternative<ipv4_range>(other))
if (_is_ipv4 and std::holds_alternative<ipv4_range>(other))
return _ipv4_range() == std::get<ipv4_range>(other);
if (not _is_ipv4 and std::holds_alternative<ipv6_range>(other))
return _ipv6_range() == std::get<ipv6_range>(other);
return _ipv6_range() == std::get<ipv6_range>(other);
return false;
}
};

View File

@ -1,10 +1,5 @@
#pragma once
extern "C"
{
#include <netinet/ip.h>
}
#include <llarp/util/formattable.hpp>
#include <oxen/quic.hpp>

View File

@ -94,7 +94,7 @@ namespace llarp
{
if (auto q = addr.find_first_not_of("0123456789abcdef:."); q != std::string_view::npos)
throw std::invalid_argument{"Invalid address: does not look like IPv4 or IPv6!"};
if (!had_sq_brackets)
else if (!had_sq_brackets)
throw std::invalid_argument{"Invalid address: IPv6 addresses require [...] square brackets"};
}

View File

@ -232,7 +232,7 @@ namespace llarp
static constexpr Default ReachableDefault{true};
static constexpr Default HopsDefault{4};
static constexpr Default PathsDefault{4};
static constexpr Default IP6RangeDefault{"fd00::"};
static constexpr Default IP6RangeDefault{"[fd00::]/16"};
conf.define_option<bool>(
"network", "save-profiles", SaveProfilesDefault, Hidden, assignment_acceptor(save_profiles));
@ -1043,7 +1043,8 @@ namespace llarp
if (auto pos = arg_v.find(':'); pos != arg_v.npos)
{
host = arg_v.substr(0, pos);
// host = arg_v.substr(0, pos);
std::tie(host, p) = detail::parse_addr(arg_v.substr(0, pos), DEFAULT_LISTEN_PORT);
if (not llarp::parse_int<uint16_t>(arg_v.substr(pos + 1), p))
throw std::invalid_argument{"Failed to parse port in arg:{}"_format(arg)};
@ -1090,8 +1091,11 @@ namespace llarp
"router can be reached.",
},
[this, parse_addr_for_link](const std::string& arg) {
if (auto a = parse_addr_for_link(arg); a and a->is_addressable())
if (auto a = parse_addr_for_link(arg))
{
if (not a->is_addressable())
throw std::invalid_argument{"Listen address ({}) is not addressible!"_format(a)};
listen_addr = *a;
using_user_value = true;
using_new_api = true;

View File

@ -421,6 +421,8 @@ namespace llarp
conf._local_base_ip = _local_base_ip;
conf._if_name = _if_name;
log::info(logcat, "Processing remote client map...");
// process remote client map; addresses must be within _local_ip_range
auto& client_ips = conf._reserved_local_ips;
@ -566,8 +568,10 @@ namespace llarp
_session_endpoint = std::make_shared<handlers::SessionEndpoint>(*this);
_session_endpoint->configure();
log::info(logcat, "Creating QUIC link manager...");
_link_manager = LinkManager::make(*this);
log::info(logcat, "Creating QUIC tunnel...");
_quic_tun = QUICTunnel::make(*this);
// API config

View File

@ -2,8 +2,6 @@
#include "param_parser.hpp"
#include <llarp/rpc/rpc_request_definitions.hpp>
namespace llarp::rpc
{
using nlohmann::json;

View File

@ -4,7 +4,7 @@
#include <llarp/config/config.hpp>
#include <oxen/log/omq_logger.hpp>
// #include <oxen/log/omq_logger.hpp>
#include <oxenmq/address.h>
#include <oxenmq/oxenmq.h>