Remove the NU_DISABLE_IR option (#14293)

# Description

Removes the `NU_DISABLE_IR` option and some code related to evaluating
blocks with the AST
evaluator.

Does not entirely remove the AST evaluator yet. We still have some
dependencies on expression
evaluation in a few minor places which will take a little bit of effort
to fix.

Also changes `debug profile` to always include instructions, because the
output is a little
confusing otherwise, and removes the different options for
instructions/exprs.

# User-Facing Changes

- `NU_DISABLE_IR` no longer has any effect, and is removed. There is no
way to use the AST
  evaluator.
- `debug profile` no longer has `--exprs`, `--instructions` options.
- `debug profile` lists `pc` and `instruction` columns by default now.

# Tests + Formatting

Eval tests fixed to only use IR.

# After Submitting

- [ ] release notes
- [ ] finish removing AST evaluator, come up with solutions for the
expression evaluation.
This commit is contained in:
Devyn Cairns
2024-11-14 20:09:25 -08:00
committed by GitHub
parent a04c90e22d
commit 215ca6c5ca
10 changed files with 81 additions and 386 deletions

View File

@ -26,9 +26,6 @@ pub(crate) fn run_commands(
let ask_to_create_config = nu_path::nu_config_dir().map_or(false, |p| !p.exists());
let mut stack = Stack::new();
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,
// load the default env file or custom (depending on parsed_nu_cli_args.env_file),
@ -119,10 +116,6 @@ pub(crate) fn run_file(
trace!("run_file");
let mut stack = Stack::new();
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,
// load the default env file or custom (depending on parsed_nu_cli_args.env_file),
// and maybe a custom config file (depending on parsed_nu_cli_args.config_file)
@ -191,10 +184,6 @@ 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_DISABLE_IR") {
stack.use_ir = false;
}
if parsed_nu_cli_args.no_config_file.is_none() {
setup_config(
engine_state,

View File

@ -236,11 +236,6 @@ 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(""));
// 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();
load_standard_library(&mut engine_state).expect("Could not load the standard library.");