Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add a devcontainer #4101

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open
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
24 changes: 24 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
FROM debian:12

RUN \
apt update && apt install -y \
build-essential \
ccache \
clang \
cmake \
curl \
git \
libssl-dev \
mold \
pkg-config

RUN \
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- \
-y \
--default-toolchain 1.81.0

ENV CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_LINKER=clang
ENV RUSTFLAGS="-C link-arg=-fuse-ld=mold"

ENV CC="ccache clang"
ENV CXX="ccache clang++"
28 changes: 28 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"name": "sdk",
"privileged": true,
"build": {
"dockerfile": "Dockerfile"
},
"mounts": [
{
"source": "${localEnv:HOME}/.cache",
"target": "/root/.cache",
"type": "bind"
}
],
"customizations": {
"vscode": {
"extensions": [
"rust-lang.rust-analyzer",
"tamasfe.even-better-toml",
"vadimcn.vscode-lldb",
"EditorConfig.EditorConfig"
],
"settings": {
"editor.formatOnSave": true,
"rust-analyzer.check.command": "clippy"
}
}
}
}
12 changes: 12 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
root = true

[*]
charset = utf-8
end_of_line = lf
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true

[*.rs]
indent_size = 4
max_line_length = 100
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@

### feat: streamlined output during asset synchronization

### feat: add devcontainer

## Dependencies

### Motoko
Expand Down
1 change: 1 addition & 0 deletions src/dfx/assets/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ fn find_assets(sources: Sources) -> PathBuf {
&*env::var("CARGO_CFG_TARGET_OS").unwrap(),
) {
("x86_64" | "aarch64", "macos") => sources.x86_64_darwin, // rosetta
("aarch64", "linux") => sources.x86_64_linux,
("x86_64", "linux" | "windows") => sources.x86_64_linux,
(arch, os) => panic!("Unsupported OS type {arch}-{os}"),
};
Expand Down
Loading