diff --git a/.bazeliskrc b/.bazeliskrc deleted file mode 100644 index dbb7b4bcc..000000000 --- a/.bazeliskrc +++ /dev/null @@ -1 +0,0 @@ -USE_BAZEL_VERSION=6.4.0 \ No newline at end of file diff --git a/.bazelrc b/.bazelrc index c5e987a13..c695beb9d 100644 --- a/.bazelrc +++ b/.bazelrc @@ -1,3 +1,7 @@ + +# Enable Bzlmod for every Bazel command +common --enable_bzlmod + # Must be first. Enables build:windows, build:linux, build:macos, build:freebsd, build:openbsd build --enable_platform_specific_config ############################################################################### diff --git a/MODULE.bazel b/MODULE.bazel new file mode 100644 index 000000000..28b92e82d --- /dev/null +++ b/MODULE.bazel @@ -0,0 +1,8 @@ +############################################################################### +# Bazel now uses Bzlmod by default to manage external dependencies. +# Please consider migrating your external dependencies from WORKSPACE to MODULE.bazel. +# +# For more details, please check https://github.com/bazelbuild/bazel/issues/18958 +############################################################################### + +bazel_dep(name = "rules_cc", version = "0.0.16") \ No newline at end of file diff --git a/README.md b/README.md index 74ec575b0..a082fc083 100644 --- a/README.md +++ b/README.md @@ -82,6 +82,9 @@ bazel build ylt # Please make sure bazel in you bin path. bazel build coro_http_example # Or replace in anyone you want to build and test. # Actually you might take it in other project in prefix @com_alibaba_yalangtinglibs, like bazel build @com_alibaba_yalangtinglibs://ylt + +bazel version > 7 +bazel build ylt --enable_bzlmod ``` You can see the test/example/benchmark executable file in `./build/output/`. diff --git a/WORKSPACE.bzlmod b/WORKSPACE.bzlmod new file mode 100644 index 000000000..0ce8eac41 --- /dev/null +++ b/WORKSPACE.bzlmod @@ -0,0 +1,7 @@ +# This is a WORKSPACE file used by bzlmod in combination with MODULE.bazel. +# It's used for a gradual migration and it should be empty. +# Don't remove this file. If the file doesn't exist, bzlmod falls back to WORKSPACE file. + +load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") + +workspace(name = "com_alibaba_yalantinglibs") \ No newline at end of file