push sheeet
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s

This commit is contained in:
Dark Steveneq
2025-10-09 14:15:47 +02:00
commit 646b892680
49168 changed files with 5897842 additions and 0 deletions

View File

@@ -0,0 +1,100 @@
{
lib,
fetchFromGitHub,
rustPlatform,
cacert,
buildPythonPackage,
uvloop,
click,
setproctitle,
watchfiles,
versionCheckHook,
pytestCheckHook,
pytest-asyncio,
websockets,
httpx,
sniffio,
nix-update-script,
}:
buildPythonPackage rec {
pname = "granian";
version = "2.5.4";
pyproject = true;
src = fetchFromGitHub {
owner = "emmett-framework";
repo = "granian";
tag = "v${version}";
hash = "sha256-6T4ge9QrLxpkgtJvNmgUlHaxFK3KyQLJo12rjs80J3M=";
};
# Granian forces a custom allocator for all the things it runs,
# which breaks some libraries in funny ways. Make it not do that,
# and allow the final application to make the allocator decision
# via LD_PRELOAD or similar.
patches = [
./no-alloc.patch
];
cargoDeps = rustPlatform.fetchCargoVendor {
inherit pname version src;
hash = "sha256-iY0vh+Y0wU1/wJVXb2GDG8vb5ovrFD+4tXKODEA35Kc=";
};
nativeBuildInputs = with rustPlatform; [
cargoSetupHook
maturinBuildHook
];
dependencies = [
click
];
optional-dependencies = {
pname = [ setproctitle ];
reload = [ watchfiles ];
# rloop = [ rloop ]; # not packaged
uvloop = [ uvloop ];
};
nativeCheckInputs = [
versionCheckHook
pytestCheckHook
pytest-asyncio
websockets
httpx
sniffio
];
preCheck = ''
# collides with the one installed in $out
rm -rf granian/
'';
# needed for checks
env.SSL_CERT_FILE = "${cacert}/etc/ssl/certs/ca-bundle.crt";
__darwinAllowLocalNetworking = true;
enabledTestPaths = [ "tests/" ];
pythonImportsCheck = [ "granian" ];
versionCheckProgramArg = "--version";
passthru.updateScript = nix-update-script { };
meta = {
description = "Rust HTTP server for Python ASGI/WSGI/RSGI applications";
homepage = "https://github.com/emmett-framework/granian";
changelog = "https://github.com/emmett-framework/granian/releases/tag/v${version}";
license = lib.licenses.bsd3;
mainProgram = "granian";
maintainers = with lib.maintainers; [
lucastso10
pbsds
];
platforms = lib.platforms.unix;
};
}

View File

@@ -0,0 +1,47 @@
diff --git a/Cargo.toml b/Cargo.toml
index cbf1cdb..e819e14 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -41,7 +41,6 @@ hyper = { version = "=1.6", features = ["http1", "http2", "server"] }
hyper-util = { version = "=0.1", features = ["server-auto", "tokio"] }
itertools = "0.14"
log = "0.4"
-mimalloc = { version = "0.1.43", default-features = false, features = ["local_dynamic_tls"], optional = true }
mime_guess = "=2.0"
pem = "=3.0"
percent-encoding = "=2.3"
@@ -52,7 +51,6 @@ pyo3-log = "=0.12"
rustls-pemfile = "2.2"
socket2 = { version = "=0.6", features = ["all"] }
sysinfo = "=0.36"
-tikv-jemallocator = { version = "0.6.0", default-features = false, features = ["disable_initial_exec_tls"], optional = true }
tls-listener = { version = "=0.11", features = ["rustls-ring"] }
tokio = { version = "1.45", features = ["full"] }
tokio-stream = "0.1"
@@ -62,10 +60,6 @@ tokio-util = { version = "0.7", features = ["codec", "rt"] }
[build-dependencies]
pyo3-build-config = "=0.25"
-[features]
-jemalloc = ["dep:tikv-jemallocator"]
-mimalloc = ["dep:mimalloc"]
-
[profile.release]
codegen-units = 1
debug = false
diff --git a/src/lib.rs b/src/lib.rs
index a17a7e5..8ea1a4d 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -1,11 +1,3 @@
-#[cfg(all(feature = "jemalloc", not(feature = "mimalloc")))]
-#[global_allocator]
-static GLOBAL: tikv_jemallocator::Jemalloc = tikv_jemallocator::Jemalloc;
-
-#[cfg(all(feature = "mimalloc", not(feature = "jemalloc")))]
-#[global_allocator]
-static GLOBAL: mimalloc::MiMalloc = mimalloc::MiMalloc;
-
use pyo3::prelude::*;
use std::sync::OnceLock;