Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/utils.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,6 @@ jobs:
working-directory: utils
run: docker build --build-arg USER_ID="$(id -u)" --build-arg GROUP_ID="$(id -g)" -t rosettaboy .
- name: Build Rosettaboys
run: ./utils/shell-docker.sh ./all.py build --default --threads 16
run: ./utils/shell.sh ./all.py build --default --threads 16
- name: Run
run: ./utils/shell-docker.sh ./all.py bench --default --frames 10 --threads 4
run: ./utils/shell.sh ./all.py bench --default --frames 10 --threads 4
46 changes: 16 additions & 30 deletions utils/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,38 +11,24 @@ RUN addgroup devgrp --gid $GROUP_ID \
&& echo dev ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/dev \
&& chmod 0440 /etc/sudoers.d/dev


# Install C/C++ tools
# If debian unstable has recent-enough versions, use them
USER root
RUN apt update && apt install -y cmake clang clang-format-14 libfmt-dev

# Install Go tools
COPY --from=shish2k/rosettaboy-devkit-go:1.22.2 --chown=${USER_ID}:${GROUP_ID} /home/dev/.go /home/dev/.go
ENV PATH="/home/dev/.go/bin:$PATH"

# Install Nim tools
COPY --from=shish2k/rosettaboy-devkit-nim:2.0.2 --chown=${USER_ID}:${GROUP_ID} /home/dev/.nim /home/dev/.nim
ENV PATH="/home/dev/.nim/bin:$PATH"

# Install PHP tools
COPY --from=shish2k/rosettaboy-devkit-php:8.3.4 --chown=${USER_ID}:${GROUP_ID} /home/dev/.php /home/dev/.php
ENV PATH="/home/dev/.php/bin:$PATH"

# Install Python tools
COPY --from=shish2k/rosettaboy-devkit-python:3.12.2 --chown=${USER_ID}:${GROUP_ID} /home/dev/.pyenv /home/dev/.pyenv
ENV PYENV_ROOT="/home/dev/.pyenv"
ENV PATH="/home/dev/.pyenv/shims:/home/dev/.pyenv/bin:$PATH"

# Install Rust tools
COPY --from=shish2k/rosettaboy-devkit-rust:1.77.1 --chown=${USER_ID}:${GROUP_ID} /home/dev/.rustup /home/dev/.rustup
COPY --from=shish2k/rosettaboy-devkit-rust:1.77.1 --chown=${USER_ID}:${GROUP_ID} /home/dev/.cargo /home/dev/.cargo
ENV PATH="/home/dev/.cargo/bin:$PATH"

# Install Zig tools
COPY --from=shish2k/rosettaboy-devkit-zig:0.11.0 --chown=${USER_ID}:${GROUP_ID} /home/dev/.zig /home/dev/.zig
ENV PATH="/home/dev/.zig:$PATH"
RUN apt update && apt install -y \
cmake clang clang-format-14 libfmt-dev \
golang golang-1.24 \
php8.4-cli \
python3.13 python3.13-venv python3.13-dev \
pypy3 pypy3-venv \
cargo

# For places where debian unstable is lacking, use DIY devkits
ENV DEVKITS_BASE=https://github.com/shish/rosettaboy-devkits/releases/download/nightly
ENV PATH="/opt/nim/bin:$PATH"
RUN wget -q ${DEVKITS_BASE}/rosettaboy-zig-dev_0.14.1_$(dpkg-architecture -q DEB_BUILD_ARCH).deb
RUN wget -q ${DEVKITS_BASE}/rosettaboy-nim-dev_2.2.4_$(dpkg-architecture -q DEB_BUILD_ARCH).deb
RUN apt install -y ./*.deb

# Get ready to go
USER dev
WORKDIR /home/dev/rosettaboy
CMD /bin/bash
CMD ["/bin/bash"]
15 changes: 3 additions & 12 deletions utils/README.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,12 @@
Utils
=====

shell.sh + Nix / Docker
-----------------------
Convenience script to get a shell with all tools and dependencies needed to run any implementation.

Run `./utils/shell.sh` to get a shell where you can then `cd` to language and `./build.sh` to build it.

If Nix is available, it will use that. Otherwise, it will fallback to `shell-docker.sh`.


shell-docker.sh + Docker
------------------------
shell.sh
--------
An attempt to build a dockerfile with all of the necessary
dependencies to run any implementation (headless and silent)


cpudiff.py
----------
Spot the difference between two `--debug-cpu` log files
Spot the difference between two `--debug-cpu` log files