<commit_before>compiler_env, script, output = ARGS

if VERSION < v"0.7-"
    error("Unsupported Julia version $VERSION")
end

using Pkg

if isempty(compiler_env)
    compiler_env = abspath("compiler_env")
    Pkg.activate(compiler_env)
    Pkg.add([
        PackageSpec(
            name = "PackageCompiler",
            uuid = "9b87118b-4619-50d2-8e1e-99f35a4d4d9d",
            version = "0.6",
        )
    ])
else
    Pkg.activate(compiler_env)
end
@info "Loading PackageCompiler..."
using PackageCompiler

@info "Installing PyCall..."
Pkg.activate(".")
Pkg.add([
    PackageSpec(
        name = "PyCall",
        uuid = "438e738f-606a-5dbb-bf0a-cddfbfd45ab0",
    )
    PackageSpec(
        name = "MacroTools",
        uuid = "1914dd2f-81c6-5fcd-8719-6d5c9610ff09",
    )
])<commit_msg>Print build log of PackageCompiler<commit_after>compiler_env, script, output = ARGS

if VERSION < v"0.7-"
    error("Unsupported Julia version $VERSION")
end

using Pkg

function cat_build_log(pkg)
    modpath = Base.locate_package(pkg)
    if modpath !== nothing
        logfile = joinpath(dirname(modpath), "..", "deps", "build.log")
        if isfile(logfile)
            print(stderr, read(logfile, String))
            return
        end
    end
    @error "build.log for $pkg not found"
end

if isempty(compiler_env)
    compiler_env = abspath("compiler_env")
    Pkg.activate(compiler_env)
    @info "Installing PackageCompiler..."
    Pkg.add([
        PackageSpec(
            name = "PackageCompiler",
            uuid = "9b87118b-4619-50d2-8e1e-99f35a4d4d9d",
            version = "0.6",
        )
    ])
    cat_build_log(Base.PkgId(
        Base.UUID("9b87118b-4619-50d2-8e1e-99f35a4d4d9d"),
        "PackageCompiler"))
else
    Pkg.activate(compiler_env)
end
@info "Loading PackageCompiler..."
using PackageCompiler

@info "Installing PyCall..."
Pkg.activate(".")
Pkg.add([
    PackageSpec(
        name = "PyCall",
        uuid = "438e738f-606a-5dbb-bf0a-cddfbfd45ab0",
    )
    PackageSpec(
        name = "MacroTools",
        uuid = "1914dd2f-81c6-5fcd-8719-6d5c9610ff09",
    )
])
{'fraction_non_alphanumeric': 0.12893982808022922, 'fraction_numerical': 0.06876790830945559, 'mean_word_length': 2.5996563573883162, 'pattern_counts': {'":': 0, '<': 5, '<?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': '2317754', 'n_tokens_mistral': 827, 'n_tokens_neox': 774, 'n_words': 136}