mirror of
https://github.com/nushell/nushell.git
synced 2025-08-09 02:14:56 +02:00
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:
12
src/run.rs
12
src/run.rs
@ -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() {
|
||||
|
@ -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();
|
||||
|
Reference in New Issue
Block a user