Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
338d50e
Export route_params vtable for shared builds
sentientsergio Dec 4, 2025
ce7c5e2
Note MinGW export requirement
sentientsergio Dec 4, 2025
27574ba
Clarify Windows export guidance
sentientsergio Dec 4, 2025
2cac420
Export public classes for MSVC dll-interface
sentientsergio Dec 5, 2025
863d0e3
Remove member exports after class-level export
sentientsergio Dec 5, 2025
7d4e551
Drop member exports now that classes are exported
sentientsergio Dec 5, 2025
f40a6a9
Export base classes and clean member annotations
sentientsergio Dec 5, 2025
236b8cc
Add Windows quick CI for fix/route-params-export
sentientsergio Dec 5, 2025
2b000aa
Export parser bases and serializer stream for Windows
sentientsergio Dec 5, 2025
7705369
Fix dll-interface annotations on parser/request/response bases
sentientsergio Dec 5, 2025
7bd47a4
Export message_base for Windows dll-interface
sentientsergio Dec 5, 2025
b6fbc1f
Remove member exports from message_base
sentientsergio Dec 5, 2025
e6be3bd
Export fields_base and drop member exports
sentientsergio Dec 5, 2025
a6eba49
Export detail::header to satisfy dll-interface
sentientsergio Dec 5, 2025
9126ea0
Fix Windows exports for header members
sentientsergio Dec 5, 2025
94777b8
Export route_params base and task to silence MSVC C4251
sentientsergio Dec 5, 2025
4b17660
Make route_params::task dtor out-of-line
sentientsergio Dec 5, 2025
cf94389
Export header_limits at definition; fix forward decl
sentientsergio Dec 5, 2025
90caa4c
Add MSVC macros to silence DLL-interface warnings
sentientsergio Dec 5, 2025
e1b53f5
Define MSVC warning suppression macros in config
sentientsergio Dec 5, 2025
f3e5e60
Fix header_limits forward decl for MinGW
sentientsergio Dec 5, 2025
8840763
Export fields_base ostream operator for shared builds
sentientsergio Dec 5, 2025
f9a0f32
Silence MSVC C4251 for detail::header metadata member
sentientsergio Dec 5, 2025
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: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ env:

jobs:
runner-selection:
if: ${{ !((github.event_name == 'push' && github.ref == 'refs/heads/fix/route-params-export') || (github.event_name == 'pull_request' && github.head_ref == 'fix/route-params-export')) }}
name: Runner Selection
runs-on: ${{ github.repository_owner == 'boostorg' && fromJSON('[ "self-hosted", "linux", "x64", "ubuntu-latest-aws" ]') || 'ubuntu-latest' }}
outputs:
Expand All @@ -49,6 +50,7 @@ jobs:
uses: cppalliance/[email protected]

build:
if: ${{ !((github.event_name == 'push' && github.ref == 'refs/heads/fix/route-params-export') || (github.event_name == 'pull_request' && github.head_ref == 'fix/route-params-export')) }}
needs: [ runner-selection ]
defaults:
run:
Expand Down
194 changes: 194 additions & 0 deletions .github/workflows/windows-quick.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,194 @@
name: Windows Quick CI

on:
push:
branches:
- fix/route-params-export
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
workflow_dispatch:

concurrency:
group: ${{ format('windows-quick:{0}', github.ref) }}
cancel-in-progress: true

env:
GIT_FETCH_JOBS: 8
NET_RETRY_COUNT: 5
DEFAULT_BUILD_VARIANT: debug,release
TZ: "Europe/London"

jobs:
windows:
if: ${{ github.event_name != 'pull_request' || github.head_ref == 'fix/route-params-export' }}
name: ${{ matrix.name }}
runs-on: windows-2022
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
include:
- name: "MSVC 14.34 (shared, x64)"
compiler: "msvc"
version: "14.34"
cxxstd: "17,20"
latest-cxxstd: "20"
b2-toolset: "msvc-14.3"
generator: "Visual Studio 17 2022"
shared: true
build-type: "Release"

- name: "MSVC 14.34 (shared, x86)"
compiler: "msvc"
version: "14.34"
cxxstd: "17,20"
latest-cxxstd: "20"
b2-toolset: "msvc-14.3"
generator: "Visual Studio 17 2022"
shared: true
build-type: "Release"
x86: true

- name: "MinGW (shared)"
compiler: "mingw"
version: "*"
cxx: "g++"
cc: "gcc"
b2-toolset: "gcc"
generator: "MinGW Makefiles"
shared: true
build-type: "Debug"

steps:
- name: Clone Boost.HTTP.Proto
uses: actions/checkout@v3
with:
path: http-proto-root

- name: Clone Boost.Buffers
uses: actions/checkout@v3
with:
path: buffers-root
repository: cppalliance/buffers
ref: develop

- name: Clone Boost.Capy
uses: actions/checkout@v3
with:
path: capy-root
repository: cppalliance/capy
ref: develop

- name: Setup C++
uses: alandefreitas/cpp-actions/[email protected]
id: setup-cpp
with:
compiler: ${{ matrix.compiler }}
version: ${{ matrix.version }}
trace-commands: true

- name: Install Packages (Windows)
uses: alandefreitas/cpp-actions/[email protected]
id: package-install-windows
with:
vcpkg: zlib brotli
vcpkg-dir: vcpkg-root
vcpkg-triplet: ${{ matrix.x86 && 'x86-windows-static' || 'x64-windows' }}

- name: Clone Boost
uses: alandefreitas/cpp-actions/[email protected]
id: boost-clone
with:
branch: ${{ (github.ref_name == 'master' && github.ref_name) || 'develop' }}
boost-dir: boost-source
modules-exclude-paths: ''
scan-modules-dir: |
http-proto-root
buffers-root
capy-root
scan-modules-ignore: |
http_proto
buffers
capy

- name: Patch user-config.jam (Windows)
id: patch-user-config
shell: bash
run: |
set -xe
home=$(pwd)

triplet=${{ matrix.x86 && 'x86-windows-static' || 'x64-windows' }}
addrmdl=${{ matrix.x86 && '32' || '64' }}

echo "import-search ${home}/boost-root/libs/capy/build ;" | sed 's/\/d\//D:\//g' >> user-config.jam
echo "using zlib : : <include>\"${home}/vcpkg-root/installed/${triplet}/include\" <search>\"${home}/vcpkg-root/installed/${triplet}/lib\" <dll-path>\"${home}/vcpkg-root/installed/${triplet}/bin\" <name>zlib : <address-model>${addrmdl} ;" | sed 's/\/d\//D:\//g' >> user-config.jam
echo "using brotli : : <include>\"${home}/vcpkg-root/installed/${triplet}/include\" <search>\"${home}/vcpkg-root/installed/${triplet}/lib\" <dll-path>\"${home}/vcpkg-root/installed/${triplet}/bin\" : <address-model>${addrmdl} ;" | sed 's/\/d\//D:\//g' >> user-config.jam

cat user-config.jam

toolchain=$(echo "$GITHUB_WORKSPACE/vcpkg-root/scripts/buildsystems/vcpkg.cmake" | sed 's/\/d\//D:\//g' )
echo "toolchain=${toolchain}" >> $GITHUB_OUTPUT

- name: Patch Boost
id: patch
shell: bash
run: |
set -xe
module=${GITHUB_REPOSITORY#*/}
echo "module=$module" >> $GITHUB_OUTPUT

workspace_root=$(echo "$GITHUB_WORKSPACE" | sed 's/\\/\//g')
echo -E "workspace_root=$workspace_root" >> $GITHUB_OUTPUT

rm -r "boost-source/libs/$module" || true

cp -r boost-source boost-root

cd boost-root
boost_root="$(pwd)"
boost_root=$(echo "$boost_root" | sed 's/\\/\//g')
echo -E "boost_root=$boost_root" >> $GITHUB_OUTPUT

cp -r "$workspace_root"/http-proto-root "libs/$module"
cp -r "$workspace_root"/buffers-root libs/buffers
cp -r "$workspace_root"/capy-root libs/capy

- name: Boost B2 Workflow
uses: alandefreitas/cpp-actions/[email protected]
env:
ASAN_OPTIONS: detect_invalid_pointer_pairs=2:strict_string_checks=1:detect_stack_use_after_return=1:check_initialization_order=1:strict_init_order=1
with:
source-dir: boost-root
modules: http_proto
toolset: ${{ matrix.b2-toolset }}
build-variant: ${{ matrix.build-type }}
cxx: ${{ steps.setup-cpp.outputs.cxx || matrix.cxx || '' }}
cxxstd: ${{ matrix.cxxstd }}
address-model: ${{ (matrix.x86 && '32') || '64' }}
shared: ${{ matrix.shared }}
rtti: on,off
user-config: ${{ format('{0}/user-config.jam', steps.patch.outputs.workspace_root) }}
stop-on-error: true

- name: Root Project CMake Workflow
uses: alandefreitas/cpp-actions/[email protected]
if: ${{ matrix.compiler == 'msvc' }}
with:
source-dir: boost-root/libs/${{ steps.patch.outputs.module }}
build-dir: __build_root_test__
build-target: tests
run-tests: true
generator: ${{ matrix.generator }}
build-type: ${{ matrix.build-type }}
install: false
cxxstd: ${{ matrix.latest-cxxstd }}
cc: ${{ steps.setup-cpp.outputs.cc || matrix.cc }}
cxx: ${{ steps.setup-cpp.outputs.cxx || matrix.cxx }}
shared: ${{ matrix.shared }}
cmake-version: '>=3.20'
extra-args: |
-D Boost_VERBOSE=ON
-D BOOST_INCLUDE_LIBRARIES="${{ steps.patch.outputs.module }}"
export-compile-commands: false
toolchain: ${{ steps.patch-user-config.outputs.toolchain }}
4 changes: 4 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,7 @@ T default_value();
- Concise, dry answers
- Full files, not diffs
- Accurate, compiling C++ code

## Windows/MinGW note

- On Windows (MinGW/MSVC) shared builds, apply the module's `*_DECL` macro to polymorphic class declarations, not just members, to export the vtable.
12 changes: 12 additions & 0 deletions include/boost/http_proto/detail/config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,18 @@ namespace http_proto {
# define BOOST_HTTP_PROTO_DECL
# endif

// MSVC-only helpers to locally suppress benign DLL-interface warnings
# if defined(BOOST_MSVC)
# define BOOST_HTTP_PROTO_MSVC_WARNING_PUSH __pragma(warning(push))
# define BOOST_HTTP_PROTO_MSVC_WARNING_POP __pragma(warning(pop))
# define BOOST_HTTP_PROTO_MSVC_DISABLE_4251_4275 \
__pragma(warning(disable:4251 4275))
# else
# define BOOST_HTTP_PROTO_MSVC_WARNING_PUSH
# define BOOST_HTTP_PROTO_MSVC_WARNING_POP
# define BOOST_HTTP_PROTO_MSVC_DISABLE_4251_4275
# endif

# if !defined(BOOST_HTTP_PROTO_SOURCE) && !defined(BOOST_ALL_NO_LIB) && !defined(BOOST_HTTP_PROTO_NO_LIB)
# define BOOST_LIB_NAME boost_http_proto
# if defined(BOOST_ALL_DYN_LINK) || defined(BOOST_HTTP_PROTO_DYN_LINK)
Expand Down
11 changes: 6 additions & 5 deletions include/boost/http_proto/detail/header.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,10 @@ struct empty
kind param;
};

struct header
BOOST_HTTP_PROTO_MSVC_WARNING_PUSH
BOOST_HTTP_PROTO_MSVC_DISABLE_4251_4275

struct BOOST_HTTP_PROTO_DECL header
{
// +------------+---------+------+------------+-----------------------------+
// | start-line | headers | \r\n | free space | entry[count-1] ... entry[0] |
Expand Down Expand Up @@ -157,20 +160,16 @@ struct header
static header&
get(fields_base& f) noexcept;

BOOST_HTTP_PROTO_DECL
static header const*
get_default(detail::kind k) noexcept;

// called from parser
explicit header(empty) noexcept;

BOOST_HTTP_PROTO_DECL
header(detail::kind) noexcept;

BOOST_HTTP_PROTO_DECL
void swap(header&) noexcept;

BOOST_HTTP_PROTO_DECL
bool keep_alive() const noexcept;

static std::size_t bytes_needed(
Expand Down Expand Up @@ -222,6 +221,8 @@ struct header
system::error_code&) noexcept;
};

BOOST_HTTP_PROTO_MSVC_WARNING_POP

} // detail
} // http_proto
} // boost
Expand Down
Loading