foundry icon indicating copy to clipboard operation
foundry copied to clipboard

[forge install] - install does not function the same as dapp install

Open The-Arbiter opened this issue 2 years ago • 6 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 (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.

The-Arbiter avatar Sep 09 '22 16:09 The-Arbiter

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?

mattsse avatar Sep 09 '22 16:09 mattsse

@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).

The-Arbiter avatar Sep 09 '22 16:09 The-Arbiter

after running forge install makerdao/dss-exec-lib I assume?

mattsse avatar Sep 09 '22 17:09 mattsse

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.

Deps

Here is a link to the dependencies

The-Arbiter avatar Sep 09 '22 17:09 The-Arbiter

hmm

forge install does

  1. add/clone the new submodule

https://github.com/foundry-rs/foundry/blob/63c71b4f3e162c5ab7da696b865a74ba8eda80c1/cli/src/cmd/forge/install.rs#L252-L255

  1. 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

mattsse avatar Sep 12 '22 16:09 mattsse

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.

The-Arbiter avatar Sep 12 '22 16:09 The-Arbiter

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

brianmcmichael avatar Oct 19 '22 21:10 brianmcmichael

Marking as stale, feel free to open a new feature qreust with developer experience improvements for the package installation process

zerosnacks avatar Jun 26 '24 12:06 zerosnacks