<commit_before>#!/bin/bash

WINSDK_VERSION=10.0.17134.0

set -x

[ -z "${CI}" ] || export CONDA_BUILD_WINSDK=/tmp/cf-ci-winsdk

if [[ -z "${CONDA_BUILD_WINSDK}" ]]; then
    echo "CONDA_BUILD_WINSDK" is not set.
    exit 1
fi

echo "By setting CONDA_BUILD_WINSDK, you are agreeing to the terms and conditions of the Windows SDK"

WINSDK_DIR=${CONDA_BUILD_WINSDK}/winsdk-${WINSDK_VERSION}

if [[ ! -d "${WINSDK_DIR}" ]]; then
  mkdir -p ${WINSDK_DIR}
  pushd ${WINSDK_DIR}
    curl -L -o win10sdk.iso https://go.microsoft.com/fwlink/p/?linkid=870809
    mkdir -p win10sdk_iso
    pushd win10sdk_iso
      7z x ../win10sdk.iso -aoa
      mkdir tmp
      msiextract -C tmp Installers/"Windows SDK Desktop Headers x64-x86_en-us.msi"
      msiextract -C tmp Installers/"Windows SDK Desktop Headers x86-x86_en-us.msi"
      msiextract -C tmp Installers/"Windows SDK Desktop Libs x64-x86_en-us.msi"
      #msiextract -C tmp Installers/"Windows SDK Desktop Libs x86-x86_en-us.msi"
      #msiextract -C tmp Installers/"Windows SDK Desktop Tools x64-x86_en-us.msi"
      #msiextract -C tmp Installers/"Windows SDK Desktop Tools x86-x86_en-us.msi"
      msiextract -C tmp Installers/"Windows SDK for Windows Store Apps Headers-x86_en-us.msi"
      msiextract -C tmp Installers/"Windows SDK for Windows Store Apps Libs-x86_en-us.msi"
      #msiextract -C tmp Installers/"Windows SDK for Windows Store Apps Tools-x86_en-us.msi"
      #msiextract -C tmp Installers/"Windows SDK for Windows Store Apps Legacy Tools-x86_en-us.msi"
      msiextract -C tmp Installers/"Universal CRT Headers Libraries and Sources-x86_en-us.msi"
      mkdir -p ${WINSDK_DIR}/Include
      mkdir -p ${WINSDK_DIR}/Lib
      mv "tmp/Program Files/Windows Kits/10/Lib/${WINSDK_VERSION}"/* ${WINSDK_DIR}/Lib/
      mv "tmp/Program Files/Windows Kits/10/Include/${WINSDK_VERSION}"/* ${WINSDK_DIR}/Include/
      rm -rf ${WINSDK_DIR}/Include/cppwinrt
    popd

    # Make symlinks for libraries
    for f in $(find ${WINSDK_DIR}/Lib/um/x64 -name "*.[L|l]ib"); do
        name=$(basename $f)
        full_lower=$(echo "$name" | awk '{print tolower($0)}')
        if [[ "$name" != "$full_lower" ]]; then
            ln -sf "$f" "$(dirname $f)/$full_lower"
        fi
        echo "symlinking ${name}"
        lib_lower="${name::-4}.lib"
        if [[ "$lib_lower" != "$name" && "$lib_lower" != "$full_lower" ]]; then
            ln -sf "$f" "$(dirname $f)/$lib_lower"
        fi
    done
    
    # Create a VFS overlay as the Win SDK assumes case insensitive file system
    echo "version: 0" > winsdk_vfs_overlay.yaml<commit_msg>Fix for old versions of bash<commit_after>#!/bin/bash

WINSDK_VERSION=10.0.17134.0

set -x

[ -z "${CI}" ] || export CONDA_BUILD_WINSDK=/tmp/cf-ci-winsdk

if [[ -z "${CONDA_BUILD_WINSDK}" ]]; then
    echo "CONDA_BUILD_WINSDK" is not set.
    exit 1
fi

echo "By setting CONDA_BUILD_WINSDK, you are agreeing to the terms and conditions of the Windows SDK"

WINSDK_DIR=${CONDA_BUILD_WINSDK}/winsdk-${WINSDK_VERSION}

if [[ ! -d "${WINSDK_DIR}" ]]; then
  mkdir -p ${WINSDK_DIR}
  pushd ${WINSDK_DIR}
    curl -L -o win10sdk.iso https://go.microsoft.com/fwlink/p/?linkid=870809
    mkdir -p win10sdk_iso
    pushd win10sdk_iso
      7z x ../win10sdk.iso -aoa
      mkdir tmp
      msiextract -C tmp Installers/"Windows SDK Desktop Headers x64-x86_en-us.msi"
      msiextract -C tmp Installers/"Windows SDK Desktop Headers x86-x86_en-us.msi"
      msiextract -C tmp Installers/"Windows SDK Desktop Libs x64-x86_en-us.msi"
      #msiextract -C tmp Installers/"Windows SDK Desktop Libs x86-x86_en-us.msi"
      #msiextract -C tmp Installers/"Windows SDK Desktop Tools x64-x86_en-us.msi"
      #msiextract -C tmp Installers/"Windows SDK Desktop Tools x86-x86_en-us.msi"
      msiextract -C tmp Installers/"Windows SDK for Windows Store Apps Headers-x86_en-us.msi"
      msiextract -C tmp Installers/"Windows SDK for Windows Store Apps Libs-x86_en-us.msi"
      #msiextract -C tmp Installers/"Windows SDK for Windows Store Apps Tools-x86_en-us.msi"
      #msiextract -C tmp Installers/"Windows SDK for Windows Store Apps Legacy Tools-x86_en-us.msi"
      msiextract -C tmp Installers/"Universal CRT Headers Libraries and Sources-x86_en-us.msi"
      mkdir -p ${WINSDK_DIR}/Include
      mkdir -p ${WINSDK_DIR}/Lib
      mv "tmp/Program Files/Windows Kits/10/Lib/${WINSDK_VERSION}"/* ${WINSDK_DIR}/Lib/
      mv "tmp/Program Files/Windows Kits/10/Include/${WINSDK_VERSION}"/* ${WINSDK_DIR}/Include/
      rm -rf ${WINSDK_DIR}/Include/cppwinrt
    popd

    # Make symlinks for libraries
    for f in $(find ${WINSDK_DIR}/Lib/um/x64 -name "*.[L|l]ib"); do
        name=$(basename $f)
        full_lower=$(echo "$name" | awk '{print tolower($0)}')
        if [[ "$name" != "$full_lower" ]]; then
            ln -sf "$f" "$(dirname $f)/$full_lower"
        fi
        echo "symlinking ${name}"
        lib_lower="${name:0:${#name} - 4}.lib"
        if [[ "$lib_lower" != "$name" && "$lib_lower" != "$full_lower" ]]; then
            ln -sf "$f" "$(dirname $f)/$lib_lower"
        fi
    done
    
    # Create a VFS overlay as the Win SDK assumes case insensitive file system
    echo "version: 0" > winsdk_vfs_overlay.yaml
{'fraction_non_alphanumeric': 0.13274336283185842, 'fraction_numerical': 0.026356290881108118, 'mean_word_length': 3.0239938080495357, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 2, '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': '6874232', 'n_tokens_mistral': 2048, 'n_tokens_neox': 1849, 'n_words': 491}