tests/functional/common: check for UTF-8 support should be silenced, as not to create misleading stderr output #1056

Open
opened 2025-11-30 14:45:04 +00:00 by ktemkin · 0 comments
Owner

Describe the bug

Right now, if UTF-8 characters aren't supported in the shell/filesystem (e.g. due to locale issues), the check to avoid them currently splats an extraneous error message to stderr.

The relevant code is here:

https://git.lix.systems/lix-project/lix/src/branch/main/tests/functional/common/vars-and-functions.sh.in#L151

This should be tweaked to be silent, as there's not an actual error, here; and it appearing far above the actual error makes it seem like the thing to focus on.

Steps To Reproduce

  1. Set your locale such that the codepoint '\322' isn't valid.
  2. Get any test to fail (e.g. by generating a non-zero retcode, tripping the onError handler).
  3. Look at the misleading stderr output.

Expected behavior

Our output should make it very clear where the error is.

Actual behavior

We throw a nice red herring, which in issues like #1042 has been confused for the actual error message.

In that issue:

nix --version output

nix (Raito's Code, like Nix) 2.95.0pre20251122-dev_94ca4fd
System type: aarch64-darwin
Additional system types: x86_64-darwin
Features: gc, signed-caches
System configuration file: /etc/nix/nix.conf
User configuration files: /Users/deprekated/.config/nix/nix.conf:/Users/deprekated/.nix-profile/etc/xdg/nix/nix.conf:/etc/profiles/per-user/deprekated/etc/xdg/nix/nix.conf:/run/current-system/sw/etc/xdg/nix/nix.conf:/nix/var/nix/profiles/default/etc/xdg/nix/nix.conf
Store directory: /nix/store
State directory: /nix/var/nix
Data directory: /nix/store/g0rmyrw73p0if7brkmv0086sxsqj1jyv-lix-2.95.0pre20251122-dev_94ca4fd/share
## Describe the bug Right now, if UTF-8 characters aren't supported in the shell/filesystem (e.g. due to locale issues), the check to avoid them currently splats an extraneous error message to `stderr`. The relevant code is here: https://git.lix.systems/lix-project/lix/src/branch/main/tests/functional/common/vars-and-functions.sh.in#L151 This should be tweaked to be silent, as there's not an actual error, here; and it appearing far above the actual error makes it seem like the thing to focus on. ## Steps To Reproduce 1. Set your locale such that the codepoint '\322' isn't valid. 2. Get any test to fail (e.g. by generating a non-zero retcode, tripping the onError handler). 3. Look at the misleading stderr output. ## Expected behavior Our output should make it very clear where the error is. ## Actual behavior We throw a nice red herring, which in issues like #1042 has been confused for the actual error message. In that issue: - **'Apparent' issue**: https://gist.github.com/dustypomerleau/16533b321de229132ac38ae95f5e69f2#file-lix-test-failure-functional-nix-shell-basic-txt-L1736 - **Actual issue**: https://gist.github.com/dustypomerleau/16533b321de229132ac38ae95f5e69f2#file-lix-test-failure-functional-nix-shell-basic-txt-L1813 ## `nix --version` output ``` nix (Raito's Code, like Nix) 2.95.0pre20251122-dev_94ca4fd System type: aarch64-darwin Additional system types: x86_64-darwin Features: gc, signed-caches System configuration file: /etc/nix/nix.conf User configuration files: /Users/deprekated/.config/nix/nix.conf:/Users/deprekated/.nix-profile/etc/xdg/nix/nix.conf:/etc/profiles/per-user/deprekated/etc/xdg/nix/nix.conf:/run/current-system/sw/etc/xdg/nix/nix.conf:/nix/var/nix/profiles/default/etc/xdg/nix/nix.conf Store directory: /nix/store State directory: /nix/var/nix Data directory: /nix/store/g0rmyrw73p0if7brkmv0086sxsqj1jyv-lix-2.95.0pre20251122-dev_94ca4fd/share ```
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
lix-project/lix#1056
No description provided.