From 3045645df07ffdb54f9d2a11ee2e41e31999986f Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Wed, 11 Jan 2023 18:14:08 +0300 Subject: feat(tvix/cli): implement initial refscan module This module implements a ReferenceScanner struct which uses the aho_corasick crate to scan string inputs for known, non-overlapping candidates (store paths, in our case). I experimented with several different APIs, and landed on this version with an initial accumulator in the scanner. The scanner is instantiated from the candidates and "fed" all the strings, then consumed by the caller to retrieve the result. Right now only things that look vaguely like bytestrings can be fed to the scanner, there is no streaming support in the API yet. Change-Id: I7782f0f0df5fc64bccd813aa14712f5525b0168c Reviewed-on: https://cl.tvl.fyi/c/depot/+/7808 Autosubmit: tazjin Reviewed-by: flokli Tested-by: BuildkiteCI --- tvix/Cargo.nix | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'tvix/Cargo.nix') diff --git a/tvix/Cargo.nix b/tvix/Cargo.nix index 9f13a1607336..0f2b6bdd98b4 100644 --- a/tvix/Cargo.nix +++ b/tvix/Cargo.nix @@ -6477,6 +6477,10 @@ rec { then lib.cleanSourceWith { filter = sourceFilter; src = ./cli; } else ./cli; dependencies = [ + { + name = "aho-corasick"; + packageId = "aho-corasick"; + } { name = "clap"; packageId = "clap 4.0.32"; -- cgit 1.4.1