Skip to content

Commit

Permalink
Upgrade to Bazel 7
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobdweightman committed Dec 18, 2024
1 parent b272077 commit 21d3d1a
Show file tree
Hide file tree
Showing 9 changed files with 19 additions and 31 deletions.
2 changes: 1 addition & 1 deletion .bazelversion
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6.0.0
7.4.1
12 changes: 0 additions & 12 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,6 @@ zirgen_dependencies()
load("@bazel_skylib//:workspace.bzl", "bazel_skylib_workspace")
bazel_skylib_workspace()

LLVM_COMMIT = "fea7b65f23632b42ff8f7e2595ac0641e2c1d214"

LLVM_SHA256 = "7f8da8de897f20824e7d11204768ccb29a47419385bb6c9b3f5eccfd738d7510"

http_archive(
name = "llvm-raw",
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)],
)

load("@llvm-raw//utils/bazel:configure.bzl", "llvm_configure")
llvm_configure(name = "llvm-project")

Expand Down
10 changes: 5 additions & 5 deletions bazel/rules/zirgen/deps.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@ def zirgen_dependencies():
"""
http_archive(
name = "bazel_skylib",
sha256 = "74d544d96f4a5bb630d465ca8bbcfe231e3594e5aae57e1edbf17a6eb3ca2506",
sha256 = "bc283cdfcd526a52c3201279cda4bc298652efa898b10b4db0837dc51652756f",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/1.3.0/bazel-skylib-1.3.0.tar.gz",
"https://github.com/bazelbuild/bazel-skylib/releases/download/1.1.1/bazel-skylib-1.3.0.tar.gz",
"https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/1.7.1/bazel-skylib-1.7.1.tar.gz",
"https://github.com/bazelbuild/bazel-skylib/releases/download/1.7.1/bazel-skylib-1.7.1.tar.gz",
],
)

LLVM_COMMIT = "0d72fe9777e7c131dfb50c172b944d64437e2ece"
LLVM_SHA256 = "41f69c116fd1e25d290031c408f6ea0246cafb993b1fdab6f781c87fc0b903cf"
LLVM_COMMIT = "fea7b65f23632b42ff8f7e2595ac0641e2c1d214"
LLVM_SHA256 = "7f8da8de897f20824e7d11204768ccb29a47419385bb6c9b3f5eccfd738d7510"
http_archive(
name = "llvm-raw",
build_file_content = "# empty",
Expand Down
1 change: 1 addition & 0 deletions bazel/toolchain/risc0/gcc_toolchain.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ def gcc_toolchain_config(name, sysroot):
"gcov",
"ld",
"nm",
"objcopy",
"objdump",
"strip",
]}
Expand Down
1 change: 1 addition & 0 deletions bazel/toolchain/rv32im-linux/gcc_toolchain.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ def gcc_toolchain_config(name, sysroot):
"gcov",
"ld",
"nm",
"objcopy",
"objdump",
"strip",
]}
Expand Down
6 changes: 3 additions & 3 deletions zirgen/Dialect/BigInt/Precompiles.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ First, create files under [`zirgen/circuit/bigint/`] which will hold the acceler
void genAdd128(mlir::OpBuilder& builder, mlir::Location loc) {
auto lhs = builder.create<BigInt::LoadOp>(loc, 128, 11, 0);
auto rhs = builder.create<BigInt::LoadOp>(loc, 128, 12, 0);
auto sum = builder.create<BigInt::AddOp>(loc, lhs, rhs);
auto sum = builder.create<BigInt::AddOp>(loc, lhs, rhs);
builder.create<BigInt::StoreOp>(loc, sum, 13, 0);
}
```
Expand All @@ -33,7 +33,7 @@ enum class Program {

Make this option available by extending the arg parser's declaration:
```
clEnumValN(Program::Add128, "add128", "Add128")),
```

Expand All @@ -53,7 +53,7 @@ The `bigint2c` program can now compile our addition function into a "bibc" forma
genrule(
name = "add128",
outs = ["add128.blob"],
exec_tools = [":bigint2c"],
tools = [":bigint2c"],
cmd = "$(location //zirgen/circuit/bigint:bigint2c) --program=add128 --bitwidth 128 > $(OUTS)"
)
```
Expand Down
14 changes: 7 additions & 7 deletions zirgen/circuit/bigint/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -66,49 +66,49 @@ BLOBS = [
genrule(
name = "modpow65537_4096",
outs = ["modpow65537_4096.blob"],
exec_tools = [":bigint2c"],
tools = [":bigint2c"],
cmd = "$(location //zirgen/circuit/bigint:bigint2c) --program=modpow65537 --bitwidth 4096 > $(OUTS)"
)

genrule(
name = "ec_double_256",
outs = ["ec_double_256.blob"],
exec_tools = [":bigint2c"],
tools = [":bigint2c"],
cmd = "$(location //zirgen/circuit/bigint:bigint2c) --program=ec_double --bitwidth 256 > $(OUTS)"
)

genrule(
name = "ec_add_256",
outs = ["ec_add_256.blob"],
exec_tools = [":bigint2c"],
tools = [":bigint2c"],
cmd = "$(location //zirgen/circuit/bigint:bigint2c) --program=ec_add --bitwidth 256 > $(OUTS)"
)

genrule(
name = "modadd_256",
outs = ["modadd_256.blob"],
exec_tools = [":bigint2c"],
tools = [":bigint2c"],
cmd = "$(location //zirgen/circuit/bigint:bigint2c) --program=modadd --bitwidth 256 > $(OUTS)"
)

genrule(
name = "modinv_256",
outs = ["modinv_256.blob"],
exec_tools = [":bigint2c"],
tools = [":bigint2c"],
cmd = "$(location //zirgen/circuit/bigint:bigint2c) --program=modinv --bitwidth 256 > $(OUTS)"
)

genrule(
name = "modmul_256",
outs = ["modmul_256.blob"],
exec_tools = [":bigint2c"],
tools = [":bigint2c"],
cmd = "$(location //zirgen/circuit/bigint:bigint2c) --program=modmul --bitwidth 256 > $(OUTS)"
)

genrule(
name = "modsub_256",
outs = ["modsub_256.blob"],
exec_tools = [":bigint2c"],
tools = [":bigint2c"],
cmd = "$(location //zirgen/circuit/bigint:bigint2c) --program=modsub --bitwidth 256 > $(OUTS)"
)

Expand Down
2 changes: 1 addition & 1 deletion zirgen/compiler/codegen/test/lit.site.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ config.suffixes = [".mlir"]
# This is different from the root configuration. Modify the exec root so that
# the relative path of the template files used for codegen are resolved
# correctly at test execution time.
config.test_exec_root = os.environ["RUNFILES_DIR"] + "/zirgen/zirgen"
config.test_exec_root = os.environ["RUNFILES_DIR"] + "/_main"

tool_names = [
ToolSubst("FileCheck", unresolved="fatal"),
Expand Down
2 changes: 0 additions & 2 deletions zirgen/lit.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ config.test_format = formats.ShTest(True)
# by individual lit.local.cfg files in the test subdirectories.
config.suffixes = [".mlir", ".zir"]

config.test_exec_root = os.environ["RUNFILES_DIR"]

tool_names = [
ToolSubst("FileCheck", unresolved="fatal"),
ToolSubst("not", unresolved="fatal"),
Expand Down

0 comments on commit 21d3d1a

Please sign in to comment.