Skip to content

fix: Windows bklite_script 执行路径与 slim 补编缺失插件 - #7

Merged
ZhongmingFan merged 1 commit into
bklitefrom
fix/bklite-windows-script-and-slim
Nov 18, 2026
Merged

ZhongmingFan merged 1 commit into
bklitefrom
fix/bklite-windows-script-and-slim

Conversation

@ZhongmingFan

Copy link
Copy Markdown

供 Fan 查看 0.5.0 先验相关改动。先不合闸,等 Fan 看完。

本 PR 新提交(dc8c8a25,父 SHA 560fb482)

  • inputs.bklite_script Windows 修复:临时脚本补 .ps1 / .cmd,PowerShell 注入 -NoProfile -ExecutionPolicy Bypass -File,cmd 补 /C;避开 Windows\SystemTemp 与 Windows\Temp,改用 %ProgramData%\bklite_script;stdout/stderr 去 \r。
  • 追踪 build/slim-plugins.conf(原来被 /build 忽略),补上 outputs.file、inputs.postgresql_extensible、inputs.nginx_vts、inputs.sql。

关于 RocketMQ
消费偏移 / TPS / 堆积 diff 修复已经在 bklite 上(56c436f9 及后续 #5 / #6),本机工作区没有新的 RocketMQ 未提交改动,这次没有再叠一笔。

本地仍在 bklite。GitHub 要对现有 bklite 开出只含这批改动的 PR,head 不能还是 bklite 本身,所以把同一笔提交推到 fix/bklite-windows-script-and-slim。origin/bklite 先不更新。作者 / 提交者 zhongmingFan <fanzm96@gmail.com>,无 Cursor 署名。

Materialize scripts with .ps1/.cmd, inject PowerShell -File and cmd /C,
avoid Windows SystemTemp/Temp, and strip CR from stdout/stderr.

Track build/slim-plugins.conf so slim builds keep outputs.file,
inputs.postgresql_extensible, inputs.nginx_vts, and inputs.sql.

@ZhongmingFan ZhongmingFan left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

独立审 WeOps-Lab/telegraf #7 活 HEAD dc8c8a25a8600ed53ba7509695515239c59c43a3:PASS-with-residuals,must-fix 0。按 Fan 授权,审过后将用 Mac gh --merge 合入 bklite。

范围

  • 1 commit,父 560fb4820ad0cddfc968599c906edcc166d80845(与当前 live origin/bklite 一致,ahead 1 / behind 0,mergeable true)。
  • 作者/提交者均为 zhongmingFan <fanzm96@gmail.com>,无 Cursor 署名。
  • 本笔 9 文件 +434/−19:只动 .gitignore、build/slim-plugins.conf、plugins/inputs/bklite_script/*。未带 RocketMQ 改动,未带 snmp/sample.conf 或其它脏文件。

1. Windows inputs.bklite_script

  • 按解释器给临时脚本补后缀:powershell/pwsh → .ps1,cmd → .cmd,python → .py。
  • PowerShell 注入 -NoProfile -ExecutionPolicy Bypass -File(params 里已有的不重复);cmd 补 /C。
  • 默认或落到 Windows\SystemTemp / Windows\Temp 时改到 %ProgramData%\bklite_script(再不行用用户 cache)。用户目录下的 Local\Temp 不误伤。
  • stdout/stderr 去 \r 只在 run_windows.go(//go:build windows)。
  • 单测覆盖后缀、argv、受限临时目录、materialize .ps1、去 \r。

2. slim 补编

  • .gitignore 从 /build 改为 /build/* 并白名单 !/build/slim-plugins.conf,写法正确。
  • build/slim-plugins.conf 已含 outputs.file、inputs.postgresql_extensible、inputs.nginx_vts、inputs.sql,以及探测/下发常用的 inputs.bklite_script、processors.starlark / enum / converter、win_perf_counters、outputs.nats / kafka / influxdb 等。
  • 其中 user:pass@tcp(127.0.0.1:3306) 等是 custom_builder 占位,不是现场凭据。

残留(不挡合)

  • CI Target Branch / master 失败:工作流要求 PR 基于 master,本单正确以 bklite 为 base,2 秒内 exit 1。Lint Code Base 已通过。不视为本单缺陷。
  • head 是 fix/bklite-windows-script-and-slim 而不是直接推 bklite:GitHub 不能对同一分支开 PR,父提交已是 live bklite,合入后 bklite 即前进。
  • .bat 未单独给后缀(只处理 cmd → .cmd);本轮先验是 PowerShell。
  • 空 run_dir 在非 SYSTEM 临时目录下的默认改道,单测未在 Windows SYSTEM 环境实跑(显式 SystemTemp 路径已覆盖)。

合闸只合本单,不顺带其它分支。

@ZhongmingFan
ZhongmingFan merged commit 4b51885 into bklite Nov 18, 2026
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant