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
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ This repository uses Bazel.
- Generate files at build time. If one must be checked in, a freshness test regenerates and diffs it; never sync it by hand. Generated data holds only non-default keys.
- `core/` never loads a language `.bzl` file. One exception: `core/quality/tools.bzl` loads the `_tools.bzl` files.
- Root holds only language directories and the shared directories in `docs/design/layout.md`.
- Docs are for people who use or release rules_dx: command pages, guides, tutorials, the generated `docs/support-matrix.md`, READMEs, `examples/`, and runbooks like `RELEASING.md`. Never write design rationale, history, alternatives, or implementation notes. One exception: the "What rules_dx replaces" section in `README.md` may state what you get and what it costs. Keep it to those two lists.
- Docs are for people who use or release rules_dx: command pages, guides, tutorials, READMEs, `examples/`, and runbooks like `RELEASING.md`. The docs build generates doc pages such as the support matrix, the supported surface, the quality configs and the language pages. Never commit them. Never write design rationale, history, alternatives, or implementation notes. One exception: the "What rules_dx replaces" section in `README.md` may state what you get and what it costs. Keep it to those two lists.
- User docs stay complete: every command page documents its flags, scopes, output, reports, exit codes, and examples. Match `dx <command> --help`. Keep them user-facing; still no rationale, history, or issue numbers.
- No comments in any language, Rust `///`/`//!` and Go doc comments included. Use names and tests instead. Assigned strings like `_HUB_BUILD = """..."""` are code, not comments.
- Kept: tool directives, shebangs, license headers, lines tools parse (`# Why:`, `# Upstream:`, `# dx:`), `LCOV_EXCL_*`, `# floor:`, `// SAFETY:`, one Starlark docstring line per item, one clap `--help` line per flag.
Expand Down
1 change: 0 additions & 1 deletion BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -1112,7 +1112,6 @@ real_source_target(
"//docs:cli/commands/upgrade.md",
"//docs:github-ci.md",
"//docs:proxy-and-ca.md",
"//docs:support-matrix.md",
"//docs:tutorial.md",
"//examples:README.md",
"LICENSE",
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ Without a key, the remote cache returns no hits, so leave `--config=bb` and `--c
bazel run //tools/new_language -- <lang> [title]
```

It creates `<lang>/` with `defs.bzl`, `extensions.bzl`, `BUILD.bazel`, `lang.json`, `pins.json`, `private/` and `tests/`. Fill in `lang.json`, then refresh the support matrix:
It creates `<lang>/` with `defs.bzl`, `extensions.bzl`, `BUILD.bazel`, `lang.json`, `pins.json`, `private/` and `tests/`. Fill in `lang.json` and add the language to `tools/docs/languages/pages.bzl`. Then refresh the unsupported-platform list:

```sh
bazel run //tools/docs/support_matrix:update
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ Already have a Bazel repo? Read
New to Bazel and moving an existing project? Read
[adopting rules_dx without Bazel experience](docs/adopting-without-bazel.md).
You can also browse the [examples](examples/README.md), set up
[CI](docs/github-ci.md), check the [support matrix](docs/support-matrix.md),
[CI](docs/github-ci.md), check the [support matrix](https://devhusdk.github.io/rules_dx/docs/support-matrix.html),
or read everything on the [docs site](https://devhusdk.github.io/rules_dx/).

## What rules_dx replaces
Expand Down Expand Up @@ -167,7 +167,7 @@ version in `.dx/pins` without Bazel. See

## C and C++ toolchains

- Microsoft `cl.exe` (`--//cc:compiler=msvc`): the Visual Studio Build Tools come from the hermetic `@dx_msvc` repo, not an installed Visual Studio. The download needs the Visual Studio Build Tools license, accepted with `dx_licenses.accept(ids = ["visual-studio-build-tools"])`. See the [support matrix](docs/support-matrix.md).
- Microsoft `cl.exe` (`--//cc:compiler=msvc`): the Visual Studio Build Tools come from the hermetic `@dx_msvc` repo, not an installed Visual Studio. The download needs the Visual Studio Build Tools license, accepted with `dx_licenses.accept(ids = ["visual-studio-build-tools"])`. See the [support matrix](https://devhusdk.github.io/rules_dx/docs/support-matrix.html).
- GCC (`--//cc:compiler=gcc`): GCC 16.2.0 on `linux_x86_64` and `linux_arm64`, with no install.

## Contributing
Expand Down
1 change: 0 additions & 1 deletion android/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ real_source_target(
name = "corpus_markdown",
markdown_siblings = [
"//android/tests/fixtures/adopt_android:README.md",
"//docs:languages/android.md",
],
markdown_srcs = ["README.md"],
tags = ["corpus"],
Expand Down
2 changes: 1 addition & 1 deletion android/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Load its rules in a `BUILD.bazel` file, the file that declares what Bazel
builds, from `@rules_dx//android:defs.bzl`.
`extensions.bzl` holds the module extension: the part you call from
`MODULE.bazel` to set up toolchains and dependencies.
The tests live in `tests/`. The [Android page](../docs/languages/android.md) shows
The tests live in `tests/`. The [Android page](https://devhusdk.github.io/rules_dx/docs/languages/android.html) shows
setup, every rule and the tools dx runs.

Run the Android tests from a rules_dx checkout:
Expand Down
1 change: 0 additions & 1 deletion appimage/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ real_source_target(
name = "corpus_markdown",
markdown_siblings = [
"//appimage/tests/fixtures/appimage_app:README.md",
"//docs:languages/appimage.md",
],
markdown_srcs = ["README.md"],
tags = ["corpus"],
Expand Down
2 changes: 1 addition & 1 deletion appimage/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Load its rules in a `BUILD.bazel` file, the file that declares what Bazel
builds, from `@rules_dx//appimage:defs.bzl`.
`extensions.bzl` holds the module extension: the part you call from
`MODULE.bazel` to set up toolchains and dependencies.
The tests live in `tests/`. The [AppImage page](../docs/languages/appimage.md) shows
The tests live in `tests/`. The [AppImage page](https://devhusdk.github.io/rules_dx/docs/languages/appimage.html) shows
setup, every rule and the tools dx runs.

Run the AppImage tests from a rules_dx checkout:
Expand Down
3 changes: 0 additions & 3 deletions apple/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,6 @@ alias(

real_source_target(
name = "corpus_markdown",
markdown_siblings = [
"//docs:languages/apple.md",
],
markdown_srcs = ["README.md"],
tags = ["corpus"],
)
Expand Down
2 changes: 1 addition & 1 deletion apple/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Load its rules in a `BUILD.bazel` file, the file that declares what Bazel
builds, from `@rules_dx//apple:defs.bzl`.
`extensions.bzl` holds the module extension: the part you call from
`MODULE.bazel` to set up toolchains and dependencies.
The tests live in `tests/`. The [Apple page](../docs/languages/apple.md) shows
The tests live in `tests/`. The [Apple page](https://devhusdk.github.io/rules_dx/docs/languages/apple.html) shows
setup, every rule and the tools dx runs.

Run the Apple tests from a rules_dx checkout:
Expand Down
1 change: 0 additions & 1 deletion cc/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ filegroup(
real_source_target(
name = "corpus_markdown",
markdown_siblings = [
"//docs:languages/cc.md",
"//docs:own-cc-toolchain.md",
],
markdown_srcs = ["README.md"],
Expand Down
2 changes: 1 addition & 1 deletion cc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Load its rules in a `BUILD.bazel` file, the file that declares what Bazel
builds, from `@rules_dx//cc:defs.bzl`.
`extensions.bzl` holds the module extension: the part you call from
`MODULE.bazel` to set up toolchains and dependencies.
The tests live in `tests/`. The [C and C++ page](../docs/languages/cc.md) shows
The tests live in `tests/`. The [C and C++ page](https://devhusdk.github.io/rules_dx/docs/languages/cc.html) shows
setup, every rule and the tools dx runs.

Run the C and C++ tests from a rules_dx checkout:
Expand Down
3 changes: 2 additions & 1 deletion cli/exec_audit/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,12 @@ rust_test(
aliases = {}, # keep
compile_data = [
"clippy.toml",
"//docs:support-matrix.md",
"//haskell/tests/fixtures/stack:stack.yaml.lock",
],
coverage_lib = ":dx_exec_audit",
crate_name = "dx_exec_audit",
crate_root = "src/lib.rs",
data = ["//docs:support-matrix.md"],
# keep
deps = [
"//cli/adopt:dx_adopt",
Expand All @@ -93,6 +93,7 @@ rust_test(
"//cli/sbom/schema:dx_sbom_schema",
"//cli/tool_resolve:dx_tool_resolve",
"//cli/update:dx_update",
"//tools/testing:dx_testing",
"@crates//:chrono",
"@crates//:serde_json",
"@crates//:tempfile",
Expand Down
7 changes: 4 additions & 3 deletions cli/exec_audit/src/audit_uncovered.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,16 +104,17 @@ fn walk(
mod tests {
use super::{find_unowned, unowned_names};

const MATRIX: &str = include_str!("../../../docs/support-matrix.md");

#[test]
fn locks_without_a_set_have_a_none_reason_in_the_matrix() {
let matrix =
std::fs::read_to_string(dx_testing::resolve_runfiles("docs/support-matrix.md"))
.expect("support-matrix.md");
for (name, _, _) in unowned_names()
.expect("hub")
.iter()
.filter(|(_, _, has_set)| !has_set)
{
let shown = MATRIX.lines().any(|line| {
let shown = matrix.lines().any(|line| {
line.contains(&format!("`{name}`"))
&& (line.contains("none for ") || line.contains("| none:"))
});
Expand Down
33 changes: 3 additions & 30 deletions core/quality/tool_config_docs.bzl
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
"""Renders the tool config table in docs/cli/commands/quality.md from tools.bzl."""
"""Renders the tool config table of the quality configs page from tools.bzl."""

load("@bazel_lib//lib:write_source_files.bzl", "write_source_files")
load("@bazel_skylib//rules:write_file.bzl", "write_file")
load(":curated_defaults.bzl", "CROSS_FAMILY_TOOLS", "CURATED_DEFAULTS")
load(":tools.bzl", "TOOLS")

visibility(["//docs/..."])

BEGIN = "<!-- tool-config-table:begin (generated from core/quality/tools.bzl; run `bazel run //docs:update_tool_configs`) -->"
END = "<!-- tool-config-table:end -->"
visibility(["//tools/docs/quality_configs"])

_HEADER = [
"| Tool | Level | Native file(s) | Base | Config source | Shared with |",
Expand Down Expand Up @@ -56,26 +51,4 @@ def tool_config_table():
config.config_source if config.ships_config else "",
", ".join(["`%s`" % id for id in others]),
))
return [BEGIN, ""] + _HEADER + rows + ["", END]

def tool_config_docs(name, page):
"""Declares the update target and currency test for the config table in `page`."""
write_file(
name = name + "_block",
out = name + "_block.md",
content = tool_config_table() + [""],
)
native.genrule(
name = name + "_page",
srcs = [page, ":" + name + "_block"],
outs = [name + "_page.md"],
cmd = """awk -v block="$(location :%s_block)" '
/<!-- tool-config-table:begin/ { while ((getline line < block) > 0) print line; skip = 1; next }
/<!-- tool-config-table:end -->/ { skip = 0; next }
!skip { print }
' $(location %s) > $@""" % (name, page),
)
write_source_files(
name = name,
files = {page: ":" + name + "_page"},
)
return _HEADER + rows
3 changes: 0 additions & 3 deletions csharp/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,6 @@ real_source_target(
real_source_target(
name = "corpus_markdown",
aspect_hints = ["//core/quality:corpus_vale_config"],
markdown_siblings = [
"//docs:languages/csharp.md",
],
markdown_srcs = ["README.md"],
tags = ["corpus"],
)
Expand Down
4 changes: 2 additions & 2 deletions csharp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Load its rules in a `BUILD.bazel` file, the file that declares what Bazel
builds, from `@rules_dx//csharp:defs.bzl`.
`extensions.bzl` holds the module extension: the part you call from
`MODULE.bazel` to set up toolchains and dependencies.
The tests live in `tests/`. The [C# page](../docs/languages/csharp.md) shows
The tests live in `tests/`. The [C# page](https://devhusdk.github.io/rules_dx/docs/languages/csharp.html) shows
setup, every rule and the tools dx runs.

Run the C# tests from a rules_dx checkout:
Expand Down Expand Up @@ -83,4 +83,4 @@ The test assembly counts only with `--instrument_test_targets`. Tag a test

## Platforms

See the [support matrix](https://github.com/devhusdk/rules_dx/blob/main/docs/support-matrix.md).
See the [support matrix](https://devhusdk.github.io/rules_dx/docs/support-matrix.html).
3 changes: 0 additions & 3 deletions cuda/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,6 @@ filegroup(

real_source_target(
name = "corpus_markdown",
markdown_siblings = [
"//docs:languages/cuda.md",
],
markdown_srcs = ["README.md"],
tags = ["corpus"],
)
Expand Down
4 changes: 2 additions & 2 deletions cuda/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Load its rules in a `BUILD.bazel` file, the file that declares what Bazel
builds, from `@rules_dx//cuda:defs.bzl`.
`extensions.bzl` holds the module extension: the part you call from
`MODULE.bazel` to set up toolchains and dependencies.
The tests live in `tests/`. The [CUDA page](../docs/languages/cuda.md) shows
The tests live in `tests/`. The [CUDA page](https://devhusdk.github.io/rules_dx/docs/languages/cuda.html) shows
setup, every rule and the tools dx runs.

Run the CUDA tests from a rules_dx checkout:
Expand Down Expand Up @@ -183,7 +183,7 @@ rules_dx declares the pinned nvcc toolchain; a consumer adds no

## Platforms

See the [support matrix](https://github.com/devhusdk/rules_dx/blob/main/docs/support-matrix.md).
See the [support matrix](https://devhusdk.github.io/rules_dx/docs/support-matrix.html).

On Windows, nvcc compiles with `cl.exe` from the hermetic Visual Studio Build Tools, so you don't set `--//cc:compiler`. `cuda_binary` and `cuda_test` build and link everything in them with `cl.exe`. Link a `cuda_library` into a `cuda_binary` or `cuda_test`: on Windows a `cc_binary` or `cc_test` only takes one under `--//cc:compiler=msvc`. Accept both licenses in the root `MODULE.bazel`: `dx_licenses.accept(ids = ["cuda-eula", "visual-studio-build-tools"])`.

Expand Down
4 changes: 0 additions & 4 deletions d/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,6 @@ toolchain_type(

real_source_target(
name = "corpus_markdown",
markdown_siblings = [
"//docs:languages/d.md",
"//docs:support-matrix.md",
],
markdown_srcs = ["README.md"],
tags = ["corpus"],
)
Expand Down
4 changes: 2 additions & 2 deletions d/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Load its rules in a `BUILD.bazel` file, the file that declares what Bazel
builds, from `@rules_dx//d:defs.bzl`.
`extensions.bzl` holds the module extension: the part you call from
`MODULE.bazel` to set up toolchains and dependencies.
The tests live in `tests/`. The [D page](../docs/languages/d.md) shows
The tests live in `tests/`. The [D page](https://devhusdk.github.io/rules_dx/docs/languages/d.html) shows
setup, every rule and the tools dx runs.

Run the D tests from a rules_dx checkout:
Expand Down Expand Up @@ -111,5 +111,5 @@ API reference.

## Platforms

The [support matrix](../docs/support-matrix.md) lists the platforms. On
The [support matrix](https://devhusdk.github.io/rules_dx/docs/support-matrix.html) lists the platforms. On
Windows arm64, the x64 LDC runs under emulation.
3 changes: 0 additions & 3 deletions dart/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ package(default_visibility = ["//:__subpackages__"])

real_source_target(
name = "corpus_markdown",
markdown_siblings = [
"//docs:languages/dart.md",
],
markdown_srcs = ["README.md"],
tags = ["corpus"],
)
Expand Down
2 changes: 1 addition & 1 deletion dart/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Load its rules in a `BUILD.bazel` file, the file that declares what Bazel
builds, from `@rules_dx//dart:defs.bzl`.
`extensions.bzl` holds the module extension: the part you call from
`MODULE.bazel` to set up toolchains and dependencies.
The tests live in `tests/`. The [Dart page](../docs/languages/dart.md) shows
The tests live in `tests/`. The [Dart page](https://devhusdk.github.io/rules_dx/docs/languages/dart.html) shows
setup, every rule and the tools dx runs.

Run the Dart tests from a rules_dx checkout:
Expand Down
2 changes: 1 addition & 1 deletion docs/AGENTS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Documentation Instructions

- Docs are for people who use or release rules_dx: command pages, guides, tutorials, the generated `docs/support-matrix.md`, READMEs, `examples/`, and runbooks like `RELEASING.md`.
- Docs are for people who use or release rules_dx: command pages, guides, tutorials, READMEs, `examples/`, and runbooks like `RELEASING.md`. The docs build generates doc pages such as the support matrix, the supported surface, the quality configs and the language pages. Never commit them.
- One page per command or task. Commands first. Short sentences.
- Write for a person who just arrived: start each page with one line on what it helps them do, then the steps. Use "you". Show a working example before the reference tables. Prefer everyday words over jargon, and explain a Bazel term the first time a page uses it.
- User docs stay complete: every command page documents its flags, scopes, output, reports, exit codes, and examples. Match `dx <command> --help`.
Expand Down
Loading
Loading