Skip to content

Commit a49bd13

Browse files
authored
Revert modularize bazel build to unbreak yggy (#453)
* Revert "Update workspace.bzl" This reverts commit 7534508. * Revert "Modularize Bazel build (#421)" This reverts commit 9375f57. * Revert bazel redo
1 parent 96aae8b commit a49bd13

File tree

27 files changed

+338
-383
lines changed

27 files changed

+338
-383
lines changed
File renamed without changes.

deps/ReactantExtra/BUILD

Lines changed: 192 additions & 179 deletions
Large diffs are not rendered by default.

deps/ReactantExtra/WORKSPACE

Lines changed: 139 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,121 @@
1-
workspace(name = "Reactant")
1+
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
2+
3+
NSYNC_COMMIT = "82b118aa7ace3132e517e2c467f8732978cf4023"
4+
NSYNC_SHA256 = ""
5+
http_archive(
6+
name = "nsync",
7+
sha256 = NSYNC_SHA256,
8+
strip_prefix = "nsync-" + NSYNC_COMMIT,
9+
urls = ["https://github.com/wsmoses/nsync/archive/{commit}.tar.gz".format(commit = NSYNC_COMMIT)],
10+
)
11+
12+
ENZYMEXLA_COMMIT = "74046d05089c02946058f8fd94ed23efd0bf3ccc"
13+
ENZYMEXLA_SHA256 = ""
14+
15+
http_archive(
16+
name = "enzyme_ad",
17+
sha256 = ENZYMEXLA_SHA256,
18+
strip_prefix = "Enzyme-JAX-" + ENZYMEXLA_COMMIT,
19+
urls = ["https://github.com/EnzymeAD/Enzyme-JAX/archive/{commit}.tar.gz".format(commit = ENZYMEXLA_COMMIT)],
20+
)
21+
22+
23+
http_archive(
24+
name = "rules_python",
25+
sha256 = "778aaeab3e6cfd56d681c89f5c10d7ad6bf8d2f1a72de9de55b23081b2d31618",
26+
strip_prefix = "rules_python-0.34.0",
27+
url = "https://github.com/bazelbuild/rules_python/releases/download/0.34.0/rules_python-0.34.0.tar.gz",
28+
)
229

3-
load("//third_party/nsync:workspace.bzl", nsync_workspace = "repo")
4-
nsync_workspace()
30+
# Hedron's Compile Commands Extractor for Bazel
31+
# https://github.com/hedronvision/bazel-compile-commands-extractor
32+
http_archive(
33+
name = "hedron_compile_commands",
534

6-
load("//third_party/rules_python:workspace.bzl", rules_python_workspace = "repo")
7-
rules_python_workspace()
35+
# Replace the commit hash (0e990032f3c5a866e72615cf67e5ce22186dcb97) in both places (below) with the latest (https://github.com/hedronvision/bazel-compile-commands-extractor/commits/main), rather than using the stale one here.
36+
# Even better, set up Renovate and let it do the work for you (see "Suggestion: Updates" in the README).
37+
url = "https://github.com/hedronvision/bazel-compile-commands-extractor/archive/4f28899228fb3ad0126897876f147ca15026151e.tar.gz",
38+
strip_prefix = "bazel-compile-commands-extractor-4f28899228fb3ad0126897876f147ca15026151e",
39+
# When you first run this tool, it'll recommend a sha256 hash to put here with a message like: "DEBUG: Rule 'hedron_compile_commands' indicated that a canonical reproducible form can be obtained by modifying arguments sha256 = ..."
40+
)
41+
load("@hedron_compile_commands//:workspace_setup.bzl", "hedron_compile_commands_setup")
42+
hedron_compile_commands_setup()
43+
load("@hedron_compile_commands//:workspace_setup_transitive.bzl", "hedron_compile_commands_setup_transitive")
44+
hedron_compile_commands_setup_transitive()
45+
load("@hedron_compile_commands//:workspace_setup_transitive_transitive.bzl", "hedron_compile_commands_setup_transitive_transitive")
46+
hedron_compile_commands_setup_transitive_transitive()
47+
load("@hedron_compile_commands//:workspace_setup_transitive_transitive_transitive.bzl", "hedron_compile_commands_setup_transitive_transitive_transitive")
48+
hedron_compile_commands_setup_transitive_transitive_transitive()
849

9-
load("//third_party/enzyme_ad:workspace.bzl", enzyme_ad_workspace = "repo")
10-
enzyme_ad_workspace()
50+
load("@enzyme_ad//:workspace.bzl", "JAX_COMMIT", "JAX_SHA256", "ENZYME_COMMIT", "ENZYME_SHA256", "XLA_PATCHES")
51+
52+
XLA_PATCHES = XLA_PATCHES + [
53+
"""
54+
sed -i.bak0 "s/__cpp_lib_hardware_interference_size/HW_INTERFERENCE_SIZE/g" xla/backends/cpu/runtime/thunk_executor.h
55+
""",
56+
"""
57+
sed -i.bak0 "s/__cpp_lib_hardware_interference_size/HW_INTERFERENCE_SIZE/g" xla/stream_executor/host/host_kernel.cc
58+
""",
59+
"""
60+
sed -i.bak0 "s/__cpp_lib_hardware_interference_size/HW_INTERFERENCE_SIZE/g" xla/tsl/concurrency/async_value_ref.h
61+
""",
62+
"""
63+
sed -i.bak0 "s/patch_cmds = \\[/patch_cmds = \\[\\\"find . -type f -name config.bzl -exec sed -i.bak0 's\\/HAVE_LINK_H=1\\/HAVE_LINK_H=0\\/g' {} +\\\",/g" third_party/llvm/workspace.bzl
64+
""",
65+
"""
66+
sed -i.bak0 "s/patch_cmds = \\[/patch_cmds = \\[\\\"find . -type f -name config.bzl -exec sed -i.bak0 's\\/LLVM_ENABLE_THREADS=1\\/LLVM_ENABLE_THREADS=0\\/g' {} +\\\",/g" third_party/llvm/workspace.bzl
67+
""",
68+
"""
69+
sed -i.bak0 "s/patch_cmds = \\[/patch_cmds = \\[\\\"find . -type f -name config.bzl -exec sed -i.bak0 's\\/HAVE_MALLINFO=1\\/DONT_HAVE_ANY_MALLINFO=0\\/g' {} +\\\",/g" third_party/llvm/workspace.bzl
70+
""",
71+
"""
72+
sed -i.bak0 "s/patch_cmds = \\[/patch_cmds = \\[\\\"find . -type f -name config.bzl -exec sed -i.bak0 's\\/HAVE_PTHREAD_GETNAME_NP=1\\/FAKE_HAVE_PTHREAD_GETNAME_NP=0\\/g' {} +\\\",/g" third_party/llvm/workspace.bzl
73+
""",
74+
"""
75+
sed -i.bak0 "s/patch_cmds = \\[/patch_cmds = \\[\\\"find . -type f -name config.bzl -exec sed -i.bak0 's\\/HAVE_PTHREAD_SETNAME_NP=1\\/FAKE_HAVE_PTHREAD_SETNAME_NP=0\\/g' {} +\\\",/g" third_party/llvm/workspace.bzl
76+
""",
77+
"""
78+
sed -i.bak0 "s/patch_cmds = \\[/patch_cmds = \\[\\\"find . -type f -name config.h -exec sed -i.bak0 's\\/ENABLE_CRASH_OVERRIDES 1\\/ENABLE_CRASH_OVERRIDES 0\\/g' {} +\\\",/g" third_party/llvm/workspace.bzl
79+
""",
80+
"""
81+
sed -i.bak0 "s/patch_cmds = \\[/patch_cmds = \\[\\\"find . -type f -name config.h -exec sed -i.bak0 's\\/HAVE_PTHREAD_GETNAME_NP\\/FAKE_HAVE_PTHREAD_GETNAME_NP\\/g' {} +\\\",/g" third_party/llvm/workspace.bzl
82+
""",
83+
"""
84+
sed -i.bak0 "s/patch_cmds = \\[/patch_cmds = \\[\\\"find . -type f -name config.h -exec sed -i.bak0 's\\/HAVE_PTHREAD_SETNAME_NP\\/FAKE_HAVE_PTHREAD_SETNAME_NP\\/g' {} +\\\",/g" third_party/llvm/workspace.bzl
85+
""",
86+
# """
87+
# sed -i.bak0 "s/patch_cmds = \\[/patch_cmds = \\['find . -type f -name BUILD.bazel -exec sed -i.bak0 \\\\\\'s\\/\\\"CAPIIR\\\",\\/\\\"CAPIIR\\\",alwayslink=1,\\/g\\\\\\\\' {} +',/g" third_party/llvm/workspace.bzl
88+
# """,
89+
]
1190

12-
load("//third_party/rules_cc:workspace.bzl", rules_cc_workspace = "repo")
13-
rules_cc_workspace()
91+
LLVM_TARGETS = select({
92+
"@bazel_tools//src/conditions:windows": ["AMDGPU", "NVPTX"],
93+
"@bazel_tools//src/conditions:darwin": [],
94+
"//conditions:default": ["AMDGPU", "NVPTX"],
95+
}) + ["AArch64", "X86", "ARM"]
1496

15-
load("@rules_cc//cc:repositories.bzl", "rules_cc_dependencies")
16-
rules_cc_dependencies()
97+
http_archive(
98+
name = "jax",
99+
sha256 = JAX_SHA256,
100+
strip_prefix = "jax-" + JAX_COMMIT,
101+
urls = ["https://github.com/google/jax/archive/{commit}.tar.gz".format(commit = JAX_COMMIT)],
102+
patch_args = ["-p1"],
103+
patches = ["@enzyme_ad//:patches/jax.patch"],
104+
)
17105

18-
load("//third_party/jax:workspace.bzl", jax_workspace = "repo")
19-
jax_workspace()
106+
load("@jax//third_party/xla:workspace.bzl", "XLA_COMMIT", "XLA_SHA256")
20107

21-
load("//third_party/xla:workspace.bzl", xla_workspace = "repo")
22-
xla_workspace()
108+
http_archive(
109+
name = "xla",
110+
sha256 = XLA_SHA256,
111+
strip_prefix = "xla-" + XLA_COMMIT,
112+
urls = ["https://github.com/wsmoses/xla/archive/{commit}.tar.gz".format(commit = XLA_COMMIT)],
113+
patch_cmds = XLA_PATCHES
114+
)
23115

24116
load("@xla//third_party/py:python_init_rules.bzl", "python_init_rules")
25117
python_init_rules()
26-
118+
27119
load("@xla//third_party/py:python_init_repositories.bzl", "python_init_repositories")
28120
python_init_repositories(
29121
requirements = {
@@ -34,7 +126,7 @@ python_init_repositories(
34126
"3.13": "//build:requirements_lock_3_13.txt",
35127
},
36128
)
37-
129+
38130
load("@xla//third_party/py:python_init_toolchains.bzl", "python_init_toolchains")
39131
python_init_toolchains()
40132
#
@@ -52,24 +144,42 @@ python_init_toolchains()
52144
#
53145
# pip_install_dependencies()
54146

55-
load("//third_party/enzyme:workspace.bzl", enzyme_workspace = "repo")
56-
enzyme_workspace()
147+
http_archive(
148+
name = "enzyme",
149+
sha256 = ENZYME_SHA256,
150+
strip_prefix = "Enzyme-" + ENZYME_COMMIT + "/enzyme",
151+
urls = ["https://github.com/EnzymeAD/Enzyme/archive/{commit}.tar.gz".format(commit = ENZYME_COMMIT)],
152+
)
57153

58-
load("//third_party/build_bazel_rules_apple:workspace.bzl", build_bazel_rules_apple_workspace = "repo")
59-
build_bazel_rules_apple_workspace()
154+
http_archive(
155+
name = "build_bazel_rules_apple",
156+
sha256 = "34c41bfb59cdaea29ac2df5a2fa79e5add609c71bb303b2ebb10985f93fa20e7",
157+
url = "https://github.com/bazelbuild/rules_apple/releases/download/3.1.1/rules_apple.3.1.1.tar.gz",
158+
)
60159

61160
load(
62161
"@build_bazel_rules_apple//apple:repositories.bzl",
63162
"apple_rules_dependencies",
64163
)
164+
65165
apple_rules_dependencies()
66166

67-
load("//third_party/upb:workspace.bzl", upb_workspace = "repo")
68-
upb_workspace()
167+
168+
http_archive(
169+
name = "upb",
170+
sha256 = "61d0417abd60e65ed589c9deee7c124fe76a4106831f6ad39464e1525cef1454",
171+
strip_prefix = "upb-9effcbcb27f0a665f9f345030188c0b291e32482",
172+
patch_cmds = [
173+
"sed -i.bak0 's/@bazel_tools\\/\\/platforms:windows/@platforms\\/\\/os:windows/g' BUILD",
174+
"sed -i.bak0 's/-Werror//g' BUILD"
175+
],
176+
url = "https://github.com/protocolbuffers/upb/archive/9effcbcb27f0a665f9f345030188c0b291e32482.tar.gz"
177+
)
69178

70179
load("@jax//third_party/xla:workspace.bzl", jax_xla_workspace = "repo")
71180
jax_xla_workspace()
72181

182+
73183
load("@xla//:workspace4.bzl", "xla_workspace4")
74184
xla_workspace4()
75185

@@ -78,12 +188,6 @@ xla_workspace3()
78188

79189
load("@xla//:workspace2.bzl", "xla_workspace2")
80190

81-
LLVM_TARGETS = select({
82-
"@bazel_tools//src/conditions:windows": ["AMDGPU", "NVPTX"],
83-
"@bazel_tools//src/conditions:darwin": [],
84-
"//conditions:default": ["AMDGPU", "NVPTX"],
85-
}) + ["AArch64", "X86", "ARM"]
86-
87191
load("@llvm-raw//utils/bazel:configure.bzl", "llvm_configure")
88192
llvm_configure(name = "llvm-project", targets = LLVM_TARGETS)
89193
xla_workspace2()
@@ -101,6 +205,7 @@ load(
101205
"@tsl//third_party/gpus/cuda/hermetic:cuda_json_init_repository.bzl",
102206
"cuda_json_init_repository",
103207
)
208+
104209
cuda_json_init_repository()
105210

106211
load(
@@ -113,9 +218,11 @@ load(
113218
"cuda_redist_init_repositories",
114219
"cudnn_redist_init_repository",
115220
)
221+
116222
cuda_redist_init_repositories(
117223
cuda_redistributions = CUDA_REDISTRIBUTIONS,
118224
)
225+
119226
cudnn_redist_init_repository(
120227
cudnn_redistributions = CUDNN_REDISTRIBUTIONS,
121228
)
@@ -124,31 +231,19 @@ load(
124231
"@tsl//third_party/gpus/cuda/hermetic:cuda_configure.bzl",
125232
"cuda_configure",
126233
)
234+
127235
cuda_configure(name = "local_config_cuda")
128236

129237
load(
130238
"@tsl//third_party/nccl/hermetic:nccl_redist_init_repository.bzl",
131239
"nccl_redist_init_repository",
132240
)
241+
133242
nccl_redist_init_repository()
134243

135244
load(
136245
"@tsl//third_party/nccl/hermetic:nccl_configure.bzl",
137246
"nccl_configure",
138247
)
139-
nccl_configure(name = "local_config_nccl")
140-
141-
load("@enzyme_ad//third_party/hedron_compile_commands:workspace.bzl", hedron_compile_commands_workspace = "repo")
142-
hedron_compile_commands_workspace()
143-
144-
load("@hedron_compile_commands//:workspace_setup.bzl", "hedron_compile_commands_setup")
145-
hedron_compile_commands_setup()
146-
147-
load("@hedron_compile_commands//:workspace_setup_transitive.bzl", "hedron_compile_commands_setup_transitive")
148-
hedron_compile_commands_setup_transitive()
149-
150-
load("@hedron_compile_commands//:workspace_setup_transitive_transitive.bzl", "hedron_compile_commands_setup_transitive_transitive")
151-
hedron_compile_commands_setup_transitive_transitive()
152248

153-
load("@hedron_compile_commands//:workspace_setup_transitive_transitive_transitive.bzl", "hedron_compile_commands_setup_transitive_transitive_transitive")
154-
hedron_compile_commands_setup_transitive_transitive_transitive()
249+
nccl_configure(name = "local_config_nccl")

deps/ReactantExtra/third_party/BUILD

Lines changed: 0 additions & 1 deletion
This file was deleted.

deps/ReactantExtra/third_party/build_bazel_rules_apple/BUILD

Whitespace-only changes.

deps/ReactantExtra/third_party/build_bazel_rules_apple/workspace.bzl

Lines changed: 0 additions & 10 deletions
This file was deleted.

deps/ReactantExtra/third_party/enzyme/BUILD

Whitespace-only changes.

deps/ReactantExtra/third_party/enzyme/workspace.bzl

Lines changed: 0 additions & 12 deletions
This file was deleted.

deps/ReactantExtra/third_party/enzyme_ad/BUILD

Whitespace-only changes.

deps/ReactantExtra/third_party/enzyme_ad/workspace.bzl

Lines changed: 0 additions & 12 deletions
This file was deleted.

0 commit comments

Comments
 (0)