foundry icon indicating copy to clipboard operation
foundry copied to clipboard

`forge doc --build --root <PATH>` --prefix not found error

Open dalechyn opened this issue 1 year ago • 3 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 (28b2ae6 2023-03-04T00:10:50.272293Z)

What command(s) is the bug in?

forge docs

Operating System

macOS (Intel)

Describe the bug

forge docs subcommand states the support of --root argument.

However, when trying to provide one, the execution fails: Снимок экрана 2023-03-11 в 21 20 05 Снимок экрана 2023-03-11 в 21 20 16

dalechyn avatar Mar 11 '23 19:03 dalechyn

I get the same error too, when running the command: forge doc --build --out ./documentation

oveddan avatar May 04 '23 17:05 oveddan

I just hit this running the following command:

forge doc --out ./_site 

Interestingly this does not occur when I remove the dot-slash as a workaround:

forge doc --out _site

jac18281828 avatar Dec 18 '23 21:12 jac18281828

In our case, we realized the issue is that the root of our forge project is not the git root. We have the forge project in the ./contracts folder. Our workaround for the issue is to add remappings to the root of the git repository, and then run forge doc for the full repo. This is not ideal, since we may have multiple forge projects in the same repo in the future, and would like the ability to build the docs separately.

https://github.com/risc0/risc0-ethereum/pull/111/files

I spent some time trying to figure out exactly where this error is coming from, but have so far not figured it out. The fact that this mitigation works is some new evidence, but I haven't had a chance yet to re-investigate.

nategraf avatar May 14 '24 18:05 nategraf