Skip to content

Commit a501102

Browse files
authored
Merge branch 'master' into updates/various
2 parents 9f8acdb + 4532273 commit a501102

24 files changed

+267
-122
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
* @rrbutani @jsharpe @fmeum @helly25
1+
* @rrbutani @jsharpe @fmeum @helly25 @dzbarsky

.github/workflows/tests.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
env:
4242
USE_BAZEL_VERSION: ${{ matrix.bazel_version }}
4343
USE_BZLMOD: ${{ matrix.bzlmod }}
44-
run: tests/scripts/run_tests.sh
44+
run: tests/scripts/run_tests.sh -O
4545
toolchain_test:
4646
strategy:
4747
fail-fast: false
@@ -122,7 +122,7 @@ jobs:
122122
- name: Test
123123
env:
124124
USE_BZLMOD: ${{ matrix.bzlmod }}
125-
run: tests/scripts/run_tests.sh -t @llvm_toolchain_with_absolute_paths//:cc-toolchain-x86_64-linux
125+
run: tests/scripts/run_tests.sh -t @llvm_toolchain_with_absolute_paths//:cc-toolchain-x86_64-linux -O
126126
sys_paths_test:
127127
strategy:
128128
fail-fast: false
@@ -133,6 +133,7 @@ jobs:
133133
- uses: actions/checkout@v5
134134
- run: tests/scripts/ubuntu_install_libtinfo.sh
135135
- name: Download and Extract LLVM distribution
136+
# The downloaded version here must match version specified as '-v' arg to run_tests.sh below.
136137
env:
137138
release: llvmorg-16.0.0
138139
archive: clang+llvm-16.0.0-x86_64-linux-gnu-ubuntu-18.04
@@ -142,4 +143,4 @@ jobs:
142143
- name: Test
143144
env:
144145
USE_BZLMOD: ${{ matrix.bzlmod }}
145-
run: tests/scripts/run_tests.sh -t @llvm_toolchain_with_system_llvm//:cc-toolchain-x86_64-linux
146+
run: tests/scripts/run_tests.sh -t @llvm_toolchain_with_system_llvm//:cc-toolchain-x86_64-linux -v 16.0.0

MODULE.bazel

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ module(
1919
compatibility_level = 0,
2020
)
2121

22-
bazel_dep(name = "bazel_features", version = "1.36.0")
23-
bazel_dep(name = "bazel_skylib", version = "1.5.0")
24-
bazel_dep(name = "aspect_bazel_lib", version = "2.0.0")
25-
bazel_dep(name = "rules_cc", version = "0.2.2")
26-
bazel_dep(name = "platforms", version = "0.0.8")
22+
bazel_dep(name = "bazel_features", version = "1.38.0")
23+
bazel_dep(name = "bazel_skylib", version = "1.8.2")
24+
bazel_dep(name = "aspect_bazel_lib", version = "2.19.3")
25+
bazel_dep(name = "rules_cc", version = "0.2.8")
26+
bazel_dep(name = "platforms", version = "1.0.0")
2727
bazel_dep(name = "helly25_bzl", version = "0.3.1")
2828

2929
bazel_dep(name = "tar.bzl", version = "0.6.0")

tests/BUILD.bazel

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ build_test(
8181
dwp_file(
8282
name = "stdlib.dwp",
8383
src = ":stdlib_bin",
84-
# NOTE: we should eventually we able to drop this; see #109.
84+
# NOTE: we should eventually be able to drop this; see #109.
8585
override_compilation_mode = "dbg",
8686
target_compatible_with = [
8787
"@platforms//os:linux",
@@ -101,6 +101,7 @@ cc_test(
101101
srcs = ["omp_test.c"],
102102
copts = ["-fopenmp"],
103103
linkopts = ["-fopenmp"],
104+
tags = ["manual"],
104105
deps = ["@llvm_toolchain//:omp"],
105106
)
106107

@@ -114,9 +115,19 @@ cc_test(
114115
srcs = ["omp_test.cc"],
115116
copts = ["-fopenmp"],
116117
linkopts = ["-fopenmp"],
118+
tags = ["manual"],
117119
deps = ["@llvm_toolchain//:omp"],
118120
)
119121

122+
test_suite(
123+
name = "omp_tests",
124+
tags = ["manual"],
125+
tests = [
126+
":omp_test",
127+
":omp_test_cc",
128+
],
129+
)
130+
120131
sh_test(
121132
name = "file_dependency_test",
122133
srcs = ["file_dependency_test.sh"],

tests/MODULE.bazel

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,13 @@ llvm = use_extension("@toolchains_llvm//toolchain/extensions:llvm.bzl", "llvm")
6464
# When updating this version, also update the versions associated with
6565
# llvm_toolchain below, sys_paths_test in the workflows file, and xcompile_test
6666
# through the `llvm_toolchain_with_sysroot` toolchain.
67-
# We use C++17 and the first LLVM version with full suppor is 16.0.0.
67+
# We use C++17 and the first LLVM version with full support is 16.0.0.
6868
# We also use C++20 which has reasonable wide support starting with LLVM 17.0.0.
69+
# MacOS X86 does not exist for LLVM 17 or 18, so we allow 19 as well.
70+
# We also allow to override this with a environment LLVM_VERSION for testing.
6971
LLVM_VERSIONS = {
70-
"": "first:>=17.0.0,<18",
72+
"": "getenv(LLVM_VERSION,latest:>=17.0.0,<20)",
73+
"darwin-x86_64": "15.0.7", # Verify this works as opposed to using one version.
7174
}
7275

7376
llvm.toolchain(
@@ -148,9 +151,10 @@ llvm.toolchain_root(
148151
use_repo(llvm, "llvm_toolchain_with_absolute_paths")
149152

150153
# Toolchain example with system LLVM; tested in GitHub CI.
154+
# The llvm_version must match the version specified in .github/workflows/tests.yml: sys_paths_test
151155
llvm.toolchain(
152156
name = "llvm_toolchain_with_system_llvm",
153-
llvm_versions = LLVM_VERSIONS,
157+
llvm_versions = {"": "16.0.0"},
154158
)
155159

156160
# For this toolchain to work, the LLVM distribution archive would need to be unpacked here.

tests/WORKSPACE

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,17 @@ local_repository(
2121

2222
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
2323

24+
http_archive(
25+
name = "bazel_features",
26+
sha256 = "07271d0f6b12633777b69020c4cb1eb67b1939c0cf84bb3944dc85cc250c0c01",
27+
strip_prefix = "bazel_features-1.38.0",
28+
url = "https://github.com/bazel-contrib/bazel_features/releases/download/v1.38.0/bazel_features-v1.38.0.tar.gz",
29+
)
30+
31+
load("@bazel_features//:deps.bzl", "bazel_features_deps")
32+
33+
bazel_features_deps()
34+
2435
http_archive(
2536
name = "aspect_bazel_lib",
2637
sha256 = "6fd3b1e1a38ca744f9664be4627ced80895c7d2ee353891c172f1ab61309c933",
@@ -50,8 +61,11 @@ load("@toolchains_llvm//toolchain:rules.bzl", "llvm_toolchain")
5061
# through the `llvm_toolchain_with_sysroot` toolchain.
5162
# We use C++17 and the first LLVM version with full suppor is 16.0.0.
5263
# We also use C++20 which has reasonable wide support starting with LLVM 17.0.0.
64+
# MacOS X86 does not exist for LLVM 17 or 18, so we allow 19 as well.
65+
# We also allow to override this with a environment LLVM_VERSION for testing.
5366
LLVM_VERSIONS = {
54-
"": "first:>=17.0.0,<18",
67+
"": "getenv(LLVM_VERSION,latest:>=17.0.0,<20)",
68+
"darwin-x86_64": "15.0.7", # Verify this works as opposed to using one version.
5569
}
5670

5771
llvm_toolchain(
@@ -123,9 +137,10 @@ llvm_toolchain(
123137
)
124138

125139
## Toolchain example with system LLVM; tested in GitHub CI.
140+
# The llvm_version must match the version specified in .github/workflows/tests.yml: sys_paths_test
126141
llvm_toolchain(
127142
name = "llvm_toolchain_with_system_llvm",
128-
llvm_versions = LLVM_VERSIONS,
143+
llvm_version = "getenv(LLVM_VERSION)",
129144
# For this toolchain to work, the LLVM distribution archive would need to be unpacked here.
130145
toolchain_roots = {"": "/opt/llvm-16"},
131146
)
@@ -327,8 +342,8 @@ protobuf_deps()
327342

328343
http_archive(
329344
name = "rules_java",
330-
sha256 = "f79a6e10cdd213ceded45884914bb8c68f0c8d41144e74ec89ebb74984c409ac",
331-
urls = ["https://github.com/bazelbuild/rules_java/releases/download/8.8.0/rules_java-8.8.0.tar.gz"],
345+
sha256 = "1b30698d89dccd9dc01b1a4ad7e9e5c6e669cdf1918dbb050334e365b40a1b5e",
346+
urls = ["https://github.com/bazelbuild/rules_java/releases/download/8.16.1/rules_java-8.16.1.tar.gz"],
332347
)
333348

334349
load("@rules_java//java:rules_java_deps.bzl", "rules_java_dependencies")
@@ -339,10 +354,6 @@ load("@rules_foreign_cc//foreign_cc:repositories.bzl", "rules_foreign_cc_depende
339354

340355
rules_foreign_cc_dependencies()
341356

342-
load("@bazel_features//:deps.bzl", "bazel_features_deps")
343-
344-
bazel_features_deps()
345-
346357
load("@rules_cc//cc:extensions.bzl", "compatibility_proxy_repo")
347358

348359
compatibility_proxy_repo()

tests/scripts/archlinux_test.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,6 @@ set -exuo pipefail
3232
3333
# Run tests
3434
cd /src
35-
tests/scripts/run_tests.sh -t ${toolchain}
35+
tests/scripts/run_tests.sh -O -t ${toolchain}
3636
"""
3737
done

tests/scripts/debian_test.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,6 @@ apt-get -qq -y install curl libtinfo5 libxml2 zlib1g-dev >/dev/null
3636
3737
# Run tests
3838
cd /src
39-
tests/scripts/run_tests.sh
39+
tests/scripts/run_tests.sh -O
4040
"""
4141
done

tests/scripts/fedora_test.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,6 @@ dnf install -qy glibc-headers ncurses-compat-libs
3232
3333
# Run tests
3434
cd /src
35-
tests/scripts/run_tests.sh
35+
tests/scripts/run_tests.sh -O
3636
"""
3737
done

tests/scripts/linux_sysroot_test.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ images=(
1919
"ubuntu:22.04"
2020
)
2121

22+
LLVM_VERSION="first:>=15.0.0,<17"
23+
2224
git_root=$(git rev-parse --show-toplevel)
2325
readonly git_root
2426

@@ -36,6 +38,6 @@ apt-get -qq -y install curl libtinfo5 libxml2 zlib1g-dev >/dev/null
3638
3739
# Run tests
3840
cd /src
39-
tests/scripts/run_tests.sh -t '@llvm_toolchain_with_sysroot//:cc-toolchain-x86_64-linux'
41+
tests/scripts/run_tests.sh -t '@llvm_toolchain_with_sysroot//:cc-toolchain-x86_64-linux' -v '${LLVM_VERSION}'
4042
"""
4143
done

0 commit comments

Comments
 (0)