From 31747b7bd9f5bfc3e0798b98878bb7556389f32a 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 | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/rust/private/rustdoc.bzl b/rust/private/rustdoc.bzl index 3cd3ee953b..67845c34ca 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( From 311c97035d5ed6e3e5d303c53289bcd551b5744e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 4 Apr 2025 20:37:59 +0000 Subject: [PATCH 2/2] Bump openssl in /crate_universe/test_data/metadata/build_scripts Bumps [openssl](https://github.com/sfackler/rust-openssl) from 0.10.52 to 0.10.72. - [Release notes](https://github.com/sfackler/rust-openssl/releases) - [Commits](https://github.com/sfackler/rust-openssl/compare/openssl-v0.10.52...openssl-v0.10.72) --- updated-dependencies: - dependency-name: openssl dependency-version: 0.10.72 dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- .../metadata/build_scripts/Cargo.lock | 20 ++++++++++++------- .../metadata/build_scripts/Cargo.toml | 2 +- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/crate_universe/test_data/metadata/build_scripts/Cargo.lock b/crate_universe/test_data/metadata/build_scripts/Cargo.lock index 19963bcd8b..5a5ba20c0b 100644 --- a/crate_universe/test_data/metadata/build_scripts/Cargo.lock +++ b/crate_universe/test_data/metadata/build_scripts/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 = "bitflags" @@ -8,6 +8,12 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" +[[package]] +name = "bitflags" +version = "2.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c8214115b7bf84099f1309324e63141d4c5d7cc26862f97a0a857dbefe165bd" + [[package]] name = "build-scripts" version = "0.1.0" @@ -61,7 +67,7 @@ version = "0.17.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b7905cdfe33d31a88bb2e8419ddd054451f5432d1da9eaf2ac7804ee1ea12d5" dependencies = [ - "bitflags", + "bitflags 1.3.2", "libc", "libgit2-sys", "log", @@ -152,11 +158,11 @@ checksum = "da32515d9f6e6e489d7bc9d84c71b060db7247dc035bbe44eac88cf87486d8d5" [[package]] name = "openssl" -version = "0.10.52" +version = "0.10.72" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01b8574602df80f7b85fdfc5392fa884a4e3b3f4f35402c070ab34c3d3f78d56" +checksum = "fedfea7d58a1f73118430a55da6a286e7b044961736ce96a16a17068ea25e5da" dependencies = [ - "bitflags", + "bitflags 2.9.0", "cfg-if", "foreign-types", "libc", @@ -184,9 +190,9 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-sys" -version = "0.9.87" +version = "0.9.107" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e17f59264b2809d77ae94f0e1ebabc434773f370d6ca667bd223ea10e06cc7e" +checksum = "8288979acd84749c744a9014b4382d42b8f7b2592847b5afb2ed29e5d16ede07" dependencies = [ "cc", "libc", diff --git a/crate_universe/test_data/metadata/build_scripts/Cargo.toml b/crate_universe/test_data/metadata/build_scripts/Cargo.toml index 1dd7f34707..ef7fe284ee 100644 --- a/crate_universe/test_data/metadata/build_scripts/Cargo.toml +++ b/crate_universe/test_data/metadata/build_scripts/Cargo.toml @@ -11,5 +11,5 @@ path = "lib.rs" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -openssl = "=0.10.52" +openssl = "=0.10.72" git2 = "=0.17.1"