Skip to content

Commit

Permalink
Merge pull request #18 from JanBeelte/main
Browse files Browse the repository at this point in the history
Add ZLS to devcontainer.
  • Loading branch information
kassane authored Nov 19, 2024
2 parents 5b4a55f + edbe5c8 commit b0751d5
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 3 deletions.
14 changes: 13 additions & 1 deletion .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ ENV ZIG_SHA256=ad94656b00dc45fb098a7cf3dc03696bf016da76791eee32b2cdd500035c85a9
ENV ZIG_DIST=${ZIG_REL}.tar.xz
ENV ZIG_URL=https://github.com/kassane/zig-espressif-bootstrap/releases/download/0.14.0-xtensa-dev/${ZIG_DIST}

# ZLS v0.14.0
ENV ZLS_REL=zls-x86_64-linux-musl-baseline_ea2c303b0
ENV ZLS_SHA256=d74ce12d36d4ba88f2d3ea01e4cb4db0cbf70e2bc1b99a6d3381a8dd62d7ea82
ENV ZLS_DIST=${ZLS_REL}.tar.xz
ENV ZLS_URL=https://github.com/kassane/zig-espressif-bootstrap/releases/download/0.14.0-xtensa-dev/${ZLS_DIST}

ENV LC_ALL=C.UTF-8
ENV LANG=C.UTF-8

Expand All @@ -39,7 +45,13 @@ RUN wget --no-verbose ${ZIG_URL} \
&& tar -xf $ZIG_DIST -C /opt \
&& rm ${ZIG_DIST}

ENV PATH=/opt/qemu/bin:/opt/${ZIG_REL}:${PATH}
RUN wget --no-verbose ${ZLS_URL} \
&& echo "${ZLS_SHA256} *${ZLS_DIST}" | sha256sum --check --strict - \
&& mkdir -p /opt/zls \
&& tar -xf $ZLS_DIST -C /opt/zls \
&& rm ${ZLS_DIST}

ENV PATH=/opt/qemu/bin:/opt/${ZIG_REL}:/opt/zls:${PATH}

RUN groupadd --gid $USER_GID $CONTAINER_USER \
&& adduser --uid $USER_UID --gid $USER_GID --disabled-password --gecos "" ${CONTAINER_USER} \
Expand Down
12 changes: 10 additions & 2 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
"build": {
"dockerfile": "Dockerfile"
},
"mounts": [
// Unfortunately this mount only works for linux users:
"source=/dev/bus/usb,target=/dev/bus/usb,type=bind,consistency=cached"
],
"customizations": {
"vscode": {
"settings": {
Expand All @@ -14,7 +18,8 @@
"idf.gitPath": "/usr/bin/git"
},
"extensions": [
"espressif.esp-idf-extension"
"espressif.esp-idf-extension",
"ziglang.vscode-zig"
]
},
"codespaces": {
Expand All @@ -28,9 +33,12 @@
},
"extensions": [
"espressif.esp-idf-extension",
"ziglang.vscode-zig",
"espressif.esp-idf-web"
]
}
},
"runArgs": ["--privileged"]
"runArgs": [
"--privileged"
]
}

0 comments on commit b0751d5

Please sign in to comment.