Skip to content

Commit 400d7af

Browse files
committed
Swift: tweaks to codespace setup
1 parent 7223fed commit 400d7af

File tree

5 files changed

+13
-17
lines changed

5 files changed

+13
-17
lines changed

.devcontainer/swift/Dockerfile

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
11
# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.236.0/containers/cpp/.devcontainer/base.Dockerfile
22

33
# [Choice] Debian / Ubuntu version (use Debian 11, Ubuntu 18.04/22.04 on local arm64/Apple Silicon): debian-11, debian-10, ubuntu-22.04, ubuntu-20.04, ubuntu-18.04
4-
ARG VARIANT="bullseye"
5-
FROM mcr.microsoft.com/vscode/devcontainers/cpp:0-${VARIANT}
4+
FROM mcr.microsoft.com/vscode/devcontainers/cpp:0-ubuntu-22.04
65

7-
ARG BAZELISK_VERSION=v1.10.1
8-
ARG BAZELISK_DOWNLOAD_SHA=dev-mode
96
USER root
107
ADD root.sh /tmp/root.sh
118
RUN bash /tmp/root.sh && rm /tmp/root.sh

.devcontainer/swift/devcontainer.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,6 @@
1414
},
1515
"build": {
1616
"dockerfile": "Dockerfile",
17-
"args": {
18-
"VARIANT": "ubuntu-20.04"
19-
}
2017
},
2118
"runArgs": [
2219
"--cap-add=SYS_PTRACE",

.devcontainer/swift/root.sh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,19 @@
11
set -xe
22

3+
BAZELISK_VERSION=v1.12.0
4+
BAZELISK_DOWNLOAD_SHA=6b0bcb2ea15bca16fffabe6fda75803440375354c085480fe361d2cbf32501db
5+
36
apt-get update
47
export DEBIAN_FRONTEND=noninteractive
58
apt-get -y install --no-install-recommends \
69
zlib1g-dev \
710
uuid-dev \
811
python3-distutils \
9-
python3-pip
12+
python3-pip \
13+
bash-completion
1014

1115
# Install Bazel
1216
curl -fSsL -o /usr/local/bin/bazelisk https://github.com/bazelbuild/bazelisk/releases/download/${BAZELISK_VERSION}/bazelisk-linux-amd64
13-
([ "${BAZELISK_DOWNLOAD_SHA}" = "dev-mode" ] || echo "${BAZELISK_DOWNLOAD_SHA} */usr/local/bin/bazelisk" | sha256sum --check - )
17+
echo "${BAZELISK_DOWNLOAD_SHA} */usr/local/bin/bazelisk" | sha256sum --check -
1418
chmod 0755 /usr/local/bin/bazelisk
1519
ln -s bazelisk /usr/local/bin/bazel

.devcontainer/swift/user.sh

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,4 @@ bazel run swift/create-extractor-pack
1212
python3 -m pip install pre-commit --no-warn-script-location
1313
$HOME/.local/bin/pre-commit install
1414

15-
cat >> $HOME/.bashrc << EOF
16-
17-
# have the codeql binary installed by vscode automatically in PATH
18-
bin=\$(ls \$HOME/.vscode-remote/data/User/globalStorage/github.vscode-codeql/*/codeql/codeql -t 2>/dev/null | head -1)
19-
if [[ -n \$bin ]]; then
20-
export PATH=\$PATH:$(dirname "\$bin")
21-
fi
22-
EOF
15+
cat $(dirname $0)/user_bashrc.sh >> $HOME/.bashrc

.devcontainer/swift/user_bashrc.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# have the codeql binary installed by vscode automatically in PATH
2+
bin=$(ls $HOME/.vscode-remote/data/User/globalStorage/github.vscode-codeql/*/codeql/codeql -t 2>/dev/null | head -1)
3+
if [[ -n $bin ]]; then
4+
export PATH=$PATH:$(dirname "$bin")
5+
fi

0 commit comments

Comments
 (0)