File tree Expand file tree Collapse file tree 2 files changed +15
-3
lines changed
Expand file tree Collapse file tree 2 files changed +15
-3
lines changed Original file line number Diff line number Diff line change 6666 with :
6767 cache-on-failure : true
6868 - name : Install dependencies
69- run : sudo apt-get update && sudo apt-get install -y liburing-dev pkg-config
69+ run : sudo apt-get update && sudo apt-get install -y liburing-dev pkg-config libjemalloc-dev
7070 - name : Set PKG_CONFIG_PATH
7171 run : echo "PKG_CONFIG_PATH=/usr/lib/x86_64-linux-gnu/pkgconfig" >> $GITHUB_ENV
7272 - name : Run clippy
@@ -124,6 +124,9 @@ jobs:
124124 - name : Install dependencies
125125 if : runner.os == 'Windows'
126126 run : choco install llvm -y
127+ - name : Install dependencies (Linux)
128+ if : runner.os == 'Linux'
129+ run : sudo apt-get update && sudo apt-get install -y libjemalloc-dev
127130 - name : Mark working directory as read-only
128131 if : runner.os == 'Linux'
129132 run : |
Original file line number Diff line number Diff line change 11use std:: path:: Path ;
22use std:: { env, fs, path:: PathBuf , process:: Command } ;
33
4+ // On these platforms jemalloc-sys will use a prefixed jemalloc which cannot be linked together
5+ // with RocksDB.
6+ // See https://github.com/tikv/jemallocator/blob/tikv-jemalloc-sys-0.5.3/jemalloc-sys/src/env.rs#L25
7+ const NO_JEMALLOC_TARGETS : & [ & str ] = & [ "android" , "dragonfly" , "musl" , "darwin" ] ;
8+
49fn link ( name : & str , bundled : bool ) {
510 use std:: env:: var;
611 let target = var ( "TARGET" ) . unwrap ( ) ;
@@ -242,8 +247,12 @@ fn build_rocksdb() {
242247
243248 config. define ( "ROCKSDB_SUPPORT_THREAD_LOCAL" , None ) ;
244249
245- if cfg ! ( feature = "jemalloc" ) {
246- config. define ( "WITH_JEMALLOC" , "ON" ) ;
250+ if cfg ! ( feature = "jemalloc" ) && NO_JEMALLOC_TARGETS . iter ( ) . all ( |i| !target. contains ( i) ) {
251+ config. define ( "ROCKSDB_JEMALLOC" , Some ( "1" ) ) ;
252+ config. define ( "JEMALLOC_NO_DEMANGLE" , Some ( "1" ) ) ;
253+ if let Some ( jemalloc_root) = env:: var_os ( "DEP_JEMALLOC_ROOT" ) {
254+ config. include ( Path :: new ( & jemalloc_root) . join ( "include" ) ) ;
255+ }
247256 }
248257
249258 #[ cfg( feature = "io-uring" ) ]
You can’t perform that action at this time.
0 commit comments