<commit_before>#!/bin/sh
set -e

# This script is supposed to run inside the AppStream Docker container
# on the CI system.

#
# Read options for the current test build
#

. /etc/os-release
build_compose=true
maintainer_mode=true
if [ "$ID" = "ubuntu" ] && [ "$VERSION_CODENAME" = "focal" ]; then
    # we don't make warnings fatal on Ubuntu 20.04
    maintainer_mode=false
fi;

build_type=debugoptimized
build_dir="cibuild"
sanitize_flag=""
if [ "$1" = "sanitize" ]; then
    build_dir="cibuild-san"
    sanitize_flag="-Db_sanitize=address,undefined"
    build_type=debug
    echo "Running build with sanitizers 'address,undefined' enabled."
    # Slow unwind, but we get better backtraces
    export ASAN_OPTIONS=fast_unwind_on_malloc=0
fi;
if [ "$1" = "codeql" ]; then
    build_type=debug
fi;

echo "C compiler: $CC"
echo "C++ compiler: $CXX"
set -x
$CC --version

#
# Configure AppStream build with all flags enabled
#

mkdir $build_dir && cd $build_dir
meson --buildtype=$build_type \
      $sanitize_flag \
      -Dmaintainer=$maintainer_mode \
      -Ddocs=true \
      -Dqt=true \
      -Dcompose=$build_compose \
      -Dapt-support=true \
      -Dvapi=true \
      ..

#
# Build & Install
#

ninja
ninja documentation
DESTDIR=/tmp/install_root/ ninja install
rm -r /tmp/install_root/<commit_msg>ci: Don't build with GIR enabled when using sanitizers<commit_after>#!/bin/sh
set -e

# This script is supposed to run inside the AppStream Docker container
# on the CI system.

#
# Read options for the current test build
#

. /etc/os-release
build_compose=true
maintainer_mode=true
if [ "$ID" = "ubuntu" ] && [ "$VERSION_CODENAME" = "focal" ]; then
    # we don't make warnings fatal on Ubuntu 20.04
    maintainer_mode=false
fi;

build_type=debugoptimized
build_dir="cibuild"
sanitize_flag=""
if [ "$1" = "sanitize" ]; then
    build_dir="cibuild-san"
    # FIXME: Build withour GIR, as g-ir-scanner hangs endlessly when using asan
    sanitize_flags="-Db_sanitize=address,undefined -Dgir=false"
    build_type=debug
    echo "Running build with sanitizers 'address,undefined' enabled."
    # Slow unwind, but we get better backtraces
    export ASAN_OPTIONS=fast_unwind_on_malloc=0
fi;
if [ "$1" = "codeql" ]; then
    build_type=debug
fi;

echo "C compiler: $CC"
echo "C++ compiler: $CXX"
set -x
$CC --version

#
# Configure AppStream build with all flags enabled
#

mkdir $build_dir && cd $build_dir
meson --buildtype=$build_type \
      $sanitize_flags \
      -Dmaintainer=$maintainer_mode \
      -Ddocs=true \
      -Dqt=true \
      -Dcompose=$build_compose \
      -Dapt-support=true \
      -Dvapi=true \
      ..

#
# Build & Install
#

ninja
ninja documentation
DESTDIR=/tmp/install_root/ ninja install
rm -r /tmp/install_root/
{'fraction_non_alphanumeric': 0.11685475063705861, 'fraction_numerical': 0.005096468875136513, 'mean_word_length': 3.497545008183306, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '7353131', 'n_tokens_mistral': 1005, 'n_tokens_neox': 966, 'n_words': 259}