diff --git a/.cargo/config.toml b/.cargo/config.toml new file mode 100644 index 00000000..bff29e6e --- /dev/null +++ b/.cargo/config.toml @@ -0,0 +1,2 @@ +[build] +rustflags = ["--cfg", "tokio_unstable"] diff --git a/debian/rules b/debian/rules index e3d84d2c..40418b9a 100755 --- a/debian/rules +++ b/debian/rules @@ -3,6 +3,11 @@ export DH_VERBOSE = 1 export JEMALLOC_SYS_WITH_MALLOC_CONF = dirty_decay_ms:30000,muzzy_decay_ms:30000,background_thread:true,metadata_thp:auto +# Required by tokio::runtime::Builder::enable_eager_driver_handoff (unstable API). +# The .cargo/config.toml in the source tree is overwritten below in override_dh_auto_build +# to point at vendored sources, so we re-deliver the cfg via RUSTFLAGS here. +export RUSTFLAGS = --cfg tokio_unstable + # Rust installation directory (local install, no network access on Launchpad) RUST_INSTALL_DIR = $(CURDIR)/rust-local export PATH := $(RUST_INSTALL_DIR)/bin:$(PATH) diff --git a/pkg/rpm/pg-doorman.spec b/pkg/rpm/pg-doorman.spec index 0defd36a..7199a2d8 100644 --- a/pkg/rpm/pg-doorman.spec +++ b/pkg/rpm/pg-doorman.spec @@ -62,6 +62,11 @@ EOF # Set jemalloc configuration export JEMALLOC_SYS_WITH_MALLOC_CONF="dirty_decay_ms:30000,muzzy_decay_ms:30000,background_thread:true,metadata_thp:auto" +# Required by tokio::runtime::Builder::enable_eager_driver_handoff (unstable API). +# The .cargo/config.toml shipped in the source tree is overwritten above to point +# at vendored sources, so we re-deliver the cfg via RUSTFLAGS here. +export RUSTFLAGS="--cfg tokio_unstable" + # Build release binaries cargo build --release diff --git a/src/app/server.rs b/src/app/server.rs index 039de921..4e54f27a 100644 --- a/src/app/server.rs +++ b/src/app/server.rs @@ -92,6 +92,7 @@ pub fn run_server(args: Args, config: Config) -> Result<(), Box