Files
ipass-plugin-cache/rust/gateway/build.rs
T
ssw 43718bd0c4 iPass cache gateway 源码
容量管理: zones.rs 直读 nginx file_cache 共享内存记账(双轴: 磁盘 + keys_zone 索引内存), ?scan=1 扫盘上限 20 万文件; POST /api/admin/cache/purge 整区清理(只删文件不删目录, 根治 [crit] mkdir failed); POST /api/admin/cache/invalidate 按制品精准失效(预览->确认两步式, glob/子串, 删除上限 5000/扫描上限 20 万); GET /api/admin/cache 新增 capacity 块; 前端容量面板 + 按制品失效工具条; 测试 test-cache-capacity.sh 48/48(容量 27 + 精准失效 21, 含 EXPECT_MIN 护栏与前端静态契约); docs 容量管理章节
2026-09-21 09:25:11 +08:00

21 lines
978 B
Rust
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
//! 构建脚本:让 cdylib 允许「未定义符号」。
//!
//! nginx 动态模块的运行时符号(`ngx_palloc` / `ngx_http_add_variable` /
//! `ngx_shared_memory_add` …)由 nginx 主程序在 `load_module` 时提供,
//! 链接本模块时它们必然是未定义的——这是动态模块的固有属性,不是错误。
//!
//! * Linux:cdylib 默认允许未定义符号,无需处理。
//! * macOS:必须显式 `-undefined dynamic_lookup`,否则 ld 直接报
//! `symbol(s) not found for architecture x86_64`。
//!
//! 注意:vendored 的 `ngx` crate 的 build.rs 也设了这两项,但
//! `rustc-link-arg` 只对「设置它的那个 crate」生效,不会传递给依赖它的
//! crate,所以本 crate 必须自己再设一次。
fn main() {
if std::env::var("CARGO_CFG_TARGET_OS").as_deref() == Ok("macos") {
println!("cargo::rustc-link-arg=-undefined");
println!("cargo::rustc-link-arg=dynamic_lookup");
}
}