starship: Test directory::home_directory fails
Bug Report
Current Behavior
I’m installing from AUR but build fails with:
failures:
---- directory::home_directory stdout ----
thread 'directory::home_directory' panicked at 'assertion failed: `(left == right)`
left: `"in \u{1b}[1;36m~\u{1b}[0m "`,
right: `"in \u{1b}[1;36mfrancisco\u{1b}[0m "`', tests/testsuite/directory.rs:19:5
note: Run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
failures:
directory::home_directory
test result: FAILED. 29 passed; 1 failed; 31 ignored; 0 measured; 0 filtered out
error: test failed, to rerun pass '--test testsuite'
==> ERROR: A failure occurred in check().
Aborting...
Error making: starship
Expected Behavior
No errors.
Environment
- Operating system: ArchLinux
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 23 (17 by maintainers)
I just got this and one other similar test failure when building 0.11.0 on macOS
Huh, could have sworn I responded to this earlier…guess I imagined it.
@lilyball We do have such a construct in starship, but it’s only usable in the testing interface (which is good enough for what we need it for).
@chipbuster these two lines were added to the end of the previous output, after the patch:
@chipbuster In my case, I do have a Unix FHS, but a combination of sandboxing and an intentionally-garbage
HOMEfolder just means that the paths you’re trying to test don’t exist/aren’t reachable.In any case, it seems like a legitimate bug that
starship module directory --path=/something-that-doesn't-existwill panic regardless of what the filesystem looks like.@oblitum Thanks, that’s some very useful info. I’m now thinking the error comes from something in the environment that we didn’t anticipate–possibly a difference in how environment variables are used.
Could you run one more test for me? Same deal, but we’re going to patch the code to dump a little more info:
Replace the block starting with
match &context.repo_root(on line 33 insrc/modules/directory.rs) with that, then reruncargo buildand the same test (starship module directory + logs) as before.If you prefer .patch files, I’ve put one up on Box.
Actually maybe it does; in Nix I’m building in a sandboxed environment, and providing an invalid path to the
--pathparameter produces a similar exception. I bet the sandbox is preventing access to/etc: