diff --git a/features/src/llvm/devcontainer-feature.json b/features/src/llvm/devcontainer-feature.json index 08903497..5af48ec7 100644 --- a/features/src/llvm/devcontainer-feature.json +++ b/features/src/llvm/devcontainer-feature.json @@ -1,7 +1,7 @@ { "name": "LLVM compilers and tools", "id": "llvm", - "version": "23.8.2", + "version": "23.8.3", "description": "A feature to install LLVM compilers and tools", "options": { "version": { diff --git a/features/src/llvm/install.sh b/features/src/llvm/install.sh index 49b7e8db..bc9737ff 100755 --- a/features/src/llvm/install.sh +++ b/features/src/llvm/install.sh @@ -9,6 +9,18 @@ cd "$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"; LLVM_VERSION="${VERSION:-}"; +check_packages \ + gpg \ + wget \ + apt-utils \ + lsb-release \ + gettext-base \ + bash-completion \ + ca-certificates \ + apt-transport-https \ + software-properties-common \ + ; + if [[ -z "$LLVM_VERSION" \ || "$LLVM_VERSION" == "latest" \ || "$LLVM_VERSION" == "dev" \ @@ -23,18 +35,6 @@ if [[ -z "$LLVM_VERSION" \ LLVM_VERSION="$(echo $LLVM_VERSION | grep -oP '[0-9]+')"; fi -check_packages \ - gpg \ - wget \ - apt-utils \ - lsb-release \ - gettext-base \ - bash-completion \ - ca-certificates \ - apt-transport-https \ - software-properties-common \ - ; - echo "Installing llmv-${LLVM_VERSION} compilers and tools"; ./llvm.sh $LLVM_VERSION all; diff --git a/features/src/llvm/llvm.sh b/features/src/llvm/llvm.sh index fb5ce949..2017d699 100755 --- a/features/src/llvm/llvm.sh +++ b/features/src/llvm/llvm.sh @@ -20,7 +20,7 @@ usage() { exit 1; } -CURRENT_LLVM_STABLE=16 +CURRENT_LLVM_STABLE=17 BASE_URL="http://apt.llvm.org" # Check for required tools @@ -125,7 +125,8 @@ LLVM_VERSION_PATTERNS[13]="-13" LLVM_VERSION_PATTERNS[14]="-14" LLVM_VERSION_PATTERNS[15]="-15" LLVM_VERSION_PATTERNS[16]="-16" -LLVM_VERSION_PATTERNS[17]="" +LLVM_VERSION_PATTERNS[17]="-17" +LLVM_VERSION_PATTERNS[18]="" if [ ! ${LLVM_VERSION_PATTERNS[$LLVM_VERSION]+_} ]; then echo "This script does not support LLVM version $LLVM_VERSION" diff --git a/features/test/llvm/llvm_16.sh b/features/test/llvm/llvm_17.sh similarity index 85% rename from features/test/llvm/llvm_16.sh rename to features/test/llvm/llvm_17.sh index f030cfaf..da3494da 100644 --- a/features/test/llvm/llvm_16.sh +++ b/features/test/llvm/llvm_17.sh @@ -16,9 +16,9 @@ source dev-container-features-test-lib # The 'check' command comes from the dev-container-features-test-lib. echo "LLVM_VERSION: $LLVM_VERSION"; -check "version" bash -c "echo '$LLVM_VERSION' | grep '16'"; +check "version" bash -c "echo '$LLVM_VERSION' | grep '17'"; check "clang version" bash -c "clang --version | grep 'clang version $LLVM_VERSION'"; -check "apt repo" grep "llvm-toolchain-$(lsb_release -cs)-16 main" $(find /etc/apt -type f -name '*.list'); +check "apt repo" grep "llvm-toolchain-$(lsb_release -cs)-17 main" $(find /etc/apt -type f -name '*.list'); # Report result # If any of the checks above exited with a non-zero exit code, the test will fail. diff --git a/features/test/llvm/llvm_dev.sh b/features/test/llvm/llvm_dev.sh new file mode 100644 index 00000000..b44906cf --- /dev/null +++ b/features/test/llvm/llvm_dev.sh @@ -0,0 +1,24 @@ +#! /usr/bin/env bash + +# This test can be run with the following command (from the root of this repo) +# ``` +# npx --package=@devcontainers/cli -c 'devcontainer features test \ +# --features llvm \ +# --base-image ubuntu:22.04 .' +# ``` + +set -e + +# Optional: Import test library bundled with the devcontainer CLI +source dev-container-features-test-lib + +# Feature-specific tests +# The 'check' command comes from the dev-container-features-test-lib. + +echo "LLVM_VERSION: $LLVM_VERSION"; +check "clang version" bash -c "clang --version | grep 'clang version $LLVM_VERSION'"; +check "apt repo" grep "llvm-toolchain-$(lsb_release -cs) main" $(find /etc/apt -type f -name '*.list'); + +# Report result +# If any of the checks above exited with a non-zero exit code, the test will fail. +reportResults diff --git a/features/test/llvm/scenarios.json b/features/test/llvm/scenarios.json index 9627d936..4d0290ec 100644 --- a/features/test/llvm/scenarios.json +++ b/features/test/llvm/scenarios.json @@ -23,19 +23,19 @@ } } }, - // "llvm_15": { - // "image": "ubuntu:22.04", - // "features": { - // "llvm": { - // "version": "15" - // } - // } - // }, - "llvm_16": { + "llvm_17": { "image": "ubuntu:22.04", "features": { "llvm": { - "version": "16" + "version": "17" + } + } + }, + "llvm_dev": { + "image": "ubuntu:22.04", + "features": { + "llvm": { + "version": "dev" } } } diff --git a/matrix.yml b/matrix.yml index 659bddad..356a617f 100644 --- a/matrix.yml +++ b/matrix.yml @@ -21,8 +21,9 @@ x-llvm-11: &llvm_11 { name: "llvm", version: "11" } x-llvm-12: &llvm_12 { name: "llvm", version: "12" } x-llvm-13: &llvm_13 { name: "llvm", version: "13" } x-llvm-14: &llvm_14 { name: "llvm", version: "14" } -x-llvm-prev: &llvm_prev { name: "llvm", version: "15" } -x-llvm-curr: &llvm_curr { name: "llvm", version: "16" } +x-llvm-15: &llvm_15 { name: "llvm", version: "15" } +x-llvm-prev: &llvm_prev { name: "llvm", version: "16" } +x-llvm-curr: &llvm_curr { name: "llvm", version: "17" } x-llvm-env: &llvm_env {CC: "clang", CXX: "clang++"} x-nvhpc-prev: &nvhpc_prev { name: "nvhpc", version: "23.3" } @@ -67,6 +68,7 @@ include: - {features: [*nvhpc_curr, *python, *lit], env: *nvhpc_env} - {features: [*gcc_11, *cuda_curr_max, *python, *lit], env: *gcc_env} - {features: [*gcc_12, *cuda_curr_max, *python, *lit], env: *gcc_env} + - {features: [*llvm_15, *cuda_curr_max, *python, *lit], env: *llvm_env} - {features: [*llvm_prev, *cuda_curr_max, *python, *lit], env: *llvm_env} - {features: [*llvm_curr, *cuda_curr_max, *python, *lit], env: *llvm_env} - {features: [*oneapi_2022, *cuda_curr_max, *python, *lit], env: *onapi_env}