Skip to content

Panicking when trying to run a task in a directory that no longer exists #5639

@VeckoTheGecko

Description

@VeckoTheGecko

Checks

  • I have checked that this issue has not already been reported.

  • I have confirmed this bug exists on the latest version of pixi, using pixi --version.

Reproducible example

Commands I ran and their output:

mkdir tmp
cd tmp
pixi init
pixi task add hello echo
pixi run hello

in a new shell

rm -rf tmp

back in the original shell

pixi run hello
thread 'main2' (29060823) panicked at crates/pixi_config/src/lib.rs:70:33:
Could not retrieve the current directory: Os { code: 2, kind: NotFound, message: "No such file or directory" }
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

thread 'main' (29060822) panicked at crates/pixi/src/main.rs:49:10:
Tokio executor failed, was there a panic?: Any { .. }

Issue description

I'm a Rust noob, so I may be wrong.

I recall someone mentioning that Rust panicks should never be surfaced to the end user. If so, then this is a bug.

Expected behavior

I would have expected more graceful termination - such as the following example (which more gracefully terminates).

mkdir tmp
cd tmp
pixi init
pixi task list

in a new shell

rm -rf tmp

back in the original shell

pixi task list
Error:   × failed to determine the current directory
  ╰─▶ No such file or directory (os error 2)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions