From bb8960c5eba48f4e94755f4e9d2b44f7d8bce0cc Mon Sep 17 00:00:00 2001 From: cflmy Date: Wed, 18 Nov 2026 09:53:33 +0800 Subject: [PATCH] =?UTF-8?q?fix(env):=20=E9=87=8D=E6=94=BE=E6=B5=8B?= =?UTF-8?q?=E8=AF=95=E5=8F=AF=E7=A7=BB=E6=A4=8D=20shebang=20+=20dev-env=20?= =?UTF-8?q?=E5=B7=A5=E5=85=B7=E7=AE=B1=E7=9B=AE=E5=BD=95=E2=80=94=E2=80=94?= =?UTF-8?q?=E5=85=A8=E9=87=8F=201105=20=E6=B5=8B=E8=AF=95=E9=9B=B6?= =?UTF-8?q?=E5=A4=B1=E8=B4=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - notebook_api.rs:replay 包装脚本 shebang /usr/bin/python3 → /usr/bin/env python3(本机 /usr/bin 只读无 python3,CI 与工具链均兼容); - scripts/dev-env.sh:PATH 预置 target/toolchain/bin(本机 zip shim 所在,gitignored;CI 用真实 zip),修复 release_handbook packs 边界 cannot start zip 环境缺口; - 全量 cargo test:1105 通过 / 0 失败(此前 2 个记录在案的环境基线 失败——replay python 包装与 packs zip——均已消除)。 --- scripts/dev-env.sh | 1 + src/view/notebook_api.rs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/dev-env.sh b/scripts/dev-env.sh index 50e5a10..252b3a9 100755 --- a/scripts/dev-env.sh +++ b/scripts/dev-env.sh @@ -30,6 +30,7 @@ export ZIG_GLOBAL_CACHE_DIR="${ZIG_GLOBAL_CACHE_DIR:-$_tc/zigcache}" export ZIG_LOCAL_CACHE_DIR="${ZIG_LOCAL_CACHE_DIR:-$_tc/zigcache}" _prepend_existing "$_zshim/bin" +_prepend_existing "$_tc/bin" _prepend_existing "$_tc/python/bin" _prepend_existing "$_tc/go/bin" _prepend_existing "$_tc/cargo/bin" diff --git a/src/view/notebook_api.rs b/src/view/notebook_api.rs index 11023e1..900eaf5 100755 --- a/src/view/notebook_api.rs +++ b/src/view/notebook_api.rs @@ -609,7 +609,7 @@ mod replay_api_tests { let relative=format!("target/api-replay-seeded-{pid}.mq.md");let path=root.join(&relative); let wrapper=root.join(format!("target/api-replay-wrapper-{pid}.py"));let marker=root.join(format!("target/api-replay-marker-{pid}")); let marker_literal=serde_json::to_string(&marker.display().to_string()).unwrap(); - let script=format!("#!/usr/bin/python3\nimport os,sys\nfrom pathlib import Path\nPath({marker_literal}).write_text('started')\nos.execv(sys.executable,[sys.executable]+sys.argv[1:])\n"); + let script=format!("#!/usr/bin/env python3\nimport os,sys\nfrom pathlib import Path\nPath({marker_literal}).write_text('started')\nos.execv(sys.executable,[sys.executable]+sys.argv[1:])\n"); std::fs::write(&wrapper,script).unwrap();std::fs::set_permissions(&wrapper,std::fs::Permissions::from_mode(0o755)).unwrap(); let command=serde_json::to_string(&wrapper.display().to_string()).unwrap(); let source=format!("---\nimport:\n foreign: lib/foreign.mq.md\n---\n# main\n\n`kernels` =\n| 名称 | 语言 | 命令 |\n|---|---|---|\n| py | python | {command} |\n\n`units` =\n| 单元 | 内核 |\n|---|---|\n| a | py |\n\n`initial` =\n| 内核 | 名称 | 值 |\n|---|---|---|\n| py | n | 1 |\n\n`会话` = > foreign.session kernels=`kernels` cells=`units` values=`initial`\n\n`a` =\n```python\nprint(n)\n```\n");