Separability axis basics #17692
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: build | |
on: | |
push: | |
branches: | |
- main | |
- '*microbranch' | |
tags: | |
- '*' | |
pull_request: | |
jobs: | |
build: | |
name: ${{ matrix.name }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- name: flambda2_runtime5 | |
config: --enable-middle-end=flambda2 --enable-runtime5 | |
os: ubuntu-latest | |
- name: flambda2_dev | |
config: --enable-middle-end=flambda2 --enable-dev | |
os: ubuntu-latest | |
- name: flambda2_dev_runtime5 | |
config: --enable-middle-end=flambda2 --enable-dev --enable-runtime5 | |
os: ubuntu-latest | |
- name: flambda2_debug_runtime5 | |
config: --enable-middle-end=flambda2 --enable-runtime5 | |
os: ubuntu-latest | |
build_ocamlparam: '' | |
use_runtime: d | |
ocamlrunparam: "v=0,V=1" | |
- name: flambda2_debug_runtime | |
config: --enable-middle-end=flambda2 | |
os: ubuntu-latest | |
build_ocamlparam: '' | |
use_runtime: d | |
ocamlrunparam: "v=0,V=1" | |
- name: flambda2_o3 | |
config: --enable-middle-end=flambda2 | |
os: ubuntu-latest | |
build_ocamlparam: '' | |
ocamlparam: '_,O3=1' | |
- name: flambda2_o3_heap | |
config: --enable-middle-end=flambda2 --disable-stack-allocation | |
os: ubuntu-latest | |
build_ocamlparam: '' | |
ocamlparam: '_,O3=1' | |
- name: flambda2_o3_advanced_meet_frame_pointers_runtime5_polling | |
config: --enable-middle-end=flambda2 --enable-frame-pointers --enable-runtime5 --enable-poll-insertion --enable-flambda-invariants | |
os: ubuntu-latest | |
build_ocamlparam: '' | |
ocamlparam: '_,O3=1,flambda2-expert-cont-lifting-budget=200,flambda2-join-algorithm=n-way' | |
- name: flambda2_o3_advanced_meet_frame_pointers_runtime5_debug | |
config: --enable-middle-end=flambda2 --enable-frame-pointers --enable-runtime5 | |
os: ubuntu-latest | |
build_ocamlparam: '' | |
use_runtime: d | |
ocamlparam: '_,O3=1,flambda2-expert-cont-lifting-budget=200,cfg-invariants=1,cfg-eliminate-dead-trap-handlers=1,flambda2-join-algorithm=n-way' | |
- name: flambda2_frame_pointers_oclassic_polling | |
config: --enable-middle-end=flambda2 --enable-frame-pointers --enable-poll-insertion --enable-flambda-invariants | |
os: ubuntu-latest | |
build_ocamlparam: '' | |
ocamlparam: '_,Oclassic=1' | |
disable_testcases: 'testsuite/tests/typing-local/regression_cmm_unboxing.ml testsuite/tests/int64-unboxing/test.ml' | |
- name: flambda2_macos_arm64 | |
config: --enable-middle-end=flambda2 --disable-warn-error | |
os: macos-latest | |
- name: flambda2_macos_arm64_runtime5_irc | |
config: --enable-middle-end=flambda2 --enable-runtime5 --disable-warn-error | |
os: macos-latest | |
build_ocamlparam: '_,w=-46,regalloc=irc' | |
ocamlparam: '_,w=-46,regalloc=irc' | |
- name: flambda2_macos_arm64_debug_runtime5_irc | |
config: --enable-middle-end=flambda2 --enable-runtime5 --disable-warn-error | |
os: macos-latest | |
build_ocamlparam: '_,w=-46,regalloc=irc' | |
ocamlparam: '_,w=-46,regalloc=irc' | |
use_runtime: d | |
ocamlrunparam: "v=0,V=1" | |
- name: flambda2_macos_arm64_runtime5_ls | |
config: --enable-middle-end=flambda2 --enable-runtime5 --disable-warn-error | |
os: macos-latest | |
build_ocamlparam: '_,w=-46,regalloc=ls' | |
ocamlparam: '_,w=-46,regalloc=ls' | |
- name: flambda2_macos_arm64_gi | |
config: --enable-middle-end=flambda2 --disable-warn-error | |
os: macos-latest | |
build_ocamlparam: '_,w=-46,regalloc=gi' | |
ocamlparam: '_,w=-46,regalloc=gi' | |
- name: flambda2_macos_arm64_gi_debug_runtime | |
config: --enable-middle-end=flambda2 --disable-warn-error | |
os: macos-latest | |
build_ocamlparam: '_,w=-46,regalloc=gi' | |
ocamlparam: '_,w=-46,regalloc=gi' | |
use_runtime: d | |
ocamlrunparam: "v=0,V=1" | |
- name: flambda2_ubuntu_arm64_runtime5_irc | |
config: --enable-middle-end=flambda2 --enable-runtime5 --disable-warn-error | |
os: ubuntu-24.04-arm | |
build_ocamlparam: '_,w=-46,regalloc=irc' | |
ocamlparam: '_,w=-46,regalloc=irc' | |
- name: flambda2_ubuntu_arm64_debug_runtime5_ls | |
config: --enable-middle-end=flambda2 --enable-runtime5 --disable-warn-error | |
os: ubuntu-24.04-arm | |
build_ocamlparam: '_,w=-46,regalloc=ls' | |
ocamlparam: '_,w=-46,regalloc=ls' | |
use_runtime: d | |
ocamlrunparam: "v=0,V=1" | |
- name: irc | |
config: --enable-middle-end=flambda2 | |
os: ubuntu-latest | |
build_ocamlparam: '_,w=-46,regalloc=irc' | |
ocamlparam: '_,w=-46,regalloc=irc' | |
check_arch: true | |
- name: irc_polling | |
config: --enable-middle-end=flambda2 --enable-poll-insertion | |
os: ubuntu-latest | |
build_ocamlparam: '_,w=-46,regalloc=irc' | |
ocamlparam: '_,w=-46,regalloc=irc' | |
check_arch: true | |
- name: irc_frame_pointers | |
config: --enable-middle-end=flambda2 --enable-frame-pointers | |
os: ubuntu-latest | |
build_ocamlparam: '_,w=-46,regalloc=irc' | |
ocamlparam: '_,w=-46,regalloc=irc' | |
check_arch: true | |
- name: ls | |
config: --enable-middle-end=flambda2 | |
os: ubuntu-latest | |
build_ocamlparam: '_,w=-46,regalloc=ls' | |
ocamlparam: '_,w=-46,regalloc=ls' | |
check_arch: true | |
- name: gi | |
config: --enable-middle-end=flambda2 | |
os: ubuntu-latest | |
build_ocamlparam: '_,w=-46,regalloc=gi' | |
ocamlparam: '_,w=-46,regalloc=gi' | |
check_arch: true | |
- name: cfg-invariants | |
config: --enable-middle-end=flambda2 | |
os: ubuntu-latest | |
build_ocamlparam: '_,w=-46,regalloc=cfg,cfg-invariants=1,cfg-eliminate-dead-trap-handlers=1' | |
ocamlparam: '_,w=-46,regalloc=cfg,cfg-invariants=1,cfg-eliminate-dead-trap-handlers=1' | |
check_arch: true | |
- name: vectorizer | |
config: --enable-middle-end=flambda2 | |
os: ubuntu-latest | |
build_ocamlparam: '_,w=-46,regalloc=cfg,vectorize=1' | |
ocamlparam: '_,w=-46,regalloc=cfg,vectorize=1' | |
check_arch: true | |
- name: address_sanitizer | |
config: --enable-middle-end=flambda2 --enable-address-sanitizer | |
os: ubuntu-latest | |
cc: clang | |
env: | |
J: "3" | |
run_testsuite: "true" | |
steps: | |
- name: Checkout the Flambda backend repo | |
uses: actions/checkout@master | |
with: | |
path: 'flambda_backend' | |
- name: Install AFL (for Linux workers) | |
if: matrix.os == 'ubuntu-latest' | |
run: sudo apt-get install afl++ | |
- name: Install clang | |
if: matrix.os == 'ubuntu-latest' && matrix.cc == 'clang' | |
run: sudo apt-get install clang | |
- name: Install AFL (for macOS workers) | |
# The "afl-fuzz" package is deprecated (2023-10) and can no longer be installed | |
if: matrix.os == 'macos-latest' | |
run: true | |
# run: HOMEBREW_NO_INSTALL_CLEANUP=TRUE brew install afl-fuzz | |
- name: Install autoconf (for macOS workers) | |
if: matrix.os == 'macos-latest' | |
run: HOMEBREW_NO_INSTALL_CLEANUP=TRUE brew install autoconf | |
# NB. The "rev" number in the cache key below must be updated each time | |
# the patch file is changed! | |
- name: Cache OCaml 4.14, dune and menhir | |
uses: actions/cache@v4 | |
id: cache | |
with: | |
path: ${{ github.workspace }}/ocaml-414/_install | |
key: ${{ matrix.os }}-cache-ocaml-414-patched-dune-3152-menhir-20231231-rev13 | |
- name: Checkout OCaml 4.14 | |
uses: actions/checkout@master | |
if: steps.cache.outputs.cache-hit != 'true' | |
with: | |
repository: 'ocaml/ocaml' | |
path: 'ocaml-414' | |
ref: '4.14' | |
- name: Build OCaml 4.14 | |
if: steps.cache.outputs.cache-hit != 'true' | |
working-directory: ocaml-414 | |
run: | | |
patch -p1 < $GITHUB_WORKSPACE/flambda_backend/arm64-issue-debug-upstream.patch | |
./configure --prefix=$GITHUB_WORKSPACE/ocaml-414/_install | |
make -j $J world.opt | |
make install | |
# Remove unneeded parts to shrink cache file | |
rm -rf $GITHUB_WORKSPACE/ocaml-414/_install/{lib/ocaml/expunge,bin/*.byte} | |
- name: Checkout dune github repo | |
uses: actions/checkout@master | |
if: steps.cache.outputs.cache-hit != 'true' | |
with: | |
repository: 'ocaml/dune' | |
ref: '3.15.2' | |
path: 'dune' | |
- name: Build dune | |
working-directory: dune | |
if: steps.cache.outputs.cache-hit != 'true' | |
run: | | |
PATH=$GITHUB_WORKSPACE/ocaml-414/_install/bin:$PATH make release | |
cp _boot/dune.exe $GITHUB_WORKSPACE/ocaml-414/_install/bin/dune | |
# CR mshinwell: This should use [email protected]:fpottier/menhir.git | |
- name: Checkout menhir github repo | |
uses: actions/checkout@master | |
if: steps.cache.outputs.cache-hit != 'true' | |
with: | |
repository: 'LexiFi/menhir' | |
ref: '20231231' | |
path: 'menhir' | |
- name: Build menhir | |
working-directory: menhir | |
if: steps.cache.outputs.cache-hit != 'true' | |
run: | | |
PATH=$GITHUB_WORKSPACE/ocaml-414/_install/bin:$PATH dune build | |
cp _build/install/default/bin/menhir $GITHUB_WORKSPACE/ocaml-414/_install/bin/menhir | |
# Our dune rule uses `menhirLib.mli`, which we can't simply `cp` | |
# because it's a symbolic link to a relative path. | |
export SOURCE_DIR=_build/install/default/lib/menhirLib | |
export TARGET_DIR=$GITHUB_WORKSPACE/ocaml-414/_install/lib/menhirLib | |
mkdir -p $TARGET_DIR | |
cat $SOURCE_DIR/menhirLib.mli > $TARGET_DIR/menhirLib.mli | |
cat $SOURCE_DIR/menhirLib.ml > $TARGET_DIR/menhirLib.ml | |
- name: Install GNU parallel | |
if: matrix.os == 'macos-latest' | |
run: HOMEBREW_NO_INSTALL_CLEANUP=TRUE brew install parallel | |
- name: Disable any testcases | |
working-directory: flambda_backend | |
run: | | |
disable_testcases="${{matrix.disable_testcases}}" | |
if [ -n "$disable_testcases" ]; then | |
rm -fv $disable_testcases | |
fi | |
- name: Configure Flambda backend | |
working-directory: flambda_backend | |
run: | | |
if [[ -n "${{matrix.cc}}" ]]; then | |
export CC="${{matrix.cc}}" | |
fi | |
autoconf | |
./configure \ | |
--prefix=$GITHUB_WORKSPACE/_install \ | |
--with-dune=$GITHUB_WORKSPACE/ocaml-414/_install/bin/dune \ | |
${{ matrix.config }} | |
- name: Setup for saving core files (not for macOS) | |
if: matrix.os != 'macos-latest' | |
run: | | |
sudo mkdir /cores | |
sudo chmod 777 /cores | |
# Core filenames will be of the form executable.pid.timestamp: | |
sudo bash -c 'echo "/cores/%e.%p.%t" > /proc/sys/kernel/core_pattern' | |
- name: Setup for saving core files (macOS) | |
if: matrix.os == 'macos-latest' | |
run: | | |
sudo chmod 1777 /cores | |
sudo sysctl kern.coredump=1 | |
/usr/libexec/PlistBuddy -c "Add :com.apple.security.get-task-allow bool true" /tmp/core.entitlements | |
codesign -s - -f --entitlements /tmp/core.entitlements $GITHUB_WORKSPACE/ocaml-414/_install/bin/ocamlc.opt | |
codesign -s - -f --entitlements /tmp/core.entitlements $GITHUB_WORKSPACE/ocaml-414/_install/bin/ocamlopt.opt | |
- name: Build, install and test Flambda backend | |
working-directory: flambda_backend | |
run: | | |
if [ $run_testsuite = true ]; then target=ci; else target=compiler; fi | |
export PATH=$GITHUB_WORKSPACE/ocaml-414/_install/bin:$PATH | |
ulimit -c unlimited | |
make $target \ | |
|| (if [ $expected_fail = true ]; then exit 0; else exit 1; fi); | |
env: | |
BUILD_OCAMLPARAM: ${{ matrix.build_ocamlparam }} | |
OCAMLPARAM: ${{ matrix.ocamlparam }} | |
OCAMLRUNPARAM: ${{ matrix.ocamlrunparam }} | |
USE_RUNTIME: ${{ matrix.use_runtime }} | |
- name: Check other architectures | |
working-directory: flambda_backend | |
if: matrix.check_arch == true | |
run: | | |
PATH=$GITHUB_WORKSPACE/ocaml-414/_install/bin:$PATH make check_all_arches | |
- uses: actions/upload-artifact@v4 | |
if: ${{ failure() }} | |
with: | |
name: cores-${{ github.sha }}-${{ github.run_id }}-${{ matrix.name }} | |
path: /cores | |
# - uses: actions/upload-artifact@v4 | |
# if: ${{ failure() }} | |
# with: | |
# name: ocaml-414-${{ github.sha }}-${{ github.run_id }}-${{ matrix.name }} | |
# path: ${{ github.workspace }}/ocaml-414/_install | |
- uses: actions/upload-artifact@v4 | |
if: ${{ failure() }} && matrix.os == 'macos-latest' | |
with: | |
name: DiagnosticReports-${{ github.sha }}-${{ github.run_id }}-${{ matrix.name }} | |
path: /Users/runner/Library/Logs/DiagnosticReports | |
# - uses: actions/upload-artifact@v4 | |
# if: ${{ failure() }} | |
# with: | |
# name: _build-${{ github.sha }}-${{ github.run_id }}-${{ matrix.name }} | |
# path: ${{ github.workspace }}/flambda_backend/_build | |
# | |
# - uses: actions/upload-artifact@v4 | |
# if: ${{ failure() }} | |
# with: | |
# name: _runtest-${{ github.sha }}-${{ github.run_id }}-${{ matrix.name }} | |
# path: ${{ github.workspace }}/flambda_backend/_runtest | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | |
cancel-in-progress: true |