[PATCH] D108237: Update bazel examples.
Christian Sigg via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Aug 17 13:12:07 PDT 2021
csigg created this revision.
csigg added a reviewer: GMNGeoffrey.
Herald added a subscriber: sanjoy.google.
csigg requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
Use the simplified repo rules from https://github.com/llvm/llvm-project/commit/934f084.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D108237
Files:
utils/bazel/examples/http_archive/WORKSPACE
utils/bazel/examples/submodule/WORKSPACE
Index: utils/bazel/examples/submodule/WORKSPACE
===================================================================
--- utils/bazel/examples/submodule/WORKSPACE
+++ utils/bazel/examples/submodule/WORKSPACE
@@ -6,32 +6,16 @@
workspace(name = "submodule_example")
-SKYLIB_VERSION = "1.0.3"
-
-http_archive(
- name = "bazel_skylib",
- sha256 = "97e70364e9249702246c0e9444bccdc4b847bed1eb03c5a3ece4f83dfe6abc44",
- urls = [
- "https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/{version}/bazel-skylib-{version}.tar.gz".format(version=SKYLIB_VERSION),
- "https://github.com/bazelbuild/bazel-skylib/releases/download/{version}/bazel-skylib-{version}.tar.gz".format(version=SKYLIB_VERSION),
- ],
+new_local_repository(
+ name = "llvm-archive",
+ build_file_content = "# empty",
+ # Or wherever your submodule is located.
+ path = "third_party/llvm-project",
)
-# Or wherever your submodule is located.
-SUBMODULE_PATH = "third_party/llvm-project"
-
-local_repository(
- name = "llvm-bazel",
- path = SUBMODULE_PATH + "/utils/bazel",
-)
+load("@llvm-archive//utils/bazel:configure.bzl", "llvm_configure")
-load("@llvm-bazel//:configure.bzl", "llvm_configure", "llvm_disable_optional_support_deps")
-
-llvm_configure(
- name = "llvm-project",
- src_path = SUBMODULE_PATH,
- src_workspace = "@submodule_example//:WORKSPACE",
-)
+llvm_configure(name = "llvm-project")
# Disables optional dependencies for Support like zlib and terminfo. You may
# instead want to configure them using the macros in the corresponding bzl
Index: utils/bazel/examples/http_archive/WORKSPACE
===================================================================
--- utils/bazel/examples/http_archive/WORKSPACE
+++ utils/bazel/examples/http_archive/WORKSPACE
@@ -20,38 +20,24 @@
)
# Replace with the LLVM commit you want to use.
-LLVM_COMMIT = "09ac97ce350316b95b8cddb796d52f71b6f68296"
+LLVM_COMMIT = "934f084ad42231d225bd0eee3342f4b5f7e1ce6e"
# The easiest way to calculate this for a new commit is to set it to empty and
# then run a bazel build and it will report the digest necessary to cache the
# archive and make the build reproducible.
-LLVM_SHA256 = "2fb1aa06d12f8db349a27426cb0ced062987c5c2a75143c69f4284929e2750ff"
+LLVM_SHA256 = "82c5a82f6ea6638bf6812fdc3e0f2bdd3e45d2db7aada799e09366c1387991c9"
-# FIXME: It shouldn't be necessary to use http_archive twice here. Caching
-# should mean that this isn't too expensive though.
-
-http_archive(
- name = "llvm-project-raw",
- build_file_content = "#empty",
+new_http_archive(
+ name = "llvm-archive",
+ build_file_content = "# empty",
sha256 = LLVM_SHA256,
strip_prefix = "llvm-project-" + LLVM_COMMIT,
urls = ["https://github.com/llvm/llvm-project/archive/{commit}.tar.gz".format(commit = LLVM_COMMIT)],
)
-http_archive(
- name = "llvm-bazel",
- sha256 = LLVM_SHA256,
- strip_prefix = "llvm-project-{}/utils/bazel".format(LLVM_COMMIT),
- urls = ["https://github.com/llvm/llvm-project/archive/{commit}.tar.gz".format(commit = LLVM_COMMIT)],
-)
-
-load("@llvm-bazel//:configure.bzl", "llvm_configure", "llvm_disable_optional_support_deps")
+load("@llvm-archive//utils/bazel:configure.bzl", "llvm_configure")
-llvm_configure(
- name = "llvm-project",
- src_path = ".",
- src_workspace = "@llvm-project-raw//:WORKSPACE",
-)
+llvm_configure(name = "llvm-project")
# Disables optional dependencies for Support like zlib and terminfo. You may
# instead want to configure them using the macros in the corresponding bzl
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D108237.366996.patch
Type: text/x-patch
Size: 3601 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210817/38655c24/attachment.bin>
More information about the llvm-commits
mailing list