@@ -17,8 +17,6 @@ DEBIAN_FRONTEND=noninteractive
1717# Read tool versions + metadata into environment variables
1818. /devcontainer/features/s-core-local/versions.sh /devcontainer/features/s-core-local/versions.yaml
1919
20- ARCHITECTURE=$( dpkg --print-architecture)
21-
2220apt-get update
2321
2422# Unminimize the image to include standard packages like man pages
@@ -54,70 +52,6 @@ JAVA_HOME="$(dirname $(dirname $(realpath $(command -v javac))))"
5452export JAVA_HOME
5553echo -e " JAVA_HOME=${JAVA_HOME} \nexport JAVA_HOME" > /etc/profile.d/java_home.sh
5654
57- # Bazelisk, directly from GitHub
58- # Using the existing devcontainer feature is not optimal:
59- # - it does not check the SHA256 checksum of the downloaded file
60- # - it cannot pre-install a specific version of Bazel, or prepare bash completion
61- BAZELISK_VARIANT=" amd64"
62- SHA256SUM=" ${bazelisk_amd64_sha256} "
63- if [ " ${ARCHITECTURE} " = " arm64" ]; then
64- BAZELISK_VARIANT=" arm64"
65- SHA256SUM=" ${bazelisk_arm64_sha256} "
66- fi
67- curl -L " https://github.com/bazelbuild/bazelisk/releases/download/v${bazelisk_version} /bazelisk-${BAZELISK_VARIANT} .deb" -o /tmp/bazelisk.deb
68- echo " ${SHA256SUM} /tmp/bazelisk.deb" | sha256sum -c - || exit 1
69- apt-get install -y --no-install-recommends --fix-broken /tmp/bazelisk.deb
70- rm /tmp/bazelisk.deb
71-
72- # Pre-install a fixed Bazel version, setup the bash command completion
73- export USE_BAZEL_VERSION=${bazel_version}
74- # bazelisk downloads Bazel into the home directory of the user running the command
75- # lets assume there is only one user in the devcontainer
76- su " $( ls /home) " -c " bazel help completion bash > /tmp/bazel-complete.bash"
77- mkdir -p /etc/bash_completion.d
78- mv /tmp/bazel-complete.bash /etc/bash_completion.d/bazel-complete.bash
79- sh -c " echo 'INSTALLED_BAZEL_VERSION=${bazel_version} ' >> /devcontainer/features/s-core-local/bazel_setup.sh"
80-
81- # Configure Bazel to use system trust store for SSL/TLS connections
82- # This is required for corporate environments with custom CA certificates
83- echo ' startup --host_jvm_args=-Djavax.net.ssl.trustStore=/etc/ssl/certs/java/cacerts --host_jvm_args=-Djavax.net.ssl.trustStorePassword=changeit' >> /etc/bazel.bazelrc
84-
85- # Buildifier, directly from GitHub (apparently no APT repository available)
86- # The version is pinned to a specific release, and the SHA256 checksum is provided by the devcontainer-features.json file.
87- BUILDIFIER_VARIANT=" amd64"
88- SHA256SUM=" ${buildifier_amd64_sha256} "
89- if [ " ${ARCHITECTURE} " = " arm64" ]; then
90- BUILDIFIER_VARIANT=" arm64"
91- SHA256SUM=" ${buildifier_arm64_sha256} "
92- fi
93- curl -L " https://github.com/bazelbuild/buildtools/releases/download/v${buildifier_version} /buildifier-linux-${BUILDIFIER_VARIANT} " -o /usr/local/bin/buildifier
94- echo " ${SHA256SUM} /usr/local/bin/buildifier" | sha256sum -c - || exit 1
95- chmod +x /usr/local/bin/buildifier
96-
97- # Starlark Language Server, directly from GitHub (apparently no APT repository available)
98- STARPLS_VARIANT=" amd64"
99- SHA256SUM=" ${starpls_amd64_sha256} "
100- if [ " ${ARCHITECTURE} " = " arm64" ]; then
101- STARPLS_VARIANT=" aarch64"
102- SHA256SUM=" ${starpls_arm64_sha256} "
103- fi
104- curl -L " https://github.com/withered-magic/starpls/releases/download/v${starpls_version} /starpls-linux-${STARPLS_VARIANT} " -o /usr/local/bin/starpls
105- echo " ${SHA256SUM} /usr/local/bin/starpls" | sha256sum -c - || exit 1
106- chmod +x /usr/local/bin/starpls
107-
108- # Code completion for C++ code of Bazel projects
109- # (see https://github.com/kiron1/bazel-compile-commands)
110- source /etc/lsb-release
111- curl -L " https://github.com/kiron1/bazel-compile-commands/releases/download/v${bazel_compile_commands_version} /bazel-compile-commands_${bazel_compile_commands_version} -${DISTRIB_CODENAME} _${ARCHITECTURE} .deb" -o /tmp/bazel-compile-commands.deb
112- # Extract correct sha256 for current DISTRIB_CODENAME and check
113- SHA256SUM=" ${bazel_compile_commands_amd64_sha256} "
114- if [ " ${ARCHITECTURE} " = " arm64" ]; then
115- SHA256SUM=" ${bazel_compile_commands_arm64_sha256} "
116- fi
117- echo " ${SHA256SUM} /tmp/bazel-compile-commands.deb" | sha256sum -c - || exit 1
118- apt-get install -y --no-install-recommends --fix-broken /tmp/bazel-compile-commands.deb
119- rm /tmp/bazel-compile-commands.deb
120-
12155# qemu-system-arm
12256apt-get install -y --no-install-recommends --fix-broken qemu-system-arm=" ${qemu_system_arm_version} *"
12357
0 commit comments