Skip to content

forge build panics if its cwd is deleted #7311

Closed as not planned
Closed as not planned
@coventry

Description

Component

Forge

Have you ensured that all of these are up to date?

  • Foundry
  • Foundryup

What version of Foundry are you on?

orge 0.2.0 (3dfa43b 2024-03-05T00:16:30.030728431Z)

What command(s) is the bug in?

forge build

Operating System

Linux

Describe the bug

I think a git rebase resulted in my working directory being deleted and recreated. As a result the working directory of the shell in which I was invoking forge no longer existed. I believe this was probably the cause of the follow panic, since the problem cleared out when I cd'd into the new version of the directory.

$ forge build
The application panicked (crashed).
Message:  called `Result::unwrap()` on an `Err` value: Os { code: 2, kind: NotFound, message: "No such file or directory" }
Location: crates/cli/src/opts/build/paths.rs:71

This is a bug. Consider reporting it at https://github.com/foundry-rs/foundry

  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ BACKTRACE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
                                ⋮ 8 frames hidden ⋮                               
   9: foundry_cli::opts::build::paths::ProjectPathsArgs::project_root::h0d35ce0bac3ea3af
      at <unknown source file>:<unknown line>
  10: foundry_cli::opts::build::core::<impl core::convert::From<&foundry_cli::opts::build::core::CoreBuildArgs> for figment::figment::Figment>::from::h1c731a6eb5390b0b
      at <unknown source file>:<unknown line>
  11: forge::cmd::build::<impl core::convert::From<&forge::cmd::build::BuildArgs> for figment::figment::Figment>::from::had6ef32764553ac8
      at <unknown source file>:<unknown line>
  12: forge::cmd::build::BuildArgs::run::h1011cd9e1ed7fa3f
      at <unknown source file>:<unknown line>
  13: forge::main::h1615b0a2bc432be4
      at <unknown source file>:<unknown line>
  14: std::sys_common::backtrace::__rust_begin_short_backtrace::h86c1532f67008196
      at <unknown source file>:<unknown line>
  15: main<unknown>
      at <unknown source file>:<unknown line>
  16: __libc_start_main<unknown>
      at <unknown source file>:<unknown line>
  17: _start<unknown>
      at <unknown source file>:<unknown line>

Run with COLORBT_SHOW_HIDDEN=1 environment variable to disable frame filtering.
Aborted (core dumped)

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions