mdbook preprocessor written as a `py_binary` is silently skipped
Maintainer thường phản hồi trong vòng 3 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 68/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- python
- Lĩnh vực
- build-system
Hướng nghiên cứu
Bắt đầu với quy tắc mdbook được nạp từ @rules_rust_mdbook//:defs.bzl và theo dõi cách thuộc tính plugins xử lý target py_binary cùng tệp thực thi của nó. Tái hiện vấn đề với các tệp MODULE.bazel, BUILD.bazel, book.toml và các tệp mẫu được cung cấp; hoàn thành khi bộ tiền xử lý mở rộng {{secret}} thành 42 và đầu ra build phản ánh sự mở rộng đó.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Description
I have an mdbook target whose preprocessor is a py_binary listed in plugins. The build succeeds, but the preprocessor never runs: the marker it should expand is left unchanged, and nothing appears in the build log to say so.
Reproduction steps
MODULE.bazel
module(name = "repro", version = "0.0.0")
bazel_dep(name = "rules_rust_mdbook", version = "0.73.0")
bazel_dep(name = "rules_python", version = "2.2.0")
BUILD.bazel
load("@rules_python//python:defs.bzl", "py_binary")
load("@rules_rust_mdbook//:defs.bzl", "mdbook")
py_binary(
name = "mdbook_secret",
srcs = ["mdbook_secret.py"],
data = ["secret.txt"],
)
mdbook(
name = "book",
srcs = glob(["src/**/*.md"]),
book = "book.toml",
plugins = [":mdbook_secret"],
)
book.toml
[book]
title = "Plugin Runfiles Repro"
src = "src"
[preprocessor.secret]
command = "mdbook_secret"
mdbook_secret.py
#!/usr/bin/env python3
"""Replaces {{secret}} with the contents of a data file."""
import json
import sys
from pathlib import Path
SECRET = Path(__file__).parent / "secret.txt"
def main() -> None:
if len(sys.argv) > 1 and sys.argv[1] == "supports":
sys.exit(0)
secret = SECRET.read_text().strip()
_context, book = json.load(sys.stdin)
for section in book["sections"]:
chapter = section.get("Chapter")
if chapter:
chapter["content"] = chapter["content"].replace("{{secret}}", secret)
print(json.dumps(book))
if __name__ == "__main__":
main()
secret.txt
42
src/SUMMARY.md
# Summary
- [Chapter 1](./chapter_1.md)
src/chapter_1.md
# Chapter 1
The secret is: {{secret}}.
Then:
$ bazel build //:book
INFO: Build completed successfully
$ grep -o "The secret is: [^<]*" bazel-bin/book/chapter_1.html
The secret is: {{secret}}.
Bazel and rules_rust version
Bazel version: 8.7.0
rules_python version 2.2.0
rules_rust_mdbook version: 0.73.0
- Ngôn ngữ chính
- Starlark
- Star
- 857
- Fork
- 701
- Merge trung bình
- 4 ngày 7 giờ
- Pull request đã merge (30 ngày)
- 46
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của bazelbuild/rules_rust
-
`rust_test(crate = ...)` does not stage the crate's transitive dynamic libraries into runfilesCó thể đã có người làm @Wito-1 đã nhận 65 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
bazelbuild/rules_rust#4309 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
Windows (no-symlink path): drain_runfiles_dir_windows deletes retained runfiles — inverted filename_suffixes_to_retain conditionCó thể đã có người làm @Mattbusel đã nhận 17 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
bazelbuild/rules_rust#4266 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
rust.toolchain(strip_level = ...) is silently ignoredCó thể đã có người làm @Mattbusel đã nhận 17 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
bazelbuild/rules_rust#4223 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 90/100
bazelbuild/rules_rust#4152 · 1 reaction ·
Maintainer thường phản hồi trong vòng 3 ngày
-
awaiting-response
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
bazelbuild/rules_rust#3599 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 3 ngày
Tất cả issue của bazelbuild/rules_rust
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
bazelbuild/apple_support#707 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 92/100
-
blocky: new version 0.38.0Đang mởout-of-date
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
CachyOS/CachyOS-PKGBUILDS#2232 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
blast/large refactor risk/low spend-dem
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
chriskelly/MusicWall#87 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
neilotoole/sq#1503 ·
Maintainer thường phản hồi trong vòng 1 ngày