From 5848409723cc4512ac3901d25a72d4b1f279d7ff Mon Sep 17 00:00:00 2001 From: Dmitriy Kovalenko Date: Thu, 23 Jul 2026 16:52:10 -0700 Subject: [PATCH] fix(nix): Prevent illegal instructions sneaking into nix builds --- crates/fff-core/benches/glob_bench.rs | 10 ++-------- flake.nix | 4 ++++ 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/crates/fff-core/benches/glob_bench.rs b/crates/fff-core/benches/glob_bench.rs index 914fa0c09..49348fd6a 100644 --- a/crates/fff-core/benches/glob_bench.rs +++ b/crates/fff-core/benches/glob_bench.rs @@ -1,11 +1,5 @@ -//! Compare three glob-matching strategies for `match_glob_pattern` in constraints.rs: -//! -//! 1. Current: `zlob_match_paths` -> collect `as_ptr()` into AHashSet, filter paths -//! by pointer to recover indices. -//! 2. Free fn: `zlob_match_paths_indices` (added in zlob 1.4) — indices direct from C. -//! 3. Compiled: `ZlobPattern::compile` + `match_indices` — same indices path, but with -//! a precompiled pattern (reusable). For one-shot it should match (2); the win -//! appears if the pattern is reused (chunked / repeated calls). +//! Compare three glob-matching strategies for `match_glob_pattern` in constraints.rs +//! need to make sure that my zlob changes are not affecting fff's internal globbing use ahash::AHashSet; use criterion::{BenchmarkId, Criterion, black_box, criterion_group, criterion_main}; use zlob::{ZlobFlags, ZlobPattern, zlob_match_paths, zlob_match_paths_indices}; diff --git a/flake.nix b/flake.nix index 6a079f17b..563696fe4 100644 --- a/flake.nix +++ b/flake.nix @@ -63,6 +63,10 @@ ]; LIBCLANG_PATH = "${pkgs.llvmPackages.libclang.lib}/lib"; + # in zlob we compile by default with -target=native unless CI is detected, because + # nix is different we have to make sure that the build target is a baseline cpu + CI = "1"; + # Zig 0.16 insists on writing to its global cache even when the # zlob build.rs passes --global-cache-dir. In the nix sandbox $HOME # is /homeless-shelter (unwritable), so redirect to $TMPDIR before