Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,11 @@ xmake run <target> --gtest_brief=1

外部依赖只有 luiox-repo 中心包仓直连包(libca / libmcp / libjstr /
libjbytecode / libjzip / libgarena / libjclassfile / libjstd / libjdk_finder /
libjblw / libjhasm + xrepo 的 gtest / libarchive / zlib / nlohmann_json;
libjhasm + xrepo 的 gtest / libarchive / zlib / nlohmann_json;
libjbc 走项目内联包定义,git 直连 + commit 锁),不引入仓内副本、不做 phony
垫片;各包嵌套的 libca 必须用 `add_requireconfs` 钉回同一 `LUIOX_LIBCA_VERSION`。
libjbytecode 仅剩链接闭包兜底(mjbase.lib 的 relaxed_verifier 消费,
RFC 0002 B8 收口后随 mjbase 一并摘除);libjblw 已全退役(B7)。

## 约定

Expand Down
11 changes: 5 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,9 @@ xmake build mjt-mcp

Dependencies are pulled directly from
[luiox-repo](https://github.com/luiox/luiox-repo): libca, libmcp, libjstr,
libjbytecode, libjzip, libgarena, libjclassfile, libjstd, libjdk_finder,
libjblw, libjhasm; libarchive / zlib / nlohmann_json come from
libjbytecode (link-closure only, consumed by mjbase's relaxed_verifier until
RFC 0002 B8), libjzip, libgarena, libjclassfile, libjstd, libjdk_finder,
libjhasm; libarchive / zlib / nlohmann_json come from
[xrepo](https://xmake.io). libjbc is defined as an in-repo inline package
(git direct with a pinned commit, kept at the same version as mjbase). The
bytecode foundation itself is mjbase, consumed as a source-level sibling
Expand All @@ -56,8 +57,7 @@ failing. Test artifacts land in the `test/` directory of each project root and
can be redirected with `LIBCA_TEST_OUT_ROOT`.

The packaged libraries ship their own suites under `unittest/`
(`libjhasm_unittest`, `libjblw_unittest`, `libjdk_finder_unittest`), built and
run the same way.
(`libjhasm_unittest`, `libjdk_finder_unittest`), built and run the same way.

## Run

Expand All @@ -83,8 +83,7 @@ mjt/src/shared/ capabilities shared across the MCP tool set
mjt/skills/ MCP skill definitions
mjt-py/src/ embedded Python SDK (mjt --script embedded interpreter and
the mjt.pyd pybind11 binding; gated by --with_pysdk)
unittest/ suites for the packaged libraries (libjhasm, libjblw,
libjdk_finder)
unittest/ suites for the packaged libraries (libjhasm, libjdk_finder)
test_helper/ test scaffolding (gtest integration, artifact path resolution)
xmake/ build switches, inline libjbc package definition, embedded
libca rules, Windows manifest rule, package repository
Expand Down
9 changes: 5 additions & 4 deletions README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,9 @@ xmake build mjt-mcp
```

依赖经 [luiox-repo](https://github.com/luiox/luiox-repo) 直连拉取:libca、libmcp、
libjstr、libjbytecode、libjzip、libgarena、libjclassfile、libjstd、
libjdk_finder、libjblw、libjhasm;libarchive / zlib / nlohmann_json 走
libjstr、libjbytecode(仅链接闭包兜底——mjbase 的 relaxed_verifier 消费,
RFC 0002 B8 收口后摘除)、libjzip、libgarena、libjclassfile、libjstd、
libjdk_finder、libjhasm;libarchive / zlib / nlohmann_json 走
[xrepo](https://xmake.io)。libjbc 走项目内联包定义(git 直连 + commit 锁,与
mjbase 同版本)。字节码基座本体是 mjbase,打包进 luiox-repo 前以兄弟目录源码级
依赖消费(`--mjbase_root`,默认 `../mjbase`)。
Expand All @@ -47,7 +48,7 @@ xmake run mjt_mcp_unittest --gtest_brief=1
部分用例需要 JDK;缺失时相关用例 `GTEST_SKIP` 而非失败。测试产物落在各项目根的
`test/` 目录,可用 `LIBCA_TEST_OUT_ROOT` 改写。

已包化的各库在 `unittest/` 自带单测(`libjhasm_unittest`、`libjblw_unittest`、
已包化的各库在 `unittest/` 自带单测(`libjhasm_unittest`、
`libjdk_finder_unittest`),构建与运行方式相同。

## 运行
Expand All @@ -72,7 +73,7 @@ mjt/src/shared/ MCP 工具集共用的底层能力(反编译接入、jar 重
mjt/skills/ MCP 技能定义
mjt-py/src/ 嵌入式 Python SDK(mjt --script 嵌入解释器与 mjt.pyd
pybind11 binding;--with_pysdk 门控)
unittest/ 已包化各库的单测(libjhasm、libjblw、libjdk_finder)
unittest/ 已包化各库的单测(libjhasm、libjdk_finder)
test_helper/ 测试脚手架(gtest 集成、产物路径解析)
xmake/ 构建开关、libjbc 内联包定义、libca 规则内嵌、Windows manifest
规则、包仓覆盖
Expand Down
6 changes: 6 additions & 0 deletions docs/rfc/0002-libjbytecode-to-libjbc-migration.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,12 @@ mjbase 本身零 libjbytecode(纯 libjbc 基座)。
- 6.6 xmake 去 libjbytecode + 全链回归(pysdk 测试套全绿)。
- **B7 依赖图收尾**:mjt xmake.lua 去 libjbytecode/libjblw require/requireconf/
链接闭包项;luiox-repo libjbytecode 条目加弃用注记(不删);两仓最终回归。
- 执行注记(B7 落地):libjblw 全退役(libjhasm 0.3.2 换 libjbc 后端后
零消费方,unittest/jblw 消费验证套件随目标删除);libjbytecode 的
require/requireconf/链接闭包**保留**——mjbase.lib 的 relaxed_verifier
仍在消费(1969 个符号引用,dumpbin 实证),mjbase 被产品二进制链接,
闭包兜底不可去,随 B8 8.7(relaxed_verifier 移植 jhasm::analyze)
一并收口;luiox-repo 两包条目加弃用注记。
- **B8 mjbase 设施完善**(迁移完成后继续,同会话):
- 8.1 dev_plan 台账校准(A3/A4/A5 已在 libjbc 落地——stale 条目修正);
- 8.2 libjbc#10 move-range 原语实现(libjbc 仓:段重定位/标签随迁/边界
Expand Down
20 changes: 10 additions & 10 deletions test_helper/jdk_fixture.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ struct JdkToolchain
fs::path jdkIncludeWin; //<home>/include/win32
};

///probeJdk 的可选配置(透传给 jdk_finder::findJdk)。
///probeJdk 的可选配置(透传给 jdk_finder::find_jdk)。
struct ProbeOptions
{
///JAVA_HOME / MJT_JDK_HOME 都没命中时的额外回落候选。
Expand All @@ -169,21 +169,21 @@ struct ProbeOptions
bool requireJniHeader = false;
};

///探测 JDK 并解析 javac/java 路径。底层委托 jdk_finder::findJdk。
///探测 JDK 并解析 javac/java 路径。底层委托 jdk_finder::find_jdk。
inline JdkToolchain probeJdk(const ProbeOptions& opts = {})
{
JdkToolchain tc;
jdk_finder::FindOptions fopts;
fopts.fallbackHomes = opts.fallbackHomes;
fopts.requireJniHeader = opts.requireJniHeader;
auto loc = jdk_finder::findJdk(fopts);
tc.javaHome = loc.javaHome;
tc.jdkInclude = loc.jdkInclude;
tc.jdkIncludeWin = loc.jdkIncludePlat;
fopts.fallback_homes = opts.fallbackHomes;
fopts.require_jni_header = opts.requireJniHeader;
auto loc = jdk_finder::find_jdk(fopts);
tc.javaHome = loc.java_home;
tc.jdkInclude = loc.jdk_include;
tc.jdkIncludeWin = loc.jdk_include_plat;
tc.reason = loc.reason;
if (!loc.available) return tc;
tc.javac = jdk_finder::jdkExecutable(loc, "javac");
tc.java = jdk_finder::jdkExecutable(loc, "java");
tc.javac = jdk_finder::jdk_executable(loc, "javac");
tc.java = jdk_finder::jdk_executable(loc, "java");
if (tc.javac.empty() || tc.java.empty()) {
tc.available = false;
tc.reason = "javac 或 java 不存在: " + tc.javaHome.string();
Expand Down
88 changes: 0 additions & 88 deletions unittest/jblw/annotation_test.cpp

This file was deleted.

Loading
Loading