From 0dcd7ea02bfc89fac92751e0c8f2e6e0797460fa Mon Sep 17 00:00:00 2001 From: Oliver Pajonk Date: Tue, 23 Sep 2025 09:05:14 +0000 Subject: [PATCH 01/19] Use bazel_compile_commands 0.18.0 This has aarch64 support, finally. --- .../.devcontainer/s-core-local/versions.yaml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/s-core-devcontainer/.devcontainer/s-core-local/versions.yaml b/src/s-core-devcontainer/.devcontainer/s-core-local/versions.yaml index 874dc32..c5ceb42 100644 --- a/src/s-core-devcontainer/.devcontainer/s-core-local/versions.yaml +++ b/src/s-core-devcontainer/.devcontainer/s-core-local/versions.yaml @@ -30,11 +30,15 @@ starpls: sha256: 7c661cdde0d1c026665086d07523d825671e29056276681616bb32d0273c5eab bazel_compile_commands: - version: 0.17.2 + version: 0.18.0 amd64: # The following sha256sums are for the deb package bazel-compile-commands_-noble_amd64.deb # It is generated by running 'sha256sum bazel-compile-commands_-noble_amd64.deb' - sha256: 97239b316df58fd3370a8aa6350790ececd5e4a1de30efb42d45cb1c300a179a + sha256: 6735ea846241497094719792ad3d4f67b1d3123048693d34fcdf7190f8c2da4e + arm64: + # The following sha256sums are for the deb package bazel-compile-commands_-noble_arm64.deb + # It is generated by running 'sha256sum bazel-compile-commands_-noble_arm64.deb' + sha256: d73998efa01cbd501b82ad6266642464b78ecd9fc6224a60c9cb558182d52d88 rust_analyzer: date: 2025-08-25 From e14fb7ce9ac38856936d493241bacfa6c43a7464 Mon Sep 17 00:00:00 2001 From: Oliver Pajonk Date: Tue, 23 Sep 2025 14:25:25 +0000 Subject: [PATCH 02/19] Build also for aarch64 --- scripts/build.sh | 3 +- .../.devcontainer/devcontainer-lock.json | 5 ++ .../.devcontainer/devcontainer.json | 4 ++ .../.devcontainer/s-core-local/install.sh | 49 +++++++++---------- .../s-core-local/tests/test_default.sh | 4 +- .../.devcontainer/s-core-local/versions.sh | 12 ++++- .../.devcontainer/s-core-local/versions.yaml | 21 ++++---- src/s-core-devcontainer/test-project/test.sh | 4 ++ 8 files changed, 60 insertions(+), 42 deletions(-) diff --git a/scripts/build.sh b/scripts/build.sh index d8c570f..54a85ce 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -1,4 +1,5 @@ #!/usr/bin/env bash set -euxo pipefail -devcontainer build --workspace-folder src/s-core-devcontainer --image-name ghcr.io/eclipse-score/devcontainer:latest --cache-from ghcr.io/eclipse-score/devcontainer +devcontainer build --platform linux/aarch64 --workspace-folder src/s-core-devcontainer --image-name ghcr.io/eclipse-score/devcontainer:latest --cache-from ghcr.io/eclipse-score/devcontainer +devcontainer build --platform linux/amd64 --workspace-folder src/s-core-devcontainer --image-name ghcr.io/eclipse-score/devcontainer:latest --cache-from ghcr.io/eclipse-score/devcontainer diff --git a/src/s-core-devcontainer/.devcontainer/devcontainer-lock.json b/src/s-core-devcontainer/.devcontainer/devcontainer-lock.json index 4f40819..faf1f5a 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/bazel": { + "version": "1.2.2", + "resolved": "ghcr.io/devcontainers-community/features/bazel@sha256:587cd6cdd290cfb98c9ba8605a8a27f24fc1e9c736cdd03da099385863386331", + "integrity": "sha256:587cd6cdd290cfb98c9ba8605a8a27f24fc1e9c736cdd03da099385863386331" + }, "ghcr.io/devcontainers-community/features/llvm": { "version": "3.2.0", "resolved": "ghcr.io/devcontainers-community/features/llvm@sha256:4f464ab97a59439286a55490b55ba9851616f6f76ac3025e134127ac08ad79e2", diff --git a/src/s-core-devcontainer/.devcontainer/devcontainer.json b/src/s-core-devcontainer/.devcontainer/devcontainer.json index b9ab2ca..8e20fbc 100644 --- a/src/s-core-devcontainer/.devcontainer/devcontainer.json +++ b/src/s-core-devcontainer/.devcontainer/devcontainer.json @@ -13,6 +13,10 @@ // Installs the latest version from the Distribution "autoPull": "false" // do not automatically pull LFS files when creating the container }, + "ghcr.io/devcontainers-community/features/bazel": { + "bazelisk_version": "v1.27.0", + "buildifier_version": "v8.2.1" + }, "ghcr.io/devcontainers/features/common-utils": { // Installs latest version from the Distribution "installZsh": "false", diff --git a/src/s-core-devcontainer/.devcontainer/s-core-local/install.sh b/src/s-core-devcontainer/.devcontainer/s-core-local/install.sh index c6f7714..5af0fb1 100755 --- a/src/s-core-devcontainer/.devcontainer/s-core-local/install.sh +++ b/src/s-core-devcontainer/.devcontainer/s-core-local/install.sh @@ -15,6 +15,8 @@ DEBIAN_FRONTEND=noninteractive # Read tool versions + metadata into environment variables . /devcontainer/features/s-core-local/versions.sh +ARCHITECTURE=$(dpkg --print-architecture) + apt-get update # INSTALL CONTAINER BUILD DEPENDENCIES @@ -28,37 +30,28 @@ apt-get install -y graphviz="${graphviz_version}*" # Protobuf compiler, via APT (needed by FEO) apt-get install -y protobuf-compiler="${protobuf_compiler_version}*" -# Bazel, via APT -# - ghcr.io/devcontainers-community/features/bazel uses bazelisk, which has a few problems: -# - It does not install bash autocompletion. -# - The bazel version is not pinned, which is required to be reproducible and to have coordinated, tested tool updates. -# - In general, pre-built containers *shall not* download "more tools" from the internet. -# This is an operational risk (security, availability); it makes the build non-reproducible, -# and it prevents the container from working in air-gapped environments. -curl -fsSL https://bazel.build/bazel-release.pub.gpg | gpg --dearmor > bazel-archive-keyring.gpg -mv bazel-archive-keyring.gpg /usr/share/keyrings -echo "deb [arch=amd64 signed-by=/usr/share/keyrings/bazel-archive-keyring.gpg] https://storage.googleapis.com/bazel-apt stable jdk1.8" | tee /etc/apt/sources.list.d/bazel.list -apt-get update -apt-get install -y bazel=${bazel_version} - -# Buildifier, directly from GitHub (apparently no APT repository available) -# The version is pinned to a specific release, and the SHA256 checksum is provided by the devcontainer-features.json file. -curl -L "https://github.com/bazelbuild/buildtools/releases/download/v${buildifier_version}/buildifier-linux-amd64" -o /usr/local/bin/buildifier -echo "${buildifier_amd64_sha256} /usr/local/bin/buildifier" | sha256sum -c - || exit -1 -chmod +x /usr/local/bin/buildifier - # Starlark Language Server, directly from GitHub (apparently no APT repository available) -curl -L "https://github.com/withered-magic/starpls/releases/download/v${starpls_version}/starpls-linux-amd64" -o /usr/local/bin/starpls -echo "${starpls_amd64_sha256} /usr/local/bin/starpls" | sha256sum -c - || exit -1 +STARPLS_VARIANT="amd64" +SHA256SUM="${starpls_amd64_sha256}" +if [ "${ARCHITECTURE}" = "arm64" ]; then + STARPLS_VARIANT="aarch64" + SHA256SUM="${starpls_arm64_sha256}" +fi +curl -L "https://github.com/withered-magic/starpls/releases/download/v${starpls_version}/starpls-linux-${STARPLS_VARIANT}" -o /usr/local/bin/starpls +echo "${SHA256SUM} /usr/local/bin/starpls" | sha256sum -c - || exit -1 chmod +x /usr/local/bin/starpls # Code completion for C++ code of Bazel projects # (see https://github.com/kiron1/bazel-compile-commands) # The version is pinned to a specific release, and the SHA256 checksum is provided by the devcontainer-features.json file. source /etc/lsb-release -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}_amd64.deb" -o /tmp/bazel-compile-commands.deb +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 # Extract correct sha256 for current DISTRIB_CODENAME and check -echo "${bazel_compile_commands_amd64_sha256} /tmp/bazel-compile-commands.deb" | sha256sum -c - || exit -1 +SHA256SUM="${bazel_compile_commands_amd64_sha256}" +if [ "${ARCHITECTURE}" = "arm64" ]; then + SHA256SUM="${bazel_compile_commands_arm64_sha256}" +fi +echo "${SHA256SUM} /tmp/bazel-compile-commands.deb" | sha256sum -c - || exit -1 apt-get install -y --no-install-recommends --fix-broken /tmp/bazel-compile-commands.deb rm /tmp/bazel-compile-commands.deb @@ -66,8 +59,14 @@ rm /tmp/bazel-compile-commands.deb # (see https://bazelbuild.github.io/rules_rust/rust_analyzer.html and https://rust-analyzer.github.io/book/rust_analyzer_binary.html) # The version is pinned to a specific release, and the SHA256 checksum is provided by the devcontainer-features.json file. # NOTE: For an unknown reason, rust-analyzer uses dates for downloading of releases, while the executable reports an actual release. -curl -L https://github.com/rust-lang/rust-analyzer/releases/download/${rust_analyzer_date}/rust-analyzer-x86_64-unknown-linux-gnu.gz > /tmp/rust-analyzer.gz -echo "${rust_analyzer_amd64_sha256} /tmp/rust-analyzer.gz" | sha256sum -c - || exit -1 +RUST_ANALYZER_VARIANT="x86_64" +SHA256SUM="${rust_analyzer_amd64_sha256}" +if [ "${ARCHITECTURE}" = "arm64" ]; then + RUST_ANALYZER_VARIANT="aarch64" + SHA256SUM="${rust_analyzer_arm64_sha256}" +fi +curl -L https://github.com/rust-lang/rust-analyzer/releases/download/${rust_analyzer_date}/rust-analyzer-${RUST_ANALYZER_VARIANT}-unknown-linux-gnu.gz > /tmp/rust-analyzer.gz +echo "${SHA256SUM} /tmp/rust-analyzer.gz" | sha256sum -c - || exit -1 gunzip -d /tmp/rust-analyzer.gz mv /tmp/rust-analyzer /usr/local/bin/rust-analyzer chmod +x /usr/local/bin/rust-analyzer diff --git a/src/s-core-devcontainer/.devcontainer/s-core-local/tests/test_default.sh b/src/s-core-devcontainer/.devcontainer/s-core-local/tests/test_default.sh index 8603845..30eb727 100755 --- a/src/s-core-devcontainer/.devcontainer/s-core-local/tests/test_default.sh +++ b/src/s-core-devcontainer/.devcontainer/s-core-local/tests/test_default.sh @@ -13,9 +13,7 @@ check "validate graphviz has the correct version" bash -c "dpkg -s graphviz | gr # Other build-related tools check "validate protoc is working and has the correct version" bash -c "protoc --version | grep 'libprotoc ${protobuf_compiler_version}'" -# Bazel and related tools -check "validate bazel is working and has the correct version" bash -c "bazel version | grep '${bazel_version}'" -check "validate buildifier is working and has the correct version" bash -c "buildifier --version | grep '${buildifier_version}'" +# Bazel-related tools check "validate starpls is working and has the correct version" bash -c "starpls version | grep '${starpls_version}'" check "validate bazel-compile-commands is working and has the correct version" bash -c "bazel-compile-commands --version 2>&1 | grep '${bazel_compile_commands_version}'" diff --git a/src/s-core-devcontainer/.devcontainer/s-core-local/versions.sh b/src/s-core-devcontainer/.devcontainer/s-core-local/versions.sh index a85ee08..64760fa 100755 --- a/src/s-core-devcontainer/.devcontainer/s-core-local/versions.sh +++ b/src/s-core-devcontainer/.devcontainer/s-core-local/versions.sh @@ -1,8 +1,16 @@ #!/usr/bin/env bash set -euo pipefail -curl -L "https://github.com/mikefarah/yq/releases/download/v4.47.1/yq_linux_amd64" -o /tmp/yq -echo "0fb28c6680193c41b364193d0c0fc4a03177aecde51cfc04d506b1517158c2fb /tmp/yq" | sha256sum -c - || exit -1 +ARCHITECTURE=$(dpkg --print-architecture) +VERSION="v4.47.2" + +SHA256_FIELD="1bb99e1019e23de33c7e6afc23e93dad72aad6cf2cb03c797f068ea79814ddb0" # Default to amd64 +if [ "${ARCHITECTURE}" = "arm64" ]; then + SHA256_FIELD="05df1f6aed334f223bb3e6a967db259f7185e33650c3b6447625e16fea0ed31f" +fi + +curl -L "https://github.com/mikefarah/yq/releases/download/${VERSION}/yq_linux_${ARCHITECTURE}" -o /tmp/yq +echo "${SHA256_FIELD} /tmp/yq" | sha256sum -c - || exit -1 chmod +x /tmp/yq # Read tool versions and metadata into environment variables diff --git a/src/s-core-devcontainer/.devcontainer/s-core-local/versions.yaml b/src/s-core-devcontainer/.devcontainer/s-core-local/versions.yaml index c5ceb42..3a17b13 100644 --- a/src/s-core-devcontainer/.devcontainer/s-core-local/versions.yaml +++ b/src/s-core-devcontainer/.devcontainer/s-core-local/versions.yaml @@ -1,6 +1,3 @@ -bazel: - version: 8.3.0 - graphviz: version: 2.42.2 @@ -13,14 +10,6 @@ qemu_system_arm: sshpass: version: 1.09 -buildifier: - version: 8.2.1 - amd64: - # The following sha256sum is for the binary buildifier-linux-amd64 - # from the GitHub release page of buildtools - # It is generated by running 'sha256sum buildifier-linux-amd64' - sha256: 6ceb7b0ab7cf66fceccc56a027d21d9cc557a7f34af37d2101edb56b92fcfa1a - starpls: version: 0.1.22 amd64: @@ -28,6 +17,11 @@ starpls: # from the GitHub release page of starpls # It is generated by running 'sha256sum starpls-linux-amd64' sha256: 7c661cdde0d1c026665086d07523d825671e29056276681616bb32d0273c5eab + arm64: + # The following sha256sum is for the binary starpls-linux-arm64 + # from the GitHub release page of starpls + # It is generated by running 'sha256sum starpls-linux-arm64' + sha256: 55877ec4c3ff03e1d90d59c76f69a3a144b6c29688747c8ac4d77993e2eef1ad bazel_compile_commands: version: 0.18.0 @@ -48,3 +42,8 @@ rust_analyzer: # from the GitHub release page of rust-analyzer # It is generated by running 'sha256sum rust-analyzer-x86_64-unknown-linux-gnu.gz' sha256: 487fb1cb99e567fd6b818cc88a7c1452d5260da57dbc171fc1359a4b604348ae + arm64: + # The following sha256sum is for the binary rust-analyzer-aarch64-unknown-linux-gnu.gz + # from the GitHub release page of rust-analyzer + # It is generated by running 'sha256sum rust-analyzer-aarch64-unknown-linux-gnu.gz' + sha256: c738e00a5caa712f9d9c8f81f9661884c7108ef94db6df48985c11fe3c2695bd diff --git a/src/s-core-devcontainer/test-project/test.sh b/src/s-core-devcontainer/test-project/test.sh index 1b1d94e..bab7339 100755 --- a/src/s-core-devcontainer/test-project/test.sh +++ b/src/s-core-devcontainer/test-project/test.sh @@ -16,6 +16,10 @@ check "validate clang-format is working and has the correct version" bash -c "cl 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'" +# Bazel tooling +check "validate bazelisk is working and has the correct version" bash -c "bazelisk version | grep '1.27.0'" +check "validate buildifier is working and has the correct version" bash -c "buildifier --version | grep '8.2.1'" + # Tests from the local s-core-local feature source /devcontainer/features/s-core-local/tests/test_default.sh From f8099445a8b55aa2947b784c859cb153862d5ea5 Mon Sep 17 00:00:00 2001 From: Oliver Pajonk Date: Thu, 2 Oct 2025 08:52:17 +0000 Subject: [PATCH 03/19] switch to bazelisk (via debian package), bazel via bazelisk This method should support aarch64 as well. --- .../.devcontainer/devcontainer-lock.json | 5 ---- .../.devcontainer/devcontainer.json | 5 ---- .../.devcontainer/s-core-local/install.sh | 25 +++++++++++++++++++ .../install_matching_bazel_version.sh | 8 ++++-- .../.devcontainer/s-core-local/versions.yaml | 16 ++++++++++++ src/s-core-devcontainer/test-project/test.sh | 1 + 6 files changed, 48 insertions(+), 12 deletions(-) diff --git a/src/s-core-devcontainer/.devcontainer/devcontainer-lock.json b/src/s-core-devcontainer/.devcontainer/devcontainer-lock.json index faf1f5a..4f40819 100644 --- a/src/s-core-devcontainer/.devcontainer/devcontainer-lock.json +++ b/src/s-core-devcontainer/.devcontainer/devcontainer-lock.json @@ -1,10 +1,5 @@ { "features": { - "ghcr.io/devcontainers-community/features/bazel": { - "version": "1.2.2", - "resolved": "ghcr.io/devcontainers-community/features/bazel@sha256:587cd6cdd290cfb98c9ba8605a8a27f24fc1e9c736cdd03da099385863386331", - "integrity": "sha256:587cd6cdd290cfb98c9ba8605a8a27f24fc1e9c736cdd03da099385863386331" - }, "ghcr.io/devcontainers-community/features/llvm": { "version": "3.2.0", "resolved": "ghcr.io/devcontainers-community/features/llvm@sha256:4f464ab97a59439286a55490b55ba9851616f6f76ac3025e134127ac08ad79e2", diff --git a/src/s-core-devcontainer/.devcontainer/devcontainer.json b/src/s-core-devcontainer/.devcontainer/devcontainer.json index 8e20fbc..f6970d6 100644 --- a/src/s-core-devcontainer/.devcontainer/devcontainer.json +++ b/src/s-core-devcontainer/.devcontainer/devcontainer.json @@ -13,10 +13,6 @@ // Installs the latest version from the Distribution "autoPull": "false" // do not automatically pull LFS files when creating the container }, - "ghcr.io/devcontainers-community/features/bazel": { - "bazelisk_version": "v1.27.0", - "buildifier_version": "v8.2.1" - }, "ghcr.io/devcontainers/features/common-utils": { // Installs latest version from the Distribution "installZsh": "false", @@ -36,7 +32,6 @@ "./s-core-local": {} }, "remoteUser": "vscode", - "initializeCommand": "mkdir -p ${localEnv:HOME}/.cache/bazel", "customizations": { "vscode": { "extensions": [ diff --git a/src/s-core-devcontainer/.devcontainer/s-core-local/install.sh b/src/s-core-devcontainer/.devcontainer/s-core-local/install.sh index 5af0fb1..a593c3b 100755 --- a/src/s-core-devcontainer/.devcontainer/s-core-local/install.sh +++ b/src/s-core-devcontainer/.devcontainer/s-core-local/install.sh @@ -30,6 +30,31 @@ apt-get install -y graphviz="${graphviz_version}*" # Protobuf compiler, via APT (needed by FEO) apt-get install -y protobuf-compiler="${protobuf_compiler_version}*" +# Bazelisk, directly from GitHub +# Using the existing devcontainer feature is not optimal: +# - it does not check the SHA256 checksum of the downloaded file +# - it cannot pre-install a specific version of Bazel, or prepare bash completion +BAZELISK_VARIANT="amd64" +SHA256SUM="${bazelisk_amd64_sha256}" +if [ "${ARCHITECTURE}" = "arm64" ]; then + BAZELISK_VARIANT="aarch64" + SHA256SUM="${bazelisk_arm64_sha256}" +fi +curl -L "https://github.com/bazelbuild/bazelisk/releases/download/v${bazelisk_version}/bazelisk-${BAZELISK_VARIANT}.deb" -o /tmp/bazelisk.deb +echo "${SHA256SUM} /tmp/bazelisk.deb" | sha256sum -c - || exit -1 +apt-get install -y --no-install-recommends --fix-broken /tmp/bazelisk.deb +rm /tmp/bazelisk.deb + +# Pre-install a fixed Bazel version, setup the bash command completion +USE_BAZEL_VERSION=${bazel_version} + +bazel help completion bash > /tmp/bazel-complete.bash +ls -lah /tmp/bazel-complete.bash +mkdir -p /etc/bash_completion.d +mv /tmp/bazel-complete.bash /etc/bash_completion.d/bazel-complete.bash +sh -c "echo 'USE_BAZEL_VERSION=${bazel_version}' >> /etc/profile.d/bazel.sh" + + # Starlark Language Server, directly from GitHub (apparently no APT repository available) STARPLS_VARIANT="amd64" SHA256SUM="${starpls_amd64_sha256}" diff --git a/src/s-core-devcontainer/.devcontainer/s-core-local/install_matching_bazel_version.sh b/src/s-core-devcontainer/.devcontainer/s-core-local/install_matching_bazel_version.sh index c3b1c76..642fbff 100755 --- a/src/s-core-devcontainer/.devcontainer/s-core-local/install_matching_bazel_version.sh +++ b/src/s-core-devcontainer/.devcontainer/s-core-local/install_matching_bazel_version.sh @@ -1,6 +1,10 @@ #!/usr/bin/env bash set -eo pipefail -if [ -f .bazelversion ] && [ "$(cat .bazelversion)" != "$(dpkg --list | grep 'ii bazel ' | awk '{print $3}')" ]; then - sudo apt-get update && sudo apt-get install -y --allow-downgrades bazel=$(cat .bazelversion) +if [ -f .bazelversion ] && [ "$(cat .bazelversion)" != "$(bazel version | grep 'Build label:' | awk '{print $3}')" ]; then + # Pre-install the matching Bazel version, setup the bash command completion + USE_BAZEL_VERSION=$(cat .bazelversion) + bazel help completion bash > /tmp/bazel-complete.bash + sudo mv /tmp/bazel-complete.bash /etc/bash_completion.d/bazel-complete.bash + sudo sed -i '/^USE_BAZEL_VERSION=/c\USE_BAZEL_VERSION=${USE_BAZEL_VERSION}' /etc/profile.d/bazel.sh || true fi diff --git a/src/s-core-devcontainer/.devcontainer/s-core-local/versions.yaml b/src/s-core-devcontainer/.devcontainer/s-core-local/versions.yaml index 3a17b13..f6e7873 100644 --- a/src/s-core-devcontainer/.devcontainer/s-core-local/versions.yaml +++ b/src/s-core-devcontainer/.devcontainer/s-core-local/versions.yaml @@ -10,6 +10,22 @@ qemu_system_arm: sshpass: version: 1.09 +bazel: + # https://github.com/bazelbuild/bazel/releases -- latest version as of 2025-09-24 + version: 8.4.1 + # no need to define sha256 here, as bazel is installed via bazelisk + +bazelisk: + version: 1.27.0 + amd64: + # The following sha256sums are for the deb package bazelisk__amd64.deb + # It is generated by running 'sha256sum bazelisk__amd64.deb' + sha256: d8b00ea975c823e15263c80200ac42979e17368547fbff4ab177af035badfa83 + arm64: + # The following sha256sums are for the deb package bazelisk__arm64.deb + # It is generated by running 'sha256sum bazelisk__arm64.deb' + sha256: 173c5b367b485a30ce58c1d0d560b39d257a2d7a3c859c45d7d05eb61605a2a1 + starpls: version: 0.1.22 amd64: diff --git a/src/s-core-devcontainer/test-project/test.sh b/src/s-core-devcontainer/test-project/test.sh index bab7339..9e05d9c 100755 --- a/src/s-core-devcontainer/test-project/test.sh +++ b/src/s-core-devcontainer/test-project/test.sh @@ -17,6 +17,7 @@ check "validate clang-tidy is working and has the correct version" bash -c "clan check "validate clang is working and has the correct version" bash -c "clang --version | grep '20.1.8'" # Bazel tooling +check "validate bazel is working and has the correct version" bash -c "bazel version | grep '8.4.1'" check "validate bazelisk is working and has the correct version" bash -c "bazelisk version | grep '1.27.0'" check "validate buildifier is working and has the correct version" bash -c "buildifier --version | grep '8.2.1'" From a0013b9b85eafe30ab6836071241af531a721d89 Mon Sep 17 00:00:00 2001 From: Oliver Pajonk Date: Thu, 2 Oct 2025 09:16:21 +0000 Subject: [PATCH 04/19] fix variant name --- src/s-core-devcontainer/.devcontainer/s-core-local/install.sh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/s-core-devcontainer/.devcontainer/s-core-local/install.sh b/src/s-core-devcontainer/.devcontainer/s-core-local/install.sh index a593c3b..997372f 100755 --- a/src/s-core-devcontainer/.devcontainer/s-core-local/install.sh +++ b/src/s-core-devcontainer/.devcontainer/s-core-local/install.sh @@ -37,7 +37,7 @@ apt-get install -y protobuf-compiler="${protobuf_compiler_version}*" BAZELISK_VARIANT="amd64" SHA256SUM="${bazelisk_amd64_sha256}" if [ "${ARCHITECTURE}" = "arm64" ]; then - BAZELISK_VARIANT="aarch64" + BAZELISK_VARIANT="arm64" SHA256SUM="${bazelisk_arm64_sha256}" fi curl -L "https://github.com/bazelbuild/bazelisk/releases/download/v${bazelisk_version}/bazelisk-${BAZELISK_VARIANT}.deb" -o /tmp/bazelisk.deb @@ -68,7 +68,6 @@ chmod +x /usr/local/bin/starpls # Code completion for C++ code of Bazel projects # (see https://github.com/kiron1/bazel-compile-commands) -# The version is pinned to a specific release, and the SHA256 checksum is provided by the devcontainer-features.json file. source /etc/lsb-release 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 # Extract correct sha256 for current DISTRIB_CODENAME and check @@ -82,7 +81,6 @@ rm /tmp/bazel-compile-commands.deb # Code completion for Rust code of Bazel projects (language server part) # (see https://bazelbuild.github.io/rules_rust/rust_analyzer.html and https://rust-analyzer.github.io/book/rust_analyzer_binary.html) -# The version is pinned to a specific release, and the SHA256 checksum is provided by the devcontainer-features.json file. # NOTE: For an unknown reason, rust-analyzer uses dates for downloading of releases, while the executable reports an actual release. RUST_ANALYZER_VARIANT="x86_64" SHA256SUM="${rust_analyzer_amd64_sha256}" From fee872a1d7799d9cdbfe7ffee39a60913e7addf1 Mon Sep 17 00:00:00 2001 From: Oliver Pajonk Date: Thu, 2 Oct 2025 09:16:36 +0000 Subject: [PATCH 05/19] exchange build order more convenient --- scripts/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/build.sh b/scripts/build.sh index 54a85ce..b1e4690 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash set -euxo pipefail -devcontainer build --platform linux/aarch64 --workspace-folder src/s-core-devcontainer --image-name ghcr.io/eclipse-score/devcontainer:latest --cache-from ghcr.io/eclipse-score/devcontainer devcontainer build --platform linux/amd64 --workspace-folder src/s-core-devcontainer --image-name ghcr.io/eclipse-score/devcontainer:latest --cache-from ghcr.io/eclipse-score/devcontainer +devcontainer build --platform linux/aarch64 --workspace-folder src/s-core-devcontainer --image-name ghcr.io/eclipse-score/devcontainer:latest --cache-from ghcr.io/eclipse-score/devcontainer From b7c83fa0c3892cce4187f69b40d0c507b69949be Mon Sep 17 00:00:00 2001 From: Oliver Pajonk Date: Thu, 2 Oct 2025 11:51:50 +0000 Subject: [PATCH 06/19] export the version --- src/s-core-devcontainer/.devcontainer/s-core-local/install.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/s-core-devcontainer/.devcontainer/s-core-local/install.sh b/src/s-core-devcontainer/.devcontainer/s-core-local/install.sh index 997372f..f39f748 100755 --- a/src/s-core-devcontainer/.devcontainer/s-core-local/install.sh +++ b/src/s-core-devcontainer/.devcontainer/s-core-local/install.sh @@ -46,8 +46,7 @@ apt-get install -y --no-install-recommends --fix-broken /tmp/bazelisk.deb rm /tmp/bazelisk.deb # Pre-install a fixed Bazel version, setup the bash command completion -USE_BAZEL_VERSION=${bazel_version} - +export USE_BAZEL_VERSION=${bazel_version} bazel help completion bash > /tmp/bazel-complete.bash ls -lah /tmp/bazel-complete.bash mkdir -p /etc/bash_completion.d From ea41290a1b0adba8e6c6270d28ed0e4c2cff77ab Mon Sep 17 00:00:00 2001 From: Oliver Pajonk Date: Thu, 2 Oct 2025 13:47:26 +0000 Subject: [PATCH 07/19] move checks and installation of all Bazel-related tools to local feature --- .../.devcontainer/s-core-local/install.sh | 11 +++++++++++ .../s-core-local/tests/test_default.sh | 3 +++ .../.devcontainer/s-core-local/versions.yaml | 13 +++++++++++++ src/s-core-devcontainer/test-project/test.sh | 5 ----- 4 files changed, 27 insertions(+), 5 deletions(-) diff --git a/src/s-core-devcontainer/.devcontainer/s-core-local/install.sh b/src/s-core-devcontainer/.devcontainer/s-core-local/install.sh index f39f748..d312d00 100755 --- a/src/s-core-devcontainer/.devcontainer/s-core-local/install.sh +++ b/src/s-core-devcontainer/.devcontainer/s-core-local/install.sh @@ -53,6 +53,17 @@ mkdir -p /etc/bash_completion.d mv /tmp/bazel-complete.bash /etc/bash_completion.d/bazel-complete.bash sh -c "echo 'USE_BAZEL_VERSION=${bazel_version}' >> /etc/profile.d/bazel.sh" +# Buildifier, directly from GitHub (apparently no APT repository available) +# The version is pinned to a specific release, and the SHA256 checksum is provided by the devcontainer-features.json file. +BUILDIFIER_VARIANT="amd64" +SHA256SUM="${buildifier_amd64_sha256}" +if [ "${ARCHITECTURE}" = "arm64" ]; then + BUILDIFIER_VARIANT="arm64" + SHA256SUM="${buildifier_arm64_sha256}" +fi +curl -L "https://github.com/bazelbuild/buildtools/releases/download/v${buildifier_version}/buildifier-linux-${BUILDIFIER_VARIANT}" -o /usr/local/bin/buildifier +echo "${SHA256SUM} /usr/local/bin/buildifier" | sha256sum -c - || exit -1 +chmod +x /usr/local/bin/buildifier # Starlark Language Server, directly from GitHub (apparently no APT repository available) STARPLS_VARIANT="amd64" diff --git a/src/s-core-devcontainer/.devcontainer/s-core-local/tests/test_default.sh b/src/s-core-devcontainer/.devcontainer/s-core-local/tests/test_default.sh index 30eb727..d9478cb 100755 --- a/src/s-core-devcontainer/.devcontainer/s-core-local/tests/test_default.sh +++ b/src/s-core-devcontainer/.devcontainer/s-core-local/tests/test_default.sh @@ -14,6 +14,9 @@ check "validate graphviz has the correct version" bash -c "dpkg -s graphviz | gr check "validate protoc is working and has the correct version" bash -c "protoc --version | grep 'libprotoc ${protobuf_compiler_version}'" # Bazel-related tools +check "validate bazelisk is working and has the correct version" bash -c "bazelisk version | grep '${bazelisk_version}'" +check "validate bazel is working and has the correct version" bash -c "bazel version | grep '${bazel_version}'" +check "validate buildifier is working and has the correct version" bash -c "buildifier --version | grep '${buildifier_version}'" check "validate starpls is working and has the correct version" bash -c "starpls version | grep '${starpls_version}'" check "validate bazel-compile-commands is working and has the correct version" bash -c "bazel-compile-commands --version 2>&1 | grep '${bazel_compile_commands_version}'" diff --git a/src/s-core-devcontainer/.devcontainer/s-core-local/versions.yaml b/src/s-core-devcontainer/.devcontainer/s-core-local/versions.yaml index f6e7873..8fc03bf 100644 --- a/src/s-core-devcontainer/.devcontainer/s-core-local/versions.yaml +++ b/src/s-core-devcontainer/.devcontainer/s-core-local/versions.yaml @@ -15,6 +15,19 @@ bazel: version: 8.4.1 # no need to define sha256 here, as bazel is installed via bazelisk +buildifier: + version: 8.2.1 + amd64: + # The following sha256sum is for the binary buildifier-linux-amd64 + # from the GitHub release page of buildtools + # It is generated by running 'sha256sum buildifier-linux-amd64' + sha256: 6ceb7b0ab7cf66fceccc56a027d21d9cc557a7f34af37d2101edb56b92fcfa1a + arm64: + # The following sha256sum is for the binary buildifier-linux-arm64 + # from the GitHub release page of buildtools + # It is generated by running 'sha256sum buildifier-linux-arm64' + sha256: 3baa1cf7eb41d51f462fdd1fff3a6a4d81d757275d05b2dd5f48671284e9a1a5 + bazelisk: version: 1.27.0 amd64: diff --git a/src/s-core-devcontainer/test-project/test.sh b/src/s-core-devcontainer/test-project/test.sh index 9e05d9c..1b1d94e 100755 --- a/src/s-core-devcontainer/test-project/test.sh +++ b/src/s-core-devcontainer/test-project/test.sh @@ -16,11 +16,6 @@ check "validate clang-format is working and has the correct version" bash -c "cl 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'" -# Bazel tooling -check "validate bazel is working and has the correct version" bash -c "bazel version | grep '8.4.1'" -check "validate bazelisk is working and has the correct version" bash -c "bazelisk version | grep '1.27.0'" -check "validate buildifier is working and has the correct version" bash -c "buildifier --version | grep '8.2.1'" - # Tests from the local s-core-local feature source /devcontainer/features/s-core-local/tests/test_default.sh From 8641f0db16dc69dc007816520e0fadd63d955ef6 Mon Sep 17 00:00:00 2001 From: Oliver Pajonk Date: Thu, 2 Oct 2025 14:21:38 +0000 Subject: [PATCH 08/19] add override feature install order for s-core-local development convenience --- .../.devcontainer/devcontainer.json | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/s-core-devcontainer/.devcontainer/devcontainer.json b/src/s-core-devcontainer/.devcontainer/devcontainer.json index f6970d6..c1e446a 100644 --- a/src/s-core-devcontainer/.devcontainer/devcontainer.json +++ b/src/s-core-devcontainer/.devcontainer/devcontainer.json @@ -31,6 +31,16 @@ }, "./s-core-local": {} }, + "overrideFeatureInstallOrder": [ + // this order makes it more convenient to develop the s-core-local feature, since it will be installed last + // which means changes to it will be applied without needing to rebuild all other features + "ghcr.io/devcontainers/features/git", + "ghcr.io/devcontainers/features/git-lfs", + "ghcr.io/devcontainers/features/common-utils", + "ghcr.io/devcontainers-community/features/llvm", + "ghcr.io/devcontainers/features/python", + "./s-core-local" + ], "remoteUser": "vscode", "customizations": { "vscode": { From 7e9d422b286245621b5245427edc1d2b6988c38b Mon Sep 17 00:00:00 2001 From: Oliver Pajonk Date: Thu, 2 Oct 2025 14:21:51 +0000 Subject: [PATCH 09/19] fix: correct export syntax for USE_BAZEL_VERSION in profile script --- src/s-core-devcontainer/.devcontainer/s-core-local/install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/s-core-devcontainer/.devcontainer/s-core-local/install.sh b/src/s-core-devcontainer/.devcontainer/s-core-local/install.sh index d312d00..856c856 100755 --- a/src/s-core-devcontainer/.devcontainer/s-core-local/install.sh +++ b/src/s-core-devcontainer/.devcontainer/s-core-local/install.sh @@ -51,7 +51,7 @@ bazel help completion bash > /tmp/bazel-complete.bash ls -lah /tmp/bazel-complete.bash mkdir -p /etc/bash_completion.d mv /tmp/bazel-complete.bash /etc/bash_completion.d/bazel-complete.bash -sh -c "echo 'USE_BAZEL_VERSION=${bazel_version}' >> /etc/profile.d/bazel.sh" +sh -c "echo 'export USE_BAZEL_VERSION=${bazel_version}' >> /etc/profile.d/bazel.sh" # Buildifier, directly from GitHub (apparently no APT repository available) # The version is pinned to a specific release, and the SHA256 checksum is provided by the devcontainer-features.json file. From 8d44935e1242c86d5e789d36384649801a04180d Mon Sep 17 00:00:00 2001 From: Oliver Pajonk Date: Mon, 6 Oct 2025 07:24:46 +0000 Subject: [PATCH 10/19] Switch to multiarch builder --- .github/workflows/ci.yaml | 3 +++ .github/workflows/release.yaml | 3 +++ scripts/build.sh | 3 +-- scripts/create_builder.sh | 4 ++++ scripts/publish.sh | 6 +----- 5 files changed, 12 insertions(+), 7 deletions(-) create mode 100755 scripts/create_builder.sh diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 0f3ea2a..d0ad4e2 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -41,6 +41,9 @@ jobs: # Check pre-commit run --show-diff-on-failure --color=always --all-files || exit -1 + # Create builder for multi-arch builds + ./scripts/create_builder.sh + # Build ./scripts/build.sh diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index bcbdb49..5c493ed 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -36,6 +36,9 @@ jobs: # Check pre-commit run --show-diff-on-failure --color=always --all-files || exit -1 + # Create builder for multi-arch builds + ./scripts/create_builder.sh + # Build ./scripts/build.sh diff --git a/scripts/build.sh b/scripts/build.sh index b1e4690..0f53934 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -1,5 +1,4 @@ #!/usr/bin/env bash set -euxo pipefail -devcontainer build --platform linux/amd64 --workspace-folder src/s-core-devcontainer --image-name ghcr.io/eclipse-score/devcontainer:latest --cache-from ghcr.io/eclipse-score/devcontainer -devcontainer build --platform linux/aarch64 --workspace-folder src/s-core-devcontainer --image-name ghcr.io/eclipse-score/devcontainer:latest --cache-from ghcr.io/eclipse-score/devcontainer +devcontainer build --platform linux/amd64,linux/aarch64 --workspace-folder src/s-core-devcontainer --image-name ghcr.io/eclipse-score/devcontainer:latest --cache-from ghcr.io/eclipse-score/devcontainer diff --git a/scripts/create_builder.sh b/scripts/create_builder.sh new file mode 100755 index 0000000..cd9366a --- /dev/null +++ b/scripts/create_builder.sh @@ -0,0 +1,4 @@ +#!/usr/bin/env bash +set -euxo pipefail + +docker buildx create --name multiarch --driver docker-container --use diff --git a/scripts/publish.sh b/scripts/publish.sh index b8e7ad7..c2a980b 100755 --- a/scripts/publish.sh +++ b/scripts/publish.sh @@ -3,8 +3,4 @@ set -euxo pipefail TAG="${1:-latest}" -if [[ "$TAG" != "latest" ]]; then - docker tag "ghcr.io/eclipse-score/devcontainer:latest" "ghcr.io/eclipse-score/devcontainer:${TAG}" -fi - -docker push "ghcr.io/eclipse-score/devcontainer:${TAG}" +devcontainer build --push --platform linux/aarch64,linux/amd64 --workspace-folder src/s-core-devcontainer --image-name "ghcr.io/eclipse-score/devcontainer:${TAG}" --cache-from ghcr.io/eclipse-score/devcontainer From 372f2c6d0988409bd1a7f0f30decfed146d74525 Mon Sep 17 00:00:00 2001 From: Oliver Pajonk Date: Mon, 6 Oct 2025 07:41:10 +0000 Subject: [PATCH 11/19] split in two calls, one per platform --- scripts/build.sh | 3 ++- scripts/publish.sh | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/build.sh b/scripts/build.sh index 0f53934..54a85ce 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -1,4 +1,5 @@ #!/usr/bin/env bash set -euxo pipefail -devcontainer build --platform linux/amd64,linux/aarch64 --workspace-folder src/s-core-devcontainer --image-name ghcr.io/eclipse-score/devcontainer:latest --cache-from ghcr.io/eclipse-score/devcontainer +devcontainer build --platform linux/aarch64 --workspace-folder src/s-core-devcontainer --image-name ghcr.io/eclipse-score/devcontainer:latest --cache-from ghcr.io/eclipse-score/devcontainer +devcontainer build --platform linux/amd64 --workspace-folder src/s-core-devcontainer --image-name ghcr.io/eclipse-score/devcontainer:latest --cache-from ghcr.io/eclipse-score/devcontainer diff --git a/scripts/publish.sh b/scripts/publish.sh index c2a980b..9fb3395 100755 --- a/scripts/publish.sh +++ b/scripts/publish.sh @@ -3,4 +3,5 @@ set -euxo pipefail TAG="${1:-latest}" -devcontainer build --push --platform linux/aarch64,linux/amd64 --workspace-folder src/s-core-devcontainer --image-name "ghcr.io/eclipse-score/devcontainer:${TAG}" --cache-from ghcr.io/eclipse-score/devcontainer +devcontainer build --push --platform linux/aarch64 --workspace-folder src/s-core-devcontainer --image-name "ghcr.io/eclipse-score/devcontainer:${TAG}" --cache-from ghcr.io/eclipse-score/devcontainer +devcontainer build --push --platform linux/amd64 --workspace-folder src/s-core-devcontainer --image-name "ghcr.io/eclipse-score/devcontainer:${TAG}" --cache-from ghcr.io/eclipse-score/devcontainer From 85dc9cf3c287d424c6bb2d626a3e538610893b4d Mon Sep 17 00:00:00 2001 From: Oliver Pajonk Date: Mon, 6 Oct 2025 10:31:59 +0000 Subject: [PATCH 12/19] test-publish --- .github/workflows/ci.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index d0ad4e2..19d064a 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -53,7 +53,7 @@ jobs: # Upload devcontainer from src/s-core-devcontainer - name: Publish uses: devcontainers/ci@v0.3 - if: github.ref == 'refs/heads/main' + #if: github.ref == 'refs/heads/main' with: # We do not use the push feature of devcontainers/ci here, since that would push the wrong container. # Instead, we use the publish script which pushes the correct container (residing in src/s-core-devcontainer). @@ -61,4 +61,4 @@ jobs: runCmd: | # manually login to ghcr.io for publishing echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin - ./scripts/publish.sh "latest" + ./scripts/publish.sh "0.1.0" From 188f40396f6935ddc69d66f9b8655e07178d46ff Mon Sep 17 00:00:00 2001 From: Oliver Pajonk Date: Mon, 6 Oct 2025 22:06:46 +0200 Subject: [PATCH 13/19] revert --- .github/workflows/ci.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 19d064a..d0ad4e2 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -53,7 +53,7 @@ jobs: # Upload devcontainer from src/s-core-devcontainer - name: Publish uses: devcontainers/ci@v0.3 - #if: github.ref == 'refs/heads/main' + if: github.ref == 'refs/heads/main' with: # We do not use the push feature of devcontainers/ci here, since that would push the wrong container. # Instead, we use the publish script which pushes the correct container (residing in src/s-core-devcontainer). @@ -61,4 +61,4 @@ jobs: runCmd: | # manually login to ghcr.io for publishing echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin - ./scripts/publish.sh "0.1.0" + ./scripts/publish.sh "latest" From 3192e3de52e2d3c0f073bb8c5bf35c8d672744aa Mon Sep 17 00:00:00 2001 From: Lutz Reinhardt Date: Tue, 7 Oct 2025 11:09:02 +0000 Subject: [PATCH 14/19] prepare docker buildx in devcontainer --- .devcontainer/post_create_command.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.devcontainer/post_create_command.sh b/.devcontainer/post_create_command.sh index ebeac73..161532c 100755 --- a/.devcontainer/post_create_command.sh +++ b/.devcontainer/post_create_command.sh @@ -1,3 +1,5 @@ #!/usr/bin/env bash npm install -g @devcontainers/cli pre-commit install + +scripts/create_builder.sh From ed066d557eb8aa13f860f814879b4a2c568d0d9b Mon Sep 17 00:00:00 2001 From: Oliver Pajonk Date: Fri, 10 Oct 2025 10:06:53 +0000 Subject: [PATCH 15/19] Refactor build and publish scripts to use consistent image naming and improve platform handling --- scripts/build.sh | 4 ++-- scripts/publish.sh | 18 +++++++++++++++--- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/scripts/build.sh b/scripts/build.sh index 54a85ce..e4a23ff 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash set -euxo pipefail -devcontainer build --platform linux/aarch64 --workspace-folder src/s-core-devcontainer --image-name ghcr.io/eclipse-score/devcontainer:latest --cache-from ghcr.io/eclipse-score/devcontainer -devcontainer build --platform linux/amd64 --workspace-folder src/s-core-devcontainer --image-name ghcr.io/eclipse-score/devcontainer:latest --cache-from ghcr.io/eclipse-score/devcontainer +devcontainer build --platform linux/aarch64 --workspace-folder src/s-core-devcontainer --image-name ghcr.io/eclipse-score/devcontainer --cache-from ghcr.io/eclipse-score/devcontainer +devcontainer build --platform linux/amd64 --workspace-folder src/s-core-devcontainer --image-name ghcr.io/eclipse-score/devcontainer --cache-from ghcr.io/eclipse-score/devcontainer diff --git a/scripts/publish.sh b/scripts/publish.sh index 9fb3395..6794730 100755 --- a/scripts/publish.sh +++ b/scripts/publish.sh @@ -1,7 +1,19 @@ #!/usr/bin/env bash set -euxo pipefail -TAG="${1:-latest}" +IMAGES=("--image-name \"ghcr.io/eclipse-score/devcontainer:main\"") +if [ "$#" -gt 0 ]; then + IMAGES=() + for arg in "$@"; do + IMAGES+=("--image-name \"ghcr.io/eclipse-score/devcontainer:${arg}\"") + done +fi -devcontainer build --push --platform linux/aarch64 --workspace-folder src/s-core-devcontainer --image-name "ghcr.io/eclipse-score/devcontainer:${TAG}" --cache-from ghcr.io/eclipse-score/devcontainer -devcontainer build --push --platform linux/amd64 --workspace-folder src/s-core-devcontainer --image-name "ghcr.io/eclipse-score/devcontainer:${TAG}" --cache-from ghcr.io/eclipse-score/devcontainer +DEVCONTAINER_CALL="devcontainer build --push --workspace-folder src/s-core-devcontainer --cache-from ghcr.io/eclipse-score/devcontainer" + +for IMAGE in "${IMAGES[@]}"; do + DEVCONTAINER_CALL+=" $IMAGE" +done + +eval "$DEVCONTAINER_CALL --platform linux/amd64" +eval "$DEVCONTAINER_CALL --platform linux/arm64" From 8762a58efe2ddcde1629d7b21d888ac4af4cd1b1 Mon Sep 17 00:00:00 2001 From: Oliver Pajonk Date: Fri, 10 Oct 2025 10:28:39 +0000 Subject: [PATCH 16/19] uses consistent naming --- scripts/publish.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/publish.sh b/scripts/publish.sh index 6794730..6bca3f4 100755 --- a/scripts/publish.sh +++ b/scripts/publish.sh @@ -15,5 +15,5 @@ for IMAGE in "${IMAGES[@]}"; do DEVCONTAINER_CALL+=" $IMAGE" done +eval "$DEVCONTAINER_CALL --platform linux/aarch64" eval "$DEVCONTAINER_CALL --platform linux/amd64" -eval "$DEVCONTAINER_CALL --platform linux/arm64" From fc99f426c627a8479e063bc809daa91d1f22e80a Mon Sep 17 00:00:00 2001 From: Oliver Pajonk Date: Fri, 10 Oct 2025 10:30:41 +0000 Subject: [PATCH 17/19] use tags as discussed --- .github/workflows/ci.yaml | 2 +- .github/workflows/release.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index d0ad4e2..24fde92 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -61,4 +61,4 @@ jobs: runCmd: | # manually login to ghcr.io for publishing echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin - ./scripts/publish.sh "latest" + ./scripts/publish.sh "main" diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 5c493ed..5cc6630 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -56,4 +56,4 @@ jobs: # manually login to ghcr.io for publishing echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin # Note: "${{ github.ref_name }}" will be the tag name, e.g., "1.0.0" - ./scripts/publish.sh "${{ github.ref_name }}" + ./scripts/publish.sh "${{ github.ref_name }}" "latest" From bfee0133a964b8f00389bd2f07401137ce6c113a Mon Sep 17 00:00:00 2001 From: Oliver Pajonk Date: Fri, 10 Oct 2025 10:40:58 +0000 Subject: [PATCH 18/19] Add Rust feature to feature installation order in devcontainer configuration --- src/s-core-devcontainer/.devcontainer/devcontainer.json | 1 + 1 file changed, 1 insertion(+) diff --git a/src/s-core-devcontainer/.devcontainer/devcontainer.json b/src/s-core-devcontainer/.devcontainer/devcontainer.json index 4739cdb..4b774fa 100644 --- a/src/s-core-devcontainer/.devcontainer/devcontainer.json +++ b/src/s-core-devcontainer/.devcontainer/devcontainer.json @@ -49,6 +49,7 @@ "ghcr.io/devcontainers/features/git-lfs", "ghcr.io/devcontainers/features/common-utils", "ghcr.io/devcontainers-community/features/llvm", + "ghcr.io/devcontainers/features/rust", "ghcr.io/devcontainers/features/python", "./s-core-local" ], From 6f8c4329bad6267a5e1281cddcc2359dff96bc25 Mon Sep 17 00:00:00 2001 From: Oliver Pajonk Date: Fri, 10 Oct 2025 10:42:11 +0000 Subject: [PATCH 19/19] Clarify version usage in README to specify 'main' and 'latest' for container versioning --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a984f10..be12767 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ It should contain the following: ```` The `` must be a [valid, published release](https://github.com/eclipse-score/devcontainer/tags). -You can also use `latest` as `` to automatically follow the `main` branch - but be aware that this can result in undesired updates. +You can also use `main` as `` to automatically follow the `main` branch, and `latest` to follow release tags - but be aware that this can result in undesired updates. To start using the container, click the **Reopen in Container** button when prompted by Visual Studio Code: