- P0: rust/ 改 workspace(ipass-core 内核 + gateway 唯一 cdylib), [profile.release] 上移根、依赖收敛 workspace.dependencies; users::delete 的 stats::forget 依赖改为 on_delete 钩子注册表 - P1: 契约层 core/plugin.rs(Plugin trait)+ core/loc.rs(Switch 并集 + set_switch_fn,未实现变体保守 false);gateway PLUGINS 分发循环, 不认领统一 404(插件绝不自行 404) - P2: 身份端点下沉 core/api.rs(CorePlugin + CoreExt 扩展注册表, gateway 作装配根回填域名数/用量/连带回收/白名单校验); plugin-domain crate(domains + DomainEntry + sub: 前缀 + ResolveHandler + $proxy_backend_addr + 域名类端点含 purge) - 行为等价:conf/nginx.conf、Dockerfile、tests 零改动,262 回归全绿 - 方案文档 docs/plugin/PLUGINIZATION_PLAN.md
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");
|
||
}
|
||
}
|