feat: add marzer.tomlplusplus 3.4.0 (official source + CN mirror + generated_files cppm)#64
Merged
Merged
Conversation
Sunrisepeak
requested changes
Jul 7, 2026
Sunrisepeak
requested changes
Jul 7, 2026
| package = { | ||
| spec = "1", | ||
| namespace = "compat", | ||
| name = "compat.tomlplusplus", |
Member
There was a problem hiding this comment.
namespace = "marzer",
name = "tomlplusplus",
Member
|
cppm 只在master分支可以参考 这个 json库的做法
mcpp-index/pkgs/n/nlohmann.json.lua Lines 68 to 70 in ac4cbff 可以使用 |
Add toml++ as a C++23 module package (import tomlplusplus).
- Add pkgs/c/compat.tomlplusplus.lua (module wrapper, MIT)
- Add tests/examples/tomlplusplus with import-based test
- Declares modules = { "tomlplusplus" } for import support
- Uses fork's src/modules/tomlplusplus.cppm as source
- SHA256: cefd81c09ae8eade62f254ba0903e4585944cc86e84c320a92116a95cb725862
toml++ is a TOML v1.0.0 config file parser and serializer for C++17+.
Fork: https://github.com/yspbwx2010/tomlplusplus @ v3.4.0-mcpp
mcpp 0.0.81 (CI version) requires package.version field. Successfully tested with mcpp 0.0.81: - Build: ✓ Downloaded compat.tomlplusplus v3.4.0 from GitHub - Compile: ✓ C++23 module + test binary (5.78s) - Run: ✓ Output 'toml++ test: OK'
…ted_files Reworks the package per review feedback (mcpplibs#64 review comment), following the nlohmann.json precedent. - Rename compat.tomlplusplus -> marzer.tomlplusplus (pkgs/m/), matching the `<namespace>.<lib>` convention used by nlohmann.json. - Drop the fork from the trust path: sources now come from upstream's own v3.4.0 release tarball (marzer/tomlplusplus), not yspbwx2010/tomlplusplus. - Add a real CN mirror: gitcode mcpp-res/tomlplusplus @ 3.4.0, byte-identical to the GLOBAL asset (same sha256), replacing the CN=GLOBAL placeholder. - Carry upstream's master-only src/modules/tomlplusplus.cppm via the `generated_files` mechanism as a [==[ ]==] multi-line string, so no fork is needed to obtain the module unit. - Replace the ad-hoc bin example with a `mcpp test --workspace` member under tests/examples/marzer.tomlplusplus/, registered in [workspace].members. The embedded cppm is byte-identical to upstream master except for one dropped line: `using TOML_NAMESPACE::get_line;`. get_line was added to impl/source_region.hpp after v3.4.0 and does not exist in the pinned headers ('get_line' has not been declared in 'toml'), so re-exporting it cannot compile. Documented in the descriptor.
Member
|
已按建议重做 👍 参考
一处需要注意的坑:上游 master 的 cppm 不能原样内嵌。里面的 所以内嵌版本删了这一行(其余逐字节一致),并在 descriptor 注释里写明了原因和后续恢复条件。 本地验证:GLOBAL / CN 两条路径 分支已 rebase 到最新 |
…age skill Steps 8/9 of the repo's add-mcpp-index-package SOP: register the package in the README's 'C++23 module wrapper' row alongside nlohmann.json, and record the shape decision, the CN mirror, the feature evaluation (none — header-only, options are compile-time defines that the features table cannot carry), and the get_line deviation with its negative-verification evidence.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
添加 toml++ —— C++17 的 TOML 解析/序列化库,以 C++23 模块形式提供,可直接
import tomlplusplus;。信息
marzer.tomlplusplus(pkgs/m/marzer.tomlplusplus.lua)v3.4.0release tarball按 review 意见重做(#64 comment)
参考
nlohmann.json.lua的做法,本次改动:yspbwx2010/tomlplusplus,直接用上游官方 v3.4.0 release tarball。信任链上没有 fork。compat.tomlplusplus→marzer.tomlplusplus,放到pkgs/m/下,与nlohmann.json的命名空间.库约定一致。generated_files机制:官方模块单元src/modules/tomlplusplus.cppm只在 master 分支、不在任何 release tag 里,改用generated_files+[==[ ]==]多行字符串内嵌,因此无需 fork 即可拿到 module unit。mcpp-res/tomlplusplus@3.4.0,替换原来CN = GLOBAL的占位。资产与 GLOBAL 逐字节相同(sha256 一致)。tests/examples/marzer.tomlplusplus/,已注册进[workspace].members,由mcpp test --workspace覆盖。内嵌的 cppm 与上游 master 逐行一致,只删了一行:
get_line是 v3.4.0 之后才加进impl/source_region.hpp的,pinned 的 v3.4.0 头文件里不存在,re-export 会直接编译失败:已在 descriptor 注释里写明。等上游发 >3.4.0 且带上
src/modules/tomlplusplus.cppm时,可切回sources = { "*/src/modules/tomlplusplus.cppm" }、删掉generated_files,get_line会随之回归。用法
本地验证
mcpp test(GLOBAL 源)parse ... ok— 1 passedmcpp test(MCPP_INDEX_MIRROR=CN,清缓存后真实重新下载)parse ... ok— 1 passed8517f659…d25155check_mirror_urls.lua)mcpp xpkg parse(CI pin 0.0.91 + 本地 0.0.93)