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
6 changes: 5 additions & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,11 @@ Jamroot is its build configuration, and `libs/<name>` is its repository.
- the GCC 15 CI lane uses pinned GCC 15.3, since the Ubuntu runner's GCC 15.2
has coroutine default-argument regression PR121643. Its action extracts the
official Linux-X64 image's relocatable toolchain, verifies a compile/run probe
after installation and cache restoration, and selects its matching runtime;
after installation and cache restoration, and selects its matching runtime.
Locally, the Jamroot compiles and runs the same probe,
`tools/ci/actions/gcc/coroutine_probe.cpp`, with the GCC 15 a user-config.jam
configures, once per compiler and run of b2, and a GCC 15.2 stops the build
before it compiles anything, naming PR121643 and asking for GCC 15.3 or newer;
- Python 3.9 or newer;
- for WebAssembly: wasi-sdk 34 and wasmtime 50.0.1;
- for WebAssembly components, such as wasi's: wit-bindgen 0.62.0, which
Expand Down
14 changes: 9 additions & 5 deletions CODING-GUIDELINES.md
Original file line number Diff line number Diff line change
Expand Up @@ -658,7 +658,7 @@ with `lint: failed: <rule>` for each rule that failed.
| bare throw | a `throw` expression in a library's public header (`libs/*/include/**`), outside comments and literals, at its line: inside `#ifndef WEBCPP_<NAME>_NO_EXCEPTIONS` too, in a template that nothing instantiates, which clang-tidy's analysis without exceptions does not see, and as a rethrow, `throw;`; `boost::throw_exception` is the one way to raise, `std::rethrow_exception` the one way to rethrow (above) |
| changelog form | a library's changelog or a version's release notes out of `AGENTS.md` chapter 5's form: a section or a region missing or out of order, a line that starts with no verb of the list, a cross-reference, an inline anchor such as `[[nodiscard]]` outside a passthrough, more than ten lines for a library and a version, text outside a bullet |
| canary pins | a `WEBCPP_CRYPTO_<NAME>_COMMIT` of crypto's `detail/canary.h` that is not the first seven digits of the commit the superproject records for its submodule (`ctaes`: `bitcoin`) |
| nodiscard results | a function of a library's `include/` that returns `boost::system::result` without `[[nodiscard]]`, at its line, when the library asks for the rule in its `meta/lint.json` (`"nodiscard-results"` and its reason; crypto and hash do): `boost::system::result` carries no `[[nodiscard]]` of its own; and a malformed file or an unknown key |
| nodiscard results | a function of a library's `include/` that returns `boost::system::result` without `[[nodiscard]]`, at its line, when the library asks for the rule in its `meta/lint.json` (`"nodiscard-results"` and its reason; asio, beast, cobalt, crypto, hash and trystero do): `boost::system::result` carries no `[[nodiscard]]` of its own; and a malformed file or an unknown key |

A source b2 expects not to compile (`webcpp.compile-fail`), and one that
must stop with the error it states (`webcpp.compile-diagnostic`), are left
Expand Down Expand Up @@ -7457,10 +7457,14 @@ GCC 15.2's default-argument `await_suspend` regression (GCC PR121643) prevents
unmodified native Cobalt `race` applications from compiling. The GCC 15 CI lane
therefore provisions GCC 15.3 from a pinned official image and validates an
independent compile/run coroutine probe, including after cache restoration.
It does not change the native core or omit those tests. GCC 14's separate known
coroutine-allocation false positive (boostorg/cobalt#7) is scoped to the affected
test functions; the two immutable original application probes retain the warning
as nonfatal for GCC 14 alone. Consumers inherit no warning-suppression flags.
The lane does not change the native core or omit those tests.
A local build probes the GCC 15 its user-config.jam configures the same way: the
Jamroot's `gcc-probe` compiles and runs that probe once per compiler and run of b2,
and a compiler that fails it stops the build with a message naming PR121643 and
GCC 15.3, before a lane would end in internal compiler errors. GCC 14's separate
known coroutine-allocation false positive (boostorg/cobalt#7) is scoped to the
affected test functions; the two immutable original application probes retain the
warning as nonfatal for GCC 14 alone. Consumers inherit no warning-suppression flags.

The 2026-11-07 report covers 12 original applications in 432 cells, keeping
counterparts, unavailable facilities and upstream defects separate. Shared Release
Expand Down
66 changes: 66 additions & 0 deletions Jamroot
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
# install, and lists the targets and the lanes the libraries declare
# (declared-targets, declared-lanes).
import boost ;
import common ;
import errors ;
import feature ;
import modules ;
Expand All @@ -18,6 +19,7 @@ import numbers ;
import os ;
import package ;
import path ;
import property-set ;
import toolset ;
import type ;

Expand Down Expand Up @@ -250,6 +252,68 @@ rule boost-check ( properties * )
}
}

# GCC 15.2 crashes on an await_suspend that has a default argument, as
# unmodified Cobalt race code has (GCC PR121643, fixed in GCC 15.3). The CI
# installs GCC 15.3 and probes it (tools/ci/actions/gcc); a GCC 15 that a
# user-config.jam configures is probed here, once per compiler and run of b2:
# it compiles and runs the CI's probe, and a compiler that crashes on it, or
# builds a program that fails, stops the build before anything compiles, as
# a lane otherwise ends in internal compiler errors. Another GCC, or a build
# on Windows, is not probed. Not a check-target-builds: its answer, cached by
# properties, would outlive the compiler it measured.
rule gcc-probe ( properties * )
{
if <toolset>gcc in $(properties) && ! <webcpp-boost-check>off in $(properties)
&& [ os.name ] != NT
{
local settings = [ toolset.set-target-variables-aux gcc
: [ property-set.create $(properties) ] ] ;
local command ;
while $(settings)
{
if $(settings[1]) = CONFIG_COMMAND
{
command += $(settings[2]) ;
}
settings = $(settings[3-]) ;
}
local compiler = $(command:J=" ") ;
command = [ common.make-command-string $(command) ] ;
if $(command) && ! $(.gcc-probed.$(command))
{
.gcc-probed.$(command) = true ;
local version = [ SHELL "$(command) -dumpfullversion -dumpversion"
: strip-eol ] ;
if [ MATCH "^(15)\\." : $(version) ]
{
local probe = [ path.native [ path.join
[ path.root [ path.make $(WEBCPP_ROOT) ] [ path.pwd ] ]
tools/ci/actions/gcc/coroutine_probe.cpp ] ] ;
# The flags of install.py; the program goes to a directory
# of its own, removed as the shell exits.
local script =
"directory=`mktemp -d` && trap 'rm -rf \"$directory\"' EXIT &&"
"$(command) -std=c++20 -O0 -Wall -Wextra -Werror \"$(probe)\""
"-o \"$directory/probe\" 2>&1 && \"$directory/probe\" 2>&1" ;
local result = [ SHELL $(script:J=" ") : exit-status ] ;
if $(result[2]) != 0
{
local config = [ modules.binding user-config ] ;
config ?= user-config.jam ;
errors.user-error "GCC $(version) ($(compiler)) fails"
"tools/ci/actions/gcc/coroutine_probe.cpp, which every GCC 15"
"must compile and run: GCC PR121643, the await_suspend"
"default-argument regression of GCC 15.2, crashes it on"
"Cobalt's race. Configure GCC 15.3 or newer in $(config)"
"in its place, `using gcc : 15 : /path/to/g++-15 ;`."
"The probe printed:"
: $(result[1]) ;
}
}
}
}
}

project /webcpp
: requirements
<cxxstd>20
Expand Down Expand Up @@ -308,6 +372,8 @@ project /webcpp
<toolset>clang-wasip3,<exception-handling>on:<cxxflags>"-fwasm-exceptions -mllvm -wasm-use-legacy-eh=false"
<toolset>clang-wasip3,<exception-handling>on:<linkflags>"-fwasm-exceptions -lunwind"
# end::wasi-exceptions[]
# The compiler first: a broken one would fail Boost's check too.
<conditional>@gcc-probe
<conditional>@boost-check
: default-build <variant>debug
: build-dir bin
Expand Down
1 change: 1 addition & 0 deletions doc/releases/0.1.0.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ None.
* Added tests of a missing /third_party// name, of the BIPs' pin and of Emscripten without a crypto backend.
* Fixed BearSSL's entropy defines on a Windows target built by Clang or GCC.
* Added the lint rule nodiscard results, which a library asks for in its meta/lint.json.
* Added a probe of a configured GCC 15, which stops a build on GCC 15.2 (GCC PR121643) and names GCC 15.3.
* Changed the pages' tables to stack as on a phone when they do not fit, and long names in them to break between their parts.
* Changed the pages' tables to keep names whole where they fit, and a table of eight columns or more to scroll rather than stack.
* Added the role key-column, which keeps a table's first column wide enough for its words.
Expand Down
2 changes: 1 addition & 1 deletion libs/asio
2 changes: 1 addition & 1 deletion libs/trystero
4 changes: 3 additions & 1 deletion tools/lint/lint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -858,7 +858,9 @@ fi
# 20. A library that asks for it in its meta/lint.json, "nodiscard-results" and the reason,
# declares every function of its headers that returns boost::system::result [[nodiscard]]:
# boost::system::result carries no [[nodiscard]] of its own, so a dropped result, a
# verification's or an open's, compiles silently otherwise (tools/lint/rules.py).
# verification's or an open's, compiles silently otherwise (tools/lint/rules.py). The rule
# reads the declarations of namespaces and classes, an alias's result and a trailing return
# type too, and not a function's body, where T name(arguments); is a variable.
rule 'nodiscard results'
if python3 tools/lint/rules.py nodiscard-results < "${work_directory}/files"; then
printf 'every library that asks for it declares its results [[nodiscard]]\n'
Expand Down
123 changes: 116 additions & 7 deletions tools/lint/lint_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -2168,8 +2168,12 @@ def test_include_boundaries_missing_key(root):


def plant_results(root) -> None:
"""Writes NODISCARD_HEADER: functions returning boost::system::result with and without
[[nodiscard]], and results that are no function's."""
"""Writes NODISCARD_HEADER: functions returning boost::system::result, by its name, an alias
of it or a trailing return type, with and without [[nodiscard]]; members declared in their
class and defined out of it; and results that are no function's: locals written with
parentheses in the bodies of functions and of members, a lambda's, a commented-out one and a
variable's type; a friend declaration, which takes no attribute, and the hidden friend
defined in the class, which does."""
write(root, NODISCARD_HEADER, CPP + '\n'
'#ifndef WEBCPP_DEMO_RESULTS_HPP\n'
'#define WEBCPP_DEMO_RESULTS_HPP\n'
Expand Down Expand Up @@ -2198,14 +2202,93 @@ def plant_results(root) -> None:
' return T{};\n'
'}\n'
'\n'
'inline boost::system::result<std::pair<int, std::pair<int, int>>> dropped_nested() {\n'
' return std::pair<int, std::pair<int, int>>{};\n'
'}\n'
'\n'
'[[nodiscard]] inline boost::system::result<std::pair<int, std::pair<int, int>>> '
'kept_nested() {\n'
' return std::pair<int, std::pair<int, int>>{};\n'
'}\n'
'\n'
'using outcome = boost::system::result<int>;\n'
'\n'
'template <class T>\n'
'using outcome_of = boost::system::result<T>;\n'
'\n'
'inline outcome dropped_alias() {\n'
' return 1;\n'
'}\n'
'\n'
'[[nodiscard]] inline outcome kept_alias() {\n'
' return 1;\n'
'}\n'
'\n'
'template <class T>\n'
'outcome_of<T> dropped_alias_template() {\n'
' return T{};\n'
'}\n'
'\n'
'inline auto dropped_trailing() -> boost::system::result<int> {\n'
' return 1;\n'
'}\n'
'\n'
'[[nodiscard]] inline auto kept_trailing() noexcept -> boost::system::result<int> {\n'
' return 1;\n'
'}\n'
'\n'
'inline auto const lambda_value = []() -> boost::system::result<int> { return 1; };\n'
'\n'
'inline int local_with_parentheses() {\n'
' boost::system::result<int> local_outcome(kept_free());\n'
' outcome const local_alias(kept_alias());\n'
' return local_outcome.has_value() && local_alias.has_value() ? *local_outcome : 0;\n'
'}\n'
'\n'
'class holder;\n'
'\n'
'[[nodiscard]] boost::system::result<int> befriended(holder const& granting);\n'
'\n'
'class holder {\n'
'public:\n'
' friend boost::system::result<int> befriended(holder const& granting);\n'
'\n'
' friend boost::system::result<int> dropped_friend(holder const& /*granting*/) '
'{ return 1; }\n'
'\n'
' [[nodiscard]] static boost::system::result<void> kept_member() { return {}; }\n'
'\n'
' [[nodiscard]] static boost::system::result<int> kept_declared();\n'
'\n'
' static boost::system::result<int> dropped_declared();\n'
'\n'
' [[nodiscard]] static int member_body() {\n'
' boost::system::result<int> member_local(kept_declared());\n'
' return member_local.has_value() ? *member_local : 0;\n'
' }\n'
'\n'
'protected:\n'
' static boost::system::result<void> dropped_member() { return {}; }\n'
'};\n'
'\n'
'inline boost::system::result<int> holder::kept_declared() {\n'
' return 1;\n'
'}\n'
'\n'
'inline boost::system::result<int> holder::dropped_declared() {\n'
' return 2;\n'
'}\n'
'\n'
'namespace unqualified {\n'
'\n'
'using boost::system::result;\n'
'\n'
'inline result<int> dropped_unqualified() {\n'
' return 1;\n'
'}\n'
'\n'
'} // namespace unqualified\n'
'\n'
'// boost::system::result<int> commented_out();\n'
'inline boost::system::result<int> const constant_value{1};\n'
'\n'
Expand All @@ -2217,21 +2300,47 @@ def plant_results(root) -> None:
def test_nodiscard_results(root):
prepare(root)
# A library that asks for it in meta/lint.json declares each function returning a result
# [[nodiscard]]: a free function, a template's and a member after an access specifier fail
# at their lines, with the library's reason; what is kept, commented out or a variable's type
# does not.
# [[nodiscard]]: a free function, a template's, one whose result nests templates, one
# returning an alias of a result, one with a trailing return type, a member after an access
# specifier, a member declared in its class, a hidden friend defined in its class, and one
# naming result after a using-declaration fail at their lines, with the library's reason.
# What is kept, a member's out-of-line definition and a friend declaration without a body,
# which the first declaration answers for and which take no attribute, a lambda, a local
# written with parentheses in a function's or a member's body, a comment and a variable's
# type do not.
write(root, 'libs/demo/meta/lint.json', '{"nodiscard-results": "a dropped result is lost"}\n')
plant_results(root)
message = 'a function returning boost::system::result without [[nodiscard]]: '
expect_alone(lint(root), 'nodiscard results', [
result = lint(root)
expect_alone(result, 'nodiscard results', [
at(root, NODISCARD_HEADER, 'dropped_free') + ' ' + message + 'a dropped result is lost',
at(root, NODISCARD_HEADER, 'dropped_template') + ' ' + message,
at(root, NODISCARD_HEADER, 'dropped_nested') + ' ' + message,
at(root, NODISCARD_HEADER, 'dropped_alias()') + ' ' + message,
at(root, NODISCARD_HEADER, 'dropped_alias_template') + ' ' + message,
at(root, NODISCARD_HEADER, 'dropped_trailing') + ' ' + message,
at(root, NODISCARD_HEADER, ' dropped_declared();') + ' ' + message,
at(root, NODISCARD_HEADER, 'dropped_member') + ' ' + message,
], spared=(at(root, NODISCARD_HEADER, 'kept_free'),
at(root, NODISCARD_HEADER, 'dropped_unqualified') + ' ' + message,
at(root, NODISCARD_HEADER, 'dropped_friend') + ' ' + message,
], spared=(at(root, NODISCARD_HEADER, 'friend boost::system::result<int> befriended'),
at(root, NODISCARD_HEADER, 'kept_free() noexcept'),
at(root, NODISCARD_HEADER, 'kept_template'),
at(root, NODISCARD_HEADER, 'kept_nested'),
at(root, NODISCARD_HEADER, 'outcome kept_alias()'),
at(root, NODISCARD_HEADER, 'kept_trailing'),
at(root, NODISCARD_HEADER, 'lambda_value'),
at(root, NODISCARD_HEADER, 'local_outcome('),
at(root, NODISCARD_HEADER, 'local_alias('),
at(root, NODISCARD_HEADER, 'kept_member'),
at(root, NODISCARD_HEADER, ' kept_declared();'),
at(root, NODISCARD_HEADER, 'member_local('),
at(root, NODISCARD_HEADER, 'holder::kept_declared'),
at(root, NODISCARD_HEADER, 'holder::dropped_declared'),
at(root, NODISCARD_HEADER, 'commented_out'),
at(root, NODISCARD_HEADER, 'constant_value')))
# Those ten and nothing else of the header.
assert result.stdout.count(message) == 10, result.stdout[-6000:]


def test_nodiscard_results_is_asked_for(root):
Expand Down
Loading