-
Notifications
You must be signed in to change notification settings - Fork 11
feat: 包身份规范化 —— 上游库归上游命名空间,版本对齐上游 #165
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
50 changes: 50 additions & 0 deletions
pkgs/f/ffmpeg.ffmpeg.lua
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| -- FFmpeg 的 C++23 module 层(import ffmpeg.av;),建在 compat.ffmpeg 的源码构建之上。 | ||
| -- | ||
| -- 由 `mcpplibs:ffmpeg@0.0.3` 迁来 —— 那个版本号是打包计数,真实答案一直写在 | ||
| -- ffmpeg-m 自己的 manifest 里:compat.ffmpeg = "8.1.2"。旧条目冻结保留。 | ||
| -- 命名空间说的是这个库是谁的,不是谁打的包;版本说的是你拿到的是哪一版上游。 | ||
| -- 规则与全生态迁移表:mcpp-index#163。 | ||
| -- | ||
| -- `mcpplibs` 是 mcpp 的**默认命名空间**(`kDefaultNamespace`),裸名就落在那里 —— | ||
| -- 它不是"上游是谁"的答案。因此上游库迁到上游 org 名下,消费者写限定名。 | ||
| package = { | ||
| spec = "1", | ||
| namespace = "ffmpeg", | ||
| name = "ffmpeg", | ||
| description = "FFmpeg 8.1.2 C++ modules for mcpp (import ffmpeg.av;) on top of the compat.ffmpeg source build", | ||
| licenses = {"MIT"}, | ||
| repo = "https://github.com/mcpplibs/ffmpeg-m", | ||
| type = "package", | ||
|
|
||
| xpm = { | ||
| linux = { | ||
| ["8.1.2"] = { | ||
| url = { | ||
| GLOBAL = "https://github.com/mcpplibs/ffmpeg-m/archive/refs/tags/v8.1.2.tar.gz", | ||
| CN = "https://gitcode.com/mcpp-res/ffmpeg/releases/download/8.1.2/ffmpeg-m-8.1.2.tar.gz", | ||
| }, | ||
| sha256 = "776d37fcaeb2b829185877b24c8ea9f663ff2b1c3d5db7425c4a29f8b0b9bc6c", | ||
| }, | ||
| }, | ||
| macosx = { | ||
| ["8.1.2"] = { | ||
| url = { | ||
| GLOBAL = "https://github.com/mcpplibs/ffmpeg-m/archive/refs/tags/v8.1.2.tar.gz", | ||
| CN = "https://gitcode.com/mcpp-res/ffmpeg/releases/download/8.1.2/ffmpeg-m-8.1.2.tar.gz", | ||
| }, | ||
| sha256 = "776d37fcaeb2b829185877b24c8ea9f663ff2b1c3d5db7425c4a29f8b0b9bc6c", | ||
| }, | ||
| }, | ||
| windows = { | ||
| ["8.1.2"] = { | ||
| url = { | ||
| GLOBAL = "https://github.com/mcpplibs/ffmpeg-m/archive/refs/tags/v8.1.2.tar.gz", | ||
| CN = "https://gitcode.com/mcpp-res/ffmpeg/releases/download/8.1.2/ffmpeg-m-8.1.2.tar.gz", | ||
| }, | ||
| sha256 = "776d37fcaeb2b829185877b24c8ea9f663ff2b1c3d5db7425c4a29f8b0b9bc6c", | ||
| }, | ||
| }, | ||
| }, | ||
|
|
||
| -- (无 `mcpp` 字段 —— 默认查找会命中 <verdir>/*/mcpp.toml) | ||
| } |
12 changes: 12 additions & 0 deletions
pkgs/f/ffmpeg.lua
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
47 changes: 47 additions & 0 deletions
pkgs/g/ggml-org.llamacpp.lua
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| -- llama.cpp 的 C++23 module 层(import llamacpp;),内含 pin 住的上游 checkpoint。 | ||
| -- | ||
| -- 版本就是上游的构建号。旧的 `0.1.0` 需要一张对照表才能读懂 —— llama.cpp-m 的 | ||
| -- README 当时正是这么写的:"Version 0.1.0 maps to llama.cpp b10069"。 | ||
| -- | ||
| -- `b10069` 不是 semver。已实测 mcpp 能处理:解析、版本键匹配、wire 寻址都正常; | ||
| -- 不成立的只有**范围**(`^b10069` 解析不了),所以消费者精确 pin。见 mcpp#363。 | ||
| -- | ||
| -- 无 CN 镜像(与迁移前一致):mcpp-res 下没有对应仓库,而 docs/cn-mirror.md 明文 | ||
| -- 允许单字符串 url 作为正当回退 —— lint 只对表形式要求 CN 指向 gitcode。 | ||
| -- 命名空间说的是这个库是谁的,不是谁打的包;版本说的是你拿到的是哪一版上游。 | ||
| -- 规则与全生态迁移表:mcpp-index#163。 | ||
| -- | ||
| -- `mcpplibs` 是 mcpp 的**默认命名空间**(`kDefaultNamespace`),裸名就落在那里 —— | ||
| -- 它不是"上游是谁"的答案。因此上游库迁到上游 org 名下,消费者写限定名。 | ||
| package = { | ||
| spec = "1", | ||
| namespace = "ggml-org", | ||
| name = "llamacpp", | ||
| description = "C++23 module package for llama.cpp b10069 (import llamacpp;)", | ||
| licenses = {"MIT"}, | ||
| repo = "https://github.com/mcpplibs/llama.cpp-m", | ||
| type = "package", | ||
|
|
||
| xpm = { | ||
| linux = { | ||
| ["b10069"] = { | ||
| url = "https://github.com/mcpplibs/llama.cpp-m/archive/refs/tags/b10069.tar.gz", | ||
| sha256 = "be0b0deeb31136ea9cf0ba61eda1fb7baf8795a6579494a0991afd2323213e0b", | ||
| }, | ||
| }, | ||
| macosx = { | ||
| ["b10069"] = { | ||
| url = "https://github.com/mcpplibs/llama.cpp-m/archive/refs/tags/b10069.tar.gz", | ||
| sha256 = "be0b0deeb31136ea9cf0ba61eda1fb7baf8795a6579494a0991afd2323213e0b", | ||
| }, | ||
| }, | ||
| windows = { | ||
| ["b10069"] = { | ||
| url = "https://github.com/mcpplibs/llama.cpp-m/archive/refs/tags/b10069.tar.gz", | ||
| sha256 = "be0b0deeb31136ea9cf0ba61eda1fb7baf8795a6579494a0991afd2323213e0b", | ||
| }, | ||
| }, | ||
| }, | ||
|
|
||
| -- (无 `mcpp` 字段 —— 默认查找会命中 <verdir>/*/mcpp.toml) | ||
| } |
61 changes: 61 additions & 0 deletions
pkgs/g/grpc-plugin.lua
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,61 @@ | ||
| -- grpc_cpp_plugin —— gRPC 的 C++ 代码生成器,作为 mcpp host tool 构建。 | ||
| -- | ||
| -- 为什么是独立包而不是 grpc 里的一个 target:mcpp 把一个包编成**一个对象池**, | ||
| -- 并把其中每个实现对象链进该包的每个 kind="bin" 目标(src/build/plan.cppm 的 | ||
| -- "Also include implementation .cpp/.cc/.cxx/.c units")。没有 per-target 源码 | ||
| -- 分区。所以插件若住在 grpc 里,会链进全部约 1000 个 gRPC TU,并继承 OpenSSL / | ||
| -- re2 / c-ares / zlib —— 而它真正需要的只有 protobuf 的 libprotoc(9 个 TU)。 | ||
| -- | ||
| -- 也因此它的平台覆盖比主包宽:主包受 compat.openssl 的 windows 缺口限制,插件不受。 | ||
| -- | ||
| -- 代码是上游的(plugin/src/compiler/* 每个文件都是 Copyright gRPC authors), | ||
| -- 所以归 `grpc` 命名空间。 | ||
| -- | ||
| -- manifest 在归档的 plugin/ 子目录里,默认查找(<verdir>/mcpp.toml 与 | ||
| -- <verdir>/*/mcpp.toml)够不到两级,故用显式 mcpp 指针。 | ||
| -- 命名空间说的是这个库是谁的,不是谁打的包;版本说的是你拿到的是哪一版上游。 | ||
| -- 规则与全生态迁移表:mcpp-index#163。 | ||
| -- | ||
| -- `mcpplibs` 是 mcpp 的**默认命名空间**(`kDefaultNamespace`),裸名就落在那里 —— | ||
| -- 它不是"上游是谁"的答案。因此上游库迁到上游 org 名下,消费者写限定名。 | ||
| package = { | ||
| spec = "1", | ||
| namespace = "grpc", | ||
| name = "grpc-plugin", | ||
| description = "grpc_cpp_plugin 1.83.0 — the gRPC C++ code generator, buildable as an mcpp host tool", | ||
| licenses = {"Apache-2.0"}, | ||
| repo = "https://github.com/mcpplibs/grpc-m", | ||
| type = "package", | ||
|
|
||
| xpm = { | ||
| linux = { | ||
| ["1.83.0"] = { | ||
| url = { | ||
| GLOBAL = "https://github.com/mcpplibs/grpc-m/archive/refs/tags/v1.83.0-2.tar.gz", | ||
| CN = "https://gitcode.com/mcpp-res/grpc/releases/download/1.83.0/grpc-m-1.83.0-2.tar.gz", | ||
| }, | ||
| sha256 = "9083a85879f67b726d68130ca8374e791e3cc73f9fff8d324cde11314c70b06e", | ||
| }, | ||
| }, | ||
| macosx = { | ||
| ["1.83.0"] = { | ||
| url = { | ||
| GLOBAL = "https://github.com/mcpplibs/grpc-m/archive/refs/tags/v1.83.0-2.tar.gz", | ||
| CN = "https://gitcode.com/mcpp-res/grpc/releases/download/1.83.0/grpc-m-1.83.0-2.tar.gz", | ||
| }, | ||
| sha256 = "9083a85879f67b726d68130ca8374e791e3cc73f9fff8d324cde11314c70b06e", | ||
| }, | ||
| }, | ||
| windows = { | ||
| ["1.83.0"] = { | ||
| url = { | ||
| GLOBAL = "https://github.com/mcpplibs/grpc-m/archive/refs/tags/v1.83.0-2.tar.gz", | ||
| CN = "https://gitcode.com/mcpp-res/grpc/releases/download/1.83.0/grpc-m-1.83.0-2.tar.gz", | ||
| }, | ||
| sha256 = "9083a85879f67b726d68130ca8374e791e3cc73f9fff8d324cde11314c70b06e", | ||
| }, | ||
| }, | ||
| }, | ||
|
|
||
| mcpp = "*/plugin/mcpp.toml", | ||
| } |
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
61 changes: 61 additions & 0 deletions
pkgs/g/grpcgen.lua
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,61 @@ | ||
| -- grpcgen —— protoc + grpc_cpp_plugin 的调用收成一条可 import 的构建规则。 | ||
| -- | ||
| -- [dependencies] | ||
| -- grpcgen = { version = "1.83.0", host-module = true } | ||
| -- | ||
| -- // build.mcpp | ||
| -- import mcpp; | ||
| -- import grpcgen; | ||
| -- int main() { return grpcgen::generate({"helloworld"}) ? 0 : 1; } | ||
| -- | ||
| -- 这是本生态**自己写的** 163 行 C++(不是上游任何东西),所以留在 `mcpplibs`。 | ||
| -- 包名承重:mcpp 用依赖的裸 package.name 注册 host 模块,故包名即模块名,必须是 | ||
| -- 合法 C++ 模块名 —— `grpc-rules` 不行(连字符),`grpcgen` 可以。 | ||
| -- | ||
| -- 需要 mcpp >= 2026年8月5日.2:规则里 `import std;` 与 `import mcpp;` 在此之前都编不过。 | ||
| -- 命名空间说的是这个库是谁的,不是谁打的包;版本说的是你拿到的是哪一版上游。 | ||
| -- 规则与全生态迁移表:mcpp-index#163。 | ||
| -- | ||
| -- `mcpplibs` 是 mcpp 的**默认命名空间**(`kDefaultNamespace`),裸名就落在那里 —— | ||
| -- 它不是"上游是谁"的答案。因此上游库迁到上游 org 名下,消费者写限定名。 | ||
| package = { | ||
| spec = "1", | ||
| namespace = "mcpplibs", | ||
| name = "grpcgen", | ||
| description = "protoc + grpc_cpp_plugin codegen as an importable mcpp build rule (host-module)", | ||
| licenses = {"Apache-2.0"}, | ||
| repo = "https://github.com/mcpplibs/grpc-m", | ||
| type = "package", | ||
|
|
||
| xpm = { | ||
| linux = { | ||
| ["1.83.0"] = { | ||
| url = { | ||
| GLOBAL = "https://github.com/mcpplibs/grpc-m/archive/refs/tags/v1.83.0-2.tar.gz", | ||
| CN = "https://gitcode.com/mcpp-res/grpc/releases/download/1.83.0/grpc-m-1.83.0-2.tar.gz", | ||
| }, | ||
| sha256 = "9083a85879f67b726d68130ca8374e791e3cc73f9fff8d324cde11314c70b06e", | ||
| }, | ||
| }, | ||
| macosx = { | ||
| ["1.83.0"] = { | ||
| url = { | ||
| GLOBAL = "https://github.com/mcpplibs/grpc-m/archive/refs/tags/v1.83.0-2.tar.gz", | ||
| CN = "https://gitcode.com/mcpp-res/grpc/releases/download/1.83.0/grpc-m-1.83.0-2.tar.gz", | ||
| }, | ||
| sha256 = "9083a85879f67b726d68130ca8374e791e3cc73f9fff8d324cde11314c70b06e", | ||
| }, | ||
| }, | ||
| windows = { | ||
| ["1.83.0"] = { | ||
| url = { | ||
| GLOBAL = "https://github.com/mcpplibs/grpc-m/archive/refs/tags/v1.83.0-2.tar.gz", | ||
| CN = "https://gitcode.com/mcpp-res/grpc/releases/download/1.83.0/grpc-m-1.83.0-2.tar.gz", | ||
| }, | ||
| sha256 = "9083a85879f67b726d68130ca8374e791e3cc73f9fff8d324cde11314c70b06e", | ||
| }, | ||
| }, | ||
| }, | ||
|
|
||
| mcpp = "*/rules/mcpp.toml", | ||
| } |
12 changes: 12 additions & 0 deletions
pkgs/i/imgui.lua
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
12 changes: 12 additions & 0 deletions
pkgs/l/llamacpp.lua
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
Oops, something went wrong.
Oops, something went wrong.
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.