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

source common.sh

if [[ ! -d "$PKG_DIR/fbthrift" ]]; then
  git clone https://github.com/facebook/fbthrift
  cd "$PKG_DIR/fbthrift" || die "cd fail"
  if [[ -f "$REPO_BASE_DIR/mcrouter/FBTHRIFT_COMMIT" ]]; then
    FBTHRIFT_COMMIT="$(head -n 1 "$REPO_BASE_DIR/mcrouter/FBTHRIFT_COMMIT")"
    echo "FBTHRIFT_COMMIT file found: using fbthrift commit $FBTHRIFT_COMMIT"
    git checkout "$FBTHRIFT_COMMIT"
  else
    echo "No FBTHRIFT_COMMIT file, using fbthrift HEAD=$(git rev-parse HEAD)"
  fi
fi

if [ ! -d "$PKG_DIR/mstch" ]; then
  cd "$PKG_DIR" || die "cd fail"
  git clone https://github.com/no1msd/mstch

  cd "$PKG_DIR/mstch" || die "cd fail"

  cmake -DBUILD_SHARED_LIBS=ON -DCMAKE_CXX_FLAGS="-fPIC" .
  make $MAKE_ARGS && make install $MAKE_ARGS
fi

if [ ! -d "$PKG_DIR/zstd" ]; then
  cd "$PKG_DIR" || die "cd fail"
  git clone https://github.com/facebook/zstd

  cd "$PKG_DIR/zstd" || die "cd fail"

  cmake build/cmake/
  make $MAKE_ARGS && make install $MAKE_ARGS
fi

cd "$PKG_DIR/fbthrift/thrift" || die "cd fbthrift failed"

CXXFLAGS="$CXXFLAGS -fPIC" \
cmake .. -DCMAKE_INSTALL_PREFIX="$INSTALL_DIR"
make $MAKE_ARGS && make install $MAKE_ARGS<commit_msg>Fix oss thrift recipe<commit_after>#!/usr/bin/env bash

source common.sh

if [[ ! -d "$PKG_DIR/fbthrift" ]]; then
  git clone https://github.com/facebook/fbthrift
  cd "$PKG_DIR/fbthrift" || die "cd fail"
  if [[ -f "$REPO_BASE_DIR/mcrouter/FBTHRIFT_COMMIT" ]]; then
    FBTHRIFT_COMMIT="$(head -n 1 "$REPO_BASE_DIR/mcrouter/FBTHRIFT_COMMIT")"
    echo "FBTHRIFT_COMMIT file found: using fbthrift commit $FBTHRIFT_COMMIT"
    git checkout "$FBTHRIFT_COMMIT"
  else
    echo "No FBTHRIFT_COMMIT file, using fbthrift HEAD=$(git rev-parse HEAD)"
  fi
fi

if [ ! -d "$PKG_DIR/mstch" ]; then
  cd "$PKG_DIR" || die "cd fail"
  git clone https://github.com/no1msd/mstch

  cd "$PKG_DIR/mstch" || die "cd fail"

  cmake -DCMAKE_INSTALL_PREFIX="$INSTALL_DIR" -DBUILD_SHARED_LIBS=ON \
  -DCMAKE_CXX_FLAGS="-fPIC" .
  make $MAKE_ARGS && make install $MAKE_ARGS
fi

if [ ! -d "$PKG_DIR/zstd" ]; then
  cd "$PKG_DIR" || die "cd fail"
  git clone https://github.com/facebook/zstd

  cd "$PKG_DIR/zstd" || die "cd fail"

  cmake -DCMAKE_INSTALL_PREFIX="$INSTALL_DIR" build/cmake/
  make $MAKE_ARGS && make install $MAKE_ARGS
fi

cd "$PKG_DIR/fbthrift/thrift" || die "cd fbthrift failed"

CXXFLAGS="$CXXFLAGS -fPIC" \
cmake .. -DCMAKE_INSTALL_PREFIX="$INSTALL_DIR"
make $MAKE_ARGS && make install $MAKE_ARGS
{'fraction_non_alphanumeric': 0.14543269230769232, 'fraction_numerical': 0.0016025641025641025, 'mean_word_length': 4.095918367346939, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 6, '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': '7374196', 'n_tokens_mistral': 1053, 'n_tokens_neox': 1007, 'n_words': 230}