diff --git a/.bazelrc b/.bazelrc index 281e38238..4f57e7abe 100644 --- a/.bazelrc +++ b/.bazelrc @@ -29,6 +29,9 @@ common:macos --features=-supports_dynamic_linker --linkopt=-framework --linkopt= # Since we use designated initializers (C99 ... but >= c++20), compiler really wants the c++20 mode common:windows --compiler=clang-cl --cxxopt=/std:c++20 --host_cxxopt=/std:c++20 --client_env=BAZEL_CXXOPTS=/std:c++20 +# TODO: this looks like benign where it happens but to be explored further +build --cxxopt="-Wno-dangling-reference" --host_cxxopt="-Wno-dangling-reference" + # For 3rd party code: Disable warnings entirely. # They are not actionable and just create noise. build --per_file_copt=external/.*@-w diff --git a/.github/workflows/verible-ci.yml b/.github/workflows/verible-ci.yml index 8d6a1176a..21ab15034 100644 --- a/.github/workflows/verible-ci.yml +++ b/.github/workflows/verible-ci.yml @@ -103,8 +103,8 @@ jobs: path: | /root/.cache/clang-tidy /root/.cache/bazel - key: clang-tidy1-${{ steps.cache_timestamp.outputs.time }} - restore-keys: clang-tidy1- + key: clang-tidy2-${{ steps.cache_timestamp.outputs.time }} + restore-keys: clang-tidy2- - name: Build Project genrules run: | @@ -115,7 +115,8 @@ jobs: //verible/verilog/parser:verilog-lex \ //verible/verilog/parser:verilog-y \ //verible/verilog/parser:verilog-y-final \ - //verible/common/analysis:command-file-lexer_test + //verible/common/analysis:command-file-lexer_test \ + //verible/common/lsp:lsp-text-buffer bazel build $(bin/bant -q genrule-outputs | awk '{print $2}') \ $(bin/bant list-targets | grep cc_proto_library | awk '{print $3}') @@ -437,14 +438,14 @@ jobs: uses: actions/cache@v3 with: path: "c:/users/runneradmin/_bazel_runneradmin" - key: bazelcache_windows1_${{ steps.cache_timestamp.outputs.time }} - restore-keys: bazelcache_windows1_ + key: bazelcache_windows3_${{ steps.cache_timestamp.outputs.time }} + restore-keys: bazelcache_windows3_ - name: Install dependencies run: | choco install bazel --force --version=6.5.0 choco install winflexbison3 - choco install llvm --allow-downgrade --version=16.0.6 + choco install llvm --allow-downgrade --version=17.0.6 - name: Debug bazel directory settings # We need to explicitly call the bazel binary from choco, otherwise diff --git a/MODULE.bazel b/MODULE.bazel index cf7da38b2..611a82c05 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -2,11 +2,15 @@ module( name = "verible", ) -bazel_dep(name = "platforms", version = "0.0.8") -bazel_dep(name = "bazel_skylib", version = "1.5.0") -bazel_dep(name = "rules_license", version = "0.0.8") -bazel_dep(name = "rules_proto", version = "6.0.0-rc2") +bazel_dep(name = "platforms", version = "0.0.10") +bazel_dep(name = "bazel_skylib", version = "1.7.1") +bazel_dep(name = "rules_license", version = "1.0.0") + +# Last version working with bazel 6. The following +# rules are needed for proto bazel rules as the ones in @protobuf +# not yet available in protobuf version that works on windows. bazel_dep(name = "rules_cc", version = "0.0.9") +bazel_dep(name = "rules_proto", version = "6.0.0-rc2") # Register m4 rules and toolchain. bazel_dep(name = "rules_m4", version = "0.2.3") @@ -69,6 +73,8 @@ single_version_override( bazel_dep(name = "googletest", version = "1.14.0.bcr.1", repo_name = "com_google_googletest") bazel_dep(name = "nlohmann_json", version = "3.11.3.bcr.1", repo_name = "jsonhpp") -bazel_dep(name = "protobuf", version = "26.0", repo_name = "com_google_protobuf") -bazel_dep(name = "re2", version = "2023-09-01", repo_name = "com_googlesource_code_re2") -bazel_dep(name = "zlib", version = "1.3.1") + +# Last that works with windows. Unfortunately can't used @protobuf//bazel rules +bazel_dep(name = "protobuf", version = "24.4", repo_name = "com_google_protobuf") +bazel_dep(name = "re2", version = "2024-07-02.bcr.1", repo_name = "com_googlesource_code_re2") +bazel_dep(name = "zlib", version = "1.3.1.bcr.3") diff --git a/bazel/zlib.BUILD b/bazel/zlib.BUILD deleted file mode 100644 index 197650f41..000000000 --- a/bazel/zlib.BUILD +++ /dev/null @@ -1,73 +0,0 @@ -load("@rules_cc//cc:defs.bzl", "cc_library") - -licenses(["notice"]) # BSD/MIT-like license (for zlib) - -exports_files(["zlib.BUILD"]) - -_ZLIB_HEADERS = [ - "crc32.h", - "deflate.h", - "gzguts.h", - "inffast.h", - "inffixed.h", - "inflate.h", - "inftrees.h", - "trees.h", - "zconf.h", - "zlib.h", - "zutil.h", -] - -_ZLIB_PREFIXED_HEADERS = ["zlib/include/" + hdr for hdr in _ZLIB_HEADERS] - -# In order to limit the damage from the `includes` propagation -# via `:zlib`, copy the public headers to a subdirectory and -# expose those. -genrule( - name = "copy_public_headers", - srcs = _ZLIB_HEADERS, - outs = _ZLIB_PREFIXED_HEADERS, - cmd_bash = "cp $(SRCS) $(@D)/zlib/include/", - cmd_bat = " && ".join( - ["@copy /Y $(location %s) $(@D)\\zlib\\include\\ >NUL" % - s for s in _ZLIB_HEADERS], - ), -) - -cc_library( - name = "zlib", - srcs = [ - "adler32.c", - "compress.c", - "crc32.c", - "deflate.c", - "gzclose.c", - "gzlib.c", - "gzread.c", - "gzwrite.c", - "infback.c", - "inffast.c", - "inflate.c", - "inftrees.c", - "trees.c", - "uncompr.c", - "zutil.c", - # Include the un-prefixed headers in srcs to work - # around the fact that zlib isn't consistent in its - # choice of <> or "" delimiter when including itself. - ] + _ZLIB_HEADERS, - hdrs = [ # _ZLIB_PREFIXED_HEADERS, but we only need a few. - "zlib/include/zconf.h", - "zlib/include/zlib.h", - ], - copts = select({ - "@bazel_tools//src/conditions:windows": [], - "//conditions:default": [ - "-Wno-deprecated-non-prototype", - "-Wno-unused-variable", - "-Wno-implicit-function-declaration", - ], - }), - includes = ["zlib/include/"], - visibility = ["//visibility:public"], -) diff --git a/third_party/proto/kythe/BUILD b/third_party/proto/kythe/BUILD index 0df5ac3fa..f2e9e553e 100644 --- a/third_party/proto/kythe/BUILD +++ b/third_party/proto/kythe/BUILD @@ -1,3 +1,5 @@ +# Unfortunately, can't use @com_google_protobuf//bazel:cc_proto_library.bzl +# here, as this does not seem to work with windows. load("@rules_cc//cc:defs.bzl", "cc_proto_library") load("@rules_proto//proto:defs.bzl", "proto_library")