Skip to content

Commit

Permalink
docs: Add horizontal spacers around filenames in custom toolchain gui…
Browse files Browse the repository at this point in the history
…de (#2563)

This improves readability by clearly marking the beginnings and ends of
the three involved source files.

Follow-up of #2512, as discussed.
  • Loading branch information
nicholasjng authored Jan 14, 2025
1 parent 1aa0d9f commit c0bd668
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions docs/toolchains.md
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,10 @@ Here, we show an example for a semi-complicated toolchain suite, one that is:
Defining toolchains for this might look something like this:

```
# -------------------------------------------------------
# File: toolchain_impl/BUILD
# Contains the tool definitions (runtime, headers, libs).
# -------------------------------------------------------
load("@rules_python//python:py_cc_toolchain.bzl", "py_cc_toolchain")
load("@rules_python//python:py_exec_tools_toolchain.bzl", "py_exec_tools_toolchain")
load("@rules_python//python:py_runtime.bzl", "py_runtime")
Expand Down Expand Up @@ -453,9 +456,11 @@ cc_binary(name = "python3.12", ...)
cc_library(name = "headers", ...)
cc_library(name = "libs", ...)
# ------------------------------------------------------------------
# File: toolchains/BUILD
# Putting toolchain() calls in a separate package from the toolchain
# implementations minimizes Bazel loading overhead
# implementations minimizes Bazel loading overhead.
# ------------------------------------------------------------------
toolchain(
name = "runtime_toolchain",
Expand All @@ -480,8 +485,10 @@ toolchain(
exec_comaptible_with = ["@platforms/os:linux"]
)
# -----------------------------------------------
# File: MODULE.bazel or WORKSPACE.bazel
# These toolchains will considered before others
# These toolchains will considered before others.
# -----------------------------------------------
register_toolchains("//toolchains:all")
```

Expand Down

0 comments on commit c0bd668

Please sign in to comment.