From 4df25fcec2f30a03a094142d2c97ce8411e2886d Mon Sep 17 00:00:00 2001 From: Greg Bowyer Date: Fri, 14 Mar 2025 13:15:36 -0700 Subject: [PATCH 1/2] rustdoc: make html_in_header work Signed-off-by: Greg Bowyer --- rust/private/rustdoc.bzl | 33 +++++++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/rust/private/rustdoc.bzl b/rust/private/rustdoc.bzl index 3cd3ee953b..b351d1b5e8 100644 --- a/rust/private/rustdoc.bzl +++ b/rust/private/rustdoc.bzl @@ -84,6 +84,17 @@ def rustdoc_compile_action( rustdoc_flags = rustdoc_flags + lints_info.rustdoc_lint_flags lint_files = lint_files + lints_info.rustdoc_lint_files + # Collect HTML customization files + html_input_files = [] + if hasattr(ctx.file, "html_in_header") and ctx.file.html_in_header: + html_input_files.append(ctx.file.html_in_header) + if hasattr(ctx.file, "html_before_content") and ctx.file.html_before_content: + html_input_files.append(ctx.file.html_before_content) + if hasattr(ctx.file, "html_after_content") and ctx.file.html_after_content: + html_input_files.append(ctx.file.html_after_content) + if hasattr(ctx.files, "markdown_css"): + html_input_files.extend(ctx.files.markdown_css) + cc_toolchain, feature_configuration = find_cc_toolchain(ctx) dep_info, build_info, _ = collect_deps( @@ -149,9 +160,12 @@ def rustdoc_compile_action( if "OUT_DIR" in env: env.update({"OUT_DIR": "${{pwd}}/{}".format(build_info.out_dir.short_path)}) + # Create the combined inputs including HTML customization files + all_inputs = depset([crate_info.output], transitive = [compile_inputs, depset(html_input_files)]) + return struct( executable = ctx.executable._process_wrapper, - inputs = depset([crate_info.output], transitive = [compile_inputs]), + inputs = all_inputs, env = env, arguments = args.all, tools = [toolchain.rust_doc], @@ -205,6 +219,21 @@ def _rust_doc_impl(ctx): "--extern", "{}={}".format(crate_info.name, crate_info.output.path), ] + + # Add HTML customization flags if attributes are provided + if ctx.attr.html_in_header: + rustdoc_flags.extend(["--html-in-header", ctx.file.html_in_header.path]) + + if ctx.attr.html_before_content: + rustdoc_flags.extend(["--html-before-content", ctx.file.html_before_content.path]) + + if ctx.attr.html_after_content: + rustdoc_flags.extend(["--html-after-content", ctx.file.html_after_content.path]) + + # Add markdown CSS files if provided + for css_file in ctx.files.markdown_css: + rustdoc_flags.extend(["--markdown-css", css_file.path]) + rustdoc_flags.extend(ctx.attr.rustdoc_flags) action = rustdoc_compile_action( @@ -239,7 +268,7 @@ def _rust_doc_impl(ctx): rustdoc_zip = depset([ctx.outputs.rust_doc_zip]), ), ] - + rust_doc = rule( doc = dedent("""\ Generates code documentation. From 415ef7c6eae03e76c0fca363ec512bf518dee2d4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 19 Mar 2025 18:12:21 +0000 Subject: [PATCH 2/2] Bump mio in /examples/crate_universe/vendor_remote_manifests Bumps [mio](https://github.com/tokio-rs/mio) from 0.8.0 to 0.8.11. - [Release notes](https://github.com/tokio-rs/mio/releases) - [Changelog](https://github.com/tokio-rs/mio/blob/master/CHANGELOG.md) - [Commits](https://github.com/tokio-rs/mio/compare/v0.8.0...v0.8.11) --- updated-dependencies: - dependency-name: mio dependency-type: indirect ... Signed-off-by: dependabot[bot] --- .../vendor_remote_manifests/Cargo.lock | 117 +++++++++++++----- 1 file changed, 85 insertions(+), 32 deletions(-) diff --git a/examples/crate_universe/vendor_remote_manifests/Cargo.lock b/examples/crate_universe/vendor_remote_manifests/Cargo.lock index 641895bec4..f32af6ba1a 100644 --- a/examples/crate_universe/vendor_remote_manifests/Cargo.lock +++ b/examples/crate_universe/vendor_remote_manifests/Cargo.lock @@ -1,6 +1,6 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -version = 3 +version = 4 [[package]] name = "async-stream" @@ -85,9 +85,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.119" +version = "0.2.171" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bf2e165bb3457c8e098ea76f3e3bc9db55f87aa90d52d0e6be741470916aaa4" +checksum = "c19937216e9d3aa9956d9bb8dfc0b0c8beb6058fc4f7a4dc4d850edf86a237d6" [[package]] name = "lock_api" @@ -115,33 +115,14 @@ checksum = "308cc39be01b73d0d18f82a0e7b2a3df85245f84af96fdddc5d202d27e47b86a" [[package]] name = "mio" -version = "0.8.0" +version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba272f85fa0b41fc91872be579b3bbe0f56b792aa361a380eb669469f68dafb2" +checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c" dependencies = [ "libc", "log", - "miow", - "ntapi", - "winapi", -] - -[[package]] -name = "miow" -version = "0.3.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9f1c5b025cda876f66ef43a113f91ebc9f4ccef34843000e0adf6ebbab84e21" -dependencies = [ - "winapi", -] - -[[package]] -name = "ntapi" -version = "0.3.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c28774a7fd2fbb4f0babd8237ce554b73af68021b5f695a3cebd6c59bac0980f" -dependencies = [ - "winapi", + "wasi", + "windows-sys 0.48.0", ] [[package]] @@ -180,7 +161,7 @@ dependencies = [ "libc", "redox_syscall", "smallvec", - "windows-sys", + "windows-sys 0.32.0", ] [[package]] @@ -342,6 +323,12 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3" +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + [[package]] name = "winapi" version = "0.3.9" @@ -370,39 +357,105 @@ version = "0.32.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3df6e476185f92a12c072be4a189a0210dcdcf512a1891d6dff9edb874deadc6" dependencies = [ - "windows_aarch64_msvc", - "windows_i686_gnu", - "windows_i686_msvc", - "windows_x86_64_gnu", - "windows_x86_64_msvc", + "windows_aarch64_msvc 0.32.0", + "windows_i686_gnu 0.32.0", + "windows_i686_msvc 0.32.0", + "windows_x86_64_gnu 0.32.0", + "windows_x86_64_msvc 0.32.0", +] + +[[package]] +name = "windows-sys" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +dependencies = [ + "windows-targets", +] + +[[package]] +name = "windows-targets" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" +dependencies = [ + "windows_aarch64_gnullvm", + "windows_aarch64_msvc 0.48.5", + "windows_i686_gnu 0.48.5", + "windows_i686_msvc 0.48.5", + "windows_x86_64_gnu 0.48.5", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc 0.48.5", ] +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" + [[package]] name = "windows_aarch64_msvc" version = "0.32.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d8e92753b1c443191654ec532f14c199742964a061be25d77d7a96f09db20bf5" +[[package]] +name = "windows_aarch64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" + [[package]] name = "windows_i686_gnu" version = "0.32.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a711c68811799e017b6038e0922cb27a5e2f43a2ddb609fe0b6f3eeda9de615" +[[package]] +name = "windows_i686_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" + [[package]] name = "windows_i686_msvc" version = "0.32.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "146c11bb1a02615db74680b32a68e2d61f553cc24c4eb5b4ca10311740e44172" +[[package]] +name = "windows_i686_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" + [[package]] name = "windows_x86_64_gnu" version = "0.32.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c912b12f7454c6620635bbff3450962753834be2a594819bd5e945af18ec64bc" +[[package]] +name = "windows_x86_64_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" + [[package]] name = "windows_x86_64_msvc" version = "0.32.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "504a2476202769977a040c6364301a3f65d0cc9e3fb08600b2bda150a0488316" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538"