From f12818b2c9d7767978c4d79bbf8f20eacec48fdb Mon Sep 17 00:00:00 2001 From: Cloud Han Date: Sat, 1 Feb 2025 11:42:05 +0800 Subject: [PATCH 1/5] chore: bump bazel version to v8 --- .bazelversion | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.bazelversion b/.bazelversion index 18bb4182..5210382a 100644 --- a/.bazelversion +++ b/.bazelversion @@ -1 +1 @@ -7.5.0 +8.0.1 \ No newline at end of file From 53e6e093caa8eb3bfcd7cc8ca288152c19634491 Mon Sep 17 00:00:00 2001 From: Cloud Han Date: Sat, 1 Feb 2025 11:52:26 +0800 Subject: [PATCH 2/5] test: fix tests for v8 --- MODULE.bazel | 3 +++ 1 file changed, 3 insertions(+) diff --git a/MODULE.bazel b/MODULE.bazel index 25c9943e..1943ad0a 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -19,3 +19,6 @@ register_toolchains( "@local_cuda//toolchain/clang:clang-local-toolchain", "@local_cuda//toolchain/disabled:disabled-local-toolchain", ) + +bazel_dep(name = "rules_cuda_examples", dev_dependency = True) +local_path_override(module_name = "rules_cuda_examples", path = "./examples") From 185bf4c795b3f8396c480fd698943f4e944f58a9 Mon Sep 17 00:00:00 2001 From: Cloud Han Date: Thu, 13 Feb 2025 00:27:28 +0800 Subject: [PATCH 3/5] fix(docs): partially fix docs gen, still experience https://github.com/bazelbuild/rules_cc/issues/279 --- BUILD.bazel | 8 -------- docs/BUILD.bazel | 8 ++++---- docs/MODULE.bazel | 2 ++ docs/WORKSPACE.bzlmod | 0 4 files changed, 6 insertions(+), 12 deletions(-) create mode 100644 docs/WORKSPACE.bzlmod diff --git a/BUILD.bazel b/BUILD.bazel index 7a93d97f..e69de29b 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -1,8 +0,0 @@ -load("@bazel_skylib//:bzl_library.bzl", "bzl_library") - -bzl_library( - name = "bzl_srcs", - srcs = glob(["**/*.bzl"]), - visibility = ["//visibility:public"], - deps = ["//cuda:bzl_srcs"], -) diff --git a/docs/BUILD.bazel b/docs/BUILD.bazel index 5a8f6640..456e3005 100644 --- a/docs/BUILD.bazel +++ b/docs/BUILD.bazel @@ -13,7 +13,7 @@ stardoc( input = "user_docs.bzl", deps = [ ":bazel_tools_bzl_srcs", - "@rules_cuda//:bzl_srcs", + "@rules_cuda//cuda:bzl_srcs", ], ) @@ -23,7 +23,7 @@ stardoc( input = "toolchain_config_docs.bzl", deps = [ ":bazel_tools_bzl_srcs", - "@rules_cuda//:bzl_srcs", + "@rules_cuda//cuda:bzl_srcs", ], ) @@ -33,7 +33,7 @@ stardoc( input = "providers_docs.bzl", deps = [ ":bazel_tools_bzl_srcs", - "@rules_cuda//:bzl_srcs", + "@rules_cuda//cuda:bzl_srcs", ], ) @@ -43,7 +43,7 @@ stardoc( input = "developer_docs.bzl", deps = [ ":bazel_tools_bzl_srcs", - "@rules_cuda//:bzl_srcs", + "@rules_cuda//cuda:bzl_srcs", ], ) diff --git a/docs/MODULE.bazel b/docs/MODULE.bazel index 53d99aec..8631a1c0 100644 --- a/docs/MODULE.bazel +++ b/docs/MODULE.bazel @@ -3,6 +3,8 @@ module( version = "0.0.0", compatibility_level = 1, ) +bazel_dep(name = "bazel_skylib", version = "1.4.2") +bazel_dep(name = "platforms", version = "0.0.6") bazel_dep(name = "rules_cuda", version = "0.2.3") local_path_override( diff --git a/docs/WORKSPACE.bzlmod b/docs/WORKSPACE.bzlmod new file mode 100644 index 00000000..e69de29b From fa16106f92c00374bb386307bda93785575bec71 Mon Sep 17 00:00:00 2001 From: Cloud Han Date: Thu, 13 Feb 2025 00:27:48 +0800 Subject: [PATCH 4/5] style: format --- MODULE.bazel | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/MODULE.bazel b/MODULE.bazel index 1943ad0a..508a40b4 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -21,4 +21,7 @@ register_toolchains( ) bazel_dep(name = "rules_cuda_examples", dev_dependency = True) -local_path_override(module_name = "rules_cuda_examples", path = "./examples") +local_path_override( + module_name = "rules_cuda_examples", + path = "./examples", +) From 0039a8aace6b7aecff01734350c34ec3c755f6b3 Mon Sep 17 00:00:00 2001 From: Cloud Han Date: Thu, 13 Feb 2025 00:28:21 +0800 Subject: [PATCH 5/5] ci: copy-pasting for new version due to flag change --- .github/workflows/build-tests.yaml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/.github/workflows/build-tests.yaml b/.github/workflows/build-tests.yaml index b9b69c17..b8bd4a28 100644 --- a/.github/workflows/build-tests.yaml +++ b/.github/workflows/build-tests.yaml @@ -65,6 +65,26 @@ jobs: - run: echo "USE_BAZEL_VERSION=$(cat .bazelversion)" >> $env:GITHUB_ENV if: ${{ startsWith(matrix.cases.os, 'windows') }} + # out of @examples repo build requires WORKSPACE-based external dependency system + - run: bazelisk build --jobs=1 @rules_cuda_examples//basic:all + - run: bazelisk build --jobs=1 @rules_cuda_examples//rdc:all + - run: bazelisk build --jobs=1 @rules_cuda_examples//if_cuda:main + - run: bazelisk build --jobs=1 @rules_cuda_examples//if_cuda:main --enable_cuda=False + # in @examples repo build, bzlmod is enabled by default since Bazel 7 + - run: cd examples && bazelisk build --jobs=1 //basic:all + - run: cd examples && bazelisk build --jobs=1 //rdc:all + - run: cd examples && bazelisk build --jobs=1 //if_cuda:main + - run: cd examples && bazelisk build --jobs=1 //if_cuda:main --enable_cuda=False + - run: bazelisk shutdown + # run some repo integration tests + - run: cd tests/integration && ./test_all.sh + + # Use Bazel 7 + - run: echo "USE_BAZEL_VERSION=7.5.0" >> $GITHUB_ENV + if: ${{ !startsWith(matrix.cases.os, 'windows') }} + - run: echo "USE_BAZEL_VERSION=7.5.0" >> $env:GITHUB_ENV + if: ${{ startsWith(matrix.cases.os, 'windows') }} + # out of @examples repo build requires WORKSPACE-based external dependency system - run: bazelisk build --jobs=1 --noenable_bzlmod @rules_cuda_examples//basic:all - run: bazelisk build --jobs=1 --noenable_bzlmod @rules_cuda_examples//rdc:all