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
45 changes: 45 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
ARG VARIANT="16"
FROM mcr.microsoft.com/devcontainers/javascript-node:1-${VARIANT}

RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
&& apt-get -y install --no-install-recommends build-essential ca-certificates clang-format-15 clang-tidy-15 cmake curl git libzstd-dev ninja-build python3 python3-pip ssh sudo wabt wget zlib1g-dev wget git-lfs zlib1g-dev wget libffi-dev libncurses5-dev libncursesw5-dev libxml2-dev binaryen unzip

# RUN pip3 install cmake-format lit --no-cache-dir
# RUN cd /usr/bin/ && ln -s python3 python && ln -s clang-format-15 clang-format && ln -s clang-tidy-15 clang-tidy && ln -s run-clang-tidy-15 run-clang-tidy

RUN mkdir -p /opt
WORKDIR /opt

COPY install_llvm16.sh /opt/install_llvm16.sh
RUN chmod +x /opt/install_llvm16.sh

RUN wget https://github.com/llvm/llvm-project/releases/download/llvmorg-16.0.4/clang+llvm-16.0.4-x86_64-linux-gnu-ubuntu-22.04.tar.xz && /opt/install_llvm16.sh

RUN echo "export PATH=/opt/llvm16/bin:/opt:\$PATH" >> $HOME/.profile
RUN echo "export LLVM_SYS_160_PREFIX=/opt/llvm16" >> $HOME/.profile
ENV PATH=/opt/llvm16/bin:/opt:$PATH
ENV LLVM_SYS_160_PREFIX=/opt/llvm16

RUN wget -O /opt/solc https://github.com/ethereum/solidity/releases/download/v0.8.29/solc-static-linux
RUN chmod +x /opt/solc
RUN wget -O /opt/googletest-1.15.2.tar.gz https://github.com/google/googletest/releases/download/v1.15.2/googletest-1.15.2.tar.gz

RUN git clone https://github.com/emscripten-core/emsdk.git
WORKDIR /opt/emsdk
RUN ./emsdk install 3.1.69
RUN ./emsdk activate 3.1.69

RUN curl -sSf https://mirrors.ustc.edu.cn/misc/rustup-install.sh | sh -s -- -y
RUN bash -c ". /root/.cargo/env"
RUN bash -c ". ~/.cargo/env && rustup install 1.81.0 && rustup default 1.81.0"

RUN mkdir -p /root/.cargo && touch /root/.cargo/env
RUN echo "source \"$HOME/.cargo/env\"" >> $HOME/.profile

# install foundry
RUN curl -L https://foundry.paradigm.xyz | bash
ENV PATH=~/.foundry/bin:$PATH
# do it manually
# RUN bash -c "source ~/.bashrc && foundryup"

WORKDIR /opt
5 changes: 5 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
// ...
"build": { "dockerfile": "Dockerfile" },
// ...
}
7 changes: 7 additions & 0 deletions .devcontainer/install_llvm16.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash
set -e
cd /opt
ls
tar -xvf clang+llvm-16.0.4-x86_64-linux-gnu-ubuntu-22.04.tar.xz
rm -rf clang+llvm-16.0.4-x86_64-linux-gnu-ubuntu-22.04.tar.xz
mv clang+llvm-16.0.4-x86_64-linux-gnu-ubuntu-22.04 llvm16
6 changes: 6 additions & 0 deletions .devcontainer/install_rust.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash
set -e
curl -sSf https://mirrors.ustc.edu.cn/misc/rustup-install.sh | sh -s -- -y
. "$HOME/.cargo/env"
rustup install 1.81.0
rustup default 1.81.0
2 changes: 1 addition & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ WORKDIR /home/admin
USER root
WORKDIR /opt

RUN echo "export PATH=/opt/llvm15/bin:/opt:\$PATH" >> ~/.bash_profile
RUN echo "export PATH=/opt/llvm16/bin:/opt:\$PATH" >> ~/.bash_profile
RUN echo "export LLVM_SYS_160_PREFIX=/opt/llvm16" >> ~/.bash_profile
ENV PATH=/opt/llvm16/bin:/opt:$PATH
ENV LLVM_SYS_160_PREFIX=/opt/llvm16
Expand Down