diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 00000000..ee5ccbc4 --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1,12 @@ +FROM ubuntu:24.04 + +WORKDIR /home/ + +COPY . . + +RUN bash ./setup.sh + +ENV PATH="/root/.cargo/bin:$PATH" +ENV TZ=Asia/Shanghai +ENV LANG=en_US.UTF-8 +ENV LC_ALL=en_US.UTF-8 \ No newline at end of file diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 00000000..e9158ad2 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,27 @@ +{ + "name": "W3IF - Codespaces", + "dockerFile": "Dockerfile", + "customizations": { + "vscode": { + "extensions": [ + "rust-lang.rust-analyzer", + "vadimcn.vscode-lldb", + "tamasfe.even-better-toml", + "ms-vscode.cpptools" + ], + "settings": { + "editor.formatOnSave": true, + "terminal.integrated.defaultProfile.linux": "bash", + "files.exclude": { + "**/CODE_OF_CONDUCT.md": true, + "**/LICENSE": true + } + } + } + }, + "hostRequirements": { + "cpus": 16, + "memory": "64gb", + "storage": "128gb" + } +} \ No newline at end of file diff --git a/.devcontainer/setup.sh b/.devcontainer/setup.sh new file mode 100644 index 00000000..21ce4a8e --- /dev/null +++ b/.devcontainer/setup.sh @@ -0,0 +1,38 @@ +## update and install some things we should probably have +apt-get update +apt-get upgrade -y +apt-get install -y \ + apt-utils \ + curl \ + git \ + git-lfs \ + gnupg2 \ + jq \ + build-essential \ + openssl \ + libssl-dev \ + pkg-config \ + cmake \ + wget \ + file \ + ca-certificates \ + zstd \ + clang \ + lld \ + protobuf-compiler \ + seccomp \ + libseccomp-dev + +## Install rustup and common components +curl https://sh.rustup.rs -sSf | sh -s -- -y +source /root/.cargo/env + +## Init git-lfs +git lfs install + +## Install Buck2 +wget https://github.com/facebook/buck2/releases/download/latest/buck2-x86_64-unknown-linux-gnu.zst +zstd -d /home/buck2-x86_64-unknown-linux-gnu.zst +mv /home/buck2-x86_64-unknown-linux-gnu /home/buck2 +chmod +x /home/buck2 +mv /home/buck2 /usr/local/bin/buck2