Skip to content

Commit 6a6d2f1

Browse files
authored
fix(ci): fix ci pipelines prior updating dependency bazel to v8 (#320)
* fix(docs): partially fix docs gen, still experience bazelbuild/rules_cc#279 * ci: copy-pasting for new version due to flag change * fix: explicit allow_empty for glob
1 parent 5584a6c commit 6a6d2f1

File tree

7 files changed

+35
-13
lines changed

7 files changed

+35
-13
lines changed

.github/workflows/build-tests.yaml

+20
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,26 @@ jobs:
6565
- run: echo "USE_BAZEL_VERSION=$(cat .bazelversion)" >> $env:GITHUB_ENV
6666
if: ${{ startsWith(matrix.cases.os, 'windows') }}
6767

68+
# out of @examples repo build requires WORKSPACE-based external dependency system
69+
- run: bazelisk build --jobs=1 @rules_cuda_examples//basic:all
70+
- run: bazelisk build --jobs=1 @rules_cuda_examples//rdc:all
71+
- run: bazelisk build --jobs=1 @rules_cuda_examples//if_cuda:main
72+
- run: bazelisk build --jobs=1 @rules_cuda_examples//if_cuda:main --enable_cuda=False
73+
# in @examples repo build, bzlmod is enabled by default since Bazel 7
74+
- run: cd examples && bazelisk build --jobs=1 //basic:all
75+
- run: cd examples && bazelisk build --jobs=1 //rdc:all
76+
- run: cd examples && bazelisk build --jobs=1 //if_cuda:main
77+
- run: cd examples && bazelisk build --jobs=1 //if_cuda:main --enable_cuda=False
78+
- run: bazelisk shutdown
79+
# run some repo integration tests
80+
- run: cd tests/integration && ./test_all.sh
81+
82+
# Use Bazel 7
83+
- run: echo "USE_BAZEL_VERSION=7.5.0" >> $GITHUB_ENV
84+
if: ${{ !startsWith(matrix.cases.os, 'windows') }}
85+
- run: echo "USE_BAZEL_VERSION=7.5.0" >> $env:GITHUB_ENV
86+
if: ${{ startsWith(matrix.cases.os, 'windows') }}
87+
6888
# out of @examples repo build requires WORKSPACE-based external dependency system
6989
- run: bazelisk build --jobs=1 --noenable_bzlmod @rules_cuda_examples//basic:all
7090
- run: bazelisk build --jobs=1 --noenable_bzlmod @rules_cuda_examples//rdc:all

BUILD.bazel

-8
Original file line numberDiff line numberDiff line change
@@ -1,8 +0,0 @@
1-
load("@bazel_skylib//:bzl_library.bzl", "bzl_library")
2-
3-
bzl_library(
4-
name = "bzl_srcs",
5-
srcs = glob(["**/*.bzl"]),
6-
visibility = ["//visibility:public"],
7-
deps = ["//cuda:bzl_srcs"],
8-
)

MODULE.bazel

+6
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,9 @@ register_toolchains(
1919
"@local_cuda//toolchain/clang:clang-local-toolchain",
2020
"@local_cuda//toolchain/disabled:disabled-local-toolchain",
2121
)
22+
23+
bazel_dep(name = "rules_cuda_examples", dev_dependency = True)
24+
local_path_override(
25+
module_name = "rules_cuda_examples",
26+
path = "./examples",
27+
)

cuda/private/os_helpers.bzl

+3-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@ def cc_import_versioned_sos(name, shared_library):
2323
name: Name of the cc_library.
2424
shared_library: Prefix of the versioned .so files.
2525
"""
26-
so_paths = native.glob([shared_library + "*"])
26+
27+
# NOTE: only empty when the componnent is not installed on the system, say, cublas is not installed with apt-get
28+
so_paths = native.glob([shared_library + "*"], allow_empty = True)
2729

2830
[native.cc_import(
2931
name = paths.basename(p),

docs/BUILD.bazel

+4-4
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ stardoc(
1313
input = "user_docs.bzl",
1414
deps = [
1515
":bazel_tools_bzl_srcs",
16-
"@rules_cuda//:bzl_srcs",
16+
"@rules_cuda//cuda:bzl_srcs",
1717
],
1818
)
1919

@@ -23,7 +23,7 @@ stardoc(
2323
input = "toolchain_config_docs.bzl",
2424
deps = [
2525
":bazel_tools_bzl_srcs",
26-
"@rules_cuda//:bzl_srcs",
26+
"@rules_cuda//cuda:bzl_srcs",
2727
],
2828
)
2929

@@ -33,7 +33,7 @@ stardoc(
3333
input = "providers_docs.bzl",
3434
deps = [
3535
":bazel_tools_bzl_srcs",
36-
"@rules_cuda//:bzl_srcs",
36+
"@rules_cuda//cuda:bzl_srcs",
3737
],
3838
)
3939

@@ -43,7 +43,7 @@ stardoc(
4343
input = "developer_docs.bzl",
4444
deps = [
4545
":bazel_tools_bzl_srcs",
46-
"@rules_cuda//:bzl_srcs",
46+
"@rules_cuda//cuda:bzl_srcs",
4747
],
4848
)
4949

docs/MODULE.bazel

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ module(
44
compatibility_level = 1,
55
)
66

7+
bazel_dep(name = "bazel_skylib", version = "1.4.2")
8+
bazel_dep(name = "platforms", version = "0.0.6")
79
bazel_dep(name = "rules_cuda", version = "0.2.3")
810
local_path_override(
911
module_name = "rules_cuda",

docs/WORKSPACE.bzlmod

Whitespace-only changes.

0 commit comments

Comments
 (0)