Files
hammer/recipes/ripgrep-no-jemalloc.patch
T
sergioandClaude Opus 4.8 ffaccb9a98 recipes/ripgrep: rg Rust-nativo (Etapa C pieza 4)
ripgrep 14.1.1 (tag, commit 4649aa97) como receta Cargo, mismo patrón que
uutils/findutils/diffutils. Es su propio workspace ⇒ sin patch [workspace].
Estático musl, zig cc sólo linker; MSRV 1.72 ≤ 1.91.1.

ripgrep-no-jemalloc.patch: ripgrep mete jemallocator incondicional en musl64,
pero jemalloc-sys compila C (autotools) y embebe rutas de OUT_DIR ⇒ rompería la
reproducibilidad bit-a-bit del lab. El patch lo quita (dep Cargo.toml + stanzas
Cargo.lock + global_allocator en main.rs) ⇒ build 100% Rust, hermético, con el
allocator de musl. PCRE2 ya es opt-in ⇒ regex puro, sin C.

Construye+sella+corre: ELF static sin interpreter, `ripgrep 14.1.1
features:-pcre2`, búsqueda recursiva/glob OK. `rg` no es flag-compatible con
POSIX grep ⇒ no se symlinkea a grep; convive con el grep interino.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-20 13:16:45 -04:00

70 lines
2.1 KiB
Diff

diff --git a/Cargo.lock b/Cargo.lock
index 5ca69a0..0f0a13c 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -222,26 +222,6 @@ version = "1.0.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b"
-[[package]]
-name = "jemalloc-sys"
-version = "0.5.4+5.3.0-patched"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ac6c1946e1cea1788cbfde01c993b52a10e2da07f4bac608228d1bed20bfebf2"
-dependencies = [
- "cc",
- "libc",
-]
-
-[[package]]
-name = "jemallocator"
-version = "0.5.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a0de374a9f8e63150e6f5e8a60cc14c668226d7a347d8aee1a45766e3c4dd3bc"
-dependencies = [
- "jemalloc-sys",
- "libc",
-]
-
[[package]]
name = "jobserver"
version = "0.1.32"
@@ -367,7 +347,6 @@ dependencies = [
"bstr",
"grep",
"ignore",
- "jemallocator",
"lexopt",
"log",
"serde",
diff --git a/Cargo.toml b/Cargo.toml
index 2ec69c9..1aa4881 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -59,8 +59,6 @@ serde_json = "1.0.23"
termcolor = "1.1.0"
textwrap = { version = "0.16.0", default-features = false }
-[target.'cfg(all(target_env = "musl", target_pointer_width = "64"))'.dependencies.jemallocator]
-version = "0.5.0"
[dev-dependencies]
serde = "1.0.77"
diff --git a/crates/core/main.rs b/crates/core/main.rs
index 64f35ce..34a5473 100644
--- a/crates/core/main.rs
+++ b/crates/core/main.rs
@@ -35,9 +35,9 @@ mod search;
//
// Moreover, we only do this on 64-bit systems since jemalloc doesn't support
// i686.
-#[cfg(all(target_env = "musl", target_pointer_width = "64"))]
-#[global_allocator]
-static ALLOC: jemallocator::Jemalloc = jemallocator::Jemalloc;
+// hammer (Etapa C): jemalloc se quita a propósito. Su build C (jemalloc-sys, autotools) embebe
+// rutas de OUT_DIR ⇒ rompe la reproducibilidad bit-a-bit que exige el lab. Usamos el allocator
+// de musl (más lento, pero ripgrep no es allocation-heavy y el build queda 100% Rust, hermético).
/// Then, as it was, then again it will be.
fn main() -> ExitCode {