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 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/MODULE.bazel b/MODULE.bazel index 25c9943e..508a40b4 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -19,3 +19,9 @@ 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", +) diff --git a/cuda/private/os_helpers.bzl b/cuda/private/os_helpers.bzl index 50bcf73e..0c24a828 100644 --- a/cuda/private/os_helpers.bzl +++ b/cuda/private/os_helpers.bzl @@ -23,7 +23,9 @@ def cc_import_versioned_sos(name, shared_library): name: Name of the cc_library. shared_library: Prefix of the versioned .so files. """ - so_paths = native.glob([shared_library + "*"]) + + # NOTE: only empty when the componnent is not installed on the system, say, cublas is not installed with apt-get + so_paths = native.glob([shared_library + "*"], allow_empty = True) [native.cc_import( name = paths.basename(p), 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..df27844d 100644 --- a/docs/MODULE.bazel +++ b/docs/MODULE.bazel @@ -4,6 +4,8 @@ module( 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( module_name = "rules_cuda", diff --git a/docs/WORKSPACE.bzlmod b/docs/WORKSPACE.bzlmod new file mode 100644 index 00000000..e69de29b