<commit_before>#!/usr/bin/env bash

esy_build() {
    set -e
    set -x
    esy install
    esy build
    esy dune build -p bisect_ppx src/ppx/bucklescript/ppx.exe
    cp _build/default/src/ppx/bucklescript/ppx.exe ./ppx
    cp _build/install/default/bin/bisect-ppx-report ./bisect-ppx-report
    exit 0
}

UNAME=`uname -s`
RESULT=$?
if [ "$RESULT" != 0 ]
then
    echo "Cannot detect OS; falling back to a source build."
    esy_build
fi

case "$UNAME" in
    "Linux") OS=linux;;
    "Darwin") OS=macos;;
    *) echo "Unknown OS '$UNAME'; falling back to a source build."; esy_build;;
esac

if [ ! -f bin/$OS/ppx ]
then
    echo "bin/$OS/ppx not found; falling back to a source build."
    esy_build
fi

if [ ! -f bin/$OS/bisect-ppx-report ]
then
    echo "bin/$OS/bisect-ppx-report not found; falling back to a source build."
    esy_build
fi

bin/$OS/bisect-ppx-report --version > /dev/null
RESULT=$?
if [ "$RESULT" != 0 ]
then
    echo "Pre-built binaries invalid; falling back to a source build."
    esy_build
fi

cp bin/$OS/ppx ./ppx
cp bin/$OS/bisect-ppx-report ./bisect-ppx-report<commit_msg>BuckleScript build: some verbose output<commit_after>#!/usr/bin/env bash

esy_build() {
    set -e
    set -x
    esy install
    esy build
    esy dune build -p bisect_ppx src/ppx/bucklescript/ppx.exe
    cp _build/default/src/ppx/bucklescript/ppx.exe ./ppx
    cp _build/install/default/bin/bisect-ppx-report ./bisect-ppx-report
    exit 0
}

UNAME=`uname -s`
RESULT=$?
if [ "$RESULT" != 0 ]
then
    echo "Cannot detect OS; falling back to a source build."
    esy_build
fi

case "$UNAME" in
    "Linux") OS=linux;;
    "Darwin") OS=macos;;
    *) echo "Unknown OS '$UNAME'; falling back to a source build."; esy_build;;
esac

if [ ! -f bin/$OS/ppx ]
then
    echo "bin/$OS/ppx not found; falling back to a source build."
    esy_build
fi

if [ ! -f bin/$OS/bisect-ppx-report ]
then
    echo "bin/$OS/bisect-ppx-report not found; falling back to a source build."
    esy_build
fi

bin/$OS/bisect-ppx-report --version > /dev/null
RESULT=$?
if [ "$RESULT" != 0 ]
then
    echo "Pre-built binaries invalid; falling back to a source build."
    esy_build
fi

echo "Using pre-built binaries for system '$OS'."
cp bin/$OS/ppx ./ppx
cp bin/$OS/bisect-ppx-report ./bisect-ppx-report
{'fraction_non_alphanumeric': 0.13784021071115013, 'fraction_numerical': 0.0026338893766461808, 'mean_word_length': 2.8627118644067795, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '873673', 'n_tokens_mistral': 893, 'n_tokens_neox': 846, 'n_words': 254}