From 5a8f896515e3abe01f3023af28ffd34846e36da9 Mon Sep 17 00:00:00 2001 From: David Allsopp Date: Thu, 19 Mar 2026 18:15:09 +0000 Subject: [PATCH 1/7] Backport and disable workflows from 5.4 --- .gitattributes | 1 + .github/workflows/build-cross.yml | 287 +++++++++++++++++++ .github/workflows/build-msvc.yml | 215 ++++++++++++++ .github/workflows/hygiene.yml | 14 - .github/workflows/multicoretests.yml | 72 +++++ .github/workflows/parsetree-change.yml | 32 +++ .github/workflows/tsan.yml | 102 +++++++ tools/ci/actions/check-parsetree-modified.sh | 54 ---- tools/ci/actions/multicoretests.sh | 89 ++++++ tools/ci/actions/runner.sh | 10 + 10 files changed, 808 insertions(+), 68 deletions(-) create mode 100644 .github/workflows/build-cross.yml create mode 100644 .github/workflows/build-msvc.yml create mode 100644 .github/workflows/multicoretests.yml create mode 100644 .github/workflows/parsetree-change.yml create mode 100644 .github/workflows/tsan.yml delete mode 100755 tools/ci/actions/check-parsetree-modified.sh create mode 100755 tools/ci/actions/multicoretests.sh diff --git a/.gitattributes b/.gitattributes index f1a14e3689c8..c7d836021563 100644 --- a/.gitattributes +++ b/.gitattributes @@ -57,6 +57,7 @@ tools/mantis2gh_stripped.csv typo.missing-header # Github templates and scripts lack headers, have long lines /.github/** typo.missing-header typo.long-line=may typo.very-long-line=may +/.github/workflows/*.yml typo.non-ascii=may /.mailmap typo.long-line typo.missing-header typo.non-ascii /.merlin typo.missing-header diff --git a/.github/workflows/build-cross.yml b/.github/workflows/build-cross.yml new file mode 100644 index 000000000000..950cfd005045 --- /dev/null +++ b/.github/workflows/build-cross.yml @@ -0,0 +1,287 @@ +name: Cross compilers + +on: + workflow_dispatch: + +# Restrict the GITHUB_TOKEN +permissions: {} + +# See build.yml +concurrency: + group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name == 'pull_request' || github.sha }} + cancel-in-progress: true + +env: + failed: 0 + TESTDIR: >- + C:\Бактріан🐫 + STR_UTF8: >- + "C:\\Бактріан🐫" + STR_UTF16: >- + L"C:\\\x0411\x0430\x043a\x0442\x0440\x0456\x0430\x043d\xd83d\xdc2b" + EXAMPLE_PROGRAM: | + let _ = + Printf.printf "Version: %s\nOS: %s\nUnix: %b\nWin: %b\nCygwin: %b\n" + Sys.ocaml_version Sys.os_type Sys.unix Sys.win32 Sys.cygwin + COMPLIBS_PROG_X86_64: | + let _ = + Printf.printf "allow_unaligned_access = %b\n" Arch.allow_unaligned_access; + Printf.printf "win64 = %b\n" Arch.win64 + COMPLIBS_PROG_AARCH64: | + let _ = + Printf.printf "allow_unaligned_access = %b\n" Arch.allow_unaligned_access; + Printf.printf "macosx = %b\n" Arch.macosx + +jobs: + non-cross: + if: contains(github.event.pull_request.labels.*.name, 'run-crosscompiler-tests') + runs-on: ubuntu-latest + steps: + - name: Checkout OCaml + uses: actions/checkout@v5 + with: + persist-credentials: false + - name: Configure, build and install OCaml + run: | + PREFIX="$HOME/.local" + echo "$PREFIX/bin" >> "$GITHUB_PATH" + set -x + ./configure --disable-warn-error --disable-ocamldoc \ + --disable-ocamltest --disable-stdlib-manpages \ + --disable-dependency-generation --prefix="$PREFIX" || failed=$? + if ((failed)) ; then set +x + echo ; echo "::group::config.log content ($(wc -l config.log) lines)" + cat config.log ; echo '::endgroup::' ; exit $failed + fi + make -j + make install + cd "$HOME" + tar caf /tmp/ocaml.tar.zst .local + - name: Upload Artifact + uses: actions/upload-artifact@v4 + with: + name: non-cross-ocaml + path: /tmp/ocaml.tar.zst + retention-days: 1 + + cross-windows: + runs-on: ubuntu-latest + needs: non-cross + steps: + - name: Download Artifact + uses: actions/download-artifact@v4 + with: + name: non-cross-ocaml + - name: Install non-cross OCaml and set up environment + run: | + set -x + tar xaf ocaml.tar.zst -C "$HOME" + rm -f ocaml.tar.zst + echo "$HOME/.local/bin" >> "$GITHUB_PATH" + sudo apt-get update -y + sudo apt-get install -y gcc-mingw-w64-x86-64 + - name: Checkout OCaml + uses: actions/checkout@v5 + with: + submodules: true + persist-credentials: false + - name: Configure, build and install Linux-to-Windows OCaml + run: | + set -x + ./configure --prefix="$HOME/cross" --target=x86_64-w64-mingw32 \ + TARGET_LIBDIR="$TESTDIR" || failed=$? + if ((failed)) ; then set +x + echo ; echo "::group::config.log content ($(wc -l config.log) lines)" + cat config.log ; echo '::endgroup::' ; exit $failed + fi + # The OOM-killer may be triggered if the number of parallel + # jobs isn't limited. + make crossopt -j$(nproc) + make installcross + ln -sr "$HOME/cross/bin/flexlink.opt.exe" "$HOME/.local/bin/flexlink" + - name: Show opt.opt configuration + run: | + set -x + $HOME/cross/bin/ocamlopt.opt.exe -config + cat runtime/build_config.h + - name: Cross compile a small program + run: | + printf %s "$EXAMPLE_PROGRAM$COMPLIBS_PROG_X86_64" > example.ml + set -x + cat example.ml + $HOME/cross/bin/ocamlopt.opt.exe -I $HOME/cross/lib/ocaml/compiler-libs/ ocamlcommon.cmxa ocamloptcomp.cmxa example.ml -o example.exe -verbose + - name: Upload Artifact + uses: actions/upload-artifact@v4 + with: + name: windows-executable + path: example.exe + retention-days: 1 + - name: Test cross sak + run: | + printf %s "$STR_UTF16" > utf16.ref + printf %s "$STR_UTF8" > utf8.ref + set -x + runtime/sak encode-C-utf16-literal "$TESTDIR" > utf16 + git diff --no-index utf16.ref utf16 + runtime/sak encode-C-utf8-literal "$TESTDIR" > utf8 + git diff --no-index utf8.ref utf8 + + run-windows: + runs-on: windows-latest + needs: cross-windows + steps: + - name: Download Artifact + uses: actions/download-artifact@v4 + with: + name: windows-executable + - name: Run example program + run: | + .\example.exe + + cross-arm-linux: + runs-on: ubuntu-latest + needs: non-cross + steps: + - name: Download Artifact + uses: actions/download-artifact@v4 + with: + name: non-cross-ocaml + - name: Install non-cross OCaml and set up environment + run: | + set -x + tar xaf ocaml.tar.zst -C "$HOME" + rm -f ocaml.tar.zst + echo "$HOME/.local/bin" >> "$GITHUB_PATH" + sudo apt-get update -y + sudo apt-get install -y gcc-aarch64-linux-gnu qemu-user + - name: Checkout OCaml + uses: actions/checkout@v5 + with: + submodules: true + persist-credentials: false + - name: Configure, build and install Linux-to-Windows OCaml + run: | + set -x + ./configure --prefix="$HOME/cross" --target=aarch64-linux-gnu \ + || failed=$? + if ((failed)) ; then set +x + echo ; echo "::group::config.log content ($(wc -l config.log) lines)" + cat config.log ; echo '::endgroup::' ; exit $failed + fi + make crossopt -j + make installcross + - name: Show opt.opt configuration + run: | + set -x + $HOME/cross/bin/ocamlopt.opt -config + cat runtime/build_config.h + - name: Cross compile a small program + run: | + printf %s "$EXAMPLE_PROGRAM$COMPLIBS_PROG_AARCH64" > example.ml + set -x + cat example.ml + $HOME/cross/bin/ocamlopt.opt -I $HOME/cross/lib/ocaml/compiler-libs/ ocamlcommon.cmxa ocamloptcomp.cmxa example.ml -o example -verbose + - name: Run the small example program + run: | + set -x + qemu-aarch64 -L /usr/aarch64-linux-gnu example + - name: Test cross sak + run: | + printf %s "$STR_UTF16" > utf16.ref + printf %s "$STR_UTF8" > utf8.ref + set -x + runtime/sak encode-C-utf16-literal "$TESTDIR" > utf16 + git diff --no-index utf16.ref utf16 + runtime/sak encode-C-utf8-literal "$TESTDIR" > utf8 + git diff --no-index utf8.ref utf8 + + cross-android: + runs-on: ubuntu-latest + needs: non-cross + env: + # https://developer.android.com/ndk/downloads#lts-downloads + NDK: r27d # Latest LTS Version + API_LEVEL: 21 + steps: + - name: Download Artifact + uses: actions/download-artifact@v4 + with: + name: non-cross-ocaml + - name: Install non-cross OCaml + run: | + set -x + tar xaf ocaml.tar.zst -C "$HOME" + rm -f ocaml.tar.zst + echo "$HOME/.local/bin" >> "$GITHUB_PATH" + - name: Restore the Android NDK from cache + uses: actions/cache/restore@v4 + id: cache + with: + path: | + /home/runner/android + key: android-ndk-${{ env.NDK }} + - name: Download the Android NDK + run: | + set -x + mkdir -p "$HOME/android" + cd "$HOME/android" + wget --no-verbose "https://dl.google.com/android/repository/android-ndk-$NDK-linux.zip" + unzip android-ndk-$NDK-linux.zip + rm android-ndk-$NDK-linux.zip + if: steps.cache.outputs.cache-hit != 'true' + - name: Save the Android NDK to cache + uses: actions/cache/save@v4 + with: + path: | + /home/runner/android + key: android-ndk-${{ env.NDK }} + if: steps.cache.outputs.cache-hit != 'true' + - name: Checkout OCaml + uses: actions/checkout@v5 + with: + persist-credentials: false + - name: Configure, build and install Linux-to-Android OCaml + env: + TARGET: x86_64-linux-android${{ env.API_LEVEL }} + TOOLDIR: android-ndk-${{ env.NDK }}/toolchains/llvm/prebuilt/linux-x86_64/bin + run: | + DIR="$HOME/android/$TOOLDIR" + set -x + # Hack around the fact that pthread_cancel isn't available on Android + # So the result program should _not_ be run with cleanup on exit + # (so no `c=1` in `OCAMLRUNPARAM`) + ./configure --prefix="$HOME/cross" --target=$TARGET \ + TARGET_LIBDIR="/dummy/directory" \ + CC="$DIR/clang --target=$TARGET" \ + CPPFLAGS='-Dpthread_cancel=assert' \ + AR="$DIR/llvm-ar" \ + PARTIALLD="$DIR/ld -r" \ + RANLIB="$DIR/llvm-ranlib" \ + STRIP="$DIR/llvm-strip" || failed=$? + if ((failed)) ; then set +x + echo ; echo "::group::config.log content ($(wc -l config.log) lines)" + cat config.log ; echo '::endgroup::' ; exit $failed + fi + make crossopt -j + make installcross + - name: Show opt.opt configuration + run: | + set -x + $HOME/cross/bin/ocamlopt.opt -config + cat runtime/build_config.h + - name: Cross compile a small program + run: | + printf %s "$EXAMPLE_PROGRAM" > example.ml + set -x + cat example.ml + $HOME/cross/bin/ocamlopt.opt example.ml -o example -verbose + file example + - name: Run example + uses: reactivecircus/android-emulator-runner@v2 + with: + api-level: ${{ env.API_LEVEL }} + arch: x86_64 + disable-animations: true + script: | + adb push example /data/local/tmp/example + adb shell /data/local/tmp/example diff --git a/.github/workflows/build-msvc.yml b/.github/workflows/build-msvc.yml new file mode 100644 index 000000000000..2331a9be79cc --- /dev/null +++ b/.github/workflows/build-msvc.yml @@ -0,0 +1,215 @@ +name: Build with MSVC + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +on: + workflow_dispatch: + +# env: + # Fully print commands executed by Make + # MAKEFLAGS: V=1 + +defaults: + run: + shell: bash -eo pipefail -o igncr {0} + +jobs: + config: + runs-on: ubuntu-latest + outputs: + full-matrix: ${{ steps.full.outputs.result }} + matrix: ${{ steps.matrix.outputs.result}} + skip-testsuite: ${{ steps.skip.outputs.result }} + steps: + - name: Record if the build matrix is expanded + id: full + uses: actions/github-script@v7 + with: + script: | + let full_matrix = false; + if (context.payload.pull_request) { + const { data: labels } = + await github.rest.issues.listLabelsOnIssue({...context.repo, issue_number: context.payload.pull_request.number}); + full_matrix = labels.some(label => label.name === 'CI: Full matrix'); + } + console.log('Full matrix: ' + full_matrix); + return full_matrix; + - name: Compute matrix for the "build" job + id: matrix + uses: actions/github-script@v7 + with: + script: | + // # Always test cl and clang-cl + let compilers = ['gcc']; + // # Also test i686 MSVC + let include = []; + // # If this is a pull request, see if the PR has the + // # 'CI: Full matrix' label. This is done using an API request, + // # rather than from context.payload.pull_request.labels, since we + // # want the _current_ list of labels. This allows the labelling to + // # be changed, and then forcing a re-run of the workflow, rather + // # than having labelling triggering a fresh workflow event (which + // # is wasteful). + if (context.payload.pull_request) { + const { data: labels } = + await github.rest.issues.listLabelsOnIssue({...context.repo, issue_number: context.payload.pull_request.number}); + if (labels.some(label => label.name === 'CI: Full matrix')) { + console.log('Full matrix requested'); + // # Test bytecode-only Cygwin + include.push({cc: 'gcc', arch: 'x86_64', config_arg: '--disable-native-compiler'}); + } + } + return {config_arg: [''], arch: ['x86_64'], cc: compilers, include: include}; + - name: Determine if the testsuite should be skipped + id: skip + uses: actions/github-script@v7 + with: + script: | + let skip_testsuite = false; + if (context.payload.pull_request) { + const { data: labels } = + await github.rest.issues.listLabelsOnIssue({...context.repo, issue_number: context.payload.pull_request.number}); + skip_testsuite = labels.some(label => label.name === 'CI: Skip testsuite'); + } + console.log('Skip testsuite: ' + skip_testsuite); + return skip_testsuite; + + build: + permissions: {} + + runs-on: windows-latest + + needs: config + + timeout-minutes: ${{ matrix.cc == 'gcc' && 90 || 60 }} + + name: ${{ matrix.cc == 'cl' && 'MSVC' || matrix.cc == 'gcc' && 'Cygwin' || 'clang-cl' }} ${{ matrix.arch }} ${{ matrix.config_arg != '' && format('({0})', matrix.config_arg) || '' }} + + strategy: + matrix: ${{ fromJSON(needs.config.outputs.matrix) }} + fail-fast: true + + steps: + - name: Set git to use Unix line-endings for the testsuite + run: | + git config --global core.autocrlf false + git config --global core.eol lf + if: needs.config.outputs.full-matrix == 'true' + + - name: Fetch OCaml + uses: actions/checkout@v5 + with: + submodules: true + if: needs.config.outputs.full-matrix == 'true' + + - name: Restore Cygwin cache + uses: actions/cache/restore@v4 + with: + path: | + C:\cygwin-packages + key: cygwin-packages + if: needs.config.outputs.full-matrix == 'true' + + - name: Install Cygwin + uses: cygwin/cygwin-install-action@v3 + with: + packages: make,${{ matrix.cc != 'gcc' && 'mingw64-x86_64-' || 'gcc-fortran,' }}gcc-core + install-dir: 'D:\cygwin' + if: needs.config.outputs.full-matrix == 'true' + + - name: Save Cygwin cache + uses: actions/cache/save@v4 + with: + path: | + C:\cygwin-packages + key: cygwin-packages + if: needs.config.outputs.full-matrix == 'true' + + - name: Set up MSVC + uses: ilammy/msvc-dev-cmd@v1 + with: + arch: ${{ matrix.arch == 'x86_64' && 'x64' || 'x86' }} + if: matrix.cc != 'gcc' + + - name: Compute a key to cache configure results + id: autoconf-cache-key + env: + HOST: ${{ format('{0}-pc-{1}', matrix.arch, (matrix.cc == 'gcc' && 'cygwin' || 'windows')) }} + run: | + echo "key=${{ env.HOST }}-${{ matrix.cc }}-${{ hashFiles('configure') }}" >> $GITHUB_OUTPUT + if: needs.config.outputs.full-matrix == 'true' + + - name: Restore Autoconf cache + uses: actions/cache/restore@v4 + with: + path: | + config.cache + key: ${{ steps.autoconf-cache-key.outputs.key }} + if: needs.config.outputs.full-matrix == 'true' + + - name: Configure tree + env: + CONFIG_ARGS: >- + --cache-file=config.cache + --prefix "${{ matrix.cc != 'gcc' && '$PROGRAMFILES/Бактріан🐫' || '$(cygpath "$PROGRAMFILES/Бактріан🐫")'}}" + ${{ matrix.cc != 'gcc' && format('--host={0}-pc-windows', matrix.arch) || '' }} + ${{ matrix.cc != 'gcc' && format('CC={0}', matrix.cc) || '' }} + ${{ matrix.config_arg }} + run: | + eval $(tools/msvs-promote-path) + if ! ./configure ${{ env.CONFIG_ARGS }} ; then + rm -rf config.cache + failed=0 + ./configure ${{ env.CONFIG_ARGS }} || failed=$? + if ((failed)) ; then + echo + echo "::group::config.log content ($(wc -l config.log) lines)" + cat config.log + echo '::endgroup::' + exit $failed + fi + fi + if: needs.config.outputs.full-matrix == 'true' + + - name: Save Autoconf cache + uses: actions/cache/save@v4 + with: + path: | + config.cache + key: ${{ steps.autoconf-cache-key.outputs.key }} + if: needs.config.outputs.full-matrix == 'true' + + - name: Build OCaml + run: | + eval $(tools/msvs-promote-path) + make -j || failed=$? + if ((failed)) ; then make -j1 V=1 ; exit $failed ; fi + test -e runtime/libcamlrun.lib || tools/check-symbol-names runtime/*.a otherlibs/*/lib*.a + runtime/ocamlrun ocamlc -config + if: needs.config.outputs.full-matrix == 'true' + + - name: Assemble backend with mingw-w64 GASM and compare + run: | + x86_64-w64-mingw32-gcc -c -I./runtime -I ./flexdll -D__USE_MINGW_ANSI_STDIO=0 -DUNICODE -D_UNICODE -DWINDOWS_UNICODE=1 -DCAMLDLLIMPORT= -DIN_CAML_RUNTIME -DNATIVE_CODE -DTARGET_amd64 -DMODEL_default -DSYS_mingw64 -o runtime/amd64.o runtime/amd64.S + dumpbin /disasm:nobytes runtime/amd64nt.obj > runtime/amd64nt.dump + awk -f tools/ci/actions/canonicalize-dumpbin.awk runtime/amd64nt.dump runtime/amd64nt.dump > runtime/amd64nt.canonical + dumpbin /disasm:nobytes runtime/amd64.o > runtime/amd64.dump + awk -f tools/ci/actions/canonicalize-dumpbin.awk runtime/amd64.dump runtime/amd64.dump > runtime/amd64.canonical + git diff --no-index -- runtime/amd64*.canonical + wc -l runtime/amd64*.dump runtime/amd64*.canonical + # ^ The final wc is there to make sure that the canonical files are + # reasonable cleaned-up versions of the raw dumpbins and not simply + # empty + if: endsWith(matrix.arch, '64') && matrix.cc != 'gcc' + + - name: Run the test suite + if: needs.config.outputs.full-matrix == 'true' && needs.config.outputs.skip-testsuite != 'true' + run: | + eval $(tools/msvs-promote-path) + make tests + + - name: Install the compiler + run: make install + if: needs.config.outputs.full-matrix == 'true' diff --git a/.github/workflows/hygiene.yml b/.github/workflows/hygiene.yml index 473271f0ab44..3d18f07a3365 100644 --- a/.github/workflows/hygiene.yml +++ b/.github/workflows/hygiene.yml @@ -51,20 +51,6 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} if: github.event_name == 'pull_request' - - name: Parsetree updated - run: >- - tools/ci/actions/check-parsetree-modified.sh - '${{ github.event.pull_request.issue_url }}' - '${{ github.ref }}' - 'pull_request' - '${{ github.event.pull_request.base.ref }}' - '${{ github.event.pull_request.base.sha }}' - '${{ github.event.pull_request.head.ref }}' - '${{ github.event.pull_request.head.sha }}' - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - if: github.event_name == 'pull_request' - - name: configure correctly generated run: >- tools/ci/actions/check-configure.sh diff --git a/.github/workflows/multicoretests.yml b/.github/workflows/multicoretests.yml new file mode 100644 index 000000000000..128fe92a5e44 --- /dev/null +++ b/.github/workflows/multicoretests.yml @@ -0,0 +1,72 @@ +# Run the multicoretests testsuite if PR is labelled with run-multicoretests +name: Run multicoretests testsuite +on: + workflow_dispatch: + +# Restrict the GITHUB_TOKEN +permissions: {} + +# See build.yml +concurrency: + group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name == 'pull_request' || github.sha }} + cancel-in-progress: true + +jobs: + multicoretests: + if: contains(github.event.pull_request.labels.*.name, 'run-multicoretests') + runs-on: 'ubuntu-latest' + strategy: + matrix: + include: + - profile: dev + ocamlrunparam: b + - profile: debug-runtime + ocamlrunparam: b,s=4096 + steps: + - name: Checkout OCaml + uses: actions/checkout@v5 + with: + path: ocaml + persist-credentials: false + - name: Configure, build and install OCaml + run: | + bash -xe ocaml/tools/ci/actions/multicoretests.sh ocaml + - name: Checkout multicoretests + uses: actions/checkout@v5 + with: + repository: ocaml-multicore/multicoretests + ref: 0.11 + path: multicoretests + persist-credentials: false + - name: Checkout QCheck + uses: actions/checkout@v5 + with: + repository: c-cube/qcheck + ref: v0.26 + path: multicoretests/qcheck + persist-credentials: false + - name: Checkout dune + uses: actions/checkout@v5 + with: + repository: ocaml/dune + ref: 3.18.2 + path: dune + persist-credentials: false + - name: Build and install dune + run: | + bash -xe ocaml/tools/ci/actions/multicoretests.sh dune + - name: Show the configuration + run: | + bash ocaml/tools/ci/actions/multicoretests.sh show_config + - name: Build the test suite + env: + DUNE_PROFILE: ${{ matrix.profile }} + OCAMLRUNPARAM: ${{ matrix.ocamlrunparam }} + run: | + bash -xe ocaml/tools/ci/actions/multicoretests.sh build + - name: Run the multicore test suite + env: + DUNE_PROFILE: ${{ matrix.profile }} + OCAMLRUNPARAM: ${{ matrix.ocamlrunparam }} + run: | + bash -xe ocaml/tools/ci/actions/multicoretests.sh testsuite diff --git a/.github/workflows/parsetree-change.yml b/.github/workflows/parsetree-change.yml new file mode 100644 index 000000000000..45279561ac29 --- /dev/null +++ b/.github/workflows/parsetree-change.yml @@ -0,0 +1,32 @@ +name: Parsetree Updated + +on: + workflow_dispatch: + +jobs: + comment-and-label: + if: ${{! contains(github.event.pull_request.labels.*.name, 'parsetree-change')}} + permissions: + pull-requests: write + runs-on: ubuntu-latest + steps: + - name: Notify ppxlib maintainers + uses: actions/github-script@v7 + with: + script: | + github.rest.issues.createComment({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: 'CC @ocaml/ppxlib-dev' + }) + - name: Label PR + uses: actions/github-script@v7 + with: + script: | + github.rest.issues.addLabels({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + labels: ['parsetree-change'] + }) diff --git a/.github/workflows/tsan.yml b/.github/workflows/tsan.yml new file mode 100644 index 000000000000..959980d07e8f --- /dev/null +++ b/.github/workflows/tsan.yml @@ -0,0 +1,102 @@ +# Build the compiler and run the testsuite with ThreadSanitizer, if PR is +# labelled with run-thread-sanitizer +name: Run testsuite with ThreadSanitizer +on: + workflow_dispatch: + +# Restrict the GITHUB_TOKEN +permissions: {} + +# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#concurrency +# Concurrent workflows are grouped by the PR or branch that triggered them +# (github.ref) and the name of the workflow (github.workflow). The +# 'cancel-in-progress' option then make sure that only one workflow is running +# at a time. This doesn't prevent new jobs from running, rather it cancels +# already running jobs before scheduling new jobs. +concurrency: + group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name == 'pull_request' || github.sha }} + cancel-in-progress: true + +jobs: +# This job will do the initial build of the compiler (on linux). +# We then upload the compiler tree as a build artifact to enable re-use in +# subsequent jobs. + build: + if: contains(github.event.pull_request.labels.*.name, 'run-thread-sanitizer') + runs-on: 'ubuntu-latest' + outputs: + manual_changed: ${{ steps.manual.outputs.manual_changed }} + steps: + - name: Checkout + uses: actions/checkout@v5 + with: + persist-credentials: false + - name: Install libunwind + run: | + sudo apt-get update -y + sudo apt-get install -y libunwind-dev + # This temporary workaround reduces the number of random bits for the base + # address of vma regions for mmap allocation, to avoid the + # "FATAL: ThreadSanitizer: unexpected memory mapping" TSan error. + # See: https://github.com/google/sanitizers/issues/1716 + - name: Tune vm.mmap_rnd_bits value for TSan + run: sudo sysctl vm.mmap_rnd_bits=28 + - name: Configure tree + run: | + MAKE_ARG=-j CONFIG_ARG='--enable-cmm-invariants --enable-dependency-generation --enable-native-toplevel --enable-tsan --enable-ocamltest CPPFLAGS=-DTSAN_INSTRUMENT_ALL' OCAMLRUNPARAM=b,v=0 bash -xe tools/ci/actions/runner.sh configure + - name: Build + run: | + MAKE_ARG=-j bash -xe tools/ci/actions/runner.sh build + - name: Prepare Artifact + run: tar --zstd -cf /tmp/sources.tar.zstd . + - name: Upload Artifact + uses: actions/upload-artifact@v4 + with: + name: compiler + path: /tmp/sources.tar.zstd + retention-days: 1 + +# Testsuite run jobs: +# normal: Run the full testsuite +# debug: Run the full testsuite with the debug runtime and minor heap +# verification. + normal: + if: contains(github.event.pull_request.labels.*.name, 'run-thread-sanitizer') + name: ${{ matrix.name }} + needs: build + runs-on: ubuntu-latest + strategy: + matrix: + include: + - id: normal + name: normal + dependencies: libunwind-dev + - id: debug + name: debug runtime + dependencies: libunwind-dev + steps: + - name: Download Artifact + uses: actions/download-artifact@v4 + with: + name: compiler + - name: Unpack Artifact + run: | + tar --zstd -xf sources.tar.zstd + rm -f sources.tar.zstd + - name: Packages + if: matrix.dependencies != '' + run: | + sudo apt-get update -y + sudo apt-get install -y ${{ matrix.dependencies }} + - name: Run the testsuite + if: matrix.id == 'normal' + # Run testsuite with 30-minute timeout per test + run: | + TIMEOUT=1800 TSAN_OPTIONS=history_size=6 OCAMLRUNPARAM=b,v=0 bash -xe tools/ci/actions/runner.sh test_sequential + - name: Run the testsuite (debug runtime) + if: matrix.id == 'debug' + env: + OCAMLRUNPARAM: v=0,V=1 + USE_RUNTIME: d + run: | + bash -cxe "TSAN_OPTIONS=history_size=6 SHOW_TIMINGS=1 tools/ci/actions/runner.sh test_sequential" diff --git a/tools/ci/actions/check-parsetree-modified.sh b/tools/ci/actions/check-parsetree-modified.sh deleted file mode 100755 index 3438bb9c8acd..000000000000 --- a/tools/ci/actions/check-parsetree-modified.sh +++ /dev/null @@ -1,54 +0,0 @@ -#!/usr/bin/env bash -#************************************************************************** -#* * -#* OCaml * -#* * -#* Paul-Elliot Anglès d'Auriac, Tarides * -#* * -#* Copyright 2023 Tarides * -#* * -#* All rights reserved. This file is distributed under the terms of * -#* the GNU Lesser General Public License version 2.1, with the * -#* special exception on linking described in the file LICENSE. * -#* * -#************************************************************************** - -set -e - -# Hygiene Checks: check that whenever the parsetree.mli file has been modified, -# the parsetree-change label has been applied to the PR - -# Exactly of the following must be true: -# - No commit in the PR alters the parsetree.mli file -# - The parsetree-change label is applied to the PR - -API_URL="$1" -shift 1 - -AUTH="authorization: Bearer $GITHUB_TOKEN" - -# We need all the commits in the PR to be available -. tools/ci/actions/deepen-fetch.sh - -COMMIT_RANGE="$MERGE_BASE..$PR_HEAD" - -LABEL='parsetree-change' - -if ! git diff "$COMMIT_RANGE" --name-only --exit-code parsing/parsetree.mli \ - > /dev/null; then - echo -e "The parsetree has been modified." - if curl --silent --header "$AUTH" "$API_URL/labels" | grep -q "$LABEL"; then - echo -e "Label $LABEL is assigned to the PR." - else - echo -e "Please assign the label $LABEL to the PR" - exit 1 - fi -else - echo -e "The parsetree has not been modified." - if curl --silent --header "$AUTH" "$API_URL/labels" | grep -q "$LABEL"; then - echo -e "Please remove the label $LABEL to the PR" - exit 1 - else - echo -e "Label $LABEL is not assigned to the PR" - fi -fi diff --git a/tools/ci/actions/multicoretests.sh b/tools/ci/actions/multicoretests.sh new file mode 100755 index 000000000000..4adbd99294e6 --- /dev/null +++ b/tools/ci/actions/multicoretests.sh @@ -0,0 +1,89 @@ +#!/usr/bin/env bash +#************************************************************************** +#* * +#* OCaml * +#* * +#* Samuel Hym, Tarides * +#* * +#* Copyright 2024 Tarides * +#* * +#* All rights reserved. This file is distributed under the terms of * +#* the GNU Lesser General Public License version 2.1, with the * +#* special exception on linking described in the file LICENSE. * +#* * +#************************************************************************** + +set -e + +OCAMLDIR=ocaml +DUNEDIR=dune +MULTICORETESTSDIR=multicoretests + +export PREFIX="$HOME/local" +export PATH="$PREFIX/bin:$PATH" + +fatal() { + printf %s "$1" + exit 1 +} + +build_ocaml() { + # We let build.yml test for warnings + cd "$OCAMLDIR" + if ! ./configure --disable-warn-error --disable-stdlib-manpages \ + --disable-ocamltest --disable-ocamldoc --prefix="$PREFIX" ; then + echo + echo "::group::config.log content ($(wc -l config.log) lines)" + cat config.log + echo '::endgroup::' + exit 1 + fi + + make -j + make install +} + +build_dune() { + cd "$DUNEDIR" + make release + make install PREFIX="$PREFIX" +} + +show_config() { + set -x + ocamlc -config + dune --version +} + +build_testsuite() { + cd "$MULTICORETESTSDIR" + dune build +} + +run_testsuite() { + export QCHECK_MSG_INTERVAL=60 + cd "$MULTICORETESTSDIR" + dune build @ci -j1 --no-buffer --display=quiet --cache=disabled \ + --error-reporting=twice +} + +case "$1" in + ocaml) + build_ocaml + ;; + dune) + build_dune + ;; + show_config) + show_config + ;; + build) + build_testsuite + ;; + testsuite) + run_testsuite + ;; + *) + fatal "Unknown command '$1'" + ;; +esac diff --git a/tools/ci/actions/runner.sh b/tools/ci/actions/runner.sh index c3fe798a9234..0c9a4f55c044 100755 --- a/tools/ci/actions/runner.sh +++ b/tools/ci/actions/runner.sh @@ -109,6 +109,15 @@ Test () { fi } +# By default, TestPrefix will attempt to run the tests +# in the given directory in parallel. +TestPrefix () { + TO_RUN=parallel-"$1" + echo Running single testsuite directory with $TO_RUN + $MAKE -C testsuite $TO_RUN + cd .. +} + API_Docs () { echo Ensuring that all library documentation compiles $MAKE -C api_docgen html pdf texi @@ -205,6 +214,7 @@ configure) Configure;; build) Build;; test) Test parallel;; test_sequential) Test sequential;; +test_prefix) TestPrefix $2;; api-docs) API_Docs;; install) Install;; manual) BuildManual;; From b2a660d7983fa61189e89f1e8a6352695b002a80 Mon Sep 17 00:00:00 2001 From: David Allsopp Date: Thu, 26 Mar 2026 17:55:14 +0000 Subject: [PATCH 2/7] Temporary AppVeyor reconfiguration --- appveyor.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/appveyor.yml b/appveyor.yml index b5497a4b6198..7f2465fec0d8 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -18,6 +18,9 @@ branches: - /5\.*/ - trunk +# Do not build feature branch with open Pull Requests +skip_branch_with_pr: true + # Compile the 64 bits version platform: - x64 From 8a0027ba4390f933d9727ca2a6e032410e04b9c6 Mon Sep 17 00:00:00 2001 From: David Allsopp Date: Wed, 14 Dec 2022 00:52:52 +0100 Subject: [PATCH 3/7] Don't install ocamloptp without ocamlopt A side-effect of PR#11675 was that ocamloptp stopped being installed when the native compiler is not built. --- Changes | 3 +++ tools/Makefile | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Changes b/Changes index 0a10fa02a17b..b21d16a089c5 100644 --- a/Changes +++ b/Changes @@ -121,6 +121,9 @@ OCaml 4.14.2 (14 March 2024) - #11590: Allow installing to a destination path containing spaces. (Élie Brami, review by Sébastien Hinderer and David Allsopp) +- #11675: Stop installing ocamloptp when the native compiler is not built. + (Sébastien Hinderer, review by David Allsopp and Florian Angeletti) + - #12372: Pass option -no-execute-only to the linker for OpenBSD >= 7.3 so that code sections remain readable, as needed for closure marshaling. (Xavier Leroy and Anil Madhavapeddy, review by Anil Madhavapeddy and diff --git a/tools/Makefile b/tools/Makefile index 094f213e04c9..f51ed1709e92 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -23,8 +23,11 @@ include $(ROOTDIR)/Makefile.common # Setup GNU make variables storing per-target source and target, # a list of installed tools, and a function to quote a filename for # the shell. -installed_tools := ocamldep ocamlprof ocamlcp ocamloptp \ +installed_tools := ocamldep ocamlprof ocamlcp \ ocamlmktop ocamlmklib ocamlobjinfo +ifeq "$(NATIVE_COMPILER)" "true" +installed_tools += ocamloptp +endif install_files := define byte2native From aa35d1a87fc70d07e105928de2c21bbce2a7fcaa Mon Sep 17 00:00:00 2001 From: David Allsopp Date: Mon, 23 Mar 2026 08:10:18 +0000 Subject: [PATCH 4/7] Document the CI unity process --- tools/ci/README.md | 158 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 158 insertions(+) create mode 100644 tools/ci/README.md diff --git a/tools/ci/README.md b/tools/ci/README.md new file mode 100644 index 000000000000..3e3b4b20a82a --- /dev/null +++ b/tools/ci/README.md @@ -0,0 +1,158 @@ +# OCaml CI Infrastructure + +## Unified CI + +During the 5.2 development cycle, the CI configurations were synchronised in +[#12846][], [#12847][], [#12848][] and [#12849][]. This series of PRs focused on +`.github/workflows`, `tools/ci/actions`, `tools/ci-appveyor` and `appveyor.yml`. +Subsequent work has extended this to the Jenkins configurations in +`tools/ci/inria`. + +Following those PRs, additional changes to the CI configurations are freely +back-ported. Keeping the CI workflows running for old compilers occasionally +necessitates backporting non-CI related changes, typically because of C compiler +changes. These are: + +- [98a24eaaeef][] (from [#10831][]) was cherry-picked to 4.14 in order to + support [#13065][]. The issue was masked previously because `macos-latest` + flipped over to an arm64 image, which skips the unwind test for architecture + reasons; but switching back to amd64 testing re-revealed the problem with the + script. +- [#12231][] was backported to 5.0 (but is not needed in 4.x). It is required in + order to compile the branch with mingw-w64 11.0, otherwise the testsuite will + fail with flexdll relocation errors. +- [#11861][] and [#12509][] were backported to 5.0 (4.14 already has [#12577][] + including both of these). These are necessary for macOS CI, as clang in C17 + mode emits warnings otherwise. +- [#13019][] was backported to 5.1 and 5.0 (4.14 already has [#13018][]). As of + March 2024, this change is required for the testsuite to pass when running on + Apple silicon to eliminate linker warnings. +- [c9f4c113e5][] was added to 4.14 to disable the `lib-threads/beat.ml` test on + macOS only (see [#13339][] for more details). + +## Maintenance notes + +PRs which touch GitHub Actions are shown with: + +``` +git log --first-parent --oneline upstream/trunk -- .github/workflows appveyor.yml tools/ci +``` + +PRs which are entirely CI-related are simply back-ported as normal with +(`git cherry-pick -x -m1 ...`). PRs which are primarily a feature/fix which +happen to contain a CI change have the commit message altered to +`Unified CI cherry-pick: PR#nnnnn` to make it explicit that the feature itself +hasn't been back-ported. + +PRs which have to be back-ported in order to allow CI to work are listed above, +and do not have the GitHub PR number "neutered" in commit messages. + +GitHub insists on spamming GitHub PR conversations for every single rebase while +testing the branches on a fork. While testing the branches, it's worth neutering +all references to PRs in the commit messages (PR#xxxxx, rather than #xxxxx) and +changing them just before the final push to upstream. In the final version of +the branch, only back-ported features should have the `PR#` changed back to `#`. + +Last sync'd: 20-Mar-2026 with #14612 + +## Branch differences + +As far as possible, this process keeps `.github/workflows`, `appveyor.yml` and +`tools/ci` are kept in sync, with the exception on all release branches of +`.github/workflows/stale.yml`, which is deleted early after branching. +Naturally, features not present in older versions of OCaml can be neither tested +nor relied on. In general, CI workflows and supporting scripts are backported, +but then minimally disabled, as this allows subsequent changes on trunk to be +mechanically cherry-picked. Each branch can be compared with + +``` +git diff upstream/5.5 upstream/trunk -- .github/workflows appveyor.yml tools/ci +``` + +The differences on each branch are: + +trunk: +- [#14421][] allows `sockaddr_cxx.ml` to run on Jenkins +5.5 +- [#14240][] allows hacks around `pthread_cancel` to be removed from + `build-cross.yml` +- Relocatable OCaml ([#14014][], [#14244][], [#14245][] and [#14246][]) add + various matrix tests +- [#14310][] requires the addition of a C++ compiler in CI +- [#14424][] allows `--disable-dependency-generation` to be used more sparingly +- [#14563][] requires updates to the remove-sinh-primitive.patch used to test + the bootstrap +5.4 +- [#13199][] (and others) add debugger testing in CI +- [#13431][] adds `parsetree-change.yml` +- [#13458][] adds `multicoretests.yml` +- [#13526][] adds `build-cross.yml` +- [#13667][] adds `--enable-codegen-invariants` +5.3 +- [#12904][] enables the TSAN workflow in CI +- [#12954][] means `build-msvc.yml` actually builds MSVC and requires + winpthreads support in Jenkins +- [#13293][] improves the sanitizers Jenkins check +- [#13668][] adds a requirement for `luatex` for building the manual +5.2 +- [#12321][] requires a tweak to AppVeyor for rebuilding ocamltest +- [#12514][] allows the Cygwin testsuite to be run on a CRLF checkout +- [#12644][] re-enables TSAN testing on Jenkins +- [#12652][] changes the way the magic numbers are bumped +- [#12843][] means i386 testing can switch to Debian 13 (and GNU make 4.4.1) +5.1 +- [#11144][] allows frame pointers mode to be tested in Jenkins +- [#11642][] allows Cygwin to be tested in CI +5.0 +- OCaml 5.x workflow alterations +- [#10926][] allows otherlibs C symbol names to be checked in CI +- [#11294][] means autoconf 2.69 no longer has to be installed in CI +- [#11389][] switched AppVeyor testing to use its Visual Studio 2022 image +4.14 +- [#10690][] adds `--enable-native-toplevel`, replacing the manual compilation + of `ocamlnat` + +[#10690]: https://github.com/ocaml/ocaml/pull/10690 +[#10831]: https://github.com/ocaml/ocaml/pull/10831 +[#10926]: https://github.com/ocaml/ocaml/pull/10926 +[#11144]: https://github.com/ocaml/ocaml/pull/11144 +[#11294]: https://github.com/ocaml/ocaml/pull/11294 +[#11389]: https://github.com/ocaml/ocaml/pull/11389 +[#11642]: https://github.com/ocaml/ocaml/pull/11642 +[#11861]: https://github.com/ocaml/ocaml/pull/11861 +[#12231]: https://github.com/ocaml/ocaml/pull/12231 +[#12321]: https://github.com/ocaml/ocaml/pull/12321 +[#12509]: https://github.com/ocaml/ocaml/pull/12509 +[#12514]: https://github.com/ocaml/ocaml/pull/12514 +[#12577]: https://github.com/ocaml/ocaml/pull/12577 +[#12644]: https://github.com/ocaml/ocaml/pull/12644 +[#12652]: https://github.com/ocaml/ocaml/pull/12652 +[#12843]: https://github.com/ocaml/ocaml/pull/12843 +[#12846]: https://github.com/ocaml/ocaml/pull/12846 +[#12847]: https://github.com/ocaml/ocaml/pull/12847 +[#12848]: https://github.com/ocaml/ocaml/pull/12848 +[#12849]: https://github.com/ocaml/ocaml/pull/12849 +[#12904]: https://github.com/ocaml/ocaml/pull/12904 +[#12954]: https://github.com/ocaml/ocaml/pull/12954 +[#13018]: https://github.com/ocaml/ocaml/pull/13018 +[#13019]: https://github.com/ocaml/ocaml/pull/13019 +[#13065]: https://github.com/ocaml/ocaml/pull/13065 +[#13199]: https://github.com/ocaml/ocaml/pull/13199 +[#13293]: https://github.com/ocaml/ocaml/pull/13293 +[#13339]: https://github.com/ocaml/ocaml/pull/13339 +[#13431]: https://github.com/ocaml/ocaml/pull/13431 +[#13458]: https://github.com/ocaml/ocaml/pull/13458 +[#13526]: https://github.com/ocaml/ocaml/pull/13526 +[#13667]: https://github.com/ocaml/ocaml/pull/13667 +[#13668]: https://github.com/ocaml/ocaml/pull/13668 +[#14014]: https://github.com/ocaml/ocaml/pull/14014 +[#14240]: https://github.com/ocaml/ocaml/pull/14240 +[#14244]: https://github.com/ocaml/ocaml/pull/14244 +[#14245]: https://github.com/ocaml/ocaml/pull/14245 +[#14246]: https://github.com/ocaml/ocaml/pull/14246 +[#14310]: https://github.com/ocaml/ocaml/pull/14310 +[#14421]: https://github.com/ocaml/ocaml/pull/14421 +[#14424]: https://github.com/ocaml/ocaml/pull/14424 +[#14563]: https://github.com/ocaml/ocaml/pull/14563 +[98a24eaaeef]: https://github.com/ocaml/ocaml/commit/98a24eaaeefaa714f03427f763d73dca87f56e4d +[c9f4c113e5]: https://github.com/ocaml/ocaml/commit/c9f4c113e51f0602207b88169181810eb52c228a From 591e25a4c8313c7163afbc4b22eade4afb7fbcc2 Mon Sep 17 00:00:00 2001 From: David Allsopp Date: Tue, 24 Mar 2026 08:22:11 +0000 Subject: [PATCH 5/7] Extend to 4.08-4.13 --- tools/ci/README.md | 118 +++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 109 insertions(+), 9 deletions(-) diff --git a/tools/ci/README.md b/tools/ci/README.md index 3e3b4b20a82a..0e7d79514100 100644 --- a/tools/ci/README.md +++ b/tools/ci/README.md @@ -13,22 +13,51 @@ back-ported. Keeping the CI workflows running for old compilers occasionally necessitates backporting non-CI related changes, typically because of C compiler changes. These are: -- [98a24eaaeef][] (from [#10831][]) was cherry-picked to 4.14 in order to +- [#8650][] backported to 4.08 and 4.09 as a prerequisite for testing with + `make --warn-undefined-variables`. +- [#9414][] backported to 4.08-4.10 adding `KEEP_TEST_DIR_ON_SUCCESS` support to + the testsuite, necessary to Jenkins workers. +- [#9437][] backported to 4.08 and 4.09 to fix compilation on modern FreeBSD. +- [#9557][] backported to 4.08-4.10 to fix compilation on modern POWER. +- [98a24eaaeef][] (from [#10831][]) was cherry-picked to 4.08-4.14 in order to support [#13065][]. The issue was masked previously because `macos-latest` flipped over to an arm64 image, which skips the unwind test for architecture reasons; but switching back to amd64 testing re-revealed the problem with the script. +- [#9981][] backported to 4.08 and 4.09 to fix linking errors with Clang. +- [#10046][] backported to 4.08-4.11 to compile DLLs with `-static-libgcc` to + fix compilation with mingw-w64 runtime 8.0.0+. +- [#10148][] backported to 4.11 and 4.12, trivially fixing a GCC warning. +- [#10045][] backported to 4.08-4.12 to allow the C# tests to run on mingw-w64. +- [#9919][] partially backported to 4.10-4.12 as it's a prerequisite of + [#12577][]. `caml_do_exit` is needed to avoid declaring `caml_sys_exit` with + two different prototypes; not needed for 4.08 and 4.09, because the change + affects `-output-complete-exe`, which was introduced in 4.10. +- [#10380][] backported to 4.10-4.12 fixing compilation with non C-locale + characters in `--prefix` on Windows (4.08 and 4.09 not affected because they + don't attempt to normalise the prefix). +- [#10835][] backported to 4.08-4.13 to fix 32bit Unix shared compilation. +- [#10723][] backported to 4.08-4.13 to fix compilation on macOS +- [#11100][] backported to 4.08-4.14 to stop linker output from old versions of + Xcode tools causing unexpected errors in the testsuite. +- [#11675][] backported to 4.08 and 4.10-5.0. This PR indirectly fixed a bug + that `ocamloptp` is installed even when ocamlopt isn't built. - [#12231][] was backported to 5.0 (but is not needed in 4.x). It is required in order to compile the branch with mingw-w64 11.0, otherwise the testsuite will fail with flexdll relocation errors. -- [#11861][] and [#12509][] were backported to 5.0 (4.14 already has [#12577][] - including both of these). These are necessary for macOS CI, as clang in C17 - mode emits warnings otherwise. -- [#13019][] was backported to 5.1 and 5.0 (4.14 already has [#13018][]). As of - March 2024, this change is required for the testsuite to pass when running on - Apple silicon to eliminate linker warnings. -- [c9f4c113e5][] was added to 4.14 to disable the `lib-threads/beat.ml` test on - macOS only (see [#13339][] for more details). +- [#12372][] backported to 4.08-4.13 and 5.0 to fix compilation on OpenBSD. +- [#12520][] backported to 4.08-4.13, to provide support for testing + `configure.ac`. +- [#11861][] and [#12509][] were backported to 5.0 and 4.14's [#12577][] version + to 4.08-4.13. These are necessary for macOS CI, as clang in C17 mode emits + warnings otherwise. +- [#12993][] backported from 4.14 to 4.08-4.13 to fix 32bit Unix compilation. +- [#13019][] was backported to 5.1 and 5.0 and 4.14's [#13018][] version to + 4.08-4.13. As of March 2024, this change is required for the testsuite to pass + when running on Apple silicon to eliminate linker warnings. +- [c9f4c113e5][] was added to 4.08-4.14 to disable the `lib-threads/beat.ml` + test on macOS only (see [#13339][] for more details). +- [#14607][] backported from 4.14 to 4.11-4.13 to fix RISC-V shared compilation. ## Maintenance notes @@ -111,19 +140,88 @@ trunk: 4.14 - [#10690][] adds `--enable-native-toplevel`, replacing the manual compilation of `ocamlnat` +4.13 +- [#944][] updates to the remove-sinh-primitive.patch used to test the bootstrap +- [#1400][] adds `--enable-cmm-invariants` +- [#9996][] changes the way the API documentation build commands are invoked +- [#10135][] means flexdll no longer has to be explicitly built on AppVeyor and + Jenkins +- [#10336][] restores CI checking of the manual +4.12 +- [#9332][] adds `--disable-dependency-generation` +- [#9625][] adds `--enable-warn-error`, removing the need for configuration + hacks in AppVeyor +- [#9669][] adds macOS arm64 support +- [#9745][] synchronises the labelled/unlabelled standard library interfaces +- [#9824][] allows the sanitizers script to configure the compiler less hackily +- [#9927][] restores shared library support in Cygwin64 +- [#10063][] re-enables Solaris support +4.11 +- [#9250][] adds `--enable-ocamltest` (prior to that ocamltest was guaranteed to + be built) +- [#9441][] adds RISC-V support +- [#10026][] macOS arm64 support was only applied to 4.10 +4.10 +- [#8790][] adds case-insensitive name-collision checks to the manual +- [#8835][] adds `--disable-stdlib-manpages` +- [#8951][] adds a default `Makefile` target to the compiler +- [#10026][] backports macOS arm64 from [#9669][] in 4.12 +4.09 +- [#2289][] removes the vmthreads library (a non-obvious side-effect of this is + that it fixes `make alldepend` on Windows) +- [#2318][] removes the graphics library +- [#8537][] makes flexdll/flexlink.exe a normal executable, removing a special + case in the AppVeyor script +[#944]: https://github.com/ocaml/ocaml/pull/944 +[#1400]: https://github.com/ocaml/ocaml/pull/1400 +[#2289]: https://github.com/ocaml/ocaml/pull/2289 +[#2318]: https://github.com/ocaml/ocaml/pull/2318 +[#8537]: https://github.com/ocaml/ocaml/pull/8537 +[#8650]: https://github.com/ocaml/ocaml/pull/8650 +[#8790]: https://github.com/ocaml/ocaml/pull/8790 +[#8835]: https://github.com/ocaml/ocaml/pull/8835 +[#8951]: https://github.com/ocaml/ocaml/pull/8951 +[#9250]: https://github.com/ocaml/ocaml/pull/9250 +[#9332]: https://github.com/ocaml/ocaml/pull/9332 +[#9414]: https://github.com/ocaml/ocaml/pull/9414 +[#9437]: https://github.com/ocaml/ocaml/pull/9437 +[#9441]: https://github.com/ocaml/ocaml/pull/9441 +[#9557]: https://github.com/ocaml/ocaml/pull/9557 +[#9625]: https://github.com/ocaml/ocaml/pull/9625 +[#9669]: https://github.com/ocaml/ocaml/pull/9669 +[#9745]: https://github.com/ocaml/ocaml/pull/9745 +[#9824]: https://github.com/ocaml/ocaml/pull/9824 +[#9919]: https://github.com/ocaml/ocaml/pull/9919 +[#9927]: https://github.com/ocaml/ocaml/pull/9927 +[#9981]: https://github.com/ocaml/ocaml/pull/9981 +[#9996]: https://github.com/ocaml/ocaml/pull/9996 +[#10026]: https://github.com/ocaml/ocaml/pull/10026 +[#10045]: https://github.com/ocaml/ocaml/pull/10045 +[#10046]: https://github.com/ocaml/ocaml/pull/10046 +[#10063]: https://github.com/ocaml/ocaml/pull/10063 +[#10135]: https://github.com/ocaml/ocaml/pull/10135 +[#10148]: https://github.com/ocaml/ocaml/pull/10148 +[#10336]: https://github.com/ocaml/ocaml/pull/10336 +[#10380]: https://github.com/ocaml/ocaml/pull/10380 [#10690]: https://github.com/ocaml/ocaml/pull/10690 +[#10723]: https://github.com/ocaml/ocaml/pull/10723 [#10831]: https://github.com/ocaml/ocaml/pull/10831 +[#10835]: https://github.com/ocaml/ocaml/pull/10835 [#10926]: https://github.com/ocaml/ocaml/pull/10926 +[#11100]: https://github.com/ocaml/ocaml/pull/11100 [#11144]: https://github.com/ocaml/ocaml/pull/11144 [#11294]: https://github.com/ocaml/ocaml/pull/11294 [#11389]: https://github.com/ocaml/ocaml/pull/11389 [#11642]: https://github.com/ocaml/ocaml/pull/11642 +[#11675]: https://github.com/ocaml/ocaml/pull/11675 [#11861]: https://github.com/ocaml/ocaml/pull/11861 [#12231]: https://github.com/ocaml/ocaml/pull/12231 [#12321]: https://github.com/ocaml/ocaml/pull/12321 +[#12372]: https://github.com/ocaml/ocaml/pull/12372 [#12509]: https://github.com/ocaml/ocaml/pull/12509 [#12514]: https://github.com/ocaml/ocaml/pull/12514 +[#12520]: https://github.com/ocaml/ocaml/pull/12520 [#12577]: https://github.com/ocaml/ocaml/pull/12577 [#12644]: https://github.com/ocaml/ocaml/pull/12644 [#12652]: https://github.com/ocaml/ocaml/pull/12652 @@ -134,6 +232,7 @@ trunk: [#12849]: https://github.com/ocaml/ocaml/pull/12849 [#12904]: https://github.com/ocaml/ocaml/pull/12904 [#12954]: https://github.com/ocaml/ocaml/pull/12954 +[#12993]: https://github.com/ocaml/ocaml/pull/12993 [#13018]: https://github.com/ocaml/ocaml/pull/13018 [#13019]: https://github.com/ocaml/ocaml/pull/13019 [#13065]: https://github.com/ocaml/ocaml/pull/13065 @@ -154,5 +253,6 @@ trunk: [#14421]: https://github.com/ocaml/ocaml/pull/14421 [#14424]: https://github.com/ocaml/ocaml/pull/14424 [#14563]: https://github.com/ocaml/ocaml/pull/14563 +[#14607]: https://github.com/ocaml/ocaml/pull/14607 [98a24eaaeef]: https://github.com/ocaml/ocaml/commit/98a24eaaeefaa714f03427f763d73dca87f56e4d [c9f4c113e5]: https://github.com/ocaml/ocaml/commit/c9f4c113e51f0602207b88169181810eb52c228a From dc735bd8239e49b704846c51db05909d76afd5b5 Mon Sep 17 00:00:00 2001 From: David Allsopp Date: Tue, 31 Mar 2026 21:22:57 +0100 Subject: [PATCH 6/7] Fix noise in check-configure.sh If multiple commits are being checked, a second git branch would be resetting a checked out branch, which cuases a warning to be emitted. --- tools/ci/actions/check-configure.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/ci/actions/check-configure.sh b/tools/ci/actions/check-configure.sh index e8e764739fb1..6b5797b89aec 100755 --- a/tools/ci/actions/check-configure.sh +++ b/tools/ci/actions/check-configure.sh @@ -54,7 +54,7 @@ fi CheckTree () { local RET=0 COMMIT="$1" - git branch -qf 'return' + git checkout -qB 'return' git checkout -q "$COMMIT" mv configure configure.ref tools/autogen autoconf2.69 @@ -66,6 +66,7 @@ CheckTree () { "$COMMIT: \e[${COLOR}mconfigure.ac doesn't generate configure\e[0m\n" fi mv configure.ref configure + git reset --hard -q HEAD git checkout -q 'return' return $RET } From 9fe698f70644d84bb11e10557e013879a12ee1ab Mon Sep 17 00:00:00 2001 From: David Allsopp Date: Thu, 9 Apr 2026 19:20:22 +0100 Subject: [PATCH 7/7] Set NATIVE_COMPILER consistently Prior to 5.0, NATIVE_COMPILER was only set to false if the native compiler was explicitly disabled, but remained true even if the architecture wasn't supported. --- configure | 4 ++++ configure.ac | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/configure b/configure index 201d1c8396d5..9d74eeef1df3 100755 --- a/configure +++ b/configure @@ -14439,9 +14439,13 @@ if test x"$enable_native_compiler" = "xno"; then : native_compiler=false { $as_echo "$as_me:${as_lineno-$LINENO}: the native compiler is disabled" >&5 $as_echo "$as_me: the native compiler is disabled" >&6;} +else + if test x"$arch" = 'xnone'; then : + native_compiler=false else native_compiler=true fi +fi if ! $native_compiler; then : natdynlink=false diff --git a/configure.ac b/configure.ac index 462a3c4324aa..c17d3fbc21f4 100644 --- a/configure.ac +++ b/configure.ac @@ -1176,7 +1176,9 @@ AS_CASE([$host], AS_IF([test x"$enable_native_compiler" = "xno"], [native_compiler=false AC_MSG_NOTICE([the native compiler is disabled])], - [native_compiler=true]) + [AS_IF([test x"$arch" = 'xnone'], + [native_compiler=false], + [native_compiler=true])]) AS_IF([! $native_compiler], [natdynlink=false])