Skip to content

Commit 42e0b40

Browse files
authored
Update LLVM versions in tests to 16 (#221)
Updates to 16.0.0 as default, 16.0.5 for Apple Silicon, but keeps 15.0.7 for x86 Apple. Bonus changes: - Include libtinfo5 in test envs - New include dirs format as lib/clang/16/include/
1 parent 5a276de commit 42e0b40

File tree

9 files changed

+41
-36
lines changed

9 files changed

+41
-36
lines changed

Diff for: .github/workflows/tests.yml

+13-3
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ jobs:
3838
bzlmod: false
3939
runs-on: ${{ matrix.os }}
4040
steps:
41+
- if: startsWith(matrix.os, 'ubuntu')
42+
name: Install APT packages
43+
run: sudo apt-get -y install libtinfo5
4144
- uses: actions/checkout@v3
4245
- name: Test
4346
env:
@@ -53,6 +56,9 @@ jobs:
5356
bzlmod: [true, false]
5457
runs-on: ${{ matrix.os }}
5558
steps:
59+
- if: startsWith(matrix.os, 'ubuntu')
60+
name: Install APT packages
61+
run: sudo apt-get -y install libtinfo5
5662
- uses: actions/checkout@v3
5763
- name: Test
5864
env:
@@ -88,19 +94,23 @@ jobs:
8894
abs_paths_test:
8995
runs-on: ubuntu-latest
9096
steps:
97+
- name: Install APT packages
98+
run: sudo apt-get -y install libtinfo5
9199
- uses: actions/checkout@v3
92100
- name: Test
93101
run: tests/scripts/run_tests.sh -t @llvm_toolchain_with_absolute_paths//:cc-toolchain-x86_64-linux
94102
sys_paths_test:
95103
runs-on: ubuntu-latest
96104
steps:
105+
- name: Install APT packages
106+
run: sudo apt-get -y install libtinfo5
97107
- uses: actions/checkout@v3
98108
- name: Download and Extract LLVM distribution
99109
env:
100-
release: llvmorg-15.0.6
101-
archive: clang+llvm-15.0.6-x86_64-linux-gnu-ubuntu-18.04
110+
release: llvmorg-16.0.0
111+
archive: clang+llvm-16.0.0-x86_64-linux-gnu-ubuntu-18.04
102112
ext: .tar.xz
103-
local_path: /tmp/llvm-15
113+
local_path: /tmp/llvm-16
104114
run: wget --no-verbose "https://github.com/llvm/llvm-project/releases/download/${release}/${archive}${ext}" && tar -xf "${archive}${ext}" && mv "${archive}" "${local_path}"
105115
- name: Test
106116
run: tests/scripts/run_tests.sh -t @llvm_toolchain_with_system_llvm//:cc-toolchain-x86_64-linux

Diff for: tests/MODULE.bazel

+8-11
Original file line numberDiff line numberDiff line change
@@ -76,14 +76,15 @@ llvm = use_extension("@toolchains_llvm//toolchain/extensions:llvm.bzl", "llvm")
7676
# llvm_toolchain below, sys_paths_test in the workflows file, and xcompile_test
7777
# through the `llvm_toolchain_with_sysroot` toolchain.
7878
LLVM_VERSION = "15.0.6"
79+
LLVM_VERSIONS = {
80+
"": "16.0.0",
81+
"darwin-aarch64": "16.0.5",
82+
"darwin-x86_64": "15.0.7",
83+
}
7984

8085
llvm.toolchain(
8186
name = "llvm_toolchain",
82-
llvm_versions = {
83-
"": "15.0.6",
84-
"darwin-aarch64": "15.0.7",
85-
"darwin-x86_64": "15.0.7",
86-
},
87+
llvm_versions = LLVM_VERSIONS,
8788
)
8889
use_repo(llvm, "llvm_toolchain", "llvm_toolchain_llvm")
8990

@@ -144,19 +145,15 @@ llvm.toolchain(
144145
llvm_version = LLVM_VERSION,
145146
# For this toolchain to work, the LLVM distribution archive would need to be unpacked here.
146147
# A path in /tmp to be part of system tmp cleanup schedule.
147-
toolchain_roots = {"": "/tmp/llvm-15"},
148+
toolchain_roots = {"": "/tmp/llvm-16"},
148149
)
149150
use_repo(llvm, "llvm_toolchain_with_system_llvm")
150151

151152
# ## Toolchain example with a sysroot.
152153

153154
llvm.toolchain(
154155
name = "llvm_toolchain_with_sysroot",
155-
llvm_versions = {
156-
"": "15.0.6",
157-
"darwin-x86_64": "15.0.7",
158-
"darwin-aarch64": "15.0.7",
159-
},
156+
llvm_versions = LLVM_VERSIONS,
160157
sysroot = {
161158
"linux-x86_64": "@org_chromium_sysroot_linux_x64//:sysroot",
162159
},

Diff for: tests/WORKSPACE

+11-17
Original file line numberDiff line numberDiff line change
@@ -29,26 +29,24 @@ load("@toolchains_llvm//toolchain:rules.bzl", "llvm_toolchain")
2929
# When updating this version, also update the versions associated with
3030
# llvm_toolchain below, sys_paths_test in the workflows file, and xcompile_test
3131
# through the `llvm_toolchain_with_sysroot` toolchain.
32-
LLVM_VERSION = "15.0.6"
32+
LLVM_VERSION = "16.0.0"
33+
34+
LLVM_VERSIONS = {
35+
"": "16.0.0",
36+
"darwin-aarch64": "16.0.5",
37+
"darwin-x86_64": "15.0.7",
38+
}
3339

3440
llvm_toolchain(
3541
name = "llvm_toolchain",
36-
llvm_versions = {
37-
"": "15.0.6",
38-
"darwin-aarch64": "15.0.7",
39-
"darwin-x86_64": "15.0.7",
40-
},
42+
llvm_versions = LLVM_VERSIONS,
4143
)
4244

4345
# Example toolchain with user provided URLs.
4446
# TODO(siddharthab): Add test.
4547
llvm_toolchain(
4648
name = "llvm_toolchain_with_urls",
47-
llvm_versions = {
48-
"": "15.0.6",
49-
"darwin-aarch64": "15.0.7",
50-
"darwin-x86_64": "15.0.7",
51-
},
49+
llvm_versions = LLVM_VERSIONS,
5250
sha256 = {
5351
"": "38bc7f5563642e73e69ac5626724e206d6d539fbef653541b34cae0ba9c3f036",
5452
"darwin-aarch64": "867c6afd41158c132ef05a8f1ddaecf476a26b91c85def8e124414f9a9ba188d",
@@ -96,7 +94,7 @@ llvm_toolchain(
9694
llvm_version = LLVM_VERSION,
9795
# For this toolchain to work, the LLVM distribution archive would need to be unpacked here.
9896
# A path in /tmp to be part of system tmp cleanup schedule.
99-
toolchain_roots = {"": "/tmp/llvm-15"},
97+
toolchain_roots = {"": "/tmp/llvm-16"},
10098
)
10199

102100
## Toolchain example with a sysroot.
@@ -117,11 +115,7 @@ filegroup(
117115

118116
llvm_toolchain(
119117
name = "llvm_toolchain_with_sysroot",
120-
llvm_versions = {
121-
"": "15.0.6",
122-
"darwin-x86_64": "15.0.7",
123-
"darwin-aarch64": "15.0.7",
124-
},
118+
llvm_versions = LLVM_VERSIONS,
125119
sysroot = {
126120
"linux-x86_64": "@org_chromium_sysroot_linux_x64//:sysroot",
127121
},

Diff for: tests/scripts/debian_test.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ set -exuo pipefail
3030
# Common setup
3131
export DEBIAN_FRONTEND=noninteractive
3232
apt-get -qq update
33-
apt-get -qq -y install curl zlib1g-dev >/dev/null
33+
apt-get -qq -y install curl libtinfo5 zlib1g-dev >/dev/null
3434
# The above command gives some verbose output that can not be silenced easily.
3535
# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=288778
3636

Diff for: tests/scripts/fedora_test.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ for image in "${images[@]}"; do
2828
set -exuo pipefail
2929
3030
# Need system glibc headers (e.g. features.h).
31-
dnf install -qy glibc-headers
31+
dnf install -qy glibc-headers ncurses-compat-libs
3232
3333
# Run tests
3434
cd /src

Diff for: tests/scripts/linux_sysroot_test.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ set -exuo pipefail
3030
# Common setup
3131
export DEBIAN_FRONTEND=noninteractive
3232
apt-get -qq update
33-
apt-get -qq -y install curl zlib1g-dev >/dev/null
33+
apt-get -qq -y install curl libtinfo5 zlib1g-dev >/dev/null
3434
# The above command gives some verbose output that can not be silenced easily.
3535
# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=288778
3636

Diff for: tests/scripts/ubuntu_20_04_test.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ set -exuo pipefail
3030
# Common setup
3131
export DEBIAN_FRONTEND=noninteractive
3232
apt-get -qq update
33-
apt-get -qq -y install apt-utils curl pkg-config zip zlib1g-dev unzip python >/dev/null
33+
apt-get -qq -y install apt-utils curl libtinfo5 pkg-config zlib1g-dev >/dev/null
3434
# The above command gives some verbose output that can not be silenced easily.
3535
# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=288778
3636

Diff for: tests/scripts/ubuntu_22_04_test.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ set -exuo pipefail
3030
# Common setup
3131
export DEBIAN_FRONTEND=noninteractive
3232
apt-get -qq update
33-
apt-get -qq -y install curl zlib1g-dev >/dev/null
33+
apt-get -qq -y install curl libtinfo5 zlib1g-dev >/dev/null
3434
# The above command gives some verbose output that can not be silenced easily.
3535
# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=288778
3636

Diff for: toolchain/cc_toolchain_config.bzl

+4
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ def cc_toolchain_config(
4545
host_os_arch_key = _os_arch_pair(host_os, host_arch)
4646
target_os_arch_key = _os_arch_pair(target_os, target_arch)
4747
_check_os_arch_keys([host_os_arch_key, target_os_arch_key])
48+
major_llvm_version = int(llvm_version.split(".")[0])
4849

4950
# A bunch of variables that get passed straight through to
5051
# `create_cc_toolchain_config_info`.
@@ -269,6 +270,9 @@ def cc_toolchain_config(
269270
toolchain_path_prefix + "lib/clang/{}/include".format(llvm_version),
270271
toolchain_path_prefix + "lib/clang/{}/share".format(llvm_version),
271272
toolchain_path_prefix + "lib64/clang/{}/include".format(llvm_version),
273+
toolchain_path_prefix + "lib/clang/{}/include".format(major_llvm_version),
274+
toolchain_path_prefix + "lib/clang/{}/share".format(major_llvm_version),
275+
toolchain_path_prefix + "lib64/clang/{}/include".format(major_llvm_version),
272276
])
273277

274278
sysroot_path = compiler_configuration["sysroot_path"]

0 commit comments

Comments
 (0)