From 4493275a3f40ada534a66813f3d64a380492c284 Mon Sep 17 00:00:00 2001 From: Sunrisepeak Date: Sun, 22 Nov 2026 17:57:10 +0900 Subject: [PATCH] mwrap 5.8.3.2: the template writes its dependency selector unquoted (mcpp 2026.11.8.1 deprecates the quoted key) tools/test_template.py reads the unquoted key as the nested tables TOML makes of it, and requires that spelling in the rendered manifest. --- README.md | 4 ++-- README.zh.md | 4 ++-- mcpp.toml | 2 +- templates/pack/mcpp.toml.in | 2 +- tools/test_template.py | 11 +++++++---- 5 files changed, 13 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 63c4904..aa3a973 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ upstream's own test files with the same library. ## Getting started ```sh -mcpp new pack --template mcpplibs.mwrap.xz@5.8.3.1 +mcpp new pack --template mcpplibs.mwrap.xz@5.8.3.2 cd pack mcpp run ``` @@ -37,7 +37,7 @@ it, and prints the sizes and the checksum. ```toml [dependencies] -"mcpplibs.mwrap.xz" = "5.8.3.1" +mcpplibs.mwrap.xz = "5.8.3.2" ``` ```cpp diff --git a/README.zh.md b/README.zh.md index 804a7df..7ca40f4 100644 --- a/README.zh.md +++ b/README.zh.md @@ -24,7 +24,7 @@ C++ 常量。每次 CI 都用同一份库解码上游自己的测试文件。 ## 快速开始 ```sh -mcpp new pack --template mcpplibs.mwrap.xz@5.8.3.1 +mcpp new pack --template mcpplibs.mwrap.xz@5.8.3.2 cd pack mcpp run ``` @@ -33,7 +33,7 @@ mcpp run ```toml [dependencies] -"mcpplibs.mwrap.xz" = "5.8.3.1" +mcpplibs.mwrap.xz = "5.8.3.2" ``` ```cpp diff --git a/mcpp.toml b/mcpp.toml index c8fceea..4fd689d 100644 --- a/mcpp.toml +++ b/mcpp.toml @@ -2,7 +2,7 @@ [package] namespace = "mcpplibs.mwrap" name = "xz" -version = "5.8.3.1" +version = "5.8.3.2" description = "XZ Utils 5.8.3 liblzma C++ modules for mcpp (import mcpplibs.mwrap.xz;): .xz and .lzma streams, filters, blocks, indexes and checks over compat.xz, with the constants of lzma.h as C++ constants" license = "Apache-2.0" authors = ["mcpp-community"] diff --git a/templates/pack/mcpp.toml.in b/templates/pack/mcpp.toml.in index a637560..43c2cea 100644 --- a/templates/pack/mcpp.toml.in +++ b/templates/pack/mcpp.toml.in @@ -7,4 +7,4 @@ kind = "bin" main = "src/main.cpp" [dependencies] -"{{self.name}}" = "{{self.version}}" +{{self.name}} = "{{self.version}}" diff --git a/tools/test_template.py b/tools/test_template.py index 81ea805..07f1ca6 100644 --- a/tools/test_template.py +++ b/tools/test_template.py @@ -48,7 +48,10 @@ def main(): project = temporary / "quickstart" manifest = project / "mcpp.toml" text = manifest.read_text() - dependency = tomllib.loads(text)["dependencies"][identity] + # The key is unquoted, so TOML reads it as one table per segment. + dependency = tomllib.loads(text)["dependencies"] + for segment in identity.split("."): + dependency = dependency[segment] options = {"version": dependency} if isinstance(dependency, str) else dependency assert options["version"] == version, options replacement = '{ path = ' + json.dumps(package.as_posix()) @@ -56,9 +59,9 @@ def main(): replacement += ', features = ' + json.dumps(options["features"]) replacement += ' }' lines = text.splitlines() - matches = [i for i, line in enumerate(lines) if line.startswith(json.dumps(identity) + " =")] - assert len(matches) == 1, "Expected exactly one qualified dependency from self.name" - lines[matches[0]] = json.dumps(identity) + " = " + replacement + matches = [i for i, line in enumerate(lines) if line.startswith(identity + " =")] + assert len(matches) == 1, "Expected exactly one unquoted qualified dependency from self.name" + lines[matches[0]] = identity + " = " + replacement manifest.write_text("\n".join(lines) + "\n") if args.index: candidate_index = args.index.resolve()