diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c347800..0cbf36c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -5,7 +5,7 @@ # 退出码契约 + 宿主脚本冒烟)。 # 依赖:luiox-repo git 直连包(libca/libmcp/libjstr/libjbytecode/libjzip/ # libgarena/libjclassfile),由 CI 显式注册(root xmake.lua 不声明 -# add_repositories 到 luiox-repo 以外的远端);gtest/libarchive/zlib 走 xrepo。 +# add_repositories 到 luiox-repo 以外的远端);gtest/zlib 走 xrepo。 # mjbase:源码级依赖(公开仓 luiox/mjbase,定版 checkout 到 mjbase-src, # 经 --mjbase_root 指入;升级 mjbase 时同步更新下方 ref)。 @@ -33,7 +33,7 @@ jobs: uses: actions/checkout@v4 with: repository: luiox/mjbase - ref: 72cc5d72f79da48a6f33107103c528e9cc2d8269 + ref: 9b34b34cc9cba50b2a9e810d1b1387badc8a9d9b path: mjbase-src - name: Install system deps @@ -82,7 +82,7 @@ jobs: uses: actions/checkout@v4 with: repository: luiox/mjbase - ref: 72cc5d72f79da48a6f33107103c528e9cc2d8269 + ref: 9b34b34cc9cba50b2a9e810d1b1387badc8a9d9b path: mjbase-src - name: Setup xmake @@ -130,7 +130,7 @@ jobs: uses: actions/checkout@v4 with: repository: luiox/mjbase - ref: 72cc5d72f79da48a6f33107103c528e9cc2d8269 + ref: 9b34b34cc9cba50b2a9e810d1b1387badc8a9d9b path: mjbase-src - name: Setup Python 3.14 (python314.dll / include / libs for mjt-py) diff --git a/AGENTS.md b/AGENTS.md index 4409754..cf5aa6f 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -19,7 +19,7 @@ xmake run --gtest_brief=1 外部依赖只有 luiox-repo 中心包仓直连包(libca / libmcp / libjstr / libjzip / libgarena / libjclassfile / libjstd / libjdk_finder / -libjhasm + xrepo 的 gtest / libarchive / zlib / nlohmann_json; +libjhasm + xrepo 的 gtest / zlib / nlohmann_json; libjbc 走项目内联包定义,git 直连 + commit 锁),不引入仓内副本、不做 phony 垫片;各包嵌套的 libca 必须用 `add_requireconfs` 钉回同一 `LUIOX_LIBCA_VERSION`。 libjbytecode / libjblw 已全退役(B7 摘 libjblw,B8 8.7 摘 libjbytecode)。 diff --git a/README.md b/README.md index 70df729..acfe359 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,7 @@ xmake build mjt-mcp Dependencies are pulled directly from [luiox-repo](https://github.com/luiox/luiox-repo): libca, libmcp, libjstr, libjzip, libgarena, libjclassfile, libjstd, libjdk_finder, -libjhasm; libarchive / zlib / nlohmann_json come from +libjhasm; 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 diff --git a/README.zh-CN.md b/README.zh-CN.md index 888e9e3..2f83513 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -31,7 +31,7 @@ xmake build mjt-mcp 依赖经 [luiox-repo](https://github.com/luiox/luiox-repo) 直连拉取:libca、libmcp、 libjstr、libjzip、libgarena、libjclassfile、libjstd、 -libjdk_finder、libjhasm;libarchive / zlib / nlohmann_json 走 +libjdk_finder、libjhasm;zlib / nlohmann_json 走 [xrepo](https://xmake.io)。libjbc 走项目内联包定义(git 直连 + commit 锁,与 mjbase 同版本)。字节码基座本体是 mjbase,打包进 luiox-repo 前以兄弟目录源码级 依赖消费(`--mjbase_root`,默认 `../mjbase`)。 diff --git a/docs/rfc/0001-analysis-project-resource-container.md b/docs/rfc/0001-analysis-project-resource-container.md index 142d396..92ecb69 100644 --- a/docs/rfc/0001-analysis-project-resource-container.md +++ b/docs/rfc/0001-analysis-project-resource-container.md @@ -47,7 +47,7 @@ mjt 当前的分析载体是 **进程内 workspace**:MCP 会话里 `workspace_ ### 2.3 已落地的容器层:`mjbase::model` -`mjbase/mjbase/src/mjbase/model/`(module-map 批 2,libarchive 后端保留,`module-map.md:33`):`IResource`(URI + 类型化载荷:Class/Manifest/Jar/Unknown,`resource_model.hpp:39-47,111-122`)+ `IResourceContainer`(unordered_map + Utf8StringArena,重复条目 first-wins 对齐 JVM 类加载并记录 `duplicateResourceUris`,issue #962,`resource_container.hpp:9-11,32-110`)。 +`mjbase/mjbase/src/mjbase/model/`(module-map 批 2,`module-map.md:33`):`IResource`(URI + 类型化载荷:Class/Manifest/Jar/Unknown,`resource_model.hpp:39-47,111-122`)+ `IResourceContainer`(unordered_map + Utf8StringArena,重复条目 first-wins 对齐 JVM 类加载并记录 `duplicateResourceUris`,issue #962,`resource_container.hpp:9-11,32-110`)。 ### 2.4 公私边界与批次现状 diff --git a/xmake.lua b/xmake.lua index d47cea5..6d2fbd1 100644 --- a/xmake.lua +++ b/xmake.lua @@ -107,11 +107,7 @@ if has_config("with_tests") then add_requires("gtest") end --- libarchive:mjbase model 资源导入导出的跨平台解包后端(tar/xz/gz/zst)。 --- 本地覆盖包(xmake/repo/packages/l/libarchive/xmake.lua)规避官方包在 --- Linux 漏传 POSIX_REGEX_LIB=NONE 导致的编译失败。 -add_repositories("mjt-repo xmake/repo") -add_requires("libarchive 3.8.8", {configs = {openssl3 = false}}) +-- zlib:libjzip 传递需要;nlohmann_json:MCP 协议载荷。 add_requires("zlib") add_requires("nlohmann_json 3.12.0") diff --git a/xmake/repo/packages/l/libarchive/xmake.lua b/xmake/repo/packages/l/libarchive/xmake.lua deleted file mode 100644 index a96d08c..0000000 --- a/xmake/repo/packages/l/libarchive/xmake.lua +++ /dev/null @@ -1,83 +0,0 @@ --- 本地覆盖包:libarchive --- --- 为什么本地覆盖(而不是用 xmake-repo 官方定义): --- 官方 xmake-repo 的 libarchive 包只在 windows 传 -DPOSIX_REGEX_LIB=NONE, --- Linux 漏传。导致 libarchive cmake 第 1338 行在 ENABLE_LIBGCC=OFF 时走 ELSE --- 分支 MESSAGE(FATAL_ERROR "libgcc not found.")(其 ELSE 逻辑写反了)。 --- Linux libc 本有 regcomp,但 xrepo 静态编译环境下 CHECK_FUNCTION_EXISTS_GLIBC --- 检测失败而误入 PCREPOSIX 回退分支。 --- --- 修复:对所有平台都传 POSIX_REGEX_LIB=NONE,跳过该分支。ZipUtil 只用核心 API --- (archive_read_new/support_*/next_header/extract),不依赖 PCREPOSIX,禁用无影响。 --- --- 内容复制自 xmake-repo 官方 packages/l/libarchive/xmake.lua,仅改 POSIX_REGEX_LIB --- 那行(去掉 windows 守卫)。升级 libarchive/xmake-repo 时记得同步本文件。 - -package("libarchive") - set_homepage("https://libarchive.org/") - set_description("Multi-format archive and compression library") - set_license("BSD-2-Clause") - - add_urls("https://libarchive.org/downloads/libarchive-$(version).tar.gz") - add_urls("https://github.com/libarchive/libarchive/releases/download/v$(version)/libarchive-$(version).tar.gz") - - add_versions("3.8.8", "038918ea315cdd446cc63acfe880d6011832bbe1711c887de5de5441b306c190") - add_versions("3.8.7", "4b787cca6697a95c7725e45293c973c208cbdc71ae2279f30ef09f52472b9166") - add_versions("3.8.6", "213269b05aac957c98f6e944774bb438d0bd168a2ec60b9e4f8d92035925821c") - add_versions("3.8.5", "8a60f3a7bfd59c54ce82ae805a93dba65defd04148c3333b7eaa2102f03b7ffd") - add_versions("3.8.4", "b2c75b132a0ec43274d2867221befcb425034cd038e465afbfad09911abb1abb") - add_versions("3.7.7", "4cc540a3e9a1eebdefa1045d2e4184831100667e6d7d5b315bb1cbc951f8ddff") - add_versions("3.7.2", "df404eb7222cf30b4f8f93828677890a2986b66ff8bf39dac32a804e96ddf104") - add_versions("3.6.2", "ba6d02f15ba04aba9c23fd5f236bb234eab9d5209e95d1c4df85c44d5f19b9b3") - add_versions("3.5.2", "5f245bd5176bc5f67428eb0aa497e09979264a153a074d35416521a5b8e86189") - add_versions("3.5.1", "9015d109ec00bb9ae1a384b172bf2fc1dff41e2c66e5a9eeddf933af9db37f5a") - - add_deps("cmake") - add_deps("zlib", "bzip2", "lz4", "zstd") - - add_configs("openssl3", {description = "Enable use of OpenSSL.", default = true, type = "boolean"}) - add_configs("lzma", {description = "Enable use of LZMA.", default = false, type = "boolean"}) - - if is_plat("windows") then - add_syslinks("advapi32", "bcrypt", "ws2_32", "shlwapi", "user32", "crypt32") - end - - on_load(function (package) - if package:config("openssl3") then - package:add("deps", "openssl3", {configs = {shared = package:config("shared")}}) - end - if package:config("lzma") then - package:add("deps", "lzma") - end - end) - - on_install("windows", "linux", "macosx", function (package) - local configs = {"-DENABLE_TEST=OFF", - "-DENABLE_CAT=OFF", - "-DENABLE_TAR=OFF", - "-DENABLE_CPIO=OFF", - "-DENABLE_PCREPOSIX=OFF", - "-DENABLE_LibGCC=OFF", - "-DENABLE_LIBGCC=OFF", - "-DENABLE_ICONV=OFF", - "-DENABLE_ACL=OFF", - "-DENABLE_EXPAT=OFF", - "-DENABLE_LIBXML2=OFF", - "-DENABLE_LIBB2=OFF"} - table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release")) - table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) - table.insert(configs, "-DENABLE_OPENSSL=" .. (package:config("openssl3") and "ON" or "OFF")) - table.insert(configs, "-DENABLE_LZMA=" .. (package:config("lzma") and "ON" or "OFF")) - table.insert(configs, "-DENABLE_CNG=" .. (package:is_plat("windows") and "ON" or "OFF")) - -- [本地改动] 官方只在 windows 传,这里对所有平台都传,规避 Linux 的 - -- "libgcc not found" FATAL_ERROR(见文件头注释)。 - table.insert(configs, "-DPOSIX_REGEX_LIB=NONE") - if not package:config("shared") then - package:add("defines", "LIBARCHIVE_STATIC") - end - import("package.tools.cmake").install(package, configs) - end) - - on_test(function (package) - assert(package:has_cfuncs("archive_version_number", {includes = "archive.h"})) - end)