- vanilla nginx + Rust 动态模块(取代 OpenResty+Lua),共享内存为运行期真源 - 三域名分流 18098 ssl:mdm 管理台 / lm LLM 代理 / *.dm 企业转发,共用 *.mayishangshu.cn 通配符证书(证书不入库) - LLM 统一出口:同 Key 鉴权、上游 Key 替换、白名单、限流配额、SSE - 回归夹具 tests/(网关 55 + LLM 34 = 89 断言,夹具 cp 覆盖重置) - 文档:readme(16 章)+ CLAUDE.md + conf/tls/README(acme.sh 证书管理、hairpin 环回链路)
21 lines
978 B
Rust
21 lines
978 B
Rust
//! 构建脚本:让 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");
|
||
}
|
||
}
|