Repository navigation
fix GMSSL_DIR platform link libs, drop the stale submodule, release 0.2.0 - #3
Open
jeromexiong wants to merge 3 commits into
Open
jeromexiong wants to merge 3 commits into
jeromexiong wants to merge 3 commits into
Conversation
The GMSSL_DIR early-return emitted only link-search + gmssl, so a prebuilt static libgmssl failed to link: on macOS, `_SecRandomCopyBytes` (Security.framework, used by rand_apple.c); on Windows, the CryptoAPI symbols used by rand_win.c. Both the GMSSL_DIR and the from-source path now share emit_platform_link_libs(). Reproduced on macOS/x86_64 with a GmSSL 3.2.0 install prefix: `GMSSL_DIR=... cargo test` failed with `Undefined symbols: _SecRandomCopyBytes` before this change and passes after it. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
locate_gmssl_source() downloads the release tarball and no longer reads gmssl-sys/GmSSL, yet the gitlink still points at d655c06b (GmSSL v3.1.1) while GMSSL_RELEASE_TAG is v3.2.0 — the contradiction misleads readers, and cargo fetches submodules of git dependencies, so every downstream git build pulled an unused tree at the wrong version. Drop .gitmodules and the gitlink, the CI checkout flags, the .gitignore entry, and the README text that still documented `--recursive` cloning. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
crates.io still serves gmssl-rs 0.1.1 / gmssl-rs-sys 0.1.0 (published 2026-05-31), both predating the Windows/MSVC fixes on main, so downstream crates cannot get a working Windows build without pinning this repository via [patch.crates-io]. 0.2.0 because the released pair moves the bundled C library from GmSSL 3.1.1 to 3.2.0 and gmssl-rs-sys renames its pbkdf2 binding (pbkdf2_hmac_sm3_genkey -> sm3_pbkdf2). The gmssl-rs public API is unchanged relative to 0.1.1 (no `pub fn` signature diff). Publish order: gmssl-rs-sys first, then gmssl-rs. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Author
|
CI 说明:首次贡献者的 workflow run 需要维护者批准才会运行(当前 run 状态 |
jeromexiong
pushed a commit
to jeromexiong/gmssl-rs-patched
that referenced
this pull request
Oct 9, 2026
All three nits are now reported/fixed upstream: GmSSL/gmssl-rs#3 (GMSSL_DIR platform link libs fix, stale submodule removal, 0.2.0 release prep), pending merge and cargo publish. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
jeromexiong
pushed a commit
to jeromexiong/gmssl-fast
that referenced
this pull request
Oct 9, 2026
上游 PR 内容:GMSSL_DIR 平台链接修复 + 删除过期子模块 + 0.2.0 发版准备;合并并发版后按注释指引撤除 [patch] 段。 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.
摘要
GMSSL_DIR路径漏发平台链接库 —— 预装 GmSSL 在 macOS/Windows 上链接失败背景
crates.io 上仍是 2026-05-31 发布的
gmssl-rs0.1.1 /gmssl-rs-sys0.1.0,早于 main 上的 Windows/MSVC 修复合入。下游要拿到能用的 Windows 构建,只能用[patch.crates-io]钉住一份回移补丁的 fork,外加在自己 build.rs 里加/FORCE:UNRESOLVED绕过那对已发布 crate 自身的不自洽(0.1.1 声明了 GmSSL 3.1.1 没有的x509_key_cleanup/zuc256_generate_keystream)。发一版 0.2.0 即可让这些临时改动全部退役。改动明细
1.
fix(sys):GMSSL_DIR路径也发平台链接库GMSSL_DIR提前返回分支只发了link-search+gmssl,漏了 from-source 路径发的平台库:framework=Security(rand_apple.c需要)advapi32/bcrypt/ncrypt(rand_win.c的 CryptoAPI)两条路径现在共用
emit_platform_link_libs()。复现与验证(macOS x86_64 + 本机安装的 GmSSL 3.2.0 静态库):
GMSSL_DIR=<prefix> cargo test→Undefined symbols for architecture x86_64: "_SecRandomCopyBytes"2.
chore: 删除过期子模块locate_gmssl_source()早已改为下载 release tarball、不再读gmssl-sys/GmSSL,但 gitlink 仍指d655c06b(GmSSL v3.1.1),与GMSSL_RELEASE_TAG(v3.2.0)矛盾;且 cargo 对 git 依赖会递归拉子模块 —— 每个 git 下游都白拉一棵错版本的树。一并清理 CI 的submodules: recursive、.gitignore条目与 README 的--recursive说明/目录树。3.
release: 0.2.0gmssl-rs-sysFFI 重命名pbkdf2_hmac_sm3_genkey→sm3_pbkdf2⇒ 破坏性变更gmssl-rs公共 API 相对 0.1.1 无变化(git diff无pub fn签名变化)0.1→0.2发布顺序:先
cargo publish -p gmssl-rs-sys,再cargo publish -p gmssl-rs(后者在 sys 0.2.0 上架前无法完成cargo package,属预期)。验证清单
cargo test46 passed / 13 ignored(13 个为历史#[ignore]的 SM9 测试,与本 PR 无关)GMSSL_DIR路径:修复前链接失败 → 修复后 46 passedcargo package -p gmssl-rs-sys(含 verify 构建)通过 —— 打包不依赖子模块