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
83 changes: 47 additions & 36 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,6 @@ jobs:
container:
image: ubuntu:24.04
name: Generate Test Matrix
# Permissions allow Danger to read PR context and post comments.
permissions:
contents: read
pull-requests: write
outputs:
matrix: ${{ steps.cpp-matrix.outputs.matrix }}
llvm-matrix: ${{ steps.llvm-matrix.outputs.llvm-matrix }}
Expand All @@ -48,7 +44,7 @@ jobs:
uses: actions/checkout@v4

- name: Generate Test Matrix
uses: alandefreitas/cpp-actions/cpp-matrix@v1.8.12
uses: alandefreitas/cpp-actions/cpp-matrix@v1.9.1
id: cpp-matrix
with:
compilers: |
Expand Down Expand Up @@ -101,6 +97,7 @@ jobs:
mrdocs-release-package-artifact: release-packages-{{{ lowercase os }}}
output-file: matrix.json
trace-commands: true
github-token: ${{ secrets.GITHUB_TOKEN }}

# Set up the version as expected by the LLVM matrix script and @actions/core
- name: Setup Node.js
Expand Down Expand Up @@ -161,7 +158,7 @@ jobs:
# We need git to ensure actions/checkout@v4 will use git and
# for the next steps that need to clone repositories
- name: Install Git
uses: alandefreitas/cpp-actions/package-install@v1.8.12
uses: alandefreitas/cpp-actions/package-install@v1.9.1
if: matrix.container != ''
env:
DEBIAN_FRONTEND: 'noninteractive'
Expand All @@ -178,7 +175,7 @@ jobs:
uses: actions/checkout@v4

- name: Setup CMake
uses: alandefreitas/cpp-actions/setup-cmake@v1.8.7
uses: alandefreitas/cpp-actions/setup-cmake@v1.9.1
id: setup-cmake
with:
version: '>=3.26'
Expand All @@ -190,7 +187,7 @@ jobs:
uses: seanmiddleditch/gha-setup-ninja@v5

- name: Setup C++
uses: alandefreitas/cpp-actions/setup-cpp@v1.8.12
uses: alandefreitas/cpp-actions/setup-cpp@v1.9.1
id: setup-cpp
with:
compiler: ${{ matrix.compiler }}
Expand Down Expand Up @@ -264,7 +261,7 @@ jobs:
${{ steps.setup-cpp.outputs.cxx }} --print-target-triple

- name: Install System Packages
uses: alandefreitas/cpp-actions/package-install@v1.8.12
uses: alandefreitas/cpp-actions/package-install@v1.9.1
if: matrix.compiler != 'msvc'
id: package-install
env:
Expand All @@ -287,7 +284,7 @@ jobs:
# section, but which depend on paths not known at that point.
- name: Resolved Matrix
id: rmatrix
run: |
run: |
set -euvx

third_party_dir="$(realpath $(pwd)/..)/third-party"
Expand Down Expand Up @@ -361,7 +358,7 @@ jobs:

- name: Install libc++
id: install_libcxx
uses: alandefreitas/cpp-actions/cmake-workflow@v1.8.12
uses: alandefreitas/cpp-actions/cmake-workflow@v1.9.1
if: matrix.use-libcxx == 'true' && steps.llvm-cache.outputs.cache-hit != 'true'
with:
cmake-version: '>=3.26'
Expand Down Expand Up @@ -395,7 +392,7 @@ jobs:
# This is controlled by the llvm-runtimes matrix variable.
- name: Install LLVM
id: install_llvm
uses: alandefreitas/cpp-actions/cmake-workflow@v1.8.12
uses: alandefreitas/cpp-actions/cmake-workflow@v1.9.1
if: steps.llvm-cache.outputs.cache-hit != 'true'
with:
cmake-version: '>=3.26'
Expand Down Expand Up @@ -432,14 +429,14 @@ jobs:
run: |
rm -r ../third-party/llvm-project

- name: Install Duktape
uses: alandefreitas/cpp-actions/cmake-workflow@v1.8.12
- name: Install JerryScript
uses: alandefreitas/cpp-actions/cmake-workflow@v1.9.1
with:
source-dir: ../third-party/duktape
url: https://github.com/svaarala/duktape/releases/download/v2.7.0/duktape-2.7.0.tar.xz
source-dir: ../third-party/jerryscript
url: https://github.com/jerryscript-project/jerryscript/archive/refs/tags/v3.0.0.tar.gz
patches: |
./third-party/patches/duktape/CMakeLists.txt
./third-party/patches/duktape/duktapeConfig.cmake.in
./third-party/patches/jerryscript/CMakeLists.txt
./third-party/patches/jerryscript/jerryscriptConfig.cmake.in
build-dir: ${sourceDir}/build
cc: ${{ steps.setup-cpp.outputs.cc }}
cxx: ${{ steps.setup-cpp.outputs.cxx }}
Expand All @@ -451,9 +448,23 @@ jobs:
install-prefix: ${sourceDir}/install
run-tests: false
trace-commands: true
extra-args: |
-D JERRY_PROFILE=es.next
-D JERRY_EXTERNAL_CONTEXT=ON
-D JERRY_PORT=ON
-D JERRY_DEBUGGER=OFF
-D JERRY_SNAPSHOT_SAVE=OFF
-D JERRY_SNAPSHOT_EXEC=OFF
-D JERRY_CMDLINE=OFF
-D JERRY_TESTS=OFF
-D JERRY_MEM_STATS=OFF
-D JERRY_PARSER_STATS=OFF
-D JERRY_LINE_INFO=OFF
-D JERRY_LTO=OFF
-D JERRY_LIBC=OFF

- name: Install Lua
uses: alandefreitas/cpp-actions/cmake-workflow@v1.8.12
uses: alandefreitas/cpp-actions/cmake-workflow@v1.9.1
with:
source-dir: ../third-party/lua
url: https://github.com/lua/lua/archive/refs/tags/v5.4.8.tar.gz
Expand All @@ -473,7 +484,7 @@ jobs:
trace-commands: true

- name: Install Libxml2
uses: alandefreitas/cpp-actions/cmake-workflow@v1.8.12
uses: alandefreitas/cpp-actions/cmake-workflow@v1.9.1
if: matrix.compiler == 'msvc'
with:
source-dir: ../third-party/libxml2
Expand Down Expand Up @@ -532,10 +543,10 @@ jobs:
node-version: '20'

- name: CMake Workflow
uses: alandefreitas/cpp-actions/cmake-workflow@v1.8.12
uses: alandefreitas/cpp-actions/cmake-workflow@v1.9.1
env:
# Bump per-test timeout on Windows to avoid CTest default (1500s) killing slow golden suites.
CTEST_TEST_TIMEOUT: ${{ runner.os == 'Windows' && '3600' || '' }}
# Bump per-test timeout on Windows and for MSan jobs to avoid CTest default (1500s) killing slow golden suites.
CTEST_TEST_TIMEOUT: ${{ (runner.os == 'Windows' || matrix.msan == 'true') && '3600' || '' }}
with:
cmake-version: '>=3.26'
cxxstd: ${{ matrix.cxxstd }}
Expand All @@ -551,7 +562,7 @@ jobs:
-D MRDOCS_BUILD_DOCS=OFF
-D CMAKE_EXE_LINKER_FLAGS="${{ steps.rmatrix.outputs.common-ldflags }}"
-D LLVM_ROOT="${{ steps.rmatrix.outputs.llvm-path }}"
-D duktape_ROOT="${{ steps.rmatrix.outputs.third-party-dir }}/duktape/install"
-D jerryscript_ROOT="${{ steps.rmatrix.outputs.third-party-dir }}/jerryscript/install"
-D LUA_ROOT="${{ steps.rmatrix.outputs.third-party-dir }}/lua/install"
-D Lua_ROOT="${{ steps.rmatrix.outputs.third-party-dir }}/lua/install"
-D lua_ROOT="${{ steps.rmatrix.outputs.third-party-dir }}/lua/install"
Expand Down Expand Up @@ -649,7 +660,7 @@ jobs:
retention-days: 1

- name: FlameGraph
uses: alandefreitas/cpp-actions/flamegraph@v1.8.12
uses: alandefreitas/cpp-actions/flamegraph@v1.9.1
if: matrix.time-trace
with:
build-dir: build
Expand Down Expand Up @@ -725,7 +736,7 @@ jobs:
fi

- name: Install packages
uses: alandefreitas/cpp-actions/package-install@v1.8.12
uses: alandefreitas/cpp-actions/package-install@v1.9.1
id: package-install
with:
apt-get: build-essential asciidoctor cmake bzip2 git rsync
Expand All @@ -750,7 +761,7 @@ jobs:
if: ${{ runner.os == 'Windows' }}

- name: Setup C++
uses: alandefreitas/cpp-actions/setup-cpp@v1.8.12
uses: alandefreitas/cpp-actions/setup-cpp@v1.9.1
id: setup-cpp
with:
compiler: ${{ matrix.compiler }}
Expand Down Expand Up @@ -794,7 +805,7 @@ jobs:
$MRDOCS_ROOT/bin/mrdocs --version

- name: Clone Boost.URL
uses: alandefreitas/cpp-actions/boost-clone@v1.8.12
uses: alandefreitas/cpp-actions/boost-clone@v1.9.0
id: boost-url-clone
with:
branch: develop
Expand All @@ -808,7 +819,7 @@ jobs:
if: ${{ runner.os != 'Windows' }}
run: |
set -x

if [[ $RUNNER_OS == 'macOS' ]]; then
# Step 1: Check if llvm-symbolizer is installed
if ! command -v llvm-symbolizer &> /dev/null; then
Expand All @@ -821,7 +832,7 @@ jobs:
exit 1
fi
fi

# Step 3: Ensure llvm-symbolizer is in your PATH
llvm_bin_path=$(brew --prefix)/opt/llvm/bin
PATH="$PATH:$llvm_bin_path"
Expand All @@ -839,7 +850,7 @@ jobs:
apt-get update
apt-get install -y llvm
fi

# Step 2: Ensure llvm-symbolizer is in your PATH
LLVM_SYMBOLIZER_PATH=$(which llvm-symbolizer)
if [ -z "$LLVM_SYMBOLIZER_PATH" ]; then
Expand All @@ -852,7 +863,7 @@ jobs:
echo "Unsupported OS: $RUNNER_OS"
exit 1
fi

# Step 4: Export LLVM_SYMBOLIZER_PATH environment variable
export LLVM_SYMBOLIZER_PATH="$LLVM_SYMBOLIZER_PATH"
echo -e "LLVM_SYMBOLIZER_PATH=$LLVM_SYMBOLIZER_PATH" >> $GITHUB_ENV
Expand Down Expand Up @@ -971,7 +982,7 @@ jobs:
# Mirror contents of $src into $dst, overwriting existing files
tar -C "$src" -cf - . | tar -C "$dst" -xpf -
done


- name: Generate Demos
run: |
Expand Down Expand Up @@ -1151,7 +1162,7 @@ jobs:
time rsync "${rsyncopts[@]}" $(pwd)/demos/ "$demo_dir"/

- name: Create changelog
uses: alandefreitas/cpp-actions/create-changelog@v1.8.12
uses: alandefreitas/cpp-actions/create-changelog@v1.9.1
with:
output-path: CHANGELOG.md
thank-non-regular: ${{ startsWith(github.ref, 'refs/tags/') }}
Expand Down Expand Up @@ -1219,7 +1230,7 @@ jobs:
echo "llvm-path=$llvm_path" >> $GITHUB_OUTPUT

- name: Install packages
uses: alandefreitas/cpp-actions/package-install@v1.8.12
uses: alandefreitas/cpp-actions/package-install@v1.9.1
id: package-install
with:
apt-get: ${{ matrix.install }}
Expand All @@ -1229,4 +1240,4 @@ jobs:
uses: actions/cache@v4
with:
path: ${{ steps.rmatrix.outputs.llvm-path }}
key: ${{ matrix.llvm-archive-basename }}
key: ${{ matrix.llvm-archive-basename }}
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,7 @@
/util/danger/node_modules/
/.roadmap
/AGENTS.md
/CLAUDE.md
# Ignore hidden OS files under golden fixtures
test-files/golden-tests/**/.*
/test-files/golden-tests/**/.*
/.code
18 changes: 6 additions & 12 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -277,13 +277,8 @@ llvm_map_components_to_libnames(llvm_libs all)
string(REGEX REPLACE " /W[0-4]" "" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
string(REGEX REPLACE " /W[0-4]" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")

# Duktape
find_package(duktape CONFIG)
if (NOT DUKTAPE_FOUND)
# Duktape doesn't natively support CMake.
# Some config script patches use the capitalized version.
find_package(Duktape REQUIRED CONFIG)
endif()
# JerryScript
find_package(jerryscript REQUIRED CONFIG)

# Lua
find_package(Lua CONFIG REQUIRED)
Expand Down Expand Up @@ -344,10 +339,11 @@ target_include_directories(mrdocs-core
)
target_include_directories(mrdocs-core
SYSTEM PRIVATE
"$<BUILD_INTERFACE:${DUKTAPE_INCLUDE_DIRS}>"
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>"
"$<BUILD_INTERFACE:${JERRYSCRIPT_INCLUDE_DIRS}>"
"$<BUILD_INTERFACE:${jerryscript_ROOT}/include>"
"$<BUILD_INTERFACE:/usr/local/include>"
)
target_link_libraries(mrdocs-core PRIVATE ${DUKTAPE_LIBRARY})
target_link_libraries(mrdocs-core PRIVATE jerryscript::jerry-core jerryscript::jerry-port)
target_link_libraries(mrdocs-core PRIVATE Lua::lua)

# Clang
Expand Down Expand Up @@ -425,8 +421,6 @@ list(APPEND TOOL_SOURCES
${CMAKE_CURRENT_BINARY_DIR}/src/tool/PublicToolArgs.cpp)

add_executable(mrdocs ${TOOL_SOURCES})
target_compile_definitions(mrdocs PRIVATE -DMRDOCS_TOOL)

target_include_directories(mrdocs
PUBLIC
"$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include/>"
Expand Down
3 changes: 1 addition & 2 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@
"CMAKE_EXPORT_COMPILE_COMMANDS": "ON",
"LLVM_ROOT": "$env{LLVM_ROOT}",
"Clang_ROOT": "$env{LLVM_ROOT}",
"duktape_ROOT": "$env{DUKTAPE_ROOT}",
"Duktape_ROOT": "$env{DUKTAPE_ROOT}",
"jerryscript_ROOT": "$env{JERRYSCRIPT_ROOT}",
"libxml2_ROOT": "$env{LIBXML2_ROOT}",
"LibXml2_ROOT": "$env{LIBXML2_ROOT}",
"MRDOCS_BUILD_TESTS": "ON",
Expand Down
13 changes: 13 additions & 0 deletions bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,18 @@
# Official repository: https://github.com/cppalliance/mrdocs
#

# Heads up (Dec 2025): bootstrap.py is still moving toward being the single
# setup path for ci.yml. Some presets/paths (e.g., release-msvc vs. old
# release-windows) and edge flags may be untested. Defaults can shift while we
# finish the move. If it blows up: 1) wipe the build dir; 2) run the matching
# CMake/Ninja preset by hand; 3) share the failing command. This note stays
# until Bootstrap owns the CI flow.

TRANSITION_BANNER = (
"Heads up: bootstrap.py is mid-move to replace the process in ci.yml; presets can differ. "
"If it fails, try a clean build dir or run the preset yourself."
)

import argparse
import subprocess
import os
Expand Down Expand Up @@ -3404,6 +3416,7 @@ def get_command_line_args(argv=None):
def main():
args = get_command_line_args()
installer = MrDocsInstaller(args)
installer.ui.warn(TRANSITION_BANNER)
if installer.options.refresh_all:
installer.refresh_all()
exit(0)
Expand Down
5 changes: 0 additions & 5 deletions docs/modules/ROOT/pages/contribute/codebase-tour.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,3 @@ The documentation is written in AsciiDoc and can be built using the Antora tool.
==== `third-party/`—Helpers for third-party libraries

This directory contains build scripts and configuration files for third-party libraries.

* `third-party/`—Third-party libraries
** `third-party/llvm/`—CMake Presets for LLVM
** `third-party/duktape/`—CMake scripts for Duktape
** `third-party/lua/`—A bundled Lua interpreter
Loading
Loading