Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
e952894
Declare licenses, web engines and system libraries in the SBOM (#762)
ambroise-leclerc Dec 5, 2026
faffca5
Install WebFront for find_package, add vcpkg and Conan recipes, CPack…
ambroise-leclerc Dec 5, 2026
815c0f8
Check the Life installers, the package recipes and the updater in CI …
ambroise-leclerc Dec 5, 2026
294e405
Document distribution and accept ADR-028 (#762)
ambroise-leclerc Dec 5, 2026
b04a517
Name the package check's helper outside the Node guard's patterns (#762)
ambroise-leclerc Dec 5, 2026
ed87ddf
Rename the definition of the package check's helper too (#762)
ambroise-leclerc Dec 5, 2026
dc2c5f8
End a rollback that was interrupted after the former executable was b…
ambroise-leclerc Dec 5, 2026
e5a7970
Find an installed WebFront whatever its CMAKE_INSTALL_INCLUDEDIR (#762)
ambroise-leclerc Dec 5, 2026
9180480
Set up a frontend component requested by a later find_package (#762)
ambroise-leclerc Dec 5, 2026
ad54b3a
Merge branch '768-a11y-check' into 762-packages
ambroise-leclerc Dec 5, 2026
3d07ac0
Keep the former executable when the update state cannot be read (#762)
ambroise-leclerc Dec 5, 2026
710f348
Keep the package found when an optional component is unavailable (#762)
ambroise-leclerc Dec 5, 2026
874637d
Quote and escape the executable in the desktop entry (#762)
ambroise-leclerc Dec 5, 2026
111ff5c
Check that a built Debian package holds the AppArmor profile (#762)
ambroise-leclerc Dec 5, 2026
47404f4
Merge branch '768-a11y-check' into 762-packages
ambroise-leclerc Dec 5, 2026
d8d8125
Select the numeric array code with if constexpr, which MSVC /analyze …
ambroise-leclerc Dec 5, 2026
56cfa76
Remove the replaced executable after a rollback on Windows (#762)
ambroise-leclerc Dec 5, 2026
ff6e566
Build the Debian package check where file is available, and add it to…
ambroise-leclerc Dec 5, 2026
8a7bb33
Merge branch '768-a11y-check' into 762-packages
ambroise-leclerc Dec 6, 2026
0b6eb6a
Make the installed package complete without the Bdd component and pro…
ambroise-leclerc Dec 6, 2026
6bbb3c8
Merge branch '768-a11y-check' into 762-packages
ambroise-leclerc Dec 6, 2026
df53571
Merge branch '768-a11y-check' into 762-packages
ambroise-leclerc Dec 6, 2026
1a6397a
Merge branch '768-a11y-check' into 762-packages
ambroise-leclerc Dec 6, 2026
4f75b9a
Compare typed array codes at compile time, as MSVC /analyze asks
ambroise-leclerc Dec 6, 2026
f13266f
Install the SBOM outside /usr/share/doc, which minimal Debian systems…
ambroise-leclerc Dec 6, 2026
1edf116
Merge branch '768-a11y-check' into 762-packages
ambroise-leclerc Dec 6, 2026
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
8 changes: 5 additions & 3 deletions .github/docker/linux-ci.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,21 @@
FROM ubuntu:26.04@sha256:c098726dd9b9733f3e885f8de0ef375206a311b0a317eadc40d347b1115fb944

LABEL org.opencontainers.image.source="https://github.com/ambroise-leclerc/WebFront"
LABEL org.opencontainers.image.description="WebFront CI: GCC 16, WebKitGTK 6, lcov and Xvfb on Ubuntu 26.04"
LABEL org.opencontainers.image.description="WebFront CI: GCC 16, WebKitGTK 6, OpenSSL, lcov and Xvfb on Ubuntu 26.04"

ENV DEBIAN_FRONTEND=noninteractive

# sudo: the composite actions of the repository call it, as they do on a hosted runner. build-essential: the CTest
# fixtures configure sub-projects with CMake's default generator and compiler, which a hosted runner also provides.
# libssl-dev: the signature verification of the updater tests (OpenSSL libcrypto).
# file: CPackDeb needs it to list the dependencies of the package ApplicationPackageConfiguration builds.
# libjson-xs-perl: a recommendation of lcov, which falls back to a pure-Perl parser about eight times slower without it.
RUN apt-get update \
&& apt-get install -y --no-install-recommends -o Acquire::Retries=3 \
ca-certificates curl git sudo tar xz-utils build-essential \
ninja-build pkg-config python3 \
gcc-16 g++-16 libwebkitgtk-6.0-dev lcov libjson-xs-perl \
xvfb xauth time \
gcc-16 g++-16 libwebkitgtk-6.0-dev libssl-dev lcov libjson-xs-perl \
xvfb xauth time file \
&& rm -rf /var/lib/apt/lists/*

# The workspace is mounted from the host runner and owned by another user: let git (and the tests that call it) read it.
Expand Down
91 changes: 90 additions & 1 deletion .github/workflows/BuildAndTest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ jobs:
build_type: Debug
test_env: {WEBKIT_DISABLE_SANDBOX_THIS_IS_DANGEROUS: '1'}
# GCC 16 compiles the optional C++26 reflection layer of the forms (#383): its tests must not be skipped here.
options: -DWEBFRONT_EMBED_WEBKITGTK=ON -DWEBFRONT_WEBTEST_FRONTEND=WebKitGTK -DWEBFRONT_ENABLE_COVERAGE=ON -DWEBFRONT_REQUIRE_REFLECTION_TESTS=ON
options: -DWEBFRONT_EMBED_WEBKITGTK=ON -DWEBFRONT_WEBTEST_FRONTEND=WebKitGTK -DWEBFRONT_ENABLE_COVERAGE=ON -DWEBFRONT_REQUIRE_REFLECTION_TESTS=ON -DWEBFRONT_REQUIRE_UPDATER_TESTS=ON
runs-on: ${{ matrix.os }}
# Only the Linux job runs in the prebuilt toolchain image; an empty value means no container.
container: ${{ matrix.use_image && fromJSON(format('{{"image":"{0}","credentials":{{"username":"{1}","password":"{2}"}},"options":"--shm-size=1g"}}', needs.linux-image.outputs.image, github.actor, github.token)) || '' }}
Expand Down Expand Up @@ -279,6 +279,36 @@ jobs:
-DREPEAT=${{ (github.event_name == 'workflow_dispatch' && inputs.repeat_desktop_tests) && inputs.desktop_passes || ((github.event_name == 'schedule' || (github.event_name == 'pull_request' && github.base_ref == 'master')) && '3' || '1') }}
'-DLABEL_EXCLUDE=${{ (github.event_name == 'schedule' || (github.event_name == 'pull_request' && github.base_ref == 'master') || (github.event_name == 'workflow_dispatch' && inputs.repeat_desktop_tests)) && 'none' || (env.WEBFRONT_CONFIGURATION == 'true' && '^(portability|fast)$' || '^(portability|fast|configuration)$') }}'
-P test/cmake/RunTestSuite.cmake
# The installer of the embedded Life example (docs/DISTRIBUTION.md), from the provider that the developer journey of the
# tests above wrote with wf embed: built, installed, checked and removed on this runner.
- name: Ensure NSIS
if: runner.os == 'Windows'
shell: pwsh
run: |
if (-not (Test-Path "${env:ProgramFiles(x86)}/NSIS/makensis.exe")) { choco install nsis -y --no-progress }
if (-not (Test-Path "${env:ProgramFiles(x86)}/NSIS/makensis.exe")) { throw 'NSIS is not available' }
- name: Package the Life example, install it and remove it
shell: bash
run: |
set -euo pipefail
# Forward slashes on Windows too. The target `package` runs CMake's cpack (Chocolatey ships another `cpack`).
workspace="$(cygpath -m "$GITHUB_WORKSPACE" 2>/dev/null || pwd)"
cmake -S examples/life/package -B build-life -G Ninja -DCMAKE_BUILD_TYPE=Release \
-DWEBFRONT_LIFE_ASSETS="$workspace/build/jp/generated/LifeUI.hpp" -DENABLE_CACHE=OFF \
-DCMAKE_CXX_COMPILER_LAUNCHER=sccache ${{ matrix.options }}
cmake --build build-life --parallel 4
cmake --build build-life --target package
cmake -DPACKAGE_DIR="$workspace/build-life" -P test/cmake/CheckLifeInstaller.cmake
- name: Retain the Life installer
uses: actions/upload-artifact@v4
with:
name: life-installer-${{ runner.os }}
path: |
build-life/webfront-life-*.deb
build-life/webfront-life-*.dmg
build-life/webfront-life-*.exe
retention-days: 7
if-no-files-found: error
# Nothing consumes the capture of a pull request, which only lists it in its log: it runs on a push to develop or master
# and in the full tier. The pull request still builds and runs the instrumented tests.
- name: Collect coverage
Expand Down Expand Up @@ -401,6 +431,65 @@ jobs:
shell: bash
run: ctest --test-dir build -C Release -L portability --output-on-failure --no-tests=error

# find_package(WebFront) from the vcpkg overlay port and from the Conan recipe (docs/DISTRIBUTION.md): each installs the
# package, with the network it needs for the pinned archives, then a consumer configures and builds Hello World with the
# public network cut. Part of the portability tier.
packages:
if: github.event_name == 'schedule' || (github.event_name == 'pull_request' && github.base_ref == 'master') || (github.event_name == 'workflow_dispatch' && inputs.repeat_desktop_tests)
name: packages (${{ matrix.manager }})
runs-on: ubuntu-24.04
timeout-minutes: 30
env:
VCPKG_REVISION: 9eec002df1cd109f8f104cd966a763daf9751489 # release 2026.10.16
strategy:
fail-fast: false
matrix:
manager: [vcpkg, conan]
steps:
- uses: actions/checkout@v7
- uses: ./.github/actions/remove-node
- uses: ./.github/actions/setup-cmake
with:
version: '4.4.4'
- name: Install Ninja
run: sudo apt-get update && sudo apt-get install -y ninja-build
- name: Package with vcpkg
if: matrix.manager == 'vcpkg'
run: |
git clone --filter=blob:none https://github.com/microsoft/vcpkg.git "$RUNNER_TEMP/vcpkg"
git -C "$RUNNER_TEMP/vcpkg" checkout --detach "$VCPKG_REVISION"
"$RUNNER_TEMP/vcpkg/bootstrap-vcpkg.sh" -disableMetrics
"$RUNNER_TEMP/vcpkg/vcpkg" install webfront --overlay-ports=cmake/packaging/vcpkg --binarysource=clear
echo "TOOLCHAIN=$RUNNER_TEMP/vcpkg/scripts/buildsystems/vcpkg.cmake" >> "$GITHUB_ENV"
- name: Package with Conan
if: matrix.manager == 'conan'
run: |
python3 -m venv "$RUNNER_TEMP/conan"
"$RUNNER_TEMP/conan/bin/pip" install conan==2.35.0
conan="$RUNNER_TEMP/conan/bin/conan"
"$conan" profile detect
"$conan" create cmake/packaging/conan -s compiler.cppstd=23 --no-remote
"$conan" install test/cmake/package-consumer -c tools.cmake.cmaketoolchain:user_presets= -s compiler.cppstd=23 -s build_type=Release --no-remote --output-folder="$RUNNER_TEMP/conan-consumer"
echo "TOOLCHAIN=$RUNNER_TEMP/conan-consumer/conan_toolchain.cmake" >> "$GITHUB_ENV"
- name: Cut the public network
run: |
sudo iptables -A OUTPUT -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT
sudo iptables -A OUTPUT ! -o lo -j REJECT
sudo ip6tables -A OUTPUT -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT
sudo ip6tables -A OUTPUT ! -o lo -j REJECT
- name: Build Hello World with find_package(WebFront), offline
run: |
cmake -S test/cmake/package-consumer -B build-consumer -G Ninja -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_TOOLCHAIN_FILE="$TOOLCHAIN" -DCMAKE_CXX_SCAN_FOR_MODULES=OFF \
-DHELLO_WORLD_SOURCE="$PWD/examples/hello-world/HelloWorld.cpp"
cmake --build build-consumer --parallel 4
test -x build-consumer/HelloWorld
- name: Restore the network
if: always()
run: |
sudo iptables -F OUTPUT
sudo ip6tables -F OUTPUT

# GCC 13 on Linux aarch64 (#548): the default compiler of Ubuntu 24.04, JetPack 7.2 and Yocto Scarthgap, on the architecture of
# the Jetson boards. It builds the library, the examples and every test with the hosted ubuntu-24.04-arm image, then runs the fast
# tier. Warnings are not errors here: libstdc++ 13 reports false -Wnull-dereference positives (#526), so -Werror stays with the
Expand Down
1 change: 1 addition & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ The README introduces WebFront through the Game of Life walkthrough, demonstrati
- `include/webfront/weblink/`: bridge message encoding and routing.
- `include/webfront/system/`: layered virtual filesystems and the embedded web resources, a closed list guarded by the `MinimalCoreAssets` CTest case (normative list and 150 KiB decoded budget in ADR-016; changing it means amending the ADR and `test/cmake/CheckMinimalCoreAssets.cmake` together).
- `include/webfront/frontend/`: system-browser, CEF, optional Windows WebView2 and macOS WKWebView frontend adapters.
- `docs/DISTRIBUTION.md`: `find_package(WebFront)` (`cmake/WebFrontInstall.cmake`, pins in `cmake/WebFrontDependencies.cmake`), the vcpkg port and Conan recipe in `cmake/packaging/`, `webfront_package()`, the SBOM and the optional updater `include/webfront/components/update/` (ADR-028; never write cryptography there).
- `examples/`: the default build includes Hello World (`hello-world/`), the host loop (`host-loop/`: an application that keeps its own loop, `app.start()` or a host thread beside a native window; it ray-traces a Boing Ball on the CPU or with an optional CUDA unit, see `docs/HOST_LOOP_EXAMPLE.md`) and Game of Life (`life/`, with console, developer and embedded stages, plus the `life/react/` variant with a C++ panel inside React). The standalone [PTY example](docs/PTY.md) has its own CMake entry point.
- `js/core/`: readable browser bridge, fallback and bootstrap loader compiled into `include/webfront/`, plus the embedding CMake modules; `js/developer/`: developer environment (its terminal and `wf`), the wf scripts that build it (`scripts/`), build and publication tools. The repository is itself a `wf` project (`js/developer/webfront.project.json` and its lock, selected with `--manifest-dir js/developer`): the environment builds itself, and its pure JavaScript specs (`test/developer/`) run with `wf test`. Production C++ remains header-only in `include/webfront/`.
- `js/developer/starters/`: the sources of the `app` starter and `agent-guide.md`, the `AGENTS.md` that `wf create` puts beside a starter and that `webfront_write_agent_guide()` (`cmake/WebFrontAgentGuide.cmake`) writes in a consuming project.
Expand Down
31 changes: 29 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,25 @@ if(WEBFRONT_IS_TOP_LEVEL)

include(StaticAnalyzers)
endif()
include(CPM)
CPMAddPackage("gh:ambroise-leclerc/stdnet#8005774eabcba7e73188c02d2eeca2ff43c4ee3a")
include(WebFrontDependencies)
# A package build (vcpkg, Conan) or a machine without network access gives the sources of the pinned dependencies; nothing is
# then downloaded, CPM included, unless a downloaded engine (CEF, the WebView2 SDK) is enabled (docs/DISTRIBUTION.md).
set(WEBFRONT_STDNET_SOURCE_DIR "" CACHE PATH "Sources of the pinned stdnet, instead of downloading them")
set(WEBFRONT_STDEXEC_SOURCE_DIR "" CACHE PATH "Sources of the pinned stdexec, instead of downloading them")
if(NOT WEBFRONT_STDNET_SOURCE_DIR OR WEBFRONT_EMBED_CEF OR (WEBFRONT_EMBED_WEBVIEW2 AND NOT WEBFRONT_WEBVIEW2_SDK_DIR))
include(CPM)
endif()
if(WEBFRONT_STDEXEC_SOURCE_DIR)
set(FETCHCONTENT_SOURCE_DIR_STDEXEC "${WEBFRONT_STDEXEC_SOURCE_DIR}")
endif()
# EXCLUDE_FROM_ALL: the install rules of stdnet would copy its headers beside WebFront's; WebFrontInstall.cmake installs them.
if(WEBFRONT_STDNET_SOURCE_DIR)
add_subdirectory("${WEBFRONT_STDNET_SOURCE_DIR}" "${CMAKE_CURRENT_BINARY_DIR}/stdnet" EXCLUDE_FROM_ALL)
set(stdnet_SOURCE_DIR "${WEBFRONT_STDNET_SOURCE_DIR}")
else()
CPMAddPackage(URI "gh:ambroise-leclerc/stdnet#${WEBFRONT_STDNET_REVISION}" EXCLUDE_FROM_ALL YES)
endif()
set(WEBFRONT_USAGE_TARGET WebFront)
webfront_include_frontend_support()

include(ModuleScan)
Expand Down Expand Up @@ -161,6 +178,10 @@ include(WebFrontAgentGuide)
webfront_announce_agent_support()
# webfront_write_sbom(): an application's SPDX bill of materials (docs/DISTRIBUTION.md).
include(WebFrontSbom)
# webfront_package(): an application's installer with CPack (docs/DISTRIBUTION.md).
include(WebFrontPackage)
# webfront_use_updater(): the optional verified updater, outside the core (docs/DISTRIBUTION.md).
include(WebFrontUpdater)

if(WEBFRONT_ENABLE_TESTING OR WEBFRONT_ENABLE_FUZZING)
include(TestHardening)
Expand All @@ -185,3 +206,9 @@ endif()
if(WEBFRONT_BUILD_EXAMPLES)
add_subdirectory(examples)
endif()

# install() and find_package(WebFront): an embedding project owns its own installation (docs/DISTRIBUTION.md).
option(WEBFRONT_INSTALL "Generate the install rules of the WebFront package" ${WEBFRONT_IS_TOP_LEVEL})
if(WEBFRONT_INSTALL)
include(WebFrontInstall)
endif()
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -464,6 +464,8 @@ target_link_libraries(MyApp PRIVATE WebFront::WebFront)

As a subproject, examples and tests are off by default and compiler settings do not leak into your targets. `WEBFRONT_BUILD_EXAMPLES=OFF` disables examples in a standalone build too.

An installed WebFront (`cmake --install`, the vcpkg overlay port or the Conan recipe) is used with `find_package(WebFront CONFIG REQUIRED)`. [Distributing an application](docs/DISTRIBUTION.md) covers it, installers (`webfront_package()`), the bill of materials and verified updates.

<details>
<summary>GCC 16 and C++ module scanning</summary>

Expand Down
9 changes: 6 additions & 3 deletions cmake/WKWebViewSupport.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,14 @@ endif()
if(CMAKE_OSX_DEPLOYMENT_TARGET AND CMAKE_OSX_DEPLOYMENT_TARGET VERSION_LESS "13.3")
message(FATAL_ERROR "WEBFRONT_EMBED_WKWEBVIEW requires CMAKE_OSX_DEPLOYMENT_TARGET >= 13.3")
endif()
if(NOT DEFINED WEBFRONT_USAGE_TARGET)
set(WEBFRONT_USAGE_TARGET WebFront)
endif()
find_library(WEBFRONT_COCOA_FRAMEWORK Cocoa REQUIRED)
find_library(WEBFRONT_WEBKIT_FRAMEWORK WebKit REQUIRED)
target_compile_definitions(WebFront INTERFACE WEBFRONT_EMBED_WKWEBVIEW)
target_compile_options(WebFront INTERFACE "$<$<COMPILE_LANGUAGE:CXX>:-fblocks>")
target_link_libraries(WebFront INTERFACE "${WEBFRONT_COCOA_FRAMEWORK}" "${WEBFRONT_WEBKIT_FRAMEWORK}")
target_compile_definitions(${WEBFRONT_USAGE_TARGET} INTERFACE WEBFRONT_EMBED_WKWEBVIEW)
target_compile_options(${WEBFRONT_USAGE_TARGET} INTERFACE "$<$<COMPILE_LANGUAGE:CXX>:-fblocks>")
target_link_libraries(${WEBFRONT_USAGE_TARGET} INTERFACE "${WEBFRONT_COCOA_FRAMEWORK}" "${WEBFRONT_WEBKIT_FRAMEWORK}")

function(webfront_add_wkwebview_tests)
get_filename_component(webtest_source_dir "${CMAKE_CURRENT_FUNCTION_LIST_DIR}/../test/web" ABSOLUTE)
Expand Down
3 changes: 3 additions & 0 deletions cmake/WebFrontAgentGuide.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ function(webfront_write_agent_guide)
cmake_path(NORMAL_PATH CMAKE_CURRENT_FUNCTION_LIST_DIR OUTPUT_VARIABLE here)
set(source "${here}/../js/developer/starters/agent-guide.md")
cmake_path(NORMAL_PATH source)
if(NOT EXISTS "${source}") # the installed package keeps the guide beside this file
set(source "${here}/agent-guide.md")
endif()
set(destination "${ARG_DIRECTORY}/${ARG_NAME}")
# EXISTS follows links: a dangling link is a file somebody placed there too.
if(EXISTS "${destination}" OR IS_SYMLINK "${destination}")
Expand Down
Loading
Loading