foundry-rs / foundry

Foundry is a blazing fast, portable and modular toolkit for Ethereum application development written in Rust.
https://getfoundry.sh
Apache License 2.0
8.17k stars 1.7k forks source link

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

Open dalechyn opened 1 year ago

dalechyn commented 1 year ago

Component

Forge

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

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

oveddan commented 1 year ago

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

jac18281828 commented 9 months ago

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
nategraf commented 4 months ago

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.