From c5e19217c8ffc158bab8eeea41396ccf6f6f0bb2 Mon Sep 17 00:00:00 2001 From: Vatsal Gupta <40350810+gvatsal60@users.noreply.github.com> Date: Thu, 2 Jul 2026 15:04:43 +0530 Subject: [PATCH 1/4] [#205] Add Dev Container configuration to streamline development environment --- .devcontainer/Dockerfile.dev | 39 +++++++++++++++++++++++++++++++++ .devcontainer/devcontainer.json | 25 +++++++++++++++++++++ 2 files changed, 64 insertions(+) create mode 100644 .devcontainer/Dockerfile.dev create mode 100644 .devcontainer/devcontainer.json diff --git a/.devcontainer/Dockerfile.dev b/.devcontainer/Dockerfile.dev new file mode 100644 index 00000000..9410a5cb --- /dev/null +++ b/.devcontainer/Dockerfile.dev @@ -0,0 +1,39 @@ +# syntax=docker/dockerfile:1.7 +FROM rust:1.95-bookworm AS dev + +USER root + +# Development dependencies +RUN apt-get update && apt-get install -y --no-install-recommends \ + build-essential \ + ca-certificates \ + curl \ + fuse3 \ + git \ + libfuse3-dev \ + perl \ + pkg-config \ + && rm -rf /var/lib/apt/lists/* + +# Rust dev tooling required by the lint/format gate. +RUN rustup component add rustfmt clippy + +# Allow non-root FUSE mounts (needed for `cargo test --features fuse` dev runs). +RUN echo 'user_allow_other' >> /etc/fuse.conf + +# Developer user, in a separate layer from apt for cache isolation. +ARG USERNAME=vscode +ARG USER_UID=1000 +ARG USER_GID=1000 +RUN groupadd --gid "${USER_GID}" "${USERNAME}" \ + && useradd --uid "${USER_UID}" --gid "${USER_GID}" --create-home \ + --shell /bin/bash "${USERNAME}" + +# Give the non-root user ownership of the cargo cache and base build tree so +# `cargo` works without root inside the container. +ENV CARGO_HOME=/usr/local/cargo +ENV PATH=${CARGO_HOME}/bin:${PATH} +# Use the system git client for the git-based crates (xet-core, fuser fork). +ENV CARGO_NET_GIT_FETCH_WITH_CLI=true + +USER ${USERNAME} diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 00000000..5b6e3f26 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,25 @@ +{ + "build": { + "context": ".", + "dockerfile": "Dockerfile.dev" + }, + "runArgs": [ + "--cap-add=sys_admin", + "--device=/dev/fuse:/dev/fuse" + ], + "customizations": { + "vscode": { + "extensions": [ + "rust-lang.rust-analyzer" + ], + "settings": { + "editor.formatOnSave": true, + "[rust]": { + "editor.defaultFormatter": "rust-lang.rust-analyzer" + }, + "rust-analyzer.cargo.features": "all", + "rust-analyzer.cargo-watch.enable": true + } + } + } +} \ No newline at end of file From 7877e639bd1b481d39a126a3162df8d74061c807 Mon Sep 17 00:00:00 2001 From: Vatsal Gupta <40350810+gvatsal60@users.noreply.github.com> Date: Thu, 9 Jul 2026 12:46:08 +0530 Subject: [PATCH 2/4] Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- .devcontainer/Dockerfile.dev | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.devcontainer/Dockerfile.dev b/.devcontainer/Dockerfile.dev index 9410a5cb..1dee1d81 100644 --- a/.devcontainer/Dockerfile.dev +++ b/.devcontainer/Dockerfile.dev @@ -29,10 +29,10 @@ RUN groupadd --gid "${USER_GID}" "${USERNAME}" \ && useradd --uid "${USER_UID}" --gid "${USER_GID}" --create-home \ --shell /bin/bash "${USERNAME}" -# Give the non-root user ownership of the cargo cache and base build tree so -# `cargo` works without root inside the container. +# Ensure the non-root user can write to the cargo cache so `cargo` works without root inside the container. ENV CARGO_HOME=/usr/local/cargo ENV PATH=${CARGO_HOME}/bin:${PATH} +RUN mkdir -p "${CARGO_HOME}" && chown -R "${USERNAME}:${USERNAME}" "${CARGO_HOME}" # Use the system git client for the git-based crates (xet-core, fuser fork). ENV CARGO_NET_GIT_FETCH_WITH_CLI=true From 5438b1edc31318cc8a1dd64b9e7f57ebc96e7652 Mon Sep 17 00:00:00 2001 From: Vatsal Gupta <40350810+gvatsal60@users.noreply.github.com> Date: Thu, 9 Jul 2026 12:47:51 +0530 Subject: [PATCH 3/4] Fixed Copilot Review Comments --- .devcontainer/Dockerfile.dev | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.devcontainer/Dockerfile.dev b/.devcontainer/Dockerfile.dev index 1dee1d81..cf3534d2 100644 --- a/.devcontainer/Dockerfile.dev +++ b/.devcontainer/Dockerfile.dev @@ -3,7 +3,7 @@ FROM rust:1.95-bookworm AS dev USER root -# Development dependencies +# Development dependencies RUN apt-get update && apt-get install -y --no-install-recommends \ build-essential \ ca-certificates \ @@ -11,8 +11,10 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ fuse3 \ git \ libfuse3-dev \ + nfs-common \ perl \ pkg-config \ + sudo \ && rm -rf /var/lib/apt/lists/* # Rust dev tooling required by the lint/format gate. @@ -26,8 +28,10 @@ ARG USERNAME=vscode ARG USER_UID=1000 ARG USER_GID=1000 RUN groupadd --gid "${USER_GID}" "${USERNAME}" \ - && useradd --uid "${USER_UID}" --gid "${USER_GID}" --create-home \ - --shell /bin/bash "${USERNAME}" + && useradd --uid "${USER_UID}" --gid "${USER_GID}" --create-home --shell /bin/bash "${USERNAME}" \ + && usermod -aG sudo "${USERNAME}" \ + && echo "${USERNAME} ALL=(ALL) NOPASSWD:ALL" > "/etc/sudoers.d/${USERNAME}" \ + && chmod 0440 "/etc/sudoers.d/${USERNAME}" # Ensure the non-root user can write to the cargo cache so `cargo` works without root inside the container. ENV CARGO_HOME=/usr/local/cargo From 2f4f8abf53e73fccf594be5b2d3db2e6713d9daf Mon Sep 17 00:00:00 2001 From: Vatsal Gupta <40350810+gvatsal60@users.noreply.github.com> Date: Sat, 11 Jul 2026 12:14:36 +0530 Subject: [PATCH 4/4] Improvements and Added Makefile --- .devcontainer/Dockerfile.dev | 7 ++++++- Makefile | 27 +++++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 Makefile diff --git a/.devcontainer/Dockerfile.dev b/.devcontainer/Dockerfile.dev index cf3534d2..34413b04 100644 --- a/.devcontainer/Dockerfile.dev +++ b/.devcontainer/Dockerfile.dev @@ -6,16 +6,20 @@ USER root # Development dependencies RUN apt-get update && apt-get install -y --no-install-recommends \ build-essential \ + bash-completion \ ca-certificates \ curl \ fuse3 \ git \ + libfuse3-3 \ libfuse3-dev \ + make \ nfs-common \ perl \ pkg-config \ sudo \ - && rm -rf /var/lib/apt/lists/* + xfslibs-dev \ + && rm -rf /tmp/* /var/lib/apt/lists/* # Rust dev tooling required by the lint/format gate. RUN rustup component add rustfmt clippy @@ -39,5 +43,6 @@ ENV PATH=${CARGO_HOME}/bin:${PATH} RUN mkdir -p "${CARGO_HOME}" && chown -R "${USERNAME}:${USERNAME}" "${CARGO_HOME}" # Use the system git client for the git-based crates (xet-core, fuser fork). ENV CARGO_NET_GIT_FETCH_WITH_CLI=true +ENV RUST_BACKTRACE=full USER ${USERNAME} diff --git a/Makefile b/Makefile new file mode 100644 index 00000000..f19c108d --- /dev/null +++ b/Makefile @@ -0,0 +1,27 @@ +# Targets +.PHONY: all build check clean doc fmt release test + +BUILD_TOOL := cargo + +all: clean fmt build + +build: + @$(BUILD_TOOL) build + +check: + @$(BUILD_TOOL) check + +clean: + @$(BUILD_TOOL) clean + +doc: + @$(BUILD_TOOL) doc --no-deps + +fmt: + @$(BUILD_TOOL) fmt + +release: clean + @$(BUILD_TOOL) build --release + +test: + @$(BUILD_TOOL) test