mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-08 04:09:23 +00:00
Patch librocksdb-sys to never enable jemalloc, which conflicts with mimalloc
Allows us to update mimalloc and enable the newly added guard pages. Conflict identified by @PlasmaPower.
This commit is contained in:
17
Cargo.toml
17
Cargo.toml
@@ -178,10 +178,6 @@ ark-ff-4 = { package = "ark-ff", path = "patches/ethereum/ark-ff-0.4" }
|
|||||||
c-kzg = { path = "patches/ethereum/c-kzg" }
|
c-kzg = { path = "patches/ethereum/c-kzg" }
|
||||||
secp256k1-30 = { package = "secp256k1", path = "patches/ethereum/secp256k1-30" }
|
secp256k1-30 = { package = "secp256k1", path = "patches/ethereum/secp256k1-30" }
|
||||||
|
|
||||||
# Updates to the latest version
|
|
||||||
darling = { path = "patches/darling" }
|
|
||||||
thiserror = { path = "patches/thiserror" }
|
|
||||||
|
|
||||||
# Dependencies from monero-oxide which originate from within our own tree
|
# Dependencies from monero-oxide which originate from within our own tree
|
||||||
std-shims = { path = "patches/std-shims" }
|
std-shims = { path = "patches/std-shims" }
|
||||||
simple-request = { path = "patches/simple-request" }
|
simple-request = { path = "patches/simple-request" }
|
||||||
@@ -192,12 +188,16 @@ dalek-ff-group = { path = "patches/dalek-ff-group" }
|
|||||||
minimal-ed448 = { path = "crypto/ed448" }
|
minimal-ed448 = { path = "crypto/ed448" }
|
||||||
modular-frost = { path = "crypto/frost" }
|
modular-frost = { path = "crypto/frost" }
|
||||||
|
|
||||||
|
# This has a non-deprecated `std` alternative since Rust's 2024 edition
|
||||||
|
home = { path = "patches/home" }
|
||||||
|
|
||||||
|
# Updates to the latest version
|
||||||
|
darling = { path = "patches/darling" }
|
||||||
|
thiserror = { path = "patches/thiserror" }
|
||||||
|
|
||||||
# https://github.com/rust-lang-nursery/lazy-static.rs/issues/201
|
# https://github.com/rust-lang-nursery/lazy-static.rs/issues/201
|
||||||
lazy_static = { git = "https://github.com/rust-lang-nursery/lazy-static.rs", rev = "5735630d46572f1e5377c8f2ba0f79d18f53b10c" }
|
lazy_static = { git = "https://github.com/rust-lang-nursery/lazy-static.rs", rev = "5735630d46572f1e5377c8f2ba0f79d18f53b10c" }
|
||||||
|
|
||||||
# These has an `std` alternative since Rust's 2024 edition
|
|
||||||
home = { path = "patches/home" }
|
|
||||||
|
|
||||||
# directories-next was created because directories was unmaintained
|
# directories-next was created because directories was unmaintained
|
||||||
# directories-next is now unmaintained while directories is maintained
|
# directories-next is now unmaintained while directories is maintained
|
||||||
# The directories author pulls in ridiculously pointless crates and prefers
|
# The directories author pulls in ridiculously pointless crates and prefers
|
||||||
@@ -210,6 +210,9 @@ directories-next = { path = "patches/directories-next" }
|
|||||||
k256 = { git = "https://github.com/kayabaNerve/elliptic-curves", rev = "4994c9ab163781a88cd4a49beae812a89a44e8c3" }
|
k256 = { git = "https://github.com/kayabaNerve/elliptic-curves", rev = "4994c9ab163781a88cd4a49beae812a89a44e8c3" }
|
||||||
p256 = { git = "https://github.com/kayabaNerve/elliptic-curves", rev = "4994c9ab163781a88cd4a49beae812a89a44e8c3" }
|
p256 = { git = "https://github.com/kayabaNerve/elliptic-curves", rev = "4994c9ab163781a88cd4a49beae812a89a44e8c3" }
|
||||||
|
|
||||||
|
# `jemalloc` conflicts with `mimalloc`, so patch to a `rocksdb` which never uses `jemalloc`
|
||||||
|
librocksdb-sys = { path = "patches/librocksdb-sys" }
|
||||||
|
|
||||||
[workspace.lints.clippy]
|
[workspace.lints.clippy]
|
||||||
unwrap_or_default = "allow"
|
unwrap_or_default = "allow"
|
||||||
map_unwrap_or = "allow"
|
map_unwrap_or = "allow"
|
||||||
|
|||||||
@@ -7,10 +7,10 @@ FROM alpine:latest AS mimalloc-alpine
|
|||||||
RUN apk update && apk upgrade && apk --no-cache add gcc g++ libc-dev make cmake git
|
RUN apk update && apk upgrade && apk --no-cache add gcc g++ libc-dev make cmake git
|
||||||
RUN git clone https://github.com/microsoft/mimalloc && \
|
RUN git clone https://github.com/microsoft/mimalloc && \
|
||||||
cd mimalloc && \
|
cd mimalloc && \
|
||||||
git checkout 43ce4bd7fd34bcc730c1c7471c99995597415488 && \
|
git checkout fbd8b99c2b828428947d70fdc046bb55609be93e && \
|
||||||
mkdir -p out/secure && \
|
mkdir -p out/secure && \
|
||||||
cd out/secure && \
|
cd out/secure && \
|
||||||
cmake -DMI_SECURE=ON ../.. && \
|
cmake -DMI_SECURE=ON -DMI_GUARDED=on ../.. && \
|
||||||
make && \
|
make && \
|
||||||
cp ./libmimalloc-secure.so ../../../libmimalloc.so
|
cp ./libmimalloc-secure.so ../../../libmimalloc.so
|
||||||
"#;
|
"#;
|
||||||
@@ -21,10 +21,10 @@ FROM debian:trixie-slim AS mimalloc-debian
|
|||||||
RUN apt update && apt upgrade -y && apt install -y gcc g++ make cmake git
|
RUN apt update && apt upgrade -y && apt install -y gcc g++ make cmake git
|
||||||
RUN git clone https://github.com/microsoft/mimalloc && \
|
RUN git clone https://github.com/microsoft/mimalloc && \
|
||||||
cd mimalloc && \
|
cd mimalloc && \
|
||||||
git checkout 43ce4bd7fd34bcc730c1c7471c99995597415488 && \
|
git checkout fbd8b99c2b828428947d70fdc046bb55609be93e && \
|
||||||
mkdir -p out/secure && \
|
mkdir -p out/secure && \
|
||||||
cd out/secure && \
|
cd out/secure && \
|
||||||
cmake -DMI_SECURE=ON ../.. && \
|
cmake -DMI_SECURE=ON -DMI_GUARDED=on ../.. && \
|
||||||
make && \
|
make && \
|
||||||
cp ./libmimalloc-secure.so ../../../libmimalloc.so
|
cp ./libmimalloc-secure.so ../../../libmimalloc.so
|
||||||
"#;
|
"#;
|
||||||
|
|||||||
35
patches/librocksdb-sys/Cargo.toml
Normal file
35
patches/librocksdb-sys/Cargo.toml
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
[package]
|
||||||
|
name = "librocksdb-sys"
|
||||||
|
version = "0.17.99"
|
||||||
|
description = "Replacement for `librocksdb-sys` which removes the `jemalloc` feature"
|
||||||
|
license = "MIT"
|
||||||
|
repository = "https://github.com/serai-dex/serai/tree/develop/patches/librocksdb-sys"
|
||||||
|
authors = ["Luke Parker <lukeparker5132@gmail.com>"]
|
||||||
|
keywords = []
|
||||||
|
edition = "2018"
|
||||||
|
|
||||||
|
[package.metadata.docs.rs]
|
||||||
|
all-features = true
|
||||||
|
rustdoc-args = ["--cfg", "docsrs"]
|
||||||
|
|
||||||
|
[workspace]
|
||||||
|
|
||||||
|
[dependencies]
|
||||||
|
# librocksdb-sys 0.17.3+10.4.2, with the commit provided by crates.io in `cargo_vcs_info.json`
|
||||||
|
librocksdb-sys = { git = "https://github.com/rust-rocksdb/rust-rocksdb", commit = "bb7d2168eab1bc7849f23adbcb825e3aba1bd2f4", default-features = false }
|
||||||
|
|
||||||
|
[features]
|
||||||
|
default = ["librocksdb-sys/default"]
|
||||||
|
jemalloc = []
|
||||||
|
static = ["librocksdb-sys/static"]
|
||||||
|
bindgen-runtime = ["librocksdb-sys/bindgen-runtime"]
|
||||||
|
bindgen-static = ["librocksdb-sys/bindgen-static"]
|
||||||
|
mt_static = ["librocksdb-sys/mt_static"]
|
||||||
|
io-uring = ["librocksdb-sys/io-uring"]
|
||||||
|
snappy = ["librocksdb-sys/snappy"]
|
||||||
|
lz4 = ["librocksdb-sys/lz4"]
|
||||||
|
zstd = ["librocksdb-sys/zstd"]
|
||||||
|
zlib = ["librocksdb-sys/zlib"]
|
||||||
|
bzip2 = ["librocksdb-sys/bzip2"]
|
||||||
|
rtti = ["librocksdb-sys/rtti"]
|
||||||
|
lto = ["librocksdb-sys/lto"]
|
||||||
1
patches/librocksdb-sys/src/lib.rs
Normal file
1
patches/librocksdb-sys/src/lib.rs
Normal file
@@ -0,0 +1 @@
|
|||||||
|
pub use librocksdb_sys::*;
|
||||||
Reference in New Issue
Block a user