From 7a8af3a480d6369f332447a8a23afcbdb1f400a9 Mon Sep 17 00:00:00 2001 From: Lutz Reinhardt Date: Tue, 24 Feb 2026 09:34:52 +0000 Subject: [PATCH] Readd LLVM feature Building Rust code is not fully isolated via Bazels sandbox and bindgen accesses LLVM headers from the host environment. Thus LLVM is for the being being required in the devcontainer image even though it increases the size by ~1GB. --- .../.devcontainer/devcontainer-lock.json | 5 +++++ src/s-core-devcontainer/.devcontainer/devcontainer.json | 7 +++++++ src/s-core-devcontainer/test-project/test.sh | 6 ++++++ 3 files changed, 18 insertions(+) diff --git a/src/s-core-devcontainer/.devcontainer/devcontainer-lock.json b/src/s-core-devcontainer/.devcontainer/devcontainer-lock.json index 46ea787..84a5452 100644 --- a/src/s-core-devcontainer/.devcontainer/devcontainer-lock.json +++ b/src/s-core-devcontainer/.devcontainer/devcontainer-lock.json @@ -1,5 +1,10 @@ { "features": { + "ghcr.io/devcontainers-community/features/llvm": { + "version": "3.2.0", + "resolved": "ghcr.io/devcontainers-community/features/llvm@sha256:4f464ab97a59439286a55490b55ba9851616f6f76ac3025e134127ac08ad79e2", + "integrity": "sha256:4f464ab97a59439286a55490b55ba9851616f6f76ac3025e134127ac08ad79e2" + }, "ghcr.io/devcontainers-extra/features/pre-commit:2": { "version": "2.0.18", "resolved": "ghcr.io/devcontainers-extra/features/pre-commit@sha256:6e0bb2ce80caca1d94f44dab5d0653d88a1c00984e590adb7c6bce012d0ade6e", diff --git a/src/s-core-devcontainer/.devcontainer/devcontainer.json b/src/s-core-devcontainer/.devcontainer/devcontainer.json index 375bbbc..bbbcde5 100644 --- a/src/s-core-devcontainer/.devcontainer/devcontainer.json +++ b/src/s-core-devcontainer/.devcontainer/devcontainer.json @@ -21,6 +21,11 @@ "userGid": "1000", "upgradePackages": "false" // WARNING: do *not* enable; this would include packages also from other features, which may have been pinned to a specific version }, + "ghcr.io/devcontainers-community/features/llvm": { + // Full semantic version pinning does not work with this feature. + // In case we want this, the feature needs to be replaced with a custom installation script. + "version": "20" + }, "./s-core-local": {}, "./bazel-feature": {} }, @@ -28,6 +33,7 @@ // this order makes it more convenient to develop the local features, since they will be installed last // which means changes to it will be applied without needing to rebuild all other features "ghcr.io/devcontainers/features/common-utils", + "ghcr.io/devcontainers-community/features/llvm", "./s-core-local", "./bazel-feature" ], @@ -60,6 +66,7 @@ "[cpp]": { "editor.defaultFormatter": "llvm-vs-code-extensions.vscode-clangd" }, + "clangd.path": "/usr/bin/clangd", "clangd.arguments": [ "--compile-commands-dir=${workspaceFolder}/", "--pretty", diff --git a/src/s-core-devcontainer/test-project/test.sh b/src/s-core-devcontainer/test-project/test.sh index d7c2832..ba46321 100755 --- a/src/s-core-devcontainer/test-project/test.sh +++ b/src/s-core-devcontainer/test-project/test.sh @@ -18,6 +18,12 @@ set -euo pipefail source "test-utils.sh" vscode +# C++ tooling +check "validate clangd is working and has the correct version" bash -c "clangd --version | grep '20.1.8'" +check "validate clang-format is working and has the correct version" bash -c "clang-format --version | grep '20.1.8'" +check "validate clang-tidy is working and has the correct version" bash -c "clang-tidy --version | grep '20.1.8'" +check "validate clang is working and has the correct version" bash -c "clang --version | grep '20.1.8'" + # Tests from the local s-core-local feature source /devcontainer/features/s-core-local/tests/test_default.sh