Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .copier-answers.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Changes here will be overwritten by Copier
_commit: v0.4.0
_commit: v0.4.2
_src_path: gh:deeplex/copier-cpp
email: henrik@gassmann.onl
full_name: Henrik Steffen Gaßmann
Expand Down
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,5 @@
"toolsToInstall": "copier,pipenv"
}
},
"postCreateCommand": "cd ${containerWorkspaceFolder}/docs && pipenv sync --dev",
"postCreateCommand": "cd '${containerWorkspaceFolder}' && mkdir -p build && ln -s -f x64-linux-clang/compile_commands.json ./build/compile_commands.json && cd ./docs && pipenv sync --dev",
}
12 changes: 6 additions & 6 deletions .github/workflows/cpp-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-24.04, windows-2022]
os: [ubuntu-24.04, windows-2025]
compiler: [gcc, clang, msvc]
exclude:
- os: ubuntu-24.04
compiler: msvc
- os: windows-2022
- os: windows-2025
compiler: gcc
include:
- os: macos-13
- os: macos-15-intel
compiler: gcc
triplet: x64-macos
- os: macos-15
Expand All @@ -40,7 +40,7 @@ jobs:
sudo add-apt-repository "deb http://apt.llvm.org/noble/ llvm-toolchain-noble-19 main"
sudo apt-get -qq update
sudo apt-get -qq -y install clang-19
- os: windows-2022
- os: windows-2025
triplet: x64-windows

permissions:
Expand All @@ -50,7 +50,7 @@ jobs:
CTEST_OUTPUT_ON_FAILURE: "1"

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v6

- name: Install required packages / compilers
if: ${{ matrix.install }}
Expand Down Expand Up @@ -102,7 +102,7 @@ jobs:
actions: read

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v6

- name: "Install clang-tools-20"
run: |
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,17 @@ on:

jobs:
build:
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
name: Build docs
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v6

- name: Setup Python
uses: actions/setup-python@v4
uses: actions/setup-python@v6
with:
python-version: "3.11"
python-version: "3.12"
cache: 'pipenv'
cache-dependency-path: docs/Pipfile.lock

Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
# http://creativecommons.org/publicdomain/zero/1.0/
#
########################################################################
cmake_minimum_required(VERSION 3.23...4.0)
cmake_minimum_required(VERSION 3.25)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/tools/cmake/")

########################################################################
Expand Down
10 changes: 5 additions & 5 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -186,18 +186,18 @@
}
},
{
"name": "x64-linux-gcc-12",
"name": "x64-linux-gcc-14",
"inherits": [
"x64-linux-gcc"
],
"cacheVariables": {
"VCPKG_CHAINLOAD_TOOLCHAIN_FILE": "${sourceDir}/tools/toolchains/x64-linux-gcc-12.cmake"
"VCPKG_CHAINLOAD_TOOLCHAIN_FILE": "${sourceDir}/tools/toolchains/x64-linux-gcc-14.cmake"
}
},
{
"name": "x64-linux-gcc-ci",
"inherits": [
"x64-linux-gcc-12"
"x64-linux-gcc-14"
]
},
{
Expand Down Expand Up @@ -229,8 +229,8 @@
"base"
],
"cacheVariables": {
"VCPKG_TARGET_TRIPLET": "x64-osx-gcc-12",
"VCPKG_CHAINLOAD_TOOLCHAIN_FILE": "${sourceDir}/tools/toolchains/x64-macos-gcc-12.cmake"
"VCPKG_TARGET_TRIPLET": "x64-macos-gcc-15",
"VCPKG_CHAINLOAD_TOOLCHAIN_FILE": "${sourceDir}/tools/toolchains/x64-macos-gcc-15.cmake"
},
"vendor": {
"microsoft.com/VisualStudioSettings/CMake/1.0": {
Expand Down
4 changes: 2 additions & 2 deletions docs/Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ verify_ssl = true
name = "pypi"

[packages]
sphinx = "~=7.0"
sphinx = "~=8.2.3"
sphinx-copybutton = "~=0.5.2"
sphinx-multiversion = "~=0.2.4"
furo = "==2023.5.20"
furo = "==2025.9.25"

[dev-packages]
esbonio = "*"
Expand Down
1,003 changes: 442 additions & 561 deletions docs/Pipfile.lock

Large diffs are not rendered by default.

41 changes: 23 additions & 18 deletions src/dplx/cncr/data_defined_status_domain.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -149,20 +149,22 @@ class data_defined_status_domain_type : public system_error::status_code_domain

static constexpr auto get() noexcept -> status_code_domain const &;

[[nodiscard]] constexpr auto name() const noexcept -> string_ref override
[[nodiscard]] constexpr auto
_do_name(_vtable_name_args &args) const noexcept -> int override
{
// NOLINTNEXTLINE(cppcoreguidelines-pro-bounds-array-to-pointer-decay)
constexpr std::string_view domainName{definition::domain_name};
return string_ref(domainName.data(), domainName.size());
args.ret = string_ref(domainName.data(), domainName.size());
return 0;
}

[[nodiscard]] constexpr auto payload_info() const noexcept
-> payload_info_t override
constexpr void
_do_payload_info(_vtable_payload_info_args &args) const noexcept override
{
static_assert(alignof(Enum) <= alignof(status_code_domain *));
// NOLINTNEXTLINE(bugprone-sizeof-expression)
return {sizeof(Enum), sizeof(status_code_domain *) + sizeof(Enum),
alignof(status_code_domain *)};
args.ret = {sizeof(Enum), sizeof(status_code_domain *) + sizeof(Enum),
alignof(status_code_domain *)};
}

protected:
Expand Down Expand Up @@ -287,12 +289,12 @@ class data_defined_status_domain_type : public system_error::status_code_domain
return false;
}

[[nodiscard]] DPLX_CNCR_STATUS_CONSTEXPR auto
_generic_code(system_error2::status_code<void> const &self) const noexcept
-> system_error::generic_code override
DPLX_CNCR_STATUS_CONSTEXPR void
_do_generic_code(_vtable_generic_code_args &args) const noexcept override
{
auto const &typedCode
= static_cast<data_defined_status_code<Enum> const &>(self);
= static_cast<data_defined_status_code<Enum> const &>(
args.code);
auto &&value = typedCode.value();

// find matching descriptor
Expand All @@ -302,19 +304,20 @@ class data_defined_status_domain_type : public system_error::status_code_domain
{
if (descriptor.value == value)
{
return descriptor.equivalent;
args.ret = descriptor.equivalent;
return;
}
}
// the given code can't be represented by the generic coding.
return system_error::errc::unknown;
args.ret = system_error::errc::unknown;
}

[[nodiscard]] DPLX_CNCR_STATUS_CONSTEXPR auto
_do_message(system_error2::status_code<void> const &self) const noexcept
-> string_ref override
_do_message(_vtable_message_args &args) const noexcept -> int override
{
auto const &typedCode
= static_cast<data_defined_status_code<Enum> const &>(self);
= static_cast<data_defined_status_code<Enum> const &>(
args.code);
auto &&value = typedCode.value();
constexpr std::span<value_descriptor const> descriptors(
definition::values);
Expand All @@ -324,12 +327,14 @@ class data_defined_status_domain_type : public system_error::status_code_domain
{
if (descriptor.value == value)
{
return string_ref(descriptor.description.data(),
descriptor.description.size());
args.ret = string_ref(descriptor.description.data(),
descriptor.description.size());
return 0;
}
}

return string_ref("unknown error code value");
args.ret = string_ref("unknown error code value");
return 0;
}

[[noreturn]] void _do_throw_exception(
Expand Down
Empty file added tools/ports/.gitkeep
Empty file.
28 changes: 0 additions & 28 deletions tools/ports/fmt/portfile.cmake

This file was deleted.

8 changes: 0 additions & 8 deletions tools/ports/fmt/usage

This file was deleted.

17 changes: 0 additions & 17 deletions tools/ports/fmt/vcpkg.json

This file was deleted.

91 changes: 91 additions & 0 deletions tools/ports/llfio/portfile.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
if ("polyfill-cxx20" IN_LIST FEATURES)
message(WARNING [=[
LLFIO depends on Outcome which depends on QuickCppLib which uses the vcpkg versions of gsl-lite and byte-lite, rather than the versions tested by QuickCppLib's, Outcome's and LLFIO's CI. It is not guaranteed to work with other versions, with failures experienced in the past up-to-and-including runtime crashes. See the warning message from QuickCppLib for how you can pin the versions of those dependencies in your manifest file to those with which QuickCppLib was tested. Do not report issues to upstream without first pinning the versions as QuickCppLib was tested against.
]=])
endif()


vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO ned14/llfio
REF b3c9308f143e27161c40f6d52a8fd18e8f05761b
SHA512 eb1b629b00fc28da939b0766ce567896da098401d71bd65b895f34ccd805d5ac99c0e45cc1733e63ce985c22b6d2118e576fb49a8e3a6f02170b9fe378e801bd
HEAD_REF develop
)

vcpkg_from_github(
OUT_SOURCE_PATH NTKEC_SOURCE_PATH
REPO ned14/ntkernel-error-category
REF 5e50ff9af36a029c8ead9e0a833aa78304e95f28
SHA512 a3b8bfba8b22c79913ced23358c4a5ec56d2f2f8ca8da3ebd2e7cfaa783363d92d9de1b49766756c7b008114eee31c1509195232adcc364446eae724489be930
HEAD_REF master
)

vcpkg_check_features(
OUT_FEATURE_OPTIONS LLFIO_FEATURE_OPTIONS
FEATURES
status-code LLFIO_USE_EXPERIMENTAL_SG14_STATUS_CODE
)

# LLFIO expects ntkernel-error-category to live inside its include directory
file(REMOVE_RECURSE "${SOURCE_PATH}/include/llfio/ntkernel-error-category")
file(RENAME "${NTKEC_SOURCE_PATH}" "${SOURCE_PATH}/include/llfio/ntkernel-error-category")

set(extra_config)
# cmake does not correctly set CMAKE_SYSTEM_PROCESSOR when targeting ARM on Windows
if(VCPKG_TARGET_IS_WINDOWS AND (VCPKG_TARGET_ARCHITECTURE STREQUAL "arm" OR VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64"))
list(APPEND extra_config -DLLFIO_ASSUME_CROSS_COMPILING=ON)
endif()
# setting CMAKE_CXX_STANDARD here to prevent llfio from messing with compiler flags
# the cmake package config requires said C++ standard target transitively via quickcpplib
if ("cxx20" IN_LIST FEATURES)
list(APPEND extra_config -DCMAKE_CXX_STANDARD=20)
elseif("cxx17" IN_LIST FEATURES)
list(APPEND extra_config -DCMAKE_CXX_STANDARD=17)
endif()

# quickcpplib parses CMAKE_MSVC_RUNTIME_LIBRARY and cannot support the default crt linkage generator expression from vcpkg
if(VCPKG_TARGET_IS_WINDOWS)
if(VCPKG_CRT_LINKAGE STREQUAL "dynamic")
list(APPEND extra_config -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded$$<$$<CONFIG:Debug>:Debug>DLL)
else()
list(APPEND extra_config -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded$$<$$<CONFIG:Debug>:Debug>)
endif()
endif()

vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
-Dllfio_IS_DEPENDENCY=On
"-DCMAKE_PREFIX_PATH=${CURRENT_INSTALLED_DIR}"
${LLFIO_FEATURE_OPTIONS}
-DLLFIO_FORCE_OPENSSL_OFF=ON
-DLLFIO_ENABLE_DEPENDENCY_SMOKE_TEST=ON # Leave this always on to test everything compiles
-DCMAKE_DISABLE_FIND_PACKAGE_Git=ON
-DCXX_CONCEPTS_FLAGS=
-DCXX_COROUTINES_FLAGS=
-DCMAKE_POLICY_DEFAULT_CMP0091=NEW # MSVC <filesystem> detection fails without this
${extra_config}
)

if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
vcpkg_cmake_build(TARGET install.dl)
elseif(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
vcpkg_cmake_build(TARGET install.sl)
endif()

if("run-tests" IN_LIST FEATURES)
vcpkg_cmake_build(TARGET test)
endif()

vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/llfio)

file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include" "${CURRENT_PACKAGES_DIR}/debug/share")

if("status-code" IN_LIST FEATURES)
set(_USAGE_FEATURE "status-code")
else()
set(_USAGE_FEATURE "error-code")
endif()
file(INSTALL "${CURRENT_PORT_DIR}/usage-${_USAGE_FEATURE}-${VCPKG_LIBRARY_LINKAGE}" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME usage)
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/Licence.txt")
10 changes: 10 additions & 0 deletions tools/ports/llfio/usage-error-code-dynamic
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
The package llfio provides two CMake targets:

find_package(llfio CONFIG REQUIRED)

- If you want the header-only form of LLFIO:
find_package(Threads REQUIRED)
target_link_libraries(main PUBLIC llfio::hl)

- If you want the shared library form of LLFIO with shared NT kernel error code category:
target_link_libraries(main PUBLIC llfio::dl llfio::ntkernel-error-category::dl)
10 changes: 10 additions & 0 deletions tools/ports/llfio/usage-error-code-static
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
The package llfio provides two CMake targets:

find_package(llfio CONFIG REQUIRED)

- If you want the header-only form of LLFIO:
find_package(Threads REQUIRED)
target_link_libraries(main PUBLIC llfio::hl)

- If you want the static library form of LLFIO with static NT kernel error code category:
target_link_libraries(main PUBLIC llfio::sl llfio::ntkernel-error-category::sl)
Loading
Loading