From 8c64ebe074c9fc99c2174769f5e3c13755b82c55 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Sat, 3 Sep 2022 19:40:01 +0300 Subject: chore(tvix/eval): gate REPL-only dependencies behind `repl` feature With this change, it becomes possible to compile tvix-eval to webassembly if the `repl` feature is disabled. Change-Id: Icc0a059964cd0bea2054110c682d50fc5c87ec01 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6446 Tested-by: BuildkiteCI Reviewed-by: sterni --- tvix/eval/Cargo.toml | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'tvix/eval') diff --git a/tvix/eval/Cargo.toml b/tvix/eval/Cargo.toml index 4f2fda7e613a..226f3a98a31f 100644 --- a/tvix/eval/Cargo.toml +++ b/tvix/eval/Cargo.toml @@ -5,9 +5,16 @@ edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html +[lib] +name = "tvix_eval" + +[[bin]] +name = "tvix-eval" +required-features = [ "repl" ] + [dependencies] smol_str = "0.1" -rustyline = "10.0.0" +rustyline = { version = "10.0.0", optional = true } dirs = "4.0.0" path-clean = "0.1" tabwriter = { version = "1.2", optional = true } @@ -27,10 +34,15 @@ pretty_assertions = "1.2.1" itertools = "0.10.3" [features] +default = [ "repl" ] + # Enables running the Nix language test suite from the original C++ # Nix implementation (at version 2.3) against Tvix. nix_tests = [] +# Enables building the binary (tvix-eval REPL) +repl = [ "dep:rustyline" ] + # Enables printing compiled code and tracing the stack state at runtime. disassembler = ["dep:tabwriter"] -- cgit 1.4.1