diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 0000000..d5222a4 --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1,62 @@ +FROM rust:1.67 as builder + +RUN git clone https://github.com/vexide/vex-v5-qemu.git /vex-v5-qemu + +WORKDIR /vex-v5-qemu +RUN cd packages/kernel; cargo build --target-dir /target/kernel + +RUN cd packages/client-cli; cargo install --path . --root /target/client-cli + +FROM mcr.microsoft.com/devcontainers/cpp:1-noble +# ------------ +# Install Required Packages +# ------------ +RUN sudo apt-get update +COPY ./.devcontainer/packagelist /packagelist +RUN sudo apt-get -y install $(cat /packagelist | sed 's/\r//') +RUN rm /packagelist # Cleanup image +RUN sudo apt-get clean # Cleanup image + +# ------------ +# Install Clangd +# ------------ +RUN curl -sLo clangd.zip $( \ + curl -s https://api.github.com/repos/clangd/clangd/releases/latest \ + | jq -r '[.assets[] | select(.name | test ("^clangd-linux"))][0].browser_download_url' \ + ) \ + && unzip clangd.zip -d /usr/local/share \ + && mv /usr/local/share/clangd_*/ /usr/local/share/clangd \ + && rm clangd.zip + +ENV PATH="$PATH:/usr/local/share/clangd/bin" + +# ------------ +# Install PROS CLI +# ------------ +RUN pip install --break-system-packages pros-cli + +# ------------ +# Install ARM Toolchain +# ------------ +COPY --from=ghcr.io/lemlib/pros-build:v2.0.2 /gcc-arm-none-eabi-10.3-2021.10 /usr/local/share/arm-none-eabi +ENV PATH="$PATH:/usr/local/share/arm-none-eabi/bin" + +# Copy the simulator binary +COPY --from=builder /target/client-cli/bin/client-cli /usr/local/bin/simulator + +# Clone pros kernel source so we can reference it when debugging +COPY ./project.pros /project.pros +ENV PROS_SOURCE_PATH="$HOME/.pros" +RUN git clone https://github.com/purduesigbots/pros.git $PROS_SOURCE_PATH \ + --depth 1 \ + --branch $(