From 2465e8f24216cf6bd178411b6ce5772190950799 Mon Sep 17 00:00:00 2001 From: Damien Doligez Date: Mon, 14 Mar 2022 14:27:53 +0100 Subject: [PATCH 01/14] Merge pull request PR#11100 from damiendoligez/fix-ocamltest-reports ocamltest: fix test result reporting to avoid split messages (cherry picked from commit 02ecd08c9829d30e087ae0ca76656bc3eda7c9f3) --- Changes | 6 ++++++ ocamltest/main.ml | 4 ++-- ocamltest/result.ml | 6 +++--- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/Changes b/Changes index 6b730e693751..a7f32f2311a3 100644 --- a/Changes +++ b/Changes @@ -1,6 +1,12 @@ OCaml 4.14 maintenance version ------------------------------ +### Tools: + +- #11100: Fix ocamltest to make sure failed tests are not counted as + "unexpected error". + (Damien Doligez, review by Sébastien Hinderer) + ### Build system: - #12372, #14572: Pass option -no-execute-only to the linker for OpenBSD >= 7.3 diff --git a/ocamltest/main.ml b/ocamltest/main.ml index ea7a99d6bdee..10e785ddb604 100644 --- a/ocamltest/main.ml +++ b/ocamltest/main.ml @@ -82,9 +82,9 @@ let summary_of_result res = let rec run_test log common_prefix path behavior = function Node (testenvspec, test, env_modifiers, subtrees) -> - Printf.printf "%s %s (%s) => %!" common_prefix path test.Tests.test_name; + Printf.printf "%s %s (%s) %!" common_prefix path test.Tests.test_name; let (msg, children_behavior, summary) = match behavior with - | Skip_all_tests -> "n/a", Skip_all_tests, No_failure + | Skip_all_tests -> "=> n/a", Skip_all_tests, No_failure | Run env -> let testenv0 = interpret_environment_statements env testenvspec in let testenv = List.fold_left apply_modifiers testenv0 env_modifiers in diff --git a/ocamltest/result.ml b/ocamltest/result.ml index 9e2b932f2502..6d9fe042ce08 100644 --- a/ocamltest/result.ml +++ b/ocamltest/result.ml @@ -39,9 +39,9 @@ let skip_with_reason r = result_with_reason Skip r let fail_with_reason r = result_with_reason Fail r let string_of_status = function - | Pass -> "passed" - | Skip -> "skipped" - | Fail -> "failed" + | Pass -> "=> passed" + | Skip -> "=> skipped" + | Fail -> "=> failed" let string_of_reason = function | None -> "" From b9d09bfa252764b052afc227a9f7c17fa20b4f8a Mon Sep 17 00:00:00 2001 From: Xavier Leroy Date: Mon, 28 Nov 2022 19:40:42 +0100 Subject: [PATCH 02/14] Allow long lines in .md files Just like in .adoc files. (cherry picked from commit dafd8df984a20aa064a9d4984d66c450722eb6e1) --- .gitattributes | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.gitattributes b/.gitattributes index 2a91921601f0..f1a14e3689c8 100644 --- a/.gitattributes +++ b/.gitattributes @@ -51,7 +51,9 @@ api_docgen/*.mld typo.missing-header api_docgen/alldoc.tex typo.missing-header tools/mantis2gh_stripped.csv typo.missing-header -*.adoc typo.long-line=may +# Hyperlinks and other markup features cause long lines +*.adoc typo.long-line=may typo.very-long-line=may +*.md typo.long-line=may typo.very-long-line=may # Github templates and scripts lack headers, have long lines /.github/** typo.missing-header typo.long-line=may typo.very-long-line=may From 297bc8a7529e4afce54bfc195c0842a7e724c2ae Mon Sep 17 00:00:00 2001 From: David Allsopp Date: Wed, 14 Dec 2022 00:52:52 +0100 Subject: [PATCH 03/14] 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 a7f32f2311a3..167a8ce0ff49 100644 --- a/Changes +++ b/Changes @@ -9,6 +9,9 @@ OCaml 4.14 maintenance version ### Build system: +- #11675: Stop installing ocamloptp when the native compiler is not built. + (Sébastien Hinderer, review by David Allsopp and Florian Angeletti) + - #12372, #14572: Pass option -no-execute-only to the linker for OpenBSD >= 7.3 so that code sections remain readable, as needed for closure marshaling. Originally backported in 4.14.2, but the flag was accidentally not passed when 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 96f932a81345d1127edb08a59f2f202a4d58ad87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonin=20D=C3=A9cimo?= Date: Mon, 2 Dec 2024 15:50:16 +0100 Subject: [PATCH 04/14] Update GNU config Update to latest (00b15927496058d23e6258a28d8996f87cf1f191). https://git.savannah.gnu.org/cgit/config.git/commit/?id=00b15927496058d23e6258a28d8996f87cf1f191 (cherry picked from commit 97cd0188405d1d653941fb723e595b452cbaa828) --- build-aux/config.guess | 26 +- build-aux/config.sub | 885 +++++++++++++++++++++++++++++++---------- 2 files changed, 691 insertions(+), 220 deletions(-) diff --git a/build-aux/config.guess b/build-aux/config.guess index b187213930f1..48a684601bd2 100755 --- a/build-aux/config.guess +++ b/build-aux/config.guess @@ -1,10 +1,10 @@ #! /bin/sh # Attempt to guess a canonical system name. -# Copyright 1992-2023 Free Software Foundation, Inc. +# Copyright 1992-2024 Free Software Foundation, Inc. # shellcheck disable=SC2006,SC2268 # see below for rationale -timestamp='2023-07-20' +timestamp='2024-07-27' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -60,7 +60,7 @@ version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. -Copyright 1992-2023 Free Software Foundation, Inc. +Copyright 1992-2024 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -123,7 +123,7 @@ set_cc_for_build() { dummy=$tmp/dummy case ${CC_FOR_BUILD-},${HOST_CC-},${CC-} in ,,) echo "int x;" > "$dummy.c" - for driver in cc gcc c89 c99 ; do + for driver in cc gcc c17 c99 c89 ; do if ($driver -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then CC_FOR_BUILD=$driver break @@ -155,6 +155,9 @@ Linux|GNU|GNU/*) set_cc_for_build cat <<-EOF > "$dummy.c" + #if defined(__ANDROID__) + LIBC=android + #else #include #if defined(__UCLIBC__) LIBC=uclibc @@ -162,6 +165,8 @@ Linux|GNU|GNU/*) LIBC=dietlibc #elif defined(__GLIBC__) LIBC=gnu + #elif defined(__LLVM_LIBC__) + LIBC=llvm #else #include /* First heuristic to detect musl libc. */ @@ -169,6 +174,7 @@ Linux|GNU|GNU/*) LIBC=musl #endif #endif + #endif EOF cc_set_libc=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'` eval "$cc_set_libc" @@ -628,7 +634,8 @@ EOF sed 's/^ //' << EOF > "$dummy.c" #include - main() + int + main () { if (!__power_pc()) exit(1); @@ -712,7 +719,8 @@ EOF #include #include - int main () + int + main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); @@ -904,7 +912,7 @@ EOF fi ;; *:FreeBSD:*:*) - UNAME_PROCESSOR=`/usr/bin/uname -p` + UNAME_PROCESSOR=`uname -p` case $UNAME_PROCESSOR in amd64) UNAME_PROCESSOR=x86_64 ;; @@ -1589,6 +1597,9 @@ EOF *:Unleashed:*:*) GUESS=$UNAME_MACHINE-unknown-unleashed$UNAME_RELEASE ;; + *:Ironclad:*:*) + GUESS=$UNAME_MACHINE-unknown-ironclad + ;; esac # Do we have a guess based on uname results? @@ -1612,6 +1623,7 @@ cat > "$dummy.c" <." version="\ GNU config.sub ($timestamp) -Copyright 1992-2023 Free Software Foundation, Inc. +Copyright 1992-2024 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -120,7 +120,6 @@ case $# in esac # Split fields of configuration type -# shellcheck disable=SC2162 saved_IFS=$IFS IFS="-" read field1 field2 field3 field4 <&2 + fi + ;; *) echo "Invalid configuration '$1': OS '$os' not recognized" 1>&2 exit 1 ;; esac +case $obj in + aout* | coff* | elf* | pe*) + ;; + '') + # empty is fine + ;; + *) + echo "Invalid configuration '$1': Machine code format '$obj' not recognized" 1>&2 + exit 1 + ;; +esac + +# Here we handle the constraint that a (synthetic) cpu and os are +# valid only in combination with each other and nowhere else. +case $cpu-$os in + # The "javascript-unknown-ghcjs" triple is used by GHC; we + # accept it here in order to tolerate that, but reject any + # variations. + javascript-ghcjs) + ;; + javascript-* | *-ghcjs) + echo "Invalid configuration '$1': cpu '$cpu' is not valid with os '$os$obj'" 1>&2 + exit 1 + ;; +esac + # As a final step for OS-related things, validate the OS-kernel combination # (given a valid OS), if there is a kernel. -case $kernel-$os in - linux-gnu* | linux-dietlibc* | linux-android* | linux-newlib* \ - | linux-musl* | linux-relibc* | linux-uclibc* | linux-mlibc* ) +case $kernel-$os-$obj in + linux-gnu*- | linux-android*- | linux-dietlibc*- | linux-llvm*- \ + | linux-mlibc*- | linux-musl*- | linux-newlib*- \ + | linux-relibc*- | linux-uclibc*- | linux-ohos*- ) ;; - uclinux-uclibc* ) + uclinux-uclibc*- | uclinux-gnu*- ) ;; - managarm-mlibc* | managarm-kernel* ) + managarm-mlibc*- | managarm-kernel*- ) ;; - windows*-gnu* | windows*-msvc*) + windows*-msvc*-) ;; - -dietlibc* | -newlib* | -musl* | -relibc* | -uclibc* | -mlibc* ) + -dietlibc*- | -llvm*- | -mlibc*- | -musl*- | -newlib*- | -relibc*- \ + | -uclibc*- ) # These are just libc implementations, not actual OSes, and thus # require a kernel. echo "Invalid configuration '$1': libc '$os' needs explicit kernel." 1>&2 exit 1 ;; - -kernel* ) + -kernel*- ) echo "Invalid configuration '$1': '$os' needs explicit kernel." 1>&2 exit 1 ;; - *-kernel* ) + *-kernel*- ) echo "Invalid configuration '$1': '$kernel' does not support '$os'." 1>&2 exit 1 ;; - *-msvc* ) + *-msvc*- ) echo "Invalid configuration '$1': '$os' needs 'windows'." 1>&2 exit 1 ;; - kfreebsd*-gnu* | kopensolaris*-gnu*) + kfreebsd*-gnu*- | knetbsd*-gnu*- | netbsd*-gnu*- | kopensolaris*-gnu*-) ;; - vxworks-simlinux | vxworks-simwindows | vxworks-spe) + vxworks-simlinux- | vxworks-simwindows- | vxworks-spe-) ;; - nto-qnx*) + nto-qnx*-) ;; - os2-emx) + os2-emx-) + ;; + rtmk-nova-) ;; - *-eabi* | *-gnueabi*) + *-eabi*- | *-gnueabi*-) ;; - none-coff* | none-elf*) + none--*) # None (no kernel, i.e. freestanding / bare metal), - # can be paired with an output format "OS" + # can be paired with an machine code file format ;; - -*) + -*-) # Blank kernel with real OS is always fine. ;; - *-*) + --*) + # Blank kernel and OS with real machine code file format is always fine. + ;; + *-*-*) echo "Invalid configuration '$1': Kernel '$kernel' not known to work with OS '$os'." 1>&2 exit 1 ;; @@ -1814,7 +2273,7 @@ case $vendor in *-riscix*) vendor=acorn ;; - *-sunos*) + *-sunos* | *-solaris*) vendor=sun ;; *-cnk* | *-aix*) @@ -1884,7 +2343,7 @@ case $vendor in ;; esac -echo "$cpu-$vendor-${kernel:+$kernel-}$os" +echo "$cpu-$vendor${kernel:+-$kernel}${os:+-$os}${obj:+-$obj}" exit # Local variables: From 82585c86f66a547f6573d0056259d6d93a7efe3b Mon Sep 17 00:00:00 2001 From: David Allsopp Date: Mon, 23 Jun 2025 22:30:34 +0100 Subject: [PATCH 05/14] Unified CI cherry-pick: PR#14102 (cherry picked from commit 45e1a06ad69677e06d2110408ac414eeda10bf9f) --- .github/workflows/build.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5636f76b77ed..57dd4b714b70 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -84,6 +84,7 @@ jobs: dependencies: texlive-latex-extra texlive-fonts-recommended hevea sass - id: debug name: extra (debug) + fail-fast: true steps: - name: Download Artifact uses: actions/download-artifact@v4 @@ -187,6 +188,7 @@ jobs: strategy: matrix: include: ${{ fromJSON(needs.config.outputs.jobs) }} + fail-fast: true steps: - name: Checkout uses: actions/checkout@v5 From b092ff0532f8d37fa1e4742e63ae10527806b267 Mon Sep 17 00:00:00 2001 From: Damien Doligez Date: Thu, 5 Feb 2026 08:40:36 +0100 Subject: [PATCH 06/14] Portability of shell script tools/ci/actions/check-configure.sh: (PR#14520) - `echo -e` doesn't exist on MacOS, use printf - `\+` in sed regexp is nonexistent on MacOS, undocumented on Linux, and redundant in this case. (cherry picked from commit 86a01c1f31f633933af88d28ecefa2e6500e3ab7) --- tools/ci/actions/check-configure.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tools/ci/actions/check-configure.sh b/tools/ci/actions/check-configure.sh index 676c363b1c59..e8e764739fb1 100755 --- a/tools/ci/actions/check-configure.sh +++ b/tools/ci/actions/check-configure.sh @@ -26,11 +26,11 @@ set -e WANT=$(sed -ne 's/^AC_PREREQ(\[\(.*\)\])/\1/p' configure.ac) -HAVE=$(sh ./configure -V | sed -ne '/generated by GNU Autoconf/s/.* \+//p') +HAVE=$(sh ./configure -V | sed -ne '/generated by GNU Autoconf/s/.* //p') if [[ $WANT != "$HAVE" ]]; then - echo -ne '\e[31mWrong Autoconf version: \e[0m ' - echo -e 'Have: \e[31m'"$HAVE"'\e[0m Want: \e[32m'"$WANT"'\e[0m' - echo "Run tools/autogen autoconf[-]$WANT" + printf '\e[31mWrong Autoconf version: \e[0m ' + printf 'Have: \e[31m'"$HAVE"'\e[0m Want: \e[32m'"$WANT"'\e[0m\n' + printf "Run tools/autogen autoconf[-]$WANT\n" exit 1 fi @@ -59,11 +59,11 @@ CheckTree () { mv configure configure.ref tools/autogen autoconf2.69 if diff -q configure configure.ref >/dev/null ; then - echo -e "$COMMIT: \e[32mconfigure.ac generates configure\e[0m" + printf "$COMMIT: \e[32mconfigure.ac generates configure\e[0m\n" else RET=1 - echo -e \ - "$COMMIT: \e[${COLOR}mconfigure.ac doesn't generate configure\e[0m" + printf \ + "$COMMIT: \e[${COLOR}mconfigure.ac doesn't generate configure\e[0m\n" fi mv configure.ref configure git checkout -q 'return' From 3c3e22a6d2e553d453860f318d83169ca6a70692 Mon Sep 17 00:00:00 2001 From: Damien Doligez Date: Wed, 18 Feb 2026 16:16:18 +0100 Subject: [PATCH 07/14] increase timeout for other-configs CI job (cherry picked from commit fb4f29b29a0f493fac3dc540ee7a794fd4efbfb5) --- tools/ci/inria/main | 1 + tools/ci/inria/other-configs/Jenkinsfile | 2 +- tools/ci/inria/other-configs/script | 17 ++++++++++------- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/tools/ci/inria/main b/tools/ci/inria/main index f4ef0f3ae101..18f6e9762f92 100755 --- a/tools/ci/inria/main +++ b/tools/ci/inria/main @@ -32,6 +32,7 @@ # -patch1 file-name apply patch with -p1 # -no-native do not build "opt" and "opt.opt" # -jNN pass "-jNN" option to make for parallel builds +# -with-bootstrap perform a bootstrap error () { echo "$1" >&2 diff --git a/tools/ci/inria/other-configs/Jenkinsfile b/tools/ci/inria/other-configs/Jenkinsfile index 7eaab11b4dbc..2c3aa6e4e0e2 100644 --- a/tools/ci/inria/other-configs/Jenkinsfile +++ b/tools/ci/inria/other-configs/Jenkinsfile @@ -20,7 +20,7 @@ pipeline { agent { label 'ocaml-linux-64' } options { - timeout(time: 45, unit: 'MINUTES') + timeout(time: 90, unit: 'MINUTES') } stages { stage('Testing various other compiler configurations') { diff --git a/tools/ci/inria/other-configs/script b/tools/ci/inria/other-configs/script index 07844fe5afbe..fe3ab6279bb1 100755 --- a/tools/ci/inria/other-configs/script +++ b/tools/ci/inria/other-configs/script @@ -22,7 +22,7 @@ set -e mainjob=./tools/ci/inria/main main="${mainjob} -j8" -echo "============== minimal build =================" +echo "============== minimal build ================= `date`" # The "MIN_BUILD" (formerly on Travis) builds with everything disabled (apart # from ocamltest). Its goals: # - Ensure that the system builds correctly without native compilation @@ -40,23 +40,26 @@ ${main} -conf --disable-native-compiler \ -conf --disable-dependency-generation \ -no-native -echo "============== no naked pointers =================" +echo "============== no naked pointers ================= `date`" ${main} -conf --disable-naked-pointers -echo "============ bootstrap, no flat float arrays, clang, C23 ===============" +echo "============ bootstrap, no flat float arrays, clang, C23 ===============\ + `date`" ${main} -with-bootstrap \ -conf --disable-flat-float-array \ -conf CC=clang-18 \ -conf CFLAGS=-std=gnu2x -echo "============== flambda, no-naked-pointers =================" +echo "============== flambda, no-naked-pointers ================= `date`" ${main} -conf --enable-flambda -conf --disable-naked-pointers -echo "============== reserved header bits =================" +echo "============== reserved header bits ================= `date`" ${main} -conf --enable-reserved-header-bits=27 -echo "============== cleanup at exit, clang =================" +echo "============== cleanup at exit, clang ================= `date`" OCAMLRUNPARAM="c=1" ${main} -conf CC=clang-18 -echo "============== pic =================" +echo "============== pic ================= `date`" ${main} -conf --with-pic + +echo "============== done ================= `date`" From 96a5a3af3d5498e444c97219e33f39dd7cafcfc6 Mon Sep 17 00:00:00 2001 From: Xavier Leroy Date: Fri, 27 Feb 2026 15:05:18 +0100 Subject: [PATCH 08/14] Jenkins CI, other-configs job: reduce verbosity of output Elide test output for configurations that test successfully. (cherry picked from commit 6d1dc1b115eae5d6c27e8e36511a6742f79aea84) --- tools/ci/inria/other-configs/script | 53 ++++++++++++++++++----------- 1 file changed, 33 insertions(+), 20 deletions(-) diff --git a/tools/ci/inria/other-configs/script b/tools/ci/inria/other-configs/script index fe3ab6279bb1..d76e278aa3f3 100755 --- a/tools/ci/inria/other-configs/script +++ b/tools/ci/inria/other-configs/script @@ -16,19 +16,31 @@ # Commands to run for the 'other-configs' job on Inria's CI -# Stop on error -set -e - mainjob=./tools/ci/inria/main -main="${mainjob} -j8" -echo "============== minimal build ================= `date`" +build() { + name="$1" + shift + echo "==== $name ==== (`date`)" + t=$(mktemp) + if $mainjob -j8 $* >"$t" 2>&1 + then : + else + cat "$t" + echo "==== Failure: $name" + echo "==== Configuration: $*" + exit 2 + fi + rm -f "$t" +} + # The "MIN_BUILD" (formerly on Travis) builds with everything disabled (apart # from ocamltest). Its goals: # - Ensure that the system builds correctly without native compilation # - Ensure ocamltest builds correctly with Unix # - Ensure the testsuite runs correctly with everything switched off -${main} -conf --disable-native-compiler \ +build "minimal build" \ + -conf --disable-native-compiler \ -conf --disable-shared \ -conf --disable-debug-runtime \ -conf --disable-instrumented-runtime \ @@ -40,26 +52,27 @@ ${main} -conf --disable-native-compiler \ -conf --disable-dependency-generation \ -no-native -echo "============== no naked pointers ================= `date`" -${main} -conf --disable-naked-pointers +build "no naked pointers" \ + -conf --disable-naked-pointers -echo "============ bootstrap, no flat float arrays, clang, C23 ===============\ - `date`" -${main} -with-bootstrap \ +build "bootstrap, no flat float arrays, clang, C23" \ + -with-bootstrap \ -conf --disable-flat-float-array \ -conf CC=clang-18 \ -conf CFLAGS=-std=gnu2x -echo "============== flambda, no-naked-pointers ================= `date`" -${main} -conf --enable-flambda -conf --disable-naked-pointers +build "flambda, no-naked-pointers" \ + -conf --enable-flambda \ + -conf --disable-naked-pointers -echo "============== reserved header bits ================= `date`" -${main} -conf --enable-reserved-header-bits=27 +build "reserved header bits" \ + -conf --enable-reserved-header-bits=27 -echo "============== cleanup at exit, clang ================= `date`" -OCAMLRUNPARAM="c=1" ${main} -conf CC=clang-18 +OCAMLRUNPARAM="c=1" \ +build "cleanup at exit, clang" \ + -conf CC=clang-18 -echo "============== pic ================= `date`" -${main} -conf --with-pic +build "pic" \ + -conf --with-pic -echo "============== done ================= `date`" +echo "==== done (`date`)" From 78ae856593e4c14455d5ff0ea05d398e91e08657 Mon Sep 17 00:00:00 2001 From: David Allsopp Date: Thu, 19 Mar 2026 18:15:09 +0000 Subject: [PATCH 09/14] 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 8214b953ed3d65aa4cc7085b49d42c63087c8f81 Mon Sep 17 00:00:00 2001 From: David Allsopp Date: Mon, 23 Mar 2026 08:10:18 +0000 Subject: [PATCH 10/14] 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 0a43e84c505535e5e01eabfeb63603f961f6d5a0 Mon Sep 17 00:00:00 2001 From: David Allsopp Date: Tue, 24 Mar 2026 08:22:11 +0000 Subject: [PATCH 11/14] 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 2b9eb6e097a72bd5137becc77fc7a1c5c1b617d7 Mon Sep 17 00:00:00 2001 From: David Allsopp Date: Tue, 31 Mar 2026 21:22:57 +0100 Subject: [PATCH 12/14] 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 9d5990e9488c29006e27870506a58576bb1f03aa Mon Sep 17 00:00:00 2001 From: David Allsopp Date: Thu, 9 Apr 2026 19:20:22 +0100 Subject: [PATCH 13/14] 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 d340963a04f3..5c97683b81c4 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]) From 18653a61ebf9ebc486e1eb36508dfae5ca8a7b8f Mon Sep 17 00:00:00 2001 From: David Allsopp Date: Thu, 26 Mar 2026 17:55:14 +0000 Subject: [PATCH 14/14] 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