statechart: a relative TLA2TOOLS or JAVA path fails, because TLC runs in the snapshot folder
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 78/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- node.js, typescript
- 领域
- tooling
调研方向
阅读 pstack/skills/statechart/scripts/tlc-tools.mjs 和 pstack/skills/statechart/scripts/statechart.mjs,重点了解 findTlc 如何解析 TLA2TOOLS 和 JAVA,以及 tlc() 如何设置其工作目录。使用 issue 中的相对路径和绝对路径重现问题。当从调用方目录接受的路径在 snapshot 文件夹中也能正常工作,且 from-spec 可以运行 TLC 时,即为完成。
由索引模型根据 Issue 内容生成。
描述
What happens
findTlc in pstack/skills/statechart/scripts/tlc-tools.mjs checks that TLA2TOOLS and JAVA exist from the caller's working directory, then returns them as given. tlc() in statechart.mjs starts java with cwd set to the folder of the spec's snapshot copy under $TMPDIR/statechart-inputs-*/. Java resolves a relative -cp against that folder, so it cannot find the jar, and from-spec exits with cannot run TLC. A relative JAVA with a slash, such as ./jdk/bin/java, starts from the same folder.
Reproduce
Tested at 9e88dad on macOS with Node 25.8.0. The stand-in java prints the folder it runs in and whether it can see the -cp jar.
mkdir repro && cd repro && mkdir tools && touch tools/tla2tools.jar
cat > fake-java <<'EOF'
#!/bin/sh
cp=""; prev=""; for a in "$@"; do [ "$prev" = "-cp" ] && cp="$a"; prev="$a"; done
echo "java runs in: $PWD" >&2
if [ -e "$cp" ]; then echo "jar $cp: found" >&2; else echo "jar $cp: not found" >&2; fi
exit 1
EOF
chmod +x fake-java
printf -- '---- MODULE Spec ----\nEXTENDS Naturals\nVARIABLE x\nInit == x = 0\nNext == x'"'"' = x\n====\n' > Spec.tla
printf 'INIT Init\nNEXT Next\n' > Spec.cfg
S=/path/to/pstack/skills/statechart/scripts/statechart.mjs
export JAVA=$PWD/fake-java
TLA2TOOLS=tools/tla2tools.jar node $S from-spec Spec.tla # writes Spec.map.mjs
TLA2TOOLS=tools/tla2tools.jar node $S from-spec Spec.tla
TLA2TOOLS=$PWD/tools/tla2tools.jar node $S from-spec Spec.tla
With the relative path:
cannot run TLC with .../fake-java -cp tools/tla2tools.jar: java exited 1:
java runs in: $TMPDIR/statechart-inputs-B8EIpr/<absolute path of repro>
jar tools/tla2tools.jar: not found
With the absolute path, java runs in the same snapshot folder and prints jar <absolute path>: found.
Expected
A TLA2TOOLS or JAVA path that exists from the caller's directory, which findTlc already checks, also works when TLC runs.
- 主要语言
- TypeScript
- 星标
- 13.9k
- 派生
- 1.4k
- 平均合并
- 7 小时 5 分钟
- 30 天内合并 PR
- 150
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
cursor/plugins 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 65/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 66/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 65/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
create-plugin README documents a /create-plugin command that does not exist可能已有人在做 @lab1207 于 25 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复
相似的 Issue
-
area: server priority: P3 type: bug
难度 2/5 1-3 小时 新手友好度 83/100
appandflow/stim#4538 ·
维护者通常 1 天内回复
-
[BUG] Published Docker images lack the redis extra: HEADROOM_COMPRESS_SESSION_STORE stops startup可能已有人在做 @AlessandroSpallina 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 76/100
headroomlabs-ai/headroom#4513 ·
维护者通常 1 天内回复
-
bug extension extension: obsidian platform: Windows
难度 2/5 1-3 小时 新手友好度 68/100
raycast/extensions#32838 · 1 条评论 ·
维护者通常 1 天内回复
-
copy design-review mac P3
难度 2/5 1-3 小时 新手友好度 88/100
tosunlab/hisarapp-core#510 ·
-
bug priority-medium to-agent
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复