matrix-tuwunel: drop reference to rustc (#462712)

This commit is contained in:
Guillaume Girol
2025-11-19 21:17:19 +00:00
committed by GitHub
2 changed files with 30 additions and 0 deletions
@@ -0,0 +1,21 @@
commit be2b9e1992f5a7048fe011f4d48591dfcec927a8
Author: Guillaume Girol <symphorien+git@xlumurb.eu>
Date: Mon Nov 17 12:00:00 2025 +0000
make the macro recording conpilation flags a noop
it records references to rustc which increases the size of the closure of tuwunel by 1.5 GB.
diff --git a/src/macros/mod.rs b/src/macros/mod.rs
index b5c5b67d..86f4755b 100644
--- a/src/macros/mod.rs
+++ b/src/macros/mod.rs
@@ -39,7 +39,7 @@ pub fn recursion_depth(args: TokenStream, input: TokenStream) -> TokenStream {
}
#[proc_macro]
-pub fn rustc_flags_capture(args: TokenStream) -> TokenStream { rustc::flags_capture(args) }
+pub fn rustc_flags_capture(_args: TokenStream) -> TokenStream { TokenStream::default() }
#[proc_macro]
pub fn rustc_version(args: TokenStream) -> TokenStream { rustc::version(args) }
@@ -19,6 +19,7 @@
liburing,
nixosTests,
writeTextFile,
rustc-unwrapped,
}:
let
rust-jemalloc-sys' = rust-jemalloc-sys.override {
@@ -103,6 +104,12 @@ rustPlatform.buildRustPackage (finalAttrs: {
rustPlatform.bindgenHook
];
patches = [
# reduce closure size by not storing a reference to rustc-unwrapped
# alternative to https://github.com/NixOS/nixpkgs/pull/462394
./dont-record-compilation-flags.patch
];
buildInputs = [
bzip2
zstd
@@ -172,6 +179,8 @@ rustPlatform.buildRustPackage (finalAttrs: {
};
};
disallowedReferences = [ rustc-unwrapped ];
meta = {
description = "Matrix homeserver written in Rust, official successor to conduwuit";
homepage = "https://github.com/matrix-construct/tuwunel";