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
12 changes: 12 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -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
27 changes: 27 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -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"
}
}
38 changes: 38 additions & 0 deletions .devcontainer/setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
## update and install some things we should probably have

Copilot AI Oct 2, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shell scripts should start with a shebang line (e.g., #!/bin/bash) to explicitly specify the interpreter.

Copilot uses AI. Check for mistakes.
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

Copilot AI Oct 2, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Downloading and executing scripts directly from the internet without verification poses a security risk. Consider verifying the script's checksum or using a specific version instead of the latest.

Suggested change
curl https://sh.rustup.rs -sSf | sh -s -- -y
# Download and verify rustup-init (pinned version)
RUSTUP_VERSION=1.26.0
RUSTUP_ARCH=x86_64-unknown-linux-gnu
RUSTUP_URL="https://static.rust-lang.org/rustup/archive/${RUSTUP_VERSION}/${RUSTUP_ARCH}/rustup-init"
RUSTUP_SHA256_URL="https://static.rust-lang.org/rustup/archive/${RUSTUP_VERSION}/${RUSTUP_ARCH}/rustup-init.sha256"
wget -O /tmp/rustup-init "$RUSTUP_URL"
wget -O /tmp/rustup-init.sha256 "$RUSTUP_SHA256_URL"
cd /tmp
sha256sum -c rustup-init.sha256
if [ $? -ne 0 ]; then
echo "rustup-init checksum verification failed!" >&2
exit 1
fi
chmod +x rustup-init
./rustup-init -y
cd -

Copilot uses AI. Check for mistakes.
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

Copilot AI Oct 2, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The wget command downloads to the current directory (/home/), but the zstd command expects the file to be in /home/. This works correctly, but the path inconsistency could be confusing. Consider using explicit paths or downloading directly to /home/.

Suggested change
wget https://github.com/facebook/buck2/releases/download/latest/buck2-x86_64-unknown-linux-gnu.zst
wget -O /home/buck2-x86_64-unknown-linux-gnu.zst https://github.com/facebook/buck2/releases/download/latest/buck2-x86_64-unknown-linux-gnu.zst

Copilot uses AI. Check for mistakes.

Copilot AI Oct 2, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using 'latest' for the Buck2 download makes the build non-reproducible. Consider pinning to a specific version for consistency across environments.

Copilot uses AI. Check for mistakes.
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