Skip to content

Commit

Permalink
promote LLVM 17 to stable, make LLVM 18 dev (#105)
Browse files Browse the repository at this point in the history
* promote LLVM 17 to stable, make LLVM 18 dev

* bump llvm_prev and llvm_curr versions

* fix llvm feature tests

* install packages first
  • Loading branch information
trxcllnt authored Jul 31, 2023
1 parent 5b66d09 commit da31b0d
Show file tree
Hide file tree
Showing 7 changed files with 56 additions and 29 deletions.
2 changes: 1 addition & 1 deletion features/src/llvm/devcontainer-feature.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down
24 changes: 12 additions & 12 deletions features/src/llvm/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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" \
Expand All @@ -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;
Expand Down
5 changes: 3 additions & 2 deletions features/src/llvm/llvm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
24 changes: 24 additions & 0 deletions features/test/llvm/llvm_dev.sh
Original file line number Diff line number Diff line change
@@ -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
20 changes: 10 additions & 10 deletions features/test/llvm/scenarios.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
}
Expand Down
6 changes: 4 additions & 2 deletions matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
Expand Down Expand Up @@ -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}
Expand Down

0 comments on commit da31b0d

Please sign in to comment.