Skip to content

Commit 905e34c

Browse files
authored
Merge pull request #2390 from ivan444/reenable_xrefs2
Re-enable Kythe xRefs publishing
2 parents 0e58c80 + e2cb246 commit 905e34c

File tree

14 files changed

+86
-43
lines changed

14 files changed

+86
-43
lines changed

.bazelrc

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,23 +10,24 @@ build --enable_platform_specific_config
1010
build --workspace_status_command="bash bazel/build-version.sh"
1111

1212
# Systems with gcc or clang
13-
common:linux --cxxopt=-xc++ --host_cxxopt=-xc++ --cxxopt=-std=c++17 --host_cxxopt=-std=c++17 --client_env=BAZEL_CXXOPTS=-std=c++17
14-
common:freebsd --cxxopt=-xc++ --host_cxxopt=-xc++ --cxxopt=-std=c++17 --host_cxxopt=-std=c++17 --client_env=BAZEL_CXXOPTS=-std=c++17 --linkopt=-lm --host_linkopt=-lm
15-
common:openbsd --cxxopt=-xc++ --host_cxxopt=-xc++ --cxxopt=-std=c++17 --host_cxxopt=-std=c++17 --client_env=BAZEL_CXXOPTS=-std=c++17 --linkopt=-lm --host_linkopt=-lm
16-
common:macos --cxxopt=-xc++ --host_cxxopt=-xc++ --cxxopt=-std=c++17 --host_cxxopt=-std=c++17 --client_env=BAZEL_CXXOPTS=-std=c++17
13+
common:unix --cxxopt=-xc++ --host_cxxopt=-xc++ --cxxopt=-std=c++17 --host_cxxopt=-std=c++17 --client_env=BAZEL_CXXOPTS=-std=c++17
14+
common:linux --config=unix
15+
common:freebsd --config=unix --linkopt=-lm --host_linkopt=-lm
16+
common:openbsd --config=unix --linkopt=-lm --host_linkopt=-lm
17+
common:macos --config=unix
1718

1819
# https://github.com/abseil/abseil-cpp/issues/848
1920
# https://github.com/bazelbuild/bazel/issues/4341#issuecomment-758361769
2021
common:macos --features=-supports_dynamic_linker --linkopt=-framework --linkopt=CoreFoundation --host_linkopt=-framework --host_linkopt=CoreFoundation
2122

22-
# Force the use clang-cl on Windows instead of MSVC. MSVC has some issues with
23-
# the codebase, so we focus the effort for now is to have a Windows Verible
24-
# compiled with clang-cl before fixing the issues unique to MSVC.
25-
# Since we use designated initializers (C99 ... but >= c++20), compiler really wants the c++20 mode
26-
common:windows --compiler=clang-cl --cxxopt=/std:c++20 --host_cxxopt=/std:c++20 --client_env=BAZEL_CXXOPTS=/std:c++20
23+
# Use clang-cl by default on Windows. MSVC has some issues with the codebase,
24+
# so we focus the effort for now is to have a Windows Verible compiled with
25+
# clang-cl before fixing the issues unique to MSVC.
26+
common:windows --extra_toolchains=@local_config_cc//:cc-toolchain-x64_windows-clang-cl --extra_execution_platforms=//:x64_windows-clang-cl
27+
common:windows --compiler=clang-cl --cxxopt=/std:c++17 --host_cxxopt=/std:c++17 --client_env=BAZEL_CXXOPTS=/std:c++17
2728

2829
build --cxxopt="-Wno-unknown-warning-option" --host_cxxopt="-Wno-unknown-warning-option"
29-
# TODO: this looks like benign where it happens but to be explored further
30+
# TODO: this looks like benign where it happens but to be explored further.
3031
build --cxxopt="-Wno-dangling-reference" --host_cxxopt="-Wno-dangling-reference"
3132
# Newer bisons create an unused label.
3233
build --cxxopt="-Wno-unused-label" --host_cxxopt="-Wno-unused-label"

.github/bin/build-and-test.sh

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,8 @@ if [[ "${MODE}" == *-clang ]]; then
2323
export CXX=clang++
2424
export CC=clang
2525

26-
# clang versions supported. Starting with 13, we
27-
# get some warnings in absl, so let's not go beyond
28-
# 12 for now.
29-
for version in 12 11 10 ; do
26+
# clang versions that we have tested.
27+
for version in 19 12 11 10 ; do
3028
if command -v clang++-${version}; then
3129
export CXX=clang++-${version}
3230
export CC=clang-${version}

.github/bin/install-bazel.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515

16+
set -x
17+
1618
if [ -z "${BAZEL_VERSION}" ]; then
1719
echo "Please set \$BAZEL_VERSION"
1820
exit 1

.github/bin/install-kythe.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515

16+
set -x
17+
1618
if [ -z "${KYTHE_VERSION}" ]; then
1719
echo "Set \$KYTHE_VERSION"
1820
exit 1
@@ -42,5 +44,9 @@ else
4244
wget --no-verbose -O kythe.tar.gz \
4345
"https://github.com/kythe/kythe/releases/download/$KYTHE_VERSION/kythe-$KYTHE_VERSION.tar.gz"
4446
tar -xzf kythe.tar.gz
47+
# Bazel renamed @com_google_protobuf to @protobuf while Kythe is still
48+
# using it in their BUILD targets. Manually rename until the fixed Kythe is
49+
# released.
50+
sed -i 's/@com_google_protobuf/@protobuf/' "kythe-${KYTHE_VERSION}/BUILD"
4551
)
4652
fi

.github/bin/run-format.sh

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,20 @@ done
3131

3232
FORMAT_OUT=${TMPDIR:-/tmp}/clang-format-diff.out
3333

34-
CLANG_FORMAT=${CLANG_FORMAT:-clang-format}
34+
# Use the provided Clang format binary, or try to fallback to clang-format-17
35+
# or clang-format.
36+
if [[ ! -v CLANG_FORMAT ]]; then
37+
if command -v "clang-format-17" 2>&1 >/dev/null
38+
then
39+
CLANG_FORMAT="clang-format-17"
40+
elif command -v "clang-format" 2>&1 >/dev/null
41+
then
42+
CLANG_FORMAT="clang-format"
43+
else
44+
(echo "-- Missing the clang-format binary! --"; exit 1)
45+
fi
46+
fi
47+
3548
BUILDIFIER=${BUILDIFIER:-buildifier}
3649

3750
# Currently, we're using clang-format 17, as newer versions still have some
@@ -60,7 +73,7 @@ if [ ${SHOW_DIFF} -eq 1 ]; then
6073
if [ -s ${FORMAT_OUT} ]; then
6174
echo "Style not matching (see https://github.com/chipsalliance/verible/blob/master/CONTRIBUTING.md#style)"
6275
echo "Run"
63-
echo " .github/bin/run-clang-format.sh"
76+
echo " .github/bin/run-format.sh"
6477
echo "-------------------------------------------------"
6578
echo
6679
cat ${FORMAT_OUT}

.github/bin/run-kythe.sh

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,21 @@ then
3737
//...
3838
else
3939
# Use kythe's released tools.
40+
cat >WORKSPACE.bzlmod <<EOL
41+
local_repository(
42+
name = "kythe_release",
43+
path = "${KYTHE_DIR_ABS}",
44+
)
45+
EOL
4046
# --override_repository kythe_release expects an absolute dir
4147
bazel \
42-
--bazelrc="${KYTHE_DIR_ABS}/extractors.bazelrc" \
4348
build \
49+
--keep_going \
50+
--experimental_extra_action_top_level_only \
51+
--cc_proto_library_header_suffixes=.pb.h,.pb.h.meta \
52+
--proto_toolchain_for_cc=@kythe_release//:cc_native_proto_toolchain \
53+
--experimental_action_listener=@kythe_release//:extract_kzip_cxx \
54+
--experimental_action_listener=@kythe_release//:extract_kzip_protobuf \
4455
--override_repository kythe_release="${KYTHE_DIR_ABS}" \
4556
--define="kythe_corpus=github.com/chipsalliance/verible" \
4657
-- \

.github/settings.sh

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,24 +17,27 @@
1717
# pass through things like Docker files which don't support bash arrays and
1818
# similar functionality.
1919

20+
set -e
21+
set -x
22+
2023
[[ "${BASH_SOURCE[0]}" != "${0}" ]] && SOURCED=1 || SOURCED=0
2124

2225
if [ $SOURCED -ne 1 ]; then
2326
echo "settings.sh should be sourced, not run."
2427
exit 1
2528
fi
2629

27-
export GIT_VERSION=${GIT_VERSION:-$(git describe --match=v*)}
30+
export GIT_VERSION=${GIT_VERSION:-$(git describe --match='v*')}
2831

2932
export BAZEL_CXXOPTS="-std=c++17"
3033

3134
# Progress output is just noisy in CI outputs.
3235
export BAZEL_OPTS="-c opt --noshow_progress"
3336

3437
# Used to fetch the BAZEL version where needed.
35-
export BAZEL_VERSION=6.5.0
38+
export BAZEL_VERSION=7.6.1
3639

3740
# Kythe version for extracting xRefs
38-
export KYTHE_VERSION=v0.0.52
41+
export KYTHE_VERSION=v0.0.68
3942
# Kythe version for fetching tools (verification tools, etc.)
4043
export KYTHE_TOOLS_VERSION=${KYTHE_VERSION}

.github/workflows/verible-ci.yml

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ jobs:
115115
path: "**/plot_*.svg"
116116

117117
Check:
118-
container: ubuntu:jammy
118+
container: ubuntu:noble
119119
runs-on: [self-hosted, Linux, X64, gcp-custom-runners]
120120
strategy:
121121
fail-fast: false
@@ -183,11 +183,11 @@ jobs:
183183
apt -qqy update
184184
apt -qq -y install build-essential wget git python3 python-is-python3 default-jdk cmake python3-pip ripgrep
185185
apt -qq -y install gcc-10 g++-10
186-
apt -qq -y install gcc-12 g++-12
187-
apt -qq -y install clang-12 # clang always a particular version.
186+
apt -qq -y install gcc-14 g++-14
187+
apt -qq -y install clang-19
188188
source ./.github/settings.sh
189189
# Use newer compiler for c++2x compilation. Also slang needs c++20
190-
./.github/bin/set-compiler.sh $([[ "$MODE" == test-c++2* || "$MODE" == "smoke-test-analyzer" ]] && echo 12 || echo 10)
190+
./.github/bin/set-compiler.sh $([[ "$MODE" == test-c++2* || "$MODE" == "smoke-test-analyzer" ]] && echo 14 || echo 10)
191191
ARCH="$ARCH" ./.github/bin/install-bazel.sh
192192
193193
- name: Build Slang
@@ -276,8 +276,8 @@ jobs:
276276
277277
278278
KytheXrefs:
279-
runs-on: ubuntu-24.04
280-
if: false # Currently disabled, need to investigate failure.
279+
container: ubuntu:noble
280+
runs-on: [self-hosted, Linux, X64, gcp-custom-runners]
281281

282282
steps:
283283

@@ -289,8 +289,13 @@ jobs:
289289

290290
- name: Install Dependencies
291291
run: |
292+
set -x
293+
apt -qqy update
294+
apt -qq -y install build-essential wget git python3 python-is-python3 default-jdk cmake python3-pip ripgrep
295+
apt -qq -y install gcc-14 g++-14
296+
pwd
292297
source ./.github/settings.sh
293-
./.github/bin/set-compiler.sh 10
298+
./.github/bin/set-compiler.sh 14
294299
./.github/bin/install-bazel.sh
295300
./.github/bin/install-kythe.sh
296301
@@ -310,7 +315,7 @@ jobs:
310315

311316
- name: Install Dependencies
312317
run: |
313-
echo "USE_BAZEL_VERSION=6.5.0" >> $GITHUB_ENV
318+
echo "USE_BAZEL_VERSION=7.6.1" >> $GITHUB_ENV
314319
315320
- name: Checkout code
316321
uses: actions/checkout@v4
@@ -391,9 +396,9 @@ jobs:
391396

392397
- name: Install dependencies
393398
run: |
394-
choco install bazel --force --version=6.5.0
399+
choco install bazel --force --version=7.6.1
395400
choco install winflexbison3
396-
choco install llvm --allow-downgrade --version=17.0.6
401+
choco install llvm --allow-downgrade --version=20.1.4
397402
398403
- name: Debug bazel directory settings
399404
# We need to explicitly call the bazel binary from choco, otherwise

BUILD

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,3 +55,14 @@ genrule(
5555
"//verible/verilog/tools/lint:verible-verilog-lint",
5656
],
5757
)
58+
59+
# For building with clang-cl on Windows.
60+
# https://bazel.build/configure/windows#clang
61+
platform(
62+
name = "x64_windows-clang-cl",
63+
constraint_values = [
64+
"@platforms//cpu:x86_64",
65+
"@platforms//os:windows",
66+
"@bazel_tools//tools/cpp:clang-cl",
67+
],
68+
)

MODULE.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ bazel_dep(name = "rules_bison", version = "0.3")
1717

1818
# Last versions compatible w/ bazel6 https://github.com/chipsalliance/verible/issues/2336
1919
bazel_dep(name = "abseil-cpp", version = "20240116.2")
20-
bazel_dep(name = "protobuf", version = "28.3")
20+
bazel_dep(name = "protobuf", version = "31.0-rc2")
2121

2222
bazel_dep(name = "googletest", version = "1.14.0.bcr.1", dev_dependency = True)
2323

verible/common/formatting/BUILD

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,9 +133,6 @@ cc_library(
133133
"layout-optimizer-internal.h",
134134
],
135135
hdrs = ["layout-optimizer.h"],
136-
# Can only add @abseil-cpp//absl/log:vlog_is_on after > absl 20240116
137-
# https://github.com/chipsalliance/verible/issues/2336
138-
features = ["-layering_check"],
139136
deps = [
140137
":basic-format-style",
141138
":format-token",
@@ -150,6 +147,7 @@ cc_library(
150147
"@abseil-cpp//absl/base:config",
151148
"@abseil-cpp//absl/container:fixed_array",
152149
"@abseil-cpp//absl/log",
150+
"@abseil-cpp//absl/log:vlog_is_on",
153151
"@abseil-cpp//absl/strings",
154152
],
155153
)

verible/verilog/analysis/BUILD

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -164,9 +164,6 @@ cc_library(
164164
"verilog-analyzer.h",
165165
"verilog-excerpt-parse.h",
166166
],
167-
# Can only add @abseil-cpp//absl/log:vlog_is_on after > absl 20240116
168-
# https://github.com/chipsalliance/verible/issues/2336
169-
features = ["-layering_check"],
170167
deps = [
171168
"//verible/common/analysis:file-analyzer",
172169
"//verible/common/lexer:token-stream-adapter",
@@ -190,6 +187,7 @@ cc_library(
190187
"//verible/verilog/preprocessor:verilog-preprocess",
191188
"@abseil-cpp//absl/base:config",
192189
"@abseil-cpp//absl/log",
190+
"@abseil-cpp//absl/log:vlog_is_on",
193191
"@abseil-cpp//absl/status",
194192
"@abseil-cpp//absl/strings",
195193
],
@@ -244,9 +242,6 @@ cc_library(
244242
name = "verilog-linter",
245243
srcs = ["verilog-linter.cc"],
246244
hdrs = ["verilog-linter.h"],
247-
# Can only add @abseil-cpp//absl/log:vlog_is_on after > absl 20240116
248-
# https://github.com/chipsalliance/verible/issues/2336
249-
features = ["-layering_check"],
250245
deps = [
251246
":default-rules",
252247
":lint-rule-registry",
@@ -273,6 +268,7 @@ cc_library(
273268
"@abseil-cpp//absl/base:config",
274269
"@abseil-cpp//absl/flags:flag",
275270
"@abseil-cpp//absl/log",
271+
"@abseil-cpp//absl/log:vlog_is_on",
276272
"@abseil-cpp//absl/status",
277273
"@abseil-cpp//absl/status:statusor",
278274
"@abseil-cpp//absl/strings",

verible/verilog/parser/BUILD

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ cc_library(
132132
"-Wno-implicit-fallthrough",
133133
"-Wno-type-limits",
134134
"-Wno-unreachable-code",
135+
"-Wno-unused-but-set-variable",
135136
],
136137
}),
137138
deps = [

verible/verilog/tools/ls/BUILD

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -168,9 +168,6 @@ cc_library(
168168
name = "symbol-table-handler",
169169
srcs = ["symbol-table-handler.cc"],
170170
hdrs = ["symbol-table-handler.h"],
171-
# Can only add @abseil-cpp//absl/log:vlog_is_on after > absl 20240116
172-
# https://github.com/chipsalliance/verible/issues/2336
173-
features = ["-layering_check"],
174171
deps = [
175172
":lsp-conversion",
176173
":lsp-parse-buffer",
@@ -192,6 +189,7 @@ cc_library(
192189
"@abseil-cpp//absl/container:flat_hash_map",
193190
"@abseil-cpp//absl/flags:flag",
194191
"@abseil-cpp//absl/log",
192+
"@abseil-cpp//absl/log:vlog_is_on",
195193
"@abseil-cpp//absl/status",
196194
"@abseil-cpp//absl/status:statusor",
197195
"@abseil-cpp//absl/strings:str_format",

0 commit comments

Comments
 (0)