From a4eecf5b6f0b1eeea0ed3f4a63f3ff522a8038ee Mon Sep 17 00:00:00 2001 From: Brentley Jones Date: Tue, 17 Oct 2023 08:28:57 -0500 Subject: [PATCH 1/2] Upgrade stardoc to 0.6.2 Needed to have Bazel `last_green` tests pass. Signed-off-by: Brentley Jones --- MODULE.bazel | 7 ++++++- WORKSPACE | 26 +++++++++++++++++++++++--- doc/rules.md | 37 +++++++++++++++---------------------- 3 files changed, 44 insertions(+), 26 deletions(-) diff --git a/MODULE.bazel b/MODULE.bazel index 5d4fc9c..c0309a2 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -9,7 +9,12 @@ module( bazel_dep(name = "bazel_skylib", version = "1.3.0") bazel_dep(name = "platforms", version = "0.0.7") -bazel_dep(name = "stardoc", version = "0.5.3", dev_dependency = True, repo_name = "io_bazel_stardoc") +bazel_dep( + name = "stardoc", + version = "0.6.2", + dev_dependency = True, + repo_name = "io_bazel_stardoc", +) apple_cc_configure = use_extension("//crosstool:setup.bzl", "apple_cc_configure_extension") use_repo(apple_cc_configure, "local_config_apple_cc", "local_config_apple_cc_toolchains") diff --git a/WORKSPACE b/WORKSPACE index a35c301..a278ce9 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -18,9 +18,29 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") http_archive( name = "io_bazel_stardoc", - sha256 = "c9794dcc8026a30ff67cf7cf91ebe245ca294b20b071845d12c192afe243ad72", + sha256 = "62bd2e60216b7a6fec3ac79341aa201e0956477e7c8f6ccc286f279ad1d96432", urls = [ - "https://mirror.bazel.build/github.com/bazelbuild/stardoc/releases/download/0.5.0/stardoc-0.5.0.tar.gz", - "https://github.com/bazelbuild/stardoc/releases/download/0.5.0/stardoc-0.5.0.tar.gz", + "https://mirror.bazel.build/github.com/bazelbuild/stardoc/releases/download/0.6.2/stardoc-0.6.2.tar.gz", + "https://github.com/bazelbuild/stardoc/releases/download/0.6.2/stardoc-0.6.2.tar.gz", ], ) + +load("@io_bazel_stardoc//:setup.bzl", "stardoc_repositories") + +stardoc_repositories() + +load("@rules_jvm_external//:repositories.bzl", "rules_jvm_external_deps") + +rules_jvm_external_deps() + +load("@rules_jvm_external//:setup.bzl", "rules_jvm_external_setup") + +rules_jvm_external_setup() + +load("@io_bazel_stardoc//:deps.bzl", "stardoc_external_deps") + +stardoc_external_deps() + +load("@stardoc_maven//:defs.bzl", stardoc_pinned_maven_install = "pinned_maven_install") + +stardoc_pinned_maven_install() diff --git a/doc/rules.md b/doc/rules.md index 2f66ade..5b5064c 100644 --- a/doc/rules.md +++ b/doc/rules.md @@ -1,20 +1,18 @@ - # Helper rules for Apple platforms - On this page: * [apple_genrule](#apple_genrule) * [toolchain_substitution](#toolchain_substitution) * [universal_binary](#universal_binary) - + ## apple_genrule
-apple_genrule(name, cmd, executable, message, no_sandbox, outs, srcs, tools)
+apple_genrule(name, srcs, outs, cmd, executable, message, no_sandbox, tools)
 
Genrule which provides Apple specific environment and make variables. @@ -65,23 +63,22 @@ NOTE: `DEVELOPER_DIR` and `SDKROOT` are environment variables and *not* make variables. To refer to them in `cmd` you must use environment variable syntax (i.e. using `$$`). Example: ```cmd = "xcrun --sdkroot $$SDKROOT clang...``` - **ATTRIBUTES** | Name | Description | Type | Mandatory | Default | | :------------- | :------------- | :------------- | :------------- | :------------- | -| name | A unique name for this target. | Name | required | | -| cmd | The command to run. Subject the variable substitution. | String | required | | -| executable | Declare output to be executable. Setting this flag to 1 means the output is an executable file and can be run using the run command. The genrule must produce exactly one output in this case. | Boolean | optional | False | -| message | A progress message to be reported as the rule runs. | String | optional | "" | -| no_sandbox | If the sandbox should be disabled when the action is run. | Boolean | optional | False | +| name | A unique name for this target. | Name | required | | +| srcs | A list of inputs for this rule, such as source files to process. | List of labels | optional | `[]` | | outs | A list of files generated by this rule. If the executable flag is set, outs must contain exactly one label. | List of labels | required | | -| srcs | A list of inputs for this rule, such as source files to process. | List of labels | optional | [] | -| tools | A list of tool dependencies for this rule, they will be available when the action is run. | List of labels | optional | [] | +| cmd | The command to run. Subject the variable substitution. | String | required | | +| executable | Declare output to be executable. Setting this flag to 1 means the output is an executable file and can be run using the run command. The genrule must produce exactly one output in this case. | Boolean | optional | `False` | +| message | A progress message to be reported as the rule runs. | String | optional | `""` | +| no_sandbox | If the sandbox should be disabled when the action is run. | Boolean | optional | `False` | +| tools | A list of tool dependencies for this rule, they will be available when the action is run. | List of labels | optional | `[]` | - + ## toolchain_substitution @@ -89,7 +86,6 @@ NOTE: `DEVELOPER_DIR` and `SDKROOT` are environment variables and *not* make toolchain_substitution(name, src, var_name) - Register a subsitution, from a variable to a file, for use in arguments in a target's attributes. Useful for passing custom tools to a compile or link. @@ -112,18 +108,17 @@ ios_application( ) ``` - **ATTRIBUTES** | Name | Description | Type | Mandatory | Default | | :------------- | :------------- | :------------- | :------------- | :------------- | -| name | A unique name for this target. | Name | required | | -| src | Source file to substitute | Label | required | | +| name | A unique name for this target. | Name | required | | +| src | Source file to substitute | Label | required | | | var_name | Name of the variable to substitute, ex: FOO | String | required | | - + ## universal_binary @@ -131,20 +126,18 @@ ios_application( universal_binary(name, binary) - This rule produces a multi-architecture ("fat") binary targeting Apple macOS platforms *regardless* of the architecture of the macOS host platform. The `lipo` tool is used to combine built binaries of multiple architectures. For non-macOS platforms, this simply just creates a symbolic link of the input binary. - **ATTRIBUTES** | Name | Description | Type | Mandatory | Default | | :------------- | :------------- | :------------- | :------------- | :------------- | -| name | A unique name for this target. | Name | required | | -| binary | Target to generate a 'fat' binary from. | Label | required | | +| name | A unique name for this target. | Name | required | | +| binary | Target to generate a 'fat' binary from. | Label | required | | From 21859ff24c97520a1c0c8183994255b4899ff738 Mon Sep 17 00:00:00 2001 From: Brentley Jones Date: Tue, 17 Oct 2023 09:12:21 -0500 Subject: [PATCH 2/2] Disable `--features=treat_warnings_as_errors` on CI for Bazel 6 Bazel 6.x has dependencies that produce warnings now. Signed-off-by: Brentley Jones --- .bazelci/presubmit.yml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/.bazelci/presubmit.yml b/.bazelci/presubmit.yml index 57c5e3e..92bd201 100644 --- a/.bazelci/presubmit.yml +++ b/.bazelci/presubmit.yml @@ -20,6 +20,14 @@ tasks: name: "Latest Bazel" bazel: latest <<: *common + build_flags: + # Bazel 6.x has dependencies that produce warnings now + # TODO: Remove once latest is Bazel 7+ + - "--features=-treat_warnings_as_errors" + test_flags: + # Bazel 6.x has dependencies that produce warnings now + # TODO: Remove once latest is Bazel 7+ + - "--features=-treat_warnings_as_errors" macos_latest_bzlmod: name: "Current LTS using bzlmod" @@ -35,8 +43,14 @@ tasks: - "-//doc/..." build_flags: - "--enable_bzlmod" + # Bazel 6.x has dependencies that produce warnings now + # TODO: Remove once latest is Bazel 7+ + - "--features=-treat_warnings_as_errors" test_flags: - "--enable_bzlmod" + # Bazel 6.x has dependencies that produce warnings now + # TODO: Remove once latest is Bazel 7+ + - "--features=-treat_warnings_as_errors" macos_last_green: name: "Last Green Bazel" @@ -51,6 +65,14 @@ tasks: # has landed on them breaking this project. - .bazelci/update_workspace_to_deps_heads.sh <<: *common + build_flags: + # Bazel 6.x has dependencies that produce warnings now + # TODO: Remove once latest is Bazel 7+ + - "--features=-treat_warnings_as_errors" + test_flags: + # Bazel 6.x has dependencies that produce warnings now + # TODO: Remove once latest is Bazel 7+ + - "--features=-treat_warnings_as_errors" linux_latest: name: "Current LTS on Linux"