foundry icon indicating copy to clipboard operation
foundry copied to clipboard

bug(`forge build`): Stack overflow caused by `FOUNDRY_LIBS` or `DAPP_LIBS` containing an absolute path

Open guidanoli opened this issue 4 months ago • 0 comments

Component

Forge

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

  • [X] Foundry
  • [X] Foundryup

What version of Foundry are you on?

forge 0.2.0 (cc8e430 2024-10-16T00:22:08.572482504Z)

What command(s) is the bug in?

forge build

Operating System

Linux

Describe the bug

Steps to reproduce

  1. Push a temporary directory onto the stack
pushd "$(mktemp -d)" 
  1. Create a forge project
forge init
  1. Build the project with the environment variable FOUNDRY_LIBS set to an array that contains an absolute path to a directory. Also works with DAPP_LIBS. In this case, we use the absolute path to the lib folder just created by the forge init command.
FOUNDRY_LIBS=["$(pwd)/lib"] forge build
  1. This last command will exit with status code 134 and print the following error message.
thread 'main' has overflowed its stack
fatal runtime error: stack overflow
Aborted (core dumped)

guidanoli avatar Oct 16 '24 14:10 guidanoli