Make IR the default evaluator (#13718)

# Description

Makes IR the default evaluator, in preparation to remove the non-IR
evaluator in a future release.

# User-Facing Changes

* Remove `NU_USE_IR` option
* Add `NU_DISABLE_IR` option
* IR is enabled unless `NU_DISABLE_IR` is set

# After Submitting
- [ ] release notes
This commit is contained in:
Devyn Cairns
2024-09-15 14:54:38 -07:00
committed by GitHub
parent c535c24d03
commit 9ca0fb772d
19 changed files with 77 additions and 57 deletions

View File

@ -26,8 +26,8 @@ pub(crate) fn run_commands(
let mut stack = Stack::new();
let start_time = std::time::Instant::now();
if stack.has_env_var(engine_state, "NU_USE_IR") {
stack.use_ir = true;
if stack.has_env_var(engine_state, "NU_DISABLE_IR") {
stack.use_ir = false;
}
// if the --no-config-file(-n) option is NOT passed, load the plugin file,
@ -115,8 +115,8 @@ pub(crate) fn run_file(
trace!("run_file");
let mut stack = Stack::new();
if stack.has_env_var(engine_state, "NU_USE_IR") {
stack.use_ir = true;
if stack.has_env_var(engine_state, "NU_DISABLE_IR") {
stack.use_ir = false;
}
// if the --no-config-file(-n) option is NOT passed, load the plugin file,
@ -184,8 +184,8 @@ pub(crate) fn run_repl(
let mut stack = Stack::new();
let start_time = std::time::Instant::now();
if stack.has_env_var(engine_state, "NU_USE_IR") {
stack.use_ir = true;
if stack.has_env_var(engine_state, "NU_DISABLE_IR") {
stack.use_ir = false;
}
if parsed_nu_cli_args.no_config_file.is_none() {

View File

@ -244,9 +244,9 @@ pub fn nu_repl() {
engine_state.add_env_var("PWD".into(), Value::test_string(cwd.to_string_lossy()));
engine_state.add_env_var("PATH".into(), Value::test_string(""));
// Enable IR in tests if set
if std::env::var_os("NU_USE_IR").is_some() {
Arc::make_mut(&mut top_stack).use_ir = true;
// Disable IR in tests if set
if std::env::var_os("NU_DISABLE_IR").is_some() {
Arc::make_mut(&mut top_stack).use_ir = false;
}
let mut last_output = String::new();