Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 20 additions & 1 deletion .bazelrc
Original file line number Diff line number Diff line change
@@ -1,9 +1,28 @@
# Import bazelrc presets
import %workspace%/tools/preset.bazelrc

# Don’t want to push a rules author to update their deps if not needed.
# https://bazel.build/reference/command-line-reference#flag--check_direct_dependencies
# https://bazelbuild.slack.com/archives/C014RARENH0/p1691158021917459?thread_ts=1691156601.420349&cid=C014RARENH0
common --config=ruleset

# Ensure that the MODULE.bazel.lock file is complete and committed.
# This is an important security measure: it ensures that developers on the
# same rule set download dependencies at the same versions with the same bits.
# This setting does not affect modules that depend on this module.
#
# When updating dependencies, use --lockfile_mode=refresh, for example:
# bazel mod tidy --lockfile_mode=refresh
#
# When testing different versions of Bazel, use --lockfile_mode=update or
# --lockfile_mode=off. The lock file format changes over time, and different
# versions of Bazel may expect different syntax. Bazel also implicitly requires
# some modules, and different versions have different dependencies, which
# also affects the contents of the lock file.
common --lockfile_mode=update

# project-specific settings
startup --windows_enable_symlinks
common --lockfile_mode=off

# Allows tests to run bazelisk-in-bazel, since this is the cache folder used
common:ci --disk_cache=~/.cache/bazel
Expand Down
20 changes: 20 additions & 0 deletions .github/workflows/conventional-commits.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# This helps the tag.yaml action to automatically create new releases
#
# tag.yaml requires all commits to follow the conventional commit pattern so that it can
# automatically derive the next release version based on the commit history
name: Verify PR title/description
on:
pull_request_target:
types:
- opened
- edited
- synchronize
permissions:
pull-requests: read
jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: amannn/action-semantic-pull-request@v6
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
9 changes: 4 additions & 5 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,16 @@ module(

bazel_dep(name = "bazel_lib", version = "3.0.0")
bazel_dep(name = "bazel_features", version = "1.32.0")
bazel_dep(name = "bazel_skylib", version = "1.8.1")
bazel_dep(name = "bazel_skylib", version = "1.8.2")
bazel_dep(name = "curl", version = "8.8.0.bcr.3")
bazel_dep(name = "package_metadata", version = "0.0.5")
bazel_dep(name = "platforms", version = "0.0.11")
bazel_dep(name = "package_metadata", version = "0.0.6")
bazel_dep(name = "platforms", version = "1.0.0")
bazel_dep(name = "rules_cc", version = "0.2.1")

bazel_dep(name = "bazel_skylib_gazelle_plugin", version = "1.7.1", dev_dependency = True)
bazel_dep(name = "bazelrc-preset.bzl", version = "1.6.0", dev_dependency = True)
bazel_dep(name = "buildifier_prebuilt", version = "8.2.1", dev_dependency = True)
bazel_dep(name = "gazelle", version = "0.42.0", dev_dependency = True, repo_name = "bazel_gazelle")
bazel_dep(name = "stardoc", version = "0.7.1", dev_dependency = True)
bazel_dep(name = "gazelle", version = "0.47.0", dev_dependency = True, repo_name = "bazel_gazelle")

# Select first d toolchain available for the current platform.
d = use_extension("//d:extensions.bzl", "d")
Expand Down
3,841 changes: 3,841 additions & 0 deletions MODULE.bazel.lock

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions d/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
load("@bazel_lib//:bzl_library.bzl", "bzl_library")
load("//d/private:resolved_toolchain.bzl", "resolved_toolchain")

# For stardoc to reference the files
exports_files(["defs.bzl"])

# This is the target rule authors should put in their "toolchains"
# attribute in order to get a runtime for the correct platform.
# See https://docs.bazel.build/versions/main/toolchains.html#writing-rules-that-use-toolchains
Expand Down Expand Up @@ -48,7 +45,10 @@ bzl_library(
name = "extensions",
srcs = ["extensions.bzl"],
visibility = ["//visibility:public"],
deps = [":repositories"],
deps = [
":repositories",
"@bazel_tools//tools/build_defs/repo:cache.bzl",
],
)

bzl_library(
Expand Down
16 changes: 16 additions & 0 deletions d/extensions.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,24 @@ def _toolchain_extension(module_ctx):
d_version = select_compiler_by_os(versions, module_ctx.os),
register = False,
)
return module_ctx.extension_metadata(
# Return True if the behavior of the module extension is fully
# determined by its inputs. Return False if the module depends on
# outside state, for example, if it needs to fetch an external list
# of versions, URLs, or hashes that could change.
#
# If True, Bazel omits information from the lock file, expecting that
# it can be reproduced.
reproducible = True,
)

d = module_extension(
implementation = _toolchain_extension,
tag_classes = {"toolchain": d_toolchain},
# Mark the extension as OS and architecture independent to simplify the
# lock file. An independent module extension may still download OS- and
# arch-dependent files, but it should download the same set of files
# regardless of the host platform.
os_dependent = False,
arch_dependent = False,
)
5 changes: 1 addition & 4 deletions d/private/rules/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,5 @@ bzl_library(
bzl_library(
name = "utils",
srcs = ["utils.bzl"],
visibility = [
"//d:__subpackages__",
"//docs:__subpackages__",
],
visibility = ["//d:__subpackages__"],
)
6 changes: 3 additions & 3 deletions d/repositories.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ def rules_d_dependencies():
# The minimal version of bazel_skylib we require
http_archive(
name = "bazel_skylib",
sha256 = "bc283cdfcd526a52c3201279cda4bc298652efa898b10b4db0837dc51652756f",
sha256 = "6e78f0e57de26801f6f564fa7c4a48dc8b36873e416257a92bbb0937eeac8446",
urls = [
"https://github.com/bazelbuild/bazel-skylib/releases/download/1.7.1/bazel-skylib-1.7.1.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.8.2/bazel-skylib-1.8.2.tar.gz",
"https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/1.8.2/bazel-skylib-1.8.2.tar.gz",
],
)
http_archive(
Expand Down
2 changes: 1 addition & 1 deletion e2e/smoke/MODULE.bazel
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
bazel_dep(name = "rules_d", version = "0.0.0")
bazel_dep(name = "bazel_skylib", version = "1.7.1")
bazel_dep(name = "bazel_skylib", version = "1.8.2")

local_path_override(
module_name = "rules_d",
Expand Down
Loading