foundry
foundry copied to clipboard
[forge install] - install does not function the same as dapp install
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 (fb78b6b 2022-09-07T00:04:15.763953Z)
What command(s) is the bug in?
forge install
Operating System
macOS (Apple Silicon)
Describe the bug
As mentioned on Foundry Telegram Support.
forge install does not do the same thing as dapp install, some library bits are out of sync with the desired commit.
For now, our fix is using 'git submodule update --init --recursive' rather than forge install
.
Pinging @godsflaw for transparency.
forge install does not do the same thing as dapp install, some library bits are out of sync with the desired commit.
could you please elaborate on this what are the differences?
some library bits are out of sync with the desired commit.
what does that mean exactly? does forge pin a different commit than dapp by default if no tag
is provided in forge install org/repo@tag
?
@godsflaw to the rescue here for specifics when he has a minute (rare).
On my machine it had dss-exec-lib out of sync (it seems to have been using an older commit).
after running forge install makerdao/dss-exec-lib
I assume?
git clone {repo}
git pull
git checkout {branch}
forge install
<--- Here is where we use git submodule update --init --recursive
instead
make test-forge
There are four dependencies which turns into dependency hell as you'd imagine.
Here are the four which are being used and their commit hashes.

hmm
forge install
does
- add/clone the new submodule
https://github.com/foundry-rs/foundry/blob/63c71b4f3e162c5ab7da696b865a74ba8eda80c1/cli/src/cmd/forge/install.rs#L252-L255
- run
git submodule update --init --recursive
https://github.com/foundry-rs/foundry/blob/63c71b4f3e162c5ab7da696b865a74ba8eda80c1/cli/src/cmd/forge/install.rs#L279-L282
and also git submodule update --init --recursive
if only forge install
is run:
https://github.com/foundry-rs/foundry/blob/63c71b4f3e162c5ab7da696b865a74ba8eda80c1/cli/src/cmd/forge/install.rs#L92-L102
so unsure what we're missing
hmmm, may be more of a linking issue on compile. Will dig a bit deeper after merge week and get back to you since moving over to foundry is the goal :) you can close the issue for now if you want to.
Unrelated, but I found this topic when searching.
both dapp update
and dapp install
were chattier and would display exactly what was happening under the hood. Forge operates silently, so it's hard to know what's happening. It's be nice to know which submodules were being updated when the command is run.
With regard to this issue in particular, I think the old workflow was:
dapp install [module]
to add a new submodule
dapp update
after clone to perform a recursive submodule download (forge does not download submodules recursively with forge update
, but instead does it with forge install
)
dapp upgrade
to upgrade all submodules to latest
dapp upgrade [module]
to upgrade a single submodule to latest
Marking as stale, feel free to open a new feature qreust with developer experience improvements for the package installation process