-
Notifications
You must be signed in to change notification settings - Fork 2.1k
load-env very flaky & yields unexpected results #7149
Copy link
Copy link
Open
Labels
A:error-silent-failCases where nothing or something bad happens and an error would be helpful and expectedCases where nothing or something bad happens and an error would be helpful and expectedA:error-unhelpfulThe error message you observe is not helpful to identify the problemThe error message you observe is not helpful to identify the problem
Description
Describe the bug
I've been playing around with load-env and noticed unexpected behaviour.
- If one entry fails in any way, for example if a variable cannot be resolved, the entire
load-envblock is completely dismissed. - If an entire
load-envblock is dismissed due to an error of any kind, this all happens silently. The user does not get any message about it failing. In fact, it has to be specifically looked up or the user has to notice by accident how an environment variable is missing, even though it exists in theload-envblock. - "Compiling" the file with the
load-envblock does work and does not complain. No errors, no warnings, nothing.
How to reproduce
- Open a Nu file. For example,
test_load-env.nu. - Create a
load-envblock. - Assign an unresolvable (environment) variable to one of the record keys.
source test_load-env.nu- Try to resolve any record from the
load-envblock. None will be available and you didn't notice until now.
Expected behavior
Either an error should be shown on "compile" time and interrupt the compilation process, or every record should be evaluated, except the faulty one and an error or warning should be shown.
The most important point is the communication of what happened. The user must know, that something isn't right.
Screenshots
No response
Configuration
| key | value |
|---|---|
| version | 0.71.0 |
| branch | |
| commit_hash | 6cc4ef6 |
| build_os | linux-x86_64 |
| build_target | x86_64-unknown-linux-gnu |
| rust_version | rustc 1.65.0 (897e37553 2022-11-02) |
| rust_channel | stable-x86_64-unknown-linux-gnu |
| cargo_version | cargo 1.65.0 (4bc8f24d3 2022-10-20) |
| pkg_version | 0.71.0 |
| build_time | 2022-11-08 18:00:26 +00:00 |
| build_rust_channel | release |
| features | database, dataframe, default, trash, which, zip |
| installed_plugins | partial |
Additional context
Platform
Debian GNU/Linux 11 (bullseye) in WSL2 on Windows 10
Terminal software
Visual Studio Code integrated Terminal
Nushell is running "natively" as a login shell.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
A:error-silent-failCases where nothing or something bad happens and an error would be helpful and expectedCases where nothing or something bad happens and an error would be helpful and expectedA:error-unhelpfulThe error message you observe is not helpful to identify the problemThe error message you observe is not helpful to identify the problem