-
Notifications
You must be signed in to change notification settings - Fork 421
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore(bazel): add MODULE.bazel files for bzlmod #1245
Changes from all commits
82eb6ac
90326e4
5964102
c71b0b4
b0bf5e7
787cbcc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,3 +4,4 @@ | |
.ijwb | ||
*.iml | ||
/.bazelrc.user | ||
MODULE.bazel.lock | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,49 @@ | ||
# TODO: migrate all dependencies from WORKSPACE to MODULE.bazel | ||
# https://github.com/bazelbuild/buildtools/issues/1204 | ||
module( | ||
name = "buildtools", | ||
version = "0.0.0", | ||
) | ||
|
||
bazel_dep(name = "aspect_bazel_lib", version = "2.7.9") | ||
bazel_dep(name = "aspect_rules_js", version = "2.0.0-rc9") | ||
bazel_dep(name = "bazel_features", version = "1.14.0") | ||
bazel_dep(name = "bazel_skylib", version = "1.7.1") | ||
bazel_dep(name = "gazelle", version = "0.37.0", repo_name = "bazel_gazelle") | ||
bazel_dep(name = "protobuf", version = "28.0-rc1", repo_name = "com_google_protobuf") | ||
bazel_dep(name = "rules_go", version = "0.49.0", repo_name = "io_bazel_rules_go") | ||
bazel_dep(name = "rules_nodejs", version = "6.2.0") | ||
bazel_dep(name = "rules_proto", version = "6.0.2") | ||
# -- bazel_dep definitions -- # | ||
|
||
go_sdk = use_extension("@io_bazel_rules_go//go:extensions.bzl", "go_sdk") | ||
go_sdk.download(version = "1.20.3") | ||
|
||
go_deps = use_extension("@bazel_gazelle//:extensions.bzl", "go_deps") | ||
go_deps.from_file(go_mod = "//:go.mod") | ||
go_deps.module( | ||
path = "golang.org/x/tools", | ||
sum = "h1:zdAyfUGbYmuVokhzVmghFl2ZJh5QhcfebBgmVPFYA+8=", | ||
version = "v0.15.0", | ||
) | ||
use_repo( | ||
go_deps, | ||
"com_github_golang_protobuf", | ||
"com_github_google_go_cmp", | ||
"net_starlark_go", | ||
"org_golang_google_protobuf", | ||
"org_golang_x_tools", | ||
) | ||
|
||
node = use_extension("@rules_nodejs//nodejs:extensions.bzl", "node") | ||
node.toolchain( | ||
name = "nodejs", | ||
node_version = "16.7.0", | ||
) | ||
|
||
toolchains = use_extension("@aspect_bazel_lib//lib:extensions.bzl", "toolchains") | ||
use_repo(toolchains, "jq_toolchains") | ||
use_repo(toolchains, "copy_to_directory_toolchains") | ||
|
||
register_toolchains( | ||
"@jq_toolchains//:all", | ||
"@copy_to_directory_toolchains//:all", | ||
) |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,10 @@ | ||
module github.com/bazelbuild/buildtools | ||
|
||
go 1.15 | ||
go 1.20 | ||
|
||
require ( | ||
github.com/golang/protobuf v1.4.3 | ||
github.com/google/go-cmp v0.5.9 | ||
go.starlark.net v0.0.0-20210223155950-e043a3d3c984 | ||
google.golang.org/protobuf v1.25.0 | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's this file? Is it being created by your editor?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's the lockfile Bazel creates for
MODULE.bazel
. It is currently hard to share across machines, which is why it's commonly added to.gitignore
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bzlmod has a lockfile which afaiui the primary feature is it allows you to build offline. but it is pretty verbose, and i believe there are some cross-platform holes in it today, so it adds some maintenance burden to check in unless you really need it. ignoring it allows you the benefits locally w/o having to deal with updating it