<commit_before>FROM ubuntu:18.04 as toolchain

# `build-essential` and `file` are needed for backtrace-sys
# `cmake`, `git`, `python` are needed for wasm tools
RUN apt-get update && apt-get install -y \
    build-essential \
    cmake \
    curl \
    file \
    gcc \
    git \
    libssl-dev \
    pkg-config \
    python \
 && rm -rf /var/lib/apt/lists/*

ENV USER=root
ENV PATH=/root/.cargo/bin:$PATH

ADD entrypoint.sh /root/

ARG channel

# Ensure that we are using the latest stable version of rustup and the
# latest version of the current channel. A new manifest will trigger
# these lines to run again, forcing a new download of rustup and
# installation of Rust.
ADD https://static.rust-lang.org/rustup/release-stable.toml /root/rustup-manifest.toml
ADD https://static.rust-lang.org/dist/channel-rust-${channel}-date.txt /root/rust-channel-version

# https://github.com/rust-lang-nursery/rustup.rs/issues/998
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain "${channel}" && \
    rm -rf ~/.rustup/toolchains/*/share/doc

# Fetch all the crate source files

FROM toolchain as bare-sources

RUN cd / && \
    cargo new playground
WORKDIR /playground

ADD Cargo.toml /playground/Cargo.toml
ADD crate-information.json /playground/crate-information.json
RUN cargo fetch

# Build our tool for modifying Cargo.toml at runtime

FROM bare-sources as munge<commit_msg>Don't use Cargo to create the playground directory<commit_after>FROM ubuntu:18.04 as toolchain

# `build-essential` and `file` are needed for backtrace-sys
# `cmake`, `git`, `python` are needed for wasm tools
RUN apt-get update && apt-get install -y \
    build-essential \
    cmake \
    curl \
    file \
    gcc \
    git \
    libssl-dev \
    pkg-config \
    python \
 && rm -rf /var/lib/apt/lists/*

ENV USER=root
ENV PATH=/root/.cargo/bin:$PATH

ADD entrypoint.sh /root/

ARG channel

# Ensure that we are using the latest stable version of rustup and the
# latest version of the current channel. A new manifest will trigger
# these lines to run again, forcing a new download of rustup and
# installation of Rust.
ADD https://static.rust-lang.org/rustup/release-stable.toml /root/rustup-manifest.toml
ADD https://static.rust-lang.org/dist/channel-rust-${channel}-date.txt /root/rust-channel-version

# https://github.com/rust-lang-nursery/rustup.rs/issues/998
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain "${channel}" && \
    rm -rf ~/.rustup/toolchains/*/share/doc

# Fetch all the crate source files

FROM toolchain as bare-sources

# https://github.com/rust-lang/cargo/issues/7049
RUN cd / && \
    mkdir -p playground && \
    cargo init playground
WORKDIR /playground

ADD Cargo.toml /playground/Cargo.toml
ADD crate-information.json /playground/crate-information.json
RUN cargo fetch

# Build our tool for modifying Cargo.toml at runtime

FROM bare-sources as munge
{'fraction_non_alphanumeric': 0.11713890808569453, 'fraction_numerical': 0.006219765031098825, 'mean_word_length': 3.15351506456241, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 9, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2098036', 'n_tokens_mistral': 975, 'n_tokens_neox': 936, 'n_words': 294}