-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug: forge does not add tag information into gitmodules file on install #7225
Comments
Confirmed just in case $ forge install foundry-rs/[email protected]
Installing forge-std in /Users/janitor/tstorish/lib/forge-std (url: Some("https://github.com/foundry-rs/forge-std"), tag: Some("v1.7.6"))
Cloning into '/Users/janitor/tstorish/lib/forge-std'...
remote: Enumerating objects: 2168, done.
remote: Counting objects: 100% (2164/2164), done.
remote: Compressing objects: 100% (722/722), done.
remote: Total 2168 (delta 1436), reused 2070 (delta 1375), pack-reused 4
Receiving objects: 100% (2168/2168), 610.57 KiB | 2.81 MiB/s, done.
Resolving deltas: 100% (1436/1436), done.
Submodule 'lib/ds-test' (https://github.com/dapphub/ds-test) registered for path 'lib/ds-test'
Cloning into '/Users/janitor/tstorish/lib/forge-std/lib/ds-test'...
remote: Enumerating objects: 313, done.
remote: Counting objects: 100% (171/171), done.
remote: Compressing objects: 100% (79/79), done.
remote: Total 313 (delta 91), reused 132 (delta 83), pack-reused 142
Receiving objects: 100% (313/313), 71.35 KiB | 1.32 MiB/s, done.
Resolving deltas: 100% (130/130), done.
Installed forge-std v1.7.6
01:59:55 Sat Feb 24 2024 janitor macbook /Users/janitor/tstorish feat/simple-tests $ cat .gitmodules
[submodule "lib/forge-std"]
path = lib/forge-std
url = https://github.com/foundry-rs/forge-std |
Currently when installing submodule, forge tries to find a branch with the same name as the tag, and only if it's found, the foundry/crates/forge/bin/cmd/install.rs Lines 345 to 350 in 474591a
|
$ forge install -h
Install one or multiple dependencies
Usage: forge install \[OPTIONS\] \[DEPENDENCIES\]...
forge install \[OPTIONS\] \<github username>/\<github project>@\<tag>...
forge install \[OPTIONS\] \<alias>=\<github username>/\<github project>@\<tag>...
forge install \[OPTIONS\] \<https:// git url>...
$ forge install /transmissions11/solmate@c892309933b25c03d32b1b0d674df7ae292ba925
Resolving deltas: 100% (130/130), done.
Installed solmate c892309933b25c03d32b1b0d674df7ae292ba925
08:11:40 Mon Feb 26 2024 janitor macbook /Users/janitor/solmate-tmp master
$ cat .gitmodules
\[submodule "lib/forge-std"\]
path = lib/forge-std
url = https://github.com/foundry-rs/forge-std
\[submodule "lib/solmate"\]
path = lib/solmate
url = [https://github.com//transmissions11/solmate](https://github.com//transmissions11/solmate)
Forge uses 'tag' to mean any git commit hash, the behaviour is true in that regard. As you mention git submodules does not explicitly support proper git tags, however this is just really an alias for some git commit hash really. |
Hi @sambacha, thanks for reporting this Confirming this issue is still active (cc @klkvr) I've created a minimal reproduction here: https://github.com/zerosnacks/foundry-bug-7225-repro that has a practical example people run into relating to the |
Ref: #3720 |
we're going to add |
Reopened as #9453 doesn't address the tag/rev issue |
Component
Forge
Have you ensured that all of these are up to date?
What version of Foundry are you on?
forge 0.2.0 (a436a0d 2024-02-20T00:25:57.253479000Z) && forge 0.2.0 (6d5de51 2024-02-23T00:19:38.512335000Z)
What command(s) is the bug in?
forge install
Operating System
macOS (Apple Silicon)
Describe the bug
Running this install,
solidstate-network/[email protected]
After we inspect
.gitmodules
and findHowever we want the
.gitmodules
file to reflect this correct configuration[submodule "lib/solidstate-solidity"] path = lib/solidstate-solidity url = https://github.com/solidstate-network/solidstate-solidity + branch = v0.0.59
The text was updated successfully, but these errors were encountered: