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
18 changes: 9 additions & 9 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,7 @@ webcpp/
boost_test_runner.cpp Boost.Test's header-only framework, for webcpp.boost-test
(guidelines chapter 8)
boost/ Jamfile: the compiled Boost libraries built from Boost's sources
(/webcpp//boost_url, boost_charconv, boost_locale and
boost_cobalt)
(/webcpp//boost_url, boost_charconv and boost_locale)
node-test/ the test support every test and example links (/webcpp//node-test,
chapter 4): include/webcpp/test/exit_status.hpp on every target, and
node-pre.js, the pre-js on emscripten that fails a test under node whose
Expand Down Expand Up @@ -327,8 +326,8 @@ cannot read stops the build too, naming the directory.

**Boost's sources.** A compiled Boost library that a webcpp library needs is
built from Boost's own sources, for every target, as Boost.JSON's definitions
are: `/webcpp//boost_url`, `/webcpp//boost_charconv`, `/webcpp//boost_locale`
and `/webcpp//boost_cobalt` (`tools/boost/Jamfile`). An installed Boost has none
are: `/webcpp//boost_url`, `/webcpp//boost_charconv` and `/webcpp//boost_locale`
(`tools/boost/Jamfile`). An installed Boost has none
(Homebrew's ships its own `libboost_url` and no `libs/url/src`), so the build
reads them from `-sBOOST_SOURCE=<dir>` on b2's command line (or `-s
BOOST_SOURCE=<dir>`), which wins, else `BOOST_SOURCE` as a user-config.jam's
Expand All @@ -350,9 +349,10 @@ looks.

**Cobalt shipped sources.** `libs/cobalt/sources.json` declares the core,
runner, optional SSL and additional threaded sources per target. The independent
library owns them. `/webcpp//boost_cobalt` aliases its plain core;
library owns them. `/webcpp/cobalt//core` is its plain core;
`/webcpp/cobalt//cobalt` supplies exactly one runner for a user-defined `co_main`.
The older Asio Cobalt targets are compatibility aliases. Native core and runner
Cobalt's targets have one name each: neither Asio nor the Jamroot declares an
alias to them. Native core and runner
sources are unchanged Boost 1.92. Wasm implementations are shipped under explicit
WebCPP paths; consumers never run an importer or prepare replacement Boost headers.
Cobalt does not require an external `BOOST_SOURCE` tree. Boost.URL, Charconv,
Expand All @@ -372,8 +372,8 @@ with the shared source-built OpenSSL/CA provider. This is the owner-approved
exception to native Boost identity. `/webcpp/cobalt//cobalt_ssl` adds the runner.
Plain Cobalt does not link OpenSSL. Browser HTTPS/WSS uses the browser's TLS.
State, transfer cancellation and shutdown drivers live in `libs/cobalt/test/tls`.
Asio's existing integration aliases preserve their callers. Native upstream
OpenSSL tests remain distinct from WebCPP TLS witnesses and from WASI tests.
Native upstream OpenSSL tests remain distinct from WebCPP TLS witnesses and from
WASI tests.

**Native upstream limitations.** Native Cobalt retains Boost's composition,
accept, write-at and missing-no-exceptions-promise-hook limitations, documented
Expand All @@ -382,7 +382,7 @@ retains Boost's Windows IOCP worker/timer allocation limitation. Historical patc
inputs survive in `libs/asio/upstream/reference/windows-iocp`, without a consumer
build rule. A dry run on this machine is not Windows runtime evidence.

**Cobalt without exceptions.** A build that uses `/webcpp//boost_cobalt` with
**Cobalt without exceptions.** A build that uses `/webcpp/cobalt//core` with
`exception-handling=off` emits a non-fatal configuration warning with
https://github.com/boostorg/cobalt/issues/287 and recommends enabling exception
handling. Boost 1.92 with libc++ can abort when a pending task is moved, including
Expand Down
25 changes: 12 additions & 13 deletions CODING-GUIDELINES.md
Original file line number Diff line number Diff line change
Expand Up @@ -6519,7 +6519,7 @@ Asio's first library-main CI and the final joint candidate remain separate gates
owner asked on 2026-10-10 that every variant be tested; native runs without
exceptions are departure 5.
Source: `genesis/specs/asio/spec.md`, Exceptions (proposals).
- **`/webcpp//boost_cobalt` follows the consumer's exception setting, and
- **`/webcpp/cobalt//core` follows the consumer's exception setting, and
without exceptions b2 prints a non-fatal warning that names Cobalt's issue
287.** The owner asked on 2026-10-14 to remove the blanket refusal; in Boost
1.92 moving a pending task calls `std::make_exception_ptr`, which aborts
Expand Down Expand Up @@ -6626,8 +6626,9 @@ Asio's first library-main CI and the final joint candidate remain separate gates
**Boost.Cobalt.**

- **Cobalt owns separate native and Wasm core and runner sources, selected
by `/webcpp/cobalt//cobalt`; the old Asio and root names are compatibility
aliases.** Native `src/native/main.cpp` retains upstream behavior. Wasm
by `/webcpp/cobalt//cobalt`; neither Asio nor the Jamroot declares an alias
to a Cobalt target (the owner's decision of 2026-11-14).** Native
`src/native/main.cpp` retains upstream behavior. Wasm
`src/wasm/main.cpp` supplies `main_promise::run_main` and `final_suspend`
over `webcpp::asio::io_context{WEBCPP_ASIO_BACKEND_CONCURRENCY_HINT_1}`,
which adds bounded turns on Emscripten. `co_main` calls the separately
Expand Down Expand Up @@ -6680,7 +6681,6 @@ supersedes the temporary system-OpenSSL choice; it does not reopen every rule.
Boost's unchanged constructors.
- Plain `/webcpp/cobalt//core` omits SSL; the explicit
`/webcpp/cobalt//io_ssl` supplies the corrected native or WASI wrapper.
The old `/webcpp//boost_cobalt` and `boost_cobalt_io_ssl` names are aliases.
- The former shared system OpenSSL/native-only bridge is superseded by the
pinned static source provider on native and WASIp3, without waiting for crypto.
Chapter 5 rule 7 retains its Configure/Make and exact-archive canary exception.
Expand Down Expand Up @@ -6780,9 +6780,8 @@ The closure record distinguishes the baseline CI from validation of later change
- **`/webcpp/cobalt//cobalt` builds on WASIp2/P3 from its shipped Wasm headers
and sources: signal, serial-port and seqpacket sources are left out,
`src/wasm/thread.cpp` comes only with threads, and the archive and its
consumers share the selected Asio backend and thread profile.** The old
`/webcpp/asio//cobalt` name is a compatibility alias. Unsupported local
sockets, signals and serial ports must not break the IP APIs, and an archive
consumers share the selected Asio backend and thread profile.** Unsupported
local sockets, signals and serial ports must not break the IP APIs, and an archive
and its program must agree about headers, threads and exceptions.
Source: `sources.json`, `src/Jamfile` (cobalt);
`docs/superpowers/plans/2026-10-16-cobalt-wasip3.md` records the original port.
Expand Down Expand Up @@ -7114,12 +7113,12 @@ What webcpp does not have yet, and the chapters that mention it:
user's allocator, applied first to xactor, xstate and wasi, whose response
holds its body as a `std::string`; pratt is born with the rule, and
trystero through `std::pmr` (chapter 4).
- **Compiled Boost libraries.** Boost.URL, Boost.Charconv, Boost.Locale and
Boost.Cobalt are built from Boost's sources (`/webcpp//boost_url`,
`/webcpp//boost_charconv`, `/webcpp//boost_locale`, `/webcpp//boost_cobalt`).
Boost.Locale requires exceptions. Boost.Cobalt follows the consumer's exception
setting with a non-fatal warning when disabled (AGENTS.md chapter 1). This is not a
guarantee that all of Cobalt
- **Compiled Boost libraries.** Boost.URL, Boost.Charconv and Boost.Locale are
built from Boost's sources (`/webcpp//boost_url`, `/webcpp//boost_charconv`,
`/webcpp//boost_locale`); Boost.Cobalt from the sources libs/cobalt ships
(`/webcpp/cobalt//core`). Boost.Locale requires exceptions. Boost.Cobalt
follows the consumer's exception setting with a non-fatal warning when
disabled (AGENTS.md chapter 1). This is not a guarantee that all of Cobalt
works without exceptions: in Boost 1.92, moving a pending task calls
std::make_exception_ptr, which aborts with libc++ and -fno-exceptions, even
when the application uses as_result. Eager promises and timer cancellation
Expand Down
9 changes: 1 addition & 8 deletions Jamroot
Original file line number Diff line number Diff line change
Expand Up @@ -435,13 +435,6 @@ for local name in boost_url boost_charconv boost_locale boost_context
alias $(name) : tools/boost//$(name) : <conditional>@boost-source-usable ;
}

# Cobalt owns shipped sources and needs matching Boost headers, not an external
# Boost source checkout. Legacy aliases retain the same dependency contract.
for local name in boost_cobalt boost_cobalt_io_ssl
{
alias $(name) : tools/boost//$(name) ;
}

# What every test and example of a library links (tools/webcpp.jam): the
# header webcpp/test/exit_status.hpp on every target, and on emscripten the
# pre-js that fails a test under node whose main did not finish, and stops
Expand Down Expand Up @@ -794,7 +787,7 @@ notfile dist : @dist : : <dependency>doc <webcpp-boost-check>off ;
webcpp-lint-headers.declare-lint-headers ;

explicit boost_version throw_exception boost_json boost_url boost_charconv
boost_locale boost_cobalt boost_cobalt_io_ssl node-test emscripten-reference test example doc install $(.install)
boost_locale node-test emscripten-reference test example doc install $(.install)
declared-targets declared-lanes site site-serve check-release whats-new
dist ;
if [ glob site/Jamfile ]
Expand Down
2 changes: 0 additions & 2 deletions doc/releases/0.1.0.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,6 @@ Boost's.
for every target.
* Added `/webcpp//boost_locale`, Boost.Locale without ICU built from Boost's
sources for every target; a program that uses it needs exceptions.
* Added `/webcpp//boost_cobalt`, Boost.Cobalt built from Boost's sources for
native programs, which need exceptions.
* Fixed a lane's alias and a library's generated files running the
configuration check of Boost, which neither needs.
* Added `webcpp.data`, which gives a test a directory of the host's at the
Expand Down
2 changes: 1 addition & 1 deletion libs/asio
2 changes: 1 addition & 1 deletion libs/cobalt
2 changes: 1 addition & 1 deletion libs/document
Submodule document updated 1 files
+2 −3 example/Jamfile
7 changes: 0 additions & 7 deletions tools/boost/Jamfile
Original file line number Diff line number Diff line change
Expand Up @@ -257,10 +257,3 @@ compiled boost_locale : $(.locale)
: libs/locale/src holds no Boost.Locale sources, or only some of them
: <define>BOOST_LOCALE_SOURCE <conditional>@locale-configuration
: <define>BOOST_LOCALE_NO_LIB=1 <target-os>darwin:<library>iconv ;

# Boost.Cobalt without its default co_main runner (main.cpp), which webcpp
# supplies separately, and io/ssl.cpp, which needs OpenSSL.
# Cobalt-specific sources and checked corrections belong to libs/cobalt.
alias boost_cobalt : /webcpp/cobalt//core ;
alias boost_cobalt_io_ssl : /webcpp/cobalt//io_ssl ;
explicit boost_cobalt boost_cobalt_io_ssl ;
2 changes: 1 addition & 1 deletion tools/ci/actions/boost/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#
# The headers are installed, and beside them, in <prefix>/source, the sources of Boost's compiled
# libraries, from which webcpp builds those it needs (the Jamroot's /webcpp//boost_url,
# boost_charconv, boost_locale and boost_cobalt).
# boost_charconv and boost_locale; libs/cobalt ships its own sources).
set -euo pipefail

version=1.92.0
Expand Down
2 changes: 1 addition & 1 deletion tools/lint/lint_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -1059,7 +1059,7 @@ def test_clang_tidy_uses_shipped_cobalt_sources_on_a_clean_tree(root):
harness.copy_integration_libraries(root, 'config', 'asio', 'cobalt')
prepare(root)
append(root, 'libs/demo/test/Jamfile',
'webcpp.run cobalt : cobalt.cpp : <library>/webcpp//boost_cobalt : wasip3 ;\n')
'webcpp.run cobalt : cobalt.cpp : <library>/webcpp/cobalt//core : wasip3 ;\n')
write(root, 'libs/demo/test/cobalt.cpp', CPP + '\n'
'int main() {\n'
' return 1;\n'
Expand Down
24 changes: 12 additions & 12 deletions tools/test/boost_libraries_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,7 @@ def test_boost_locale_is_refused_without_exceptions(root: Path) -> None:

COBALT_JAMFILE = ('import webcpp ;\n'
'webcpp.targets native emscripten ;\n'
'webcpp.run coroutines : coroutines.cpp : <library>/webcpp//boost_cobalt '
'webcpp.run coroutines : coroutines.cpp : <library>/webcpp/cobalt//core '
'<toolset>clang,<exception-handling>off:'
'<cxxflags>-Wno-error=coroutine-missing-unhandled-exception ;\n')

Expand Down Expand Up @@ -631,7 +631,7 @@ def test_boost_locale_is_refused_without_exceptions(root: Path) -> None:
def test_cobalt_consumes_shipped_sources_without_external_boost_source(root: Path) -> None:
harness.copy_integration_libraries(root, 'config', 'asio', 'cobalt')
harness.without_boost_source(root)
target = '/webcpp//boost_cobalt'
target = '/webcpp/cobalt//core'
harness.expect(harness.run_b2(root, '-a', '-j4', target), True)
assert len(list((root / 'bin').rglob('libnative-core.a'))) == 1
# An unrelated source-tree option does not replace the shipped Cobalt inventory.
Expand All @@ -649,7 +649,7 @@ def test_cobalt_core_omits_shipped_runner_and_ssl(root: Path) -> None:
for name in ('native/main.cpp', 'native/io/ssl.cpp', 'native_ssl.cpp',
'native_ssl_transfer.cpp', 'wasm/main.cpp', 'wasm/io/ssl.cpp'):
(root / 'libs/cobalt/src' / name).write_text('#error Core compiled an optional source\n')
result = harness.run_b2(root, '-a', '-j4', '-d+2', '/webcpp//boost_cobalt')
result = harness.run_b2(root, '-a', '-j4', '-d+2', '/webcpp/cobalt//core')
harness.expect(result, True)
compiled = {name for line in result.stdout.splitlines() if ' -c ' in line
for name in re.findall(r'"libs/cobalt/(src/[^" ]+[.]cpp)"', line)}
Expand All @@ -659,7 +659,7 @@ def test_cobalt_core_omits_shipped_runner_and_ssl(root: Path) -> None:
assert not list((root / 'bin').rglob('libssl.a'))


def test_boost_cobalt_warns_only_for_disabled_exceptions(root: Path) -> None:
def test_cobalt_core_warns_only_for_disabled_exceptions(root: Path) -> None:
harness.copy_integration_libraries(root, 'config', 'asio', 'cobalt')
# Missing, unconditional or repeated warnings would hide or misrepresent the risk.
# Dry runs exercise dependency configuration without recompiling the archive.
Expand All @@ -685,8 +685,8 @@ def test_boost_cobalt_warns_only_for_disabled_exceptions(root: Path) -> None:
harness.expect(variants, True)
assert variants.stdout.count(issue) == 1, variants.stdout
# A consumer may require exceptions even in an otherwise exception-free build.
forced = COBALT_JAMFILE.replace('<library>/webcpp//boost_cobalt',
'<library>/webcpp//boost_cobalt <exception-handling>on')
forced = COBALT_JAMFILE.replace('<library>/webcpp/cobalt//core',
'<library>/webcpp/cobalt//core <exception-handling>on')
(root / 'libs/coroutines/test/Jamfile').write_text(forced)
result = harness.run_b2(root, '-a', '-n', 'exception-handling=off', targets[0])
harness.expect(result, True)
Expand Down Expand Up @@ -780,7 +780,7 @@ def test_msvc_commands_preserve_native_header_identity(root: Path) -> None:
assert '/external:anglebrackets' not in words, command


def test_boost_cobalt_thread_joins_without_exceptions(root: Path) -> None:
def test_cobalt_core_thread_joins_without_exceptions(root: Path) -> None:
harness.copy_integration_libraries(root, 'config', 'asio', 'cobalt')
# Native Boost retains the missing no-EH hook. Keep that known Clang
# diagnostic visible while checking thread execution and joining separately.
Expand Down Expand Up @@ -808,7 +808,7 @@ def test_boost_cobalt_thread_joins_without_exceptions(root: Path) -> None:
harness.add_library(root, 'thread_probe',
'import webcpp ;\nwebcpp.targets native ;\n'
'webcpp.run thread : thread.cpp : <threading>multi '
'<library>/webcpp//boost_cobalt '
'<library>/webcpp/cobalt//core '
'<toolset>clang,<exception-handling>off:'
'<cxxflags>-Wno-error=coroutine-missing-unhandled-exception ;\n',
{'thread.cpp': source})
Expand All @@ -819,7 +819,7 @@ def test_boost_cobalt_thread_joins_without_exceptions(root: Path) -> None:
assert passed(result) == {'thread'}, result.stdout[-4000:]


def test_boost_cobalt_preserves_exception_setting(root: Path) -> None:
def test_cobalt_core_preserves_exception_setting(root: Path) -> None:
harness.copy_integration_libraries(root, 'config', 'asio', 'cobalt')
# A blanket exception requirement would reject a valid result-based consumer.
# Build the real archive and execute eager promises and cancellation in each mode.
Expand Down Expand Up @@ -900,9 +900,9 @@ def test_boost_context_refuses_unverified_wasm(root: Path) -> None:
test_boost_context_refuses_unverified_wasm,
test_cobalt_consumes_shipped_sources_without_external_boost_source,
test_cobalt_core_omits_shipped_runner_and_ssl,
test_boost_cobalt_warns_only_for_disabled_exceptions,
test_boost_cobalt_thread_joins_without_exceptions,
test_boost_cobalt_preserves_exception_setting,
test_cobalt_core_warns_only_for_disabled_exceptions,
test_cobalt_core_thread_joins_without_exceptions,
test_cobalt_core_preserves_exception_setting,
test_native_sources_and_consumers_do_not_select_windows_overlays,
test_msvc_commands_preserve_native_header_identity,
test_boost_url_links_on_every_target,
Expand Down
29 changes: 25 additions & 4 deletions tools/test/cobalt_ownership_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,32 @@ def test_asio_builds_without_cobalt_or_openssl(root: Path) -> None:
assert not list((root / 'bin').rglob('libssl.a'))


def test_legacy_and_canonical_runner_have_one_definition(root: Path) -> None:
def test_only_the_cobalt_library_names_cobalt(root: Path) -> None:
harness.copy_integration_libraries(root, 'config', 'asio', 'cobalt')
# One name per target: the old Asio and root names are gone, not forwarded.
# A program that still names one stops at its Jamfile, naming the target.
old = ('/webcpp/asio//cobalt', '/webcpp/asio//cobalt_ssl',
'/webcpp//boost_cobalt', '/webcpp//boost_cobalt_io_ssl')
for index, target in enumerate((*old, '/webcpp/cobalt//cobalt')):
harness.add_library(root, f'consumer{index}', f'''import webcpp ;
webcpp.targets native ;
webcpp.run main : main.cpp : <library>{target} ;
''', {'main.cpp': '''#include <webcpp/cobalt.hpp>
webcpp::cobalt::main co_main(int, char**) { co_return 0; }
'''})
result = harness.run_b2(root, '-n', f'libs/consumer{index}/test')
if target in old:
harness.expect(result, False, 'Unable to find file or target named', target)
else:
harness.expect(result, True)


def test_core_and_runner_have_one_definition(root: Path) -> None:
harness.copy_integration_libraries(root, 'config', 'asio', 'cobalt')
harness.add_library(root, 'consumer', '''import webcpp ;
webcpp.targets native ;
webcpp.run main : main.cpp : <library>/webcpp/asio//cobalt
<library>/webcpp/cobalt//cobalt <library>/webcpp//boost_cobalt ;
webcpp.run main : main.cpp : <library>/webcpp/cobalt//cobalt
<library>/webcpp/cobalt//core ;
''', {'main.cpp': '''#include <webcpp/cobalt.hpp>
webcpp::cobalt::main co_main(int, char**) { co_return 0; }
'''})
Expand Down Expand Up @@ -79,7 +99,8 @@ def test_native_archive_rejects_mismatched_headers(root: Path) -> None:


CASES = [test_asio_builds_without_cobalt_or_openssl,
test_legacy_and_canonical_runner_have_one_definition,
test_only_the_cobalt_library_names_cobalt,
test_core_and_runner_have_one_definition,
test_native_archive_rejects_mismatched_headers]

if __name__ == '__main__':
Expand Down
Loading
Loading