@@ -29,7 +29,7 @@ rm -f "${COPY_TARGET}/devcontainer-features.env" "${COPY_TARGET}/devcontainer-fe
2929DEBIAN_FRONTEND=noninteractive
3030
3131# Read tool versions + metadata into environment variables
32- . /devcontainer/features/s-core-local /versions.sh /devcontainer/features/bazel/versions.yaml
32+ . /usr/local/share/score-tools /versions.sh /devcontainer/features/bazel/versions.yaml
3333
3434ARCHITECTURE=$( dpkg --print-architecture)
3535
@@ -39,20 +39,11 @@ apt-get update
3939# Container build dependencies are not pinned, since they are removed anyway after container creation.
4040apt-get install apt-transport-https -y
4141
42- # Bazelisk, directly from GitHub
43- # Using the existing devcontainer feature is not optimal:
44- # - it does not check the SHA256 checksum of the downloaded file
45- # - it cannot pre-install a specific version of Bazel, or prepare bash completion
46- BAZELISK_VARIANT=" amd64"
47- SHA256SUM=" ${bazelisk_amd64_sha256} "
48- if [ " ${ARCHITECTURE} " = " arm64" ]; then
49- BAZELISK_VARIANT=" arm64"
50- SHA256SUM=" ${bazelisk_arm64_sha256} "
51- fi
52- curl -L " https://github.com/bazelbuild/bazelisk/releases/download/v${bazelisk_version} /bazelisk-${BAZELISK_VARIANT} .deb" -o /tmp/bazelisk.deb
53- echo " ${SHA256SUM} /tmp/bazelisk.deb" | sha256sum -c - || exit 1
54- apt-get install -y --no-install-recommends --fix-broken /tmp/bazelisk.deb
55- rm /tmp/bazelisk.deb
42+ # Lockfile-managed Bazel tooling
43+ /usr/local/share/score-tools/tool_installer.py install bazelisk buildifier starpls
44+
45+ # Bazelisk + Bazel
46+ ln -sf /usr/local/bin/bazelisk /usr/local/bin/bazel
5647
5748# Pre-install a fixed Bazel version, setup the bash command completion
5849export USE_BAZEL_VERSION=${bazel_version}
@@ -67,29 +58,6 @@ sh -c "echo 'INSTALLED_BAZEL_VERSION=${bazel_version}' >> /devcontainer/features
6758# This is required for corporate environments with custom CA certificates
6859echo ' startup --host_jvm_args=-Djavax.net.ssl.trustStore=/etc/ssl/certs/java/cacerts --host_jvm_args=-Djavax.net.ssl.trustStorePassword=changeit' >> /etc/bazel.bazelrc
6960
70- # Buildifier, directly from GitHub (apparently no APT repository available)
71- # The version is pinned to a specific release, and the SHA256 checksum is provided by the devcontainer-features.json file.
72- BUILDIFIER_VARIANT=" amd64"
73- SHA256SUM=" ${buildifier_amd64_sha256} "
74- if [ " ${ARCHITECTURE} " = " arm64" ]; then
75- BUILDIFIER_VARIANT=" arm64"
76- SHA256SUM=" ${buildifier_arm64_sha256} "
77- fi
78- curl -L " https://github.com/bazelbuild/buildtools/releases/download/v${buildifier_version} /buildifier-linux-${BUILDIFIER_VARIANT} " -o /usr/local/bin/buildifier
79- echo " ${SHA256SUM} /usr/local/bin/buildifier" | sha256sum -c - || exit 1
80- chmod +x /usr/local/bin/buildifier
81-
82- # Starlark Language Server, directly from GitHub (apparently no APT repository available)
83- STARPLS_VARIANT=" amd64"
84- SHA256SUM=" ${starpls_amd64_sha256} "
85- if [ " ${ARCHITECTURE} " = " arm64" ]; then
86- STARPLS_VARIANT=" aarch64"
87- SHA256SUM=" ${starpls_arm64_sha256} "
88- fi
89- curl -L " https://github.com/withered-magic/starpls/releases/download/v${starpls_version} /starpls-linux-${STARPLS_VARIANT} " -o /usr/local/bin/starpls
90- echo " ${SHA256SUM} /usr/local/bin/starpls" | sha256sum -c - || exit 1
91- chmod +x /usr/local/bin/starpls
92-
9361# Code completion for C++ code of Bazel projects
9462# (see https://github.com/kiron1/bazel-compile-commands)
9563source /etc/lsb-release
0 commit comments