mirror of
https://github.com/mailscope/kumomta.git
synced 2026-09-10 20:42:14 +00:00
This commit adds a declare_cache! macro that serves a couple of purposes: * Make it slightly less boilerplatey to define a cache * Register them explicitly as a list of predefined caches, so that we can raise an error if lua code would conflict via memoize * Enable a future change that allows reconfiguring the cache parameters for those predefined caches Note: if you are using clang as a linker via RUSTFLAGS/.make-env, the linkme crate that is employed for the registry may result in linker errors. The solution that I have in my `.make-env` is to add `-Clink-arg=-Wl,-z,nostart-stop-gc` to RUSTFLAGS so that its sections are not removed too soon in the build process: ``` ; cat .make-env ROCKSDB_LIB_DIR=/usr/lib/x86_64-linux-gnu RUSTFLAGS=-C linker=clang -C link-arg=-fuse-ld=lld --cfg tokio_unstable -Clink-arg=-Wl,-z,nostart-stop-gc ```