diff --git a/README.md b/README.md index 5812cd0..ad98897 100644 --- a/README.md +++ b/README.md @@ -41,6 +41,7 @@ libraries marked with it are published, in the superproject's `main`. | organization | [site-increments-4-5](organization/openspec/changes/site-increments-4-5) | organization: the site, increments 4 and 5 (trystero's JavaScript API and the cursors; the state machine, on the server, C++ calls the browser) | organization | accepted | | 2026-10-10 | | | organization | [wasm-tools](organization/openspec/changes/wasm-tools) | organization: build and install the wasm bindings generator as a host tool | organization | accepted | | 2026-11-03 | [code](https://github.com/webcpporg/webcpp) | | organization | [agent-skills](organization/openspec/changes/archive/2026-10-13-agent-skills) | organization: agent skills in .agents/skills, in the proposals and the superproject | organization | implemented | 0.1.0 | 2026-10-13 | [code](https://github.com/webcpporg/webcpp/tree/5a441c1e90c5b242cf55c351edf6c79c37ef1f8d) | +| organization | [cobalt-target-names](organization/openspec/changes/archive/2026-11-14-cobalt-target-names) | organization: the build names Cobalt's targets only under /webcpp/cobalt | organization | implemented | 0.1.0 | 2026-11-14 | [code](https://github.com/webcpporg/webcpp/tree/eb0819805cb890b006ededef925115e4fdc54497) | | organization | [coding-guidelines](organization/openspec/changes/archive/2026-10-28-coding-guidelines) | organization: CODING-GUIDELINES.md, the single source of the rules and the design decisions | organization | implemented | 0.1.0 | 2026-10-26 | [code](https://github.com/webcpporg/webcpp/tree/a4c770e07becaa32b840554512b37d96b4440d18) | | organization | [contributor-identity](organization/openspec/changes/archive/2026-10-13-contributor-identity) | organization: every contributor commits under their own git identity | organization | implemented | 0.1.0 | 2026-10-13 | [code](https://github.com/webcpporg/webcpp/tree/9a268b7efa8a9b7eab8810bc024486288c689fab) | | asio | [genesis](libraries/asio/openspec/changes/genesis) | asio: Boost.Asio across native, browsers and WASI | wrapper | implementing | | 2026-10-11 | [code](https://github.com/webcpporg/asio) | diff --git a/organization/openspec/changes/archive/2026-11-14-cobalt-target-names/.openspec.yaml b/organization/openspec/changes/archive/2026-11-14-cobalt-target-names/.openspec.yaml new file mode 100644 index 0000000..490e0d6 --- /dev/null +++ b/organization/openspec/changes/archive/2026-11-14-cobalt-target-names/.openspec.yaml @@ -0,0 +1,11 @@ +schema: spec-driven +created: 2026-11-14 +webcpp: + library: organization + title: "organization: the build names Cobalt's targets only under /webcpp/cobalt" + kind: organization + port_of: null + status: implemented + release: "0.1.0" + implementation: https://github.com/webcpporg/webcpp/tree/eb0819805cb890b006ededef925115e4fdc54497 + decided: 2026-11-14 diff --git a/organization/openspec/changes/archive/2026-11-14-cobalt-target-names/design.md b/organization/openspec/changes/archive/2026-11-14-cobalt-target-names/design.md new file mode 100644 index 0000000..f143b5c --- /dev/null +++ b/organization/openspec/changes/archive/2026-11-14-cobalt-target-names/design.md @@ -0,0 +1,86 @@ +## Context + +Until 2026-11-06 webcpp built Boost.Cobalt from Boost's own sources, as `/webcpp//boost_cobalt` +in `tools/boost/Jamfile`, and the organization's genesis specified it with Boost.URL, +Boost.Charconv and Boost.Locale. Cobalt then became a library of its own, `webcpporg/cobalt` at +`libs/cobalt`, which ships its sources (`libs/cobalt/sources.json`) and declares its targets in +`/webcpp/cobalt`; the old names were kept as aliases that forwarded to the new ones. On 2026-11-14 +the owner decided that each Cobalt target has one name, and the aliases at the superproject's root +and in Asio were removed (webcpp `eb08198`, Asio `6c4e2c8`, Cobalt `5d51c4a`), with a test, +`tools/test/cobalt_ownership_test.py`, that a program naming a removed name stops. Cobalt's and +Asio's genesis proposals were updated on the same day. The organization's main specification is +the one text that still names `boost_cobalt`. + +## Goals / Non-Goals + +**Goals:** + +- The organization's specification names no removed Cobalt target and says where Cobalt's + targets are. +- Each modified requirement describes the Jamroot and `tools/boost/Jamfile` as they are at webcpp + `eb08198`. + +**Non-Goals:** + +- Restating Cobalt's targets, configurations or exception behaviour: they are Cobalt's own + specification's. +- `/webcpp//boost_context`, which the Jamroot builds from Boost's sources since Beast's + integration (webcpp `91af39e`) and which the organization's specification has never named. + Specifying it, on which targets it builds and whether it is explicit at the root, needs its own + change. +- Any change to the build, the tools or the libraries. + +## Decisions + +### D1. The list of explicit targets is the Jamroot's + +The requirement's list is copied from the Jamroot's `explicit` declaration at `eb08198`, so it +drops `boost_cobalt` and also names `node-test`, which the Jamroot has declared since the test +under node (webcpp `5d63e95`) and the specification never listed. + +Rejected: removing `boost_cobalt` alone. The requirement would still disagree with the Jamroot it +describes, in a list this change rewrites anyway. + +### D2. Cobalt's own specification owns what Cobalt builds + +The organization's specification says only that Cobalt is a library whose targets are under +`/webcpp/cobalt`, and that the root and `/webcpp/boost-libraries` declare none. The sentence +"Boost.Cobalt is built for native programs and has no build without exceptions" is removed rather +than rewritten: it described the removed build from Boost's sources, and Cobalt's genesis now +specifies its targets ("Explicit configuration and runtime capability matrix") and its exceptions +("Exceptions follow the caller with precise limitations"). + +Rejected: rewriting the sentence for the shipped library. Two texts would describe one library's +targets and drift apart, which is how this sentence became stale. + +### D3. A dependency on Cobalt is a dependency on a library + +"Library: build.jam" names Cobalt among the libraries a library depends on by its target, with +`/webcpp/cobalt//core` as the example, and a scenario that lists the four targets. Which +of them a library or a program needs (`core` for a custom main, `cobalt` for `co_main`, `io_ssl` +and `cobalt_ssl` for TLS) is Cobalt's documentation's. + +### D4. Recorded as implemented, and archived in the same change + +The decision is the owner's, of 2026-11-14, and its implementation is merged in the superproject +(webcpp#13), Asio (asio#3), Cobalt (cobalt#1) and the proposals (proposals#9). Nothing is left to +implement but the specification itself, which archiving writes. The change is therefore +`implemented`, in the 0.1.0 release in preparation as every implemented organization change is, +and archived in the pull request that proposes it; merging that pull request is the owner's +acceptance. + +Rejected: an open change with status `accepted`. The main specification would keep naming the +removed targets until a later archive, with no work left in between. + +## Risks / Trade-offs + +- [A reader of an older proposal finds `/webcpp//boost_cobalt`] -> archived proposals and plans + keep their text as records; b2 stops with the name of the target, and Cobalt's genesis lists + the four removed names and their replacement. +- [The specification still omits `/webcpp//boost_context`] -> named as a non-goal here so that + its own change can specify it. + +## Migration Plan + +None: programs that named a removed target already stop since the implementation was merged, and +the specification follows the build. diff --git a/organization/openspec/changes/archive/2026-11-14-cobalt-target-names/proposal.md b/organization/openspec/changes/archive/2026-11-14-cobalt-target-names/proposal.md new file mode 100644 index 0000000..9db49ea --- /dev/null +++ b/organization/openspec/changes/archive/2026-11-14-cobalt-target-names/proposal.md @@ -0,0 +1,57 @@ +## Why + +The owner decided on 2026-11-14 that the build names each of Cobalt's targets once, under +`/webcpp/cobalt` (`core`, `cobalt`, `io_ssl` and `cobalt_ssl`), and removed the four legacy names +that forwarded to them: `/webcpp/asio//cobalt`, `/webcpp/asio//cobalt_ssl`, `/webcpp//boost_cobalt` +and `/webcpp//boost_cobalt_io_ssl`. The superproject, Asio, Cobalt, the Cobalt and Asio genesis +proposals, `AGENTS.md` and `CODING-GUIDELINES.md` were updated and merged that day. The +organization's main specification still names `boost_cobalt` in three requirements, and was +already stale before the decision: it says that `/webcpp//boost_cobalt` is built from Boost's own +sources in `tools/boost/Jamfile`, while since 2026-11-06 Cobalt has shipped its own sources +(`libs/cobalt/sources.json`) in its own project. A reader of the specification would name a +target that b2 no longer finds. + +## What Changes + +- "Build: The aggregates and the explicit targets": the explicit targets are the Jamroot's at + webcpp `eb08198` (`boost_version`, `throw_exception`, `boost_json`, `boost_url`, + `boost_charconv`, `boost_locale`, `node-test` and `emscripten-reference`), without + `boost_cobalt`; the Jamroot declares no Cobalt target nor an alias to one, with a scenario for + a program that still names a removed root name. +- "Build: Boost's compiled libraries from its sources": the libraries built from Boost's sources + are `/webcpp//boost_url`, `/webcpp//boost_charconv` and `/webcpp//boost_locale`; Boost.Cobalt + is not one of them, since Cobalt ships its own sources and builds them in `/webcpp/cobalt`. +- "Build: What Boost.Locale and Boost.Charconv give on each target": the closing sentence on + Boost.Cobalt, which described the removed `/webcpp//boost_cobalt` build, is removed; Cobalt's + targets and its exceptions are its own specification's. +- "Library: build.jam": a dependency on Cobalt is one of its targets under `/webcpp/cobalt`, like + a dependency on any other library, and Boost.Cobalt leaves the list of Boost's compiled + libraries. +- Nothing in the build, the tools or the libraries changes: the implementation is already merged. + +## Capabilities + +### New Capabilities + +None. + +### Modified Capabilities + +- `organization`: the requirements "Build: The aggregates and the explicit targets", "Build: + Boost's compiled libraries from its sources", "Build: What Boost.Locale and Boost.Charconv give + on each target" and "Library: build.jam" are modified. + +## Impact + +- **Kind:** the organization (the organization's specification of the superproject's build). +- **Implementation:** already merged on 2026-11-14 by the owner's decision of that day: + https://github.com/webcpporg/webcpp/pull/13 (merge commit + `eb0819805cb890b006ededef925115e4fdc54497`), https://github.com/webcpporg/asio/pull/3, + https://github.com/webcpporg/cobalt/pull/1 and https://github.com/webcpporg/proposals/pull/9; + see `reference/STATUS.md`. +- **Status:** implemented in the 0.1.0 release in preparation; archived on 2026-11-14, which + writes the modified requirements into `specs/organization/spec.md`. +- **Other proposals:** Cobalt's genesis (`libraries/cobalt/openspec/changes/genesis/`) holds + the requirement that each Cobalt target has one name, and Asio's genesis the requirement that + Asio declares no Cobalt target; this change only aligns the organization's specification with + them. diff --git a/organization/openspec/changes/archive/2026-11-14-cobalt-target-names/reference/STATUS.md b/organization/openspec/changes/archive/2026-11-14-cobalt-target-names/reference/STATUS.md new file mode 100644 index 0000000..e6a047c --- /dev/null +++ b/organization/openspec/changes/archive/2026-11-14-cobalt-target-names/reference/STATUS.md @@ -0,0 +1,57 @@ +# Cobalt's target names: implementation and archival evidence + +Verified on 2026-11-14 against the published merge commits, without running the CI. + +## Implementation + +- https://github.com/webcpporg/webcpp/pull/13 merged as + `eb0819805cb890b006ededef925115e4fdc54497`: the Jamroot and `tools/boost/Jamfile` no longer + declare `boost_cobalt` nor `boost_cobalt_io_ssl`, and + `tools/test/cobalt_ownership_test.py`, `test_only_the_cobalt_library_names_cobalt`, checks + that a program naming `/webcpp/asio//cobalt`, `/webcpp/asio//cobalt_ssl`, + `/webcpp//boost_cobalt` or `/webcpp//boost_cobalt_io_ssl` stops with "Unable to find file or + target named", while `/webcpp/cobalt//cobalt` builds. +- https://github.com/webcpporg/asio/pull/3 merged as + `6c4e2c85fe6e875bbf67db095df2497b93bf455b`: Asio's `build.jam` names no Cobalt target. +- https://github.com/webcpporg/cobalt/pull/1 merged as + `5d51c4aa89e563070aa244e0635139758d762f97`: `build.jam` declares `project /webcpp/cobalt` + with `core`, `cobalt`, `io_ssl` and `cobalt_ssl`, built from the sources `sources.json` lists + through the project `/webcpp/cobalt-sources`. +- https://github.com/webcpporg/proposals/pull/9 merged as + `18ba2b6cb2c2646d38ec4dbc62e799aa80576a54`: Cobalt's and Asio's genesis proposals record the + decision. + +## What each modified requirement was checked against + +- "Build: The aggregates and the explicit targets": the Jamroot's `explicit` declaration at + `eb08198` lists `boost_version throw_exception boost_json boost_url boost_charconv boost_locale + node-test emscripten-reference` before the aggregates and the notfile targets. `node-test` has + been in that list since webcpp `5d63e95`. +- "Build: Boost's compiled libraries from its sources": the Jamroot's aliases checked against the + sources are `boost_url`, `boost_charconv`, `boost_locale` and `boost_context`; none is a Cobalt + target. `boost_context` is a non-goal of this change (`../design.md`). +- "Build: What Boost.Locale and Boost.Charconv give on each target" and "Library: build.jam": + Cobalt's `README.md` at `5d51c4a` names its canonical targets, `/webcpp/cobalt//core` for a + custom main and `/webcpp/cobalt//cobalt` for `co_main`, with the optional `io_ssl` and + `cobalt_ssl`. + +## Reproduce the read-only checks + +From a webcpp checkout that holds the merge commit: + +```sh +git show eb08198:Jamroot | grep -n -A3 '^explicit boost_version' +git show eb08198:Jamroot | grep -n 'for local name in boost_' +git grep -n 'boost_cobalt' eb08198 -- Jamroot tools/boost +git show eb08198:tools/test/cobalt_ownership_test.py | grep -n -A20 'def test_only_the_cobalt_library_names_cobalt' +``` + +The third command prints nothing. The others print the list of explicit targets, the four +compiled aliases and the test of the removed names. + +## Archive + +The change is implemented for the 0.1.0 release in preparation, consistent with the index; no +release tag is created. Archiving writes the four modified requirements into the organization's +main specification and the index is regenerated. Local validation covers the organization's +OpenSpec root, the proposal index and the proposal tool's tests. diff --git a/organization/openspec/changes/archive/2026-11-14-cobalt-target-names/specs/organization/spec.md b/organization/openspec/changes/archive/2026-11-14-cobalt-target-names/specs/organization/spec.md new file mode 100644 index 0000000..d04effc --- /dev/null +++ b/organization/openspec/changes/archive/2026-11-14-cobalt-target-names/specs/organization/spec.md @@ -0,0 +1,57 @@ +## MODIFIED Requirements + +### Requirement: Build: The aggregates and the explicit targets +The Jamroot SHALL declare the aggregates `test`, `example`, `doc` and `install` over the registered libraries' directories, the notfile targets `declared-targets`, `declared-lanes`, `site`, `site-serve`, `check-release`, `whats-new` and `dist` (the site targets when `site/` is checked out, else `site` and `site-serve` stop with "site/, the site's repository (webcpporg/webcpporg.github.io), is not checked out ... git submodule update --init site"), and the explicit targets `boost_version`, `throw_exception`, `boost_json`, `boost_url`, `boost_charconv`, `boost_locale`, `node-test` and `emscripten-reference`. The Jamroot MUST NOT declare a Cobalt target, nor an alias to one: each of Cobalt's targets has one name, under `/webcpp/cobalt`. `declared-targets` and `declared-lanes` MUST read only Jamfiles and need neither Boost nor Node: they leave the Boost check out with `off`, as every target that compiles nothing does. + +#### Scenario: declared-targets needs no Boost +- **WHEN** `b2 -d0 declared-targets` runs on a CI job that installed no Boost +- **THEN** it prints the ` ` pairs and nothing else + +#### Scenario: The site is not checked out +- **WHEN** `b2 site` runs without `site/Jamfile` +- **THEN** it stops with the message that `site/` is not checked out and the command `git submodule update --init site` + +#### Scenario: No Cobalt target at the root +- **WHEN** a program names `/webcpp//boost_cobalt` or `/webcpp//boost_cobalt_io_ssl` +- **THEN** b2 stops with "Unable to find file or target named" and that name, and the program names `/webcpp/cobalt//cobalt` or `/webcpp/cobalt//cobalt_ssl` instead + +### Requirement: Build: Boost's compiled libraries from its sources +A compiled Boost library that a webcpp library needs SHALL be built by webcpp from Boost's own sources for every target, as `/webcpp//boost_url`, `/webcpp//boost_charconv` and `/webcpp//boost_locale` (`tools/boost/Jamfile`, a project `/webcpp/boost-libraries`, each Jamroot alias checking the sources first), static and built once per variant; a library adds e.g. `/webcpp//boost_url` to its target's usage requirements and never `/boost//url` (which would link the system's) nor `/webcpp/boost-libraries//boost_url`. The sources are a tree with Boost's `boost/version.hpp` and `libs//src` for each library, found at `-sBOOST_SOURCE=` on b2's command line (which wins), else `BOOST_SOURCE` as a `user-config.jam` `modules.poke` or the environment gives it, else `.local/boost-source`, which `bash tools/ci/actions/boost/install.sh source .local/boost-source` fills from the archive the CI uses, checked against its SHA-256 and marked by `.webcpp-boost-source`; the script replaces only a directory that holds the marker and refuses any other by name before downloading. When a target needs the tree and it is missing, its version is not the configured Boost's, the configured version is unknown (Boost on the default include path), or it lacks the library's sources, the build MUST stop naming why and the fix. Boost.Cobalt is not one of these libraries: webcpp's library Cobalt ships its own sources (`libs/cobalt/sources.json`) and builds them in its own project, `/webcpp/cobalt`, so neither the Jamroot nor `/webcpp/boost-libraries` declares a Cobalt target. + +#### Scenario: lexical links Boost.URL +- **WHEN** `libs/lexical/build.jam` names `/webcpp//boost_url` +- **THEN** `b2 libs/lexical/test` builds Boost.URL's sources once per variant and links them statically + +#### Scenario: Sources of another version +- **WHEN** `.local/boost-source` holds Boost 1.91's sources and the configured Boost is 1.92.0 +- **THEN** the build stops naming both versions + +#### Scenario: A user's tree is never replaced +- **WHEN** `install.sh source ` is given a directory with no marker, such as an installed Boost's include directory +- **THEN** it refuses by name and downloads nothing + +### Requirement: Build: What Boost.Locale and Boost.Charconv give on each target +`/webcpp//boost_locale` SHALL be Boost.Locale without ICU and `/webcpp//boost_charconv` Boost.Charconv, with these behaviours (`CODING-GUIDELINES.md` chapter 10): native Linux builds the posix and std backends with glibc's iconv; native macOS the posix and std backends with the system's libiconv given as `-liconv` by the target; native Windows (MSVC) the winapi and std backends, not measured until the first CI run that builds it; wasip2 and wasip3 the posix and std backends with wasi-libc's iconv, formatting in the C locale's form, a catalog read from a directory the test gives with `webcpp.data`; emscripten the posix and std backends with Emscripten's iconv, single-threaded, Boost.Locale's sources alone compiled with `BOOST_HAS_PTHREADS` so Boost.Thread's mutex builds, with no public header of Boost.Locale depending on it (checked by `tools/test/boost_libraries_test.py`); any target with `exception-handling=off` refuses Boost.Locale by name (61 `throw`, 14 `try` in its sources, 8 `throw` in its headers) while Boost.Charconv builds. + +#### Scenario: Locale on wasip2 +- **WHEN** a test using Boost.Locale runs with `toolset=clang-wasip2` +- **THEN** it formats numbers, currencies and dates in the C locale's form and reads a message catalog from the directory given by `webcpp.data` + +#### Scenario: Charconv without exceptions +- **WHEN** `/webcpp//boost_charconv` is built with `exception-handling=off` +- **THEN** it builds, as measured natively and on wasip2 + +### Requirement: Library: build.jam +A library's `build.jam` SHALL start with the licence notice, declare `project /webcpp/ ;` and one target, named after the library, that adds its headers and dependencies: `alias : : : : include /boost//headers /webcpp/config//config ;`. Every library adds config's target since its `config.hpp` includes ``; a dependency on another library is its target (`/webcpp/xactor//xactor`), Cobalt's included (`/webcpp/cobalt//core`); Boost.URL, Boost.Charconv and Boost.Locale are `/webcpp//boost_url`, `//boost_charconv` and `//boost_locale`; Boost.JSON is `/webcpp//boost_json`; a library that builds components declares its worlds' bindings there with `webcpp.wit-bindings`. The dependencies SHOULD sit between `tag::dependencies[]` and `end::dependencies[]` markers which the page includes with `include::{library-root}/build.jam[tag=dependencies]`. + +#### Scenario: config's build.jam +- **WHEN** `libs/config/build.jam` is read +- **THEN** it declares `project /webcpp/config ;` and `alias config : : : : include /boost//headers ;` + +#### Scenario: A dependency on another library +- **WHEN** xstate's actor layer depends on xactor +- **THEN** its target lists `/webcpp/xactor//xactor` among its usage requirements + +#### Scenario: A dependency on Cobalt +- **WHEN** a library or a program depends on Cobalt +- **THEN** it lists one of Cobalt's targets under `/webcpp/cobalt` (`//core`, `//cobalt`, `//io_ssl` or `//cobalt_ssl`), never a name of the superproject's root or of Asio diff --git a/organization/openspec/changes/archive/2026-11-14-cobalt-target-names/tasks.md b/organization/openspec/changes/archive/2026-11-14-cobalt-target-names/tasks.md new file mode 100644 index 0000000..9a0d47d --- /dev/null +++ b/organization/openspec/changes/archive/2026-11-14-cobalt-target-names/tasks.md @@ -0,0 +1,14 @@ +# Tasks + +## 1. The implementation (merged on 2026-11-14) + +- [x] 1.1 The superproject's Jamroot and `tools/boost/Jamfile` declare no Cobalt target, and `tools/test/cobalt_ownership_test.py` checks that a program naming a removed name stops (webcpp#13, `eb08198`) +- [x] 1.2 Asio declares no Cobalt target (asio#3), and Cobalt keeps its four targets under `/webcpp/cobalt` (cobalt#1) +- [x] 1.3 Cobalt's and Asio's genesis proposals record that each Cobalt target has one name (proposals#9) + +## 2. The organization's specification + +- [x] 2.1 Write the proposal, the design, these tasks and the four modified requirements +- [x] 2.2 Check each modified requirement against the Jamroot and `tools/boost/Jamfile` at webcpp `eb08198`, and record the evidence in `reference/STATUS.md` +- [x] 2.3 Validate with `openspec validate --all --strict --no-interactive`, `tools/proposals.py readme`, `tools/proposals.py check` and `tools/proposals_test.py` +- [x] 2.4 Archive the change, which writes the modified requirements into `specs/organization/spec.md` diff --git a/organization/openspec/specs/organization/spec.md b/organization/openspec/specs/organization/spec.md index b056fb8..82a8eb9 100644 --- a/organization/openspec/specs/organization/spec.md +++ b/organization/openspec/specs/organization/spec.md @@ -218,7 +218,7 @@ The Jamroot SHALL find the installed Boost through `boost.use-project` (the `usi - **THEN** b2 stops with "Boost 1.92 or newer is required, and Boost 1.91.0 was found in " ### Requirement: Build: The aggregates and the explicit targets -The Jamroot SHALL declare the aggregates `test`, `example`, `doc` and `install` over the registered libraries' directories, the notfile targets `declared-targets`, `declared-lanes`, `site`, `site-serve`, `check-release`, `whats-new` and `dist` (the site targets when `site/` is checked out, else `site` and `site-serve` stop with "site/, the site's repository (webcpporg/webcpporg.github.io), is not checked out ... git submodule update --init site"), and the explicit targets `boost_version`, `throw_exception`, `boost_json`, `boost_url`, `boost_charconv`, `boost_locale`, `boost_cobalt` and `emscripten-reference`. `declared-targets` and `declared-lanes` MUST read only Jamfiles and need neither Boost nor Node: they leave the Boost check out with `off`, as every target that compiles nothing does. +The Jamroot SHALL declare the aggregates `test`, `example`, `doc` and `install` over the registered libraries' directories, the notfile targets `declared-targets`, `declared-lanes`, `site`, `site-serve`, `check-release`, `whats-new` and `dist` (the site targets when `site/` is checked out, else `site` and `site-serve` stop with "site/, the site's repository (webcpporg/webcpporg.github.io), is not checked out ... git submodule update --init site"), and the explicit targets `boost_version`, `throw_exception`, `boost_json`, `boost_url`, `boost_charconv`, `boost_locale`, `node-test` and `emscripten-reference`. The Jamroot MUST NOT declare a Cobalt target, nor an alias to one: each of Cobalt's targets has one name, under `/webcpp/cobalt`. `declared-targets` and `declared-lanes` MUST read only Jamfiles and need neither Boost nor Node: they leave the Boost check out with `off`, as every target that compiles nothing does. #### Scenario: declared-targets needs no Boost - **WHEN** `b2 -d0 declared-targets` runs on a CI job that installed no Boost @@ -228,6 +228,10 @@ The Jamroot SHALL declare the aggregates `test`, `example`, `doc` and `install` - **WHEN** `b2 site` runs without `site/Jamfile` - **THEN** it stops with the message that `site/` is not checked out and the command `git submodule update --init site` +#### Scenario: No Cobalt target at the root +- **WHEN** a program names `/webcpp//boost_cobalt` or `/webcpp//boost_cobalt_io_ssl` +- **THEN** b2 stops with "Unable to find file or target named" and that name, and the program names `/webcpp/cobalt//cobalt` or `/webcpp/cobalt//cobalt_ssl` instead + ### Requirement: Build: Targets and the toolsets that build them A program SHALL be built for a target, one of `native`, `emscripten`, `wasip2` and `wasip3` (`tools/target.jam`'s `known`): `emscripten` is b2's `emscripten` toolset (wasm32, single-threaded, static, run by node itself); `wasip2` and `wasip3` are b2's `clang` registered against wasi-sdk with the versions `wasip2` and `wasip3` (toolsets `clang-wasip2` and `clang-wasip3`, run with `testing.launcher=wasmtime`); `native` is any other toolset (gcc, clang, msvc, darwin, and a clang without a version). The target of a build is told by `` and its version alone, in one place, never by a derived feature. `webcpp.targets` declares a Jamfile's default targets, a program may override them with its own, and a program with no declaration is built for `native` only; for any other target the program gets `no` and b2 skips it without a word. @@ -273,7 +277,7 @@ Every target SHALL build with exceptions on: whether a program uses them is the - **THEN** the build refuses by name, since Boost.Locale throws and catches unguarded ### Requirement: Build: Boost's compiled libraries from its sources -A compiled Boost library that a webcpp library needs SHALL be built by webcpp from Boost's own sources for every target, as `/webcpp//boost_url`, `/webcpp//boost_charconv`, `/webcpp//boost_locale` and `/webcpp//boost_cobalt` (`tools/boost/Jamfile`, a project `/webcpp/boost-libraries`, each Jamroot alias checking the sources first), static and built once per variant; a library adds e.g. `/webcpp//boost_url` to its target's usage requirements and never `/boost//url` (which would link the system's) nor `/webcpp/boost-libraries//boost_url`. The sources are a tree with Boost's `boost/version.hpp` and `libs//src` for each library, found at `-sBOOST_SOURCE=` on b2's command line (which wins), else `BOOST_SOURCE` as a `user-config.jam` `modules.poke` or the environment gives it, else `.local/boost-source`, which `bash tools/ci/actions/boost/install.sh source .local/boost-source` fills from the archive the CI uses, checked against its SHA-256 and marked by `.webcpp-boost-source`; the script replaces only a directory that holds the marker and refuses any other by name before downloading. When a target needs the tree and it is missing, its version is not the configured Boost's, the configured version is unknown (Boost on the default include path), or it lacks the library's sources, the build MUST stop naming why and the fix. +A compiled Boost library that a webcpp library needs SHALL be built by webcpp from Boost's own sources for every target, as `/webcpp//boost_url`, `/webcpp//boost_charconv` and `/webcpp//boost_locale` (`tools/boost/Jamfile`, a project `/webcpp/boost-libraries`, each Jamroot alias checking the sources first), static and built once per variant; a library adds e.g. `/webcpp//boost_url` to its target's usage requirements and never `/boost//url` (which would link the system's) nor `/webcpp/boost-libraries//boost_url`. The sources are a tree with Boost's `boost/version.hpp` and `libs//src` for each library, found at `-sBOOST_SOURCE=` on b2's command line (which wins), else `BOOST_SOURCE` as a `user-config.jam` `modules.poke` or the environment gives it, else `.local/boost-source`, which `bash tools/ci/actions/boost/install.sh source .local/boost-source` fills from the archive the CI uses, checked against its SHA-256 and marked by `.webcpp-boost-source`; the script replaces only a directory that holds the marker and refuses any other by name before downloading. When a target needs the tree and it is missing, its version is not the configured Boost's, the configured version is unknown (Boost on the default include path), or it lacks the library's sources, the build MUST stop naming why and the fix. Boost.Cobalt is not one of these libraries: webcpp's library Cobalt ships its own sources (`libs/cobalt/sources.json`) and builds them in its own project, `/webcpp/cobalt`, so neither the Jamroot nor `/webcpp/boost-libraries` declares a Cobalt target. #### Scenario: lexical links Boost.URL - **WHEN** `libs/lexical/build.jam` names `/webcpp//boost_url` @@ -288,7 +292,7 @@ A compiled Boost library that a webcpp library needs SHALL be built by webcpp fr - **THEN** it refuses by name and downloads nothing ### Requirement: Build: What Boost.Locale and Boost.Charconv give on each target -`/webcpp//boost_locale` SHALL be Boost.Locale without ICU and `/webcpp//boost_charconv` Boost.Charconv, with these behaviours (`CODING-GUIDELINES.md` chapter 10): native Linux builds the posix and std backends with glibc's iconv; native macOS the posix and std backends with the system's libiconv given as `-liconv` by the target; native Windows (MSVC) the winapi and std backends, not measured until the first CI run that builds it; wasip2 and wasip3 the posix and std backends with wasi-libc's iconv, formatting in the C locale's form, a catalog read from a directory the test gives with `webcpp.data`; emscripten the posix and std backends with Emscripten's iconv, single-threaded, Boost.Locale's sources alone compiled with `BOOST_HAS_PTHREADS` so Boost.Thread's mutex builds, with no public header of Boost.Locale depending on it (checked by `tools/test/boost_libraries_test.py`); any target with `exception-handling=off` refuses Boost.Locale by name (61 `throw`, 14 `try` in its sources, 8 `throw` in its headers) while Boost.Charconv builds. Boost.Cobalt is built for native programs and has no build without exceptions. +`/webcpp//boost_locale` SHALL be Boost.Locale without ICU and `/webcpp//boost_charconv` Boost.Charconv, with these behaviours (`CODING-GUIDELINES.md` chapter 10): native Linux builds the posix and std backends with glibc's iconv; native macOS the posix and std backends with the system's libiconv given as `-liconv` by the target; native Windows (MSVC) the winapi and std backends, not measured until the first CI run that builds it; wasip2 and wasip3 the posix and std backends with wasi-libc's iconv, formatting in the C locale's form, a catalog read from a directory the test gives with `webcpp.data`; emscripten the posix and std backends with Emscripten's iconv, single-threaded, Boost.Locale's sources alone compiled with `BOOST_HAS_PTHREADS` so Boost.Thread's mutex builds, with no public header of Boost.Locale depending on it (checked by `tools/test/boost_libraries_test.py`); any target with `exception-handling=off` refuses Boost.Locale by name (61 `throw`, 14 `try` in its sources, 8 `throw` in its headers) while Boost.Charconv builds. #### Scenario: Locale on wasip2 - **WHEN** a test using Boost.Locale runs with `toolset=clang-wasip2` @@ -497,7 +501,7 @@ Each library's `meta/libraries.json` SHALL be Boost's file with webcpp's `"port- - **THEN** the doc build fails naming the file and the field ### Requirement: Library: build.jam -A library's `build.jam` SHALL start with the licence notice, declare `project /webcpp/ ;` and one target, named after the library, that adds its headers and dependencies: `alias : : : : include /boost//headers /webcpp/config//config ;`. Every library adds config's target since its `config.hpp` includes ``; a dependency on another library is its target (`/webcpp/xactor//xactor`); Boost.URL, Boost.Charconv, Boost.Locale and Boost.Cobalt are `/webcpp//boost_url`, `//boost_charconv`, `//boost_locale` and `//boost_cobalt`; Boost.JSON is `/webcpp//boost_json`; a library that builds components declares its worlds' bindings there with `webcpp.wit-bindings`. The dependencies SHOULD sit between `tag::dependencies[]` and `end::dependencies[]` markers which the page includes with `include::{library-root}/build.jam[tag=dependencies]`. +A library's `build.jam` SHALL start with the licence notice, declare `project /webcpp/ ;` and one target, named after the library, that adds its headers and dependencies: `alias : : : : include /boost//headers /webcpp/config//config ;`. Every library adds config's target since its `config.hpp` includes ``; a dependency on another library is its target (`/webcpp/xactor//xactor`), Cobalt's included (`/webcpp/cobalt//core`); Boost.URL, Boost.Charconv and Boost.Locale are `/webcpp//boost_url`, `//boost_charconv` and `//boost_locale`; Boost.JSON is `/webcpp//boost_json`; a library that builds components declares its worlds' bindings there with `webcpp.wit-bindings`. The dependencies SHOULD sit between `tag::dependencies[]` and `end::dependencies[]` markers which the page includes with `include::{library-root}/build.jam[tag=dependencies]`. #### Scenario: config's build.jam - **WHEN** `libs/config/build.jam` is read @@ -507,6 +511,10 @@ A library's `build.jam` SHALL start with the licence notice, declare `project /w - **WHEN** xstate's actor layer depends on xactor - **THEN** its target lists `/webcpp/xactor//xactor` among its usage requirements +#### Scenario: A dependency on Cobalt +- **WHEN** a library or a program depends on Cobalt +- **THEN** it lists one of Cobalt's targets under `/webcpp/cobalt` (`//core`, `//cobalt`, `//io_ssl` or `//cobalt_ssl`), never a name of the superproject's root or of Asio + ### Requirement: Library: The configuration header and no-exceptions macro Each library SHALL have `/config.hpp>`, which the convenience header and every public header include first, which includes `` first, and which defines `WEBCPP__NO_EXCEPTIONS` when `WEBCPP_HAS_EXCEPTIONS` is not defined and the macro is not already defined (`#if !defined(WEBCPP_HAS_EXCEPTIONS) && !defined(WEBCPP__NO_EXCEPTIONS)`): when the code is compiled without exceptions (`BOOST_NO_EXCEPTIONS`), when the developer defines `WEBCPP_NO_EXCEPTIONS` to disable every library's at once, or when the developer defines the library's macro alone, to turn one library's exceptions off in a build that has them. A program sets `WEBCPP_NO_EXCEPTIONS` for every library alike without knowing which one throws, so a library that raises no exception of its own has the macro too and says so in its Doc Comment. Because MrDocs parses with exceptions, `config.hpp` defines the macro for the reference under `#ifdef __MRDOCS__` and undefines it at once. The library's `test/config_test.cpp` MUST be built three times: as the build asks (`config`, where the macro is defined exactly when `WEBCPP_HAS_EXCEPTIONS` is not), with `WEBCPP_NO_EXCEPTIONS` defined (`config_all_off`) and with the macro itself defined on the command line (`config_developer_defined`).