Skip to content
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

fix(forge): update submodules after dependency checkout #7142

Merged
merged 3 commits into from
Feb 15, 2024

Conversation

klkvr
Copy link
Member

@klkvr klkvr commented Feb 15, 2024

Motivation

Currently dependencies are being installed in 3 steps:

  1. Clone dependency
  2. Clone its submodules
  3. Checkout to the given or found tag, if any.

We need to swap 2 and 3 here as checked out commit might have more submodules than master and vice versa.

Because of that our CI failing right now as when installing forge-std, we are firstly cloning master which don't have ds-test dependency, and then checking out v1.7.6, which has it and requires it to compile normally

cc @mds1

Copy link
Member

@mattsse mattsse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice, makes sense

pedantic style nit

@@ -236,6 +236,9 @@ impl Installer<'_> {
// checkout the tag if necessary
self.git_checkout(&dep, path, false)?;

trace!("updating dependency submodules recursively");
self.git.root(path).submodule_update(false, false, false, true, None::<PathBuf>)?;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd prefer this if it compiles

Suggested change
self.git.root(path).submodule_update(false, false, false, true, None::<PathBuf>)?;
self.git.root(path).submodule_update(false, false, false, true, std::iter::empty::<PathBuf>())?;

Copy link
Member

@Evalir Evalir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this makes sense, pending mattsse nit

@klkvr klkvr requested a review from mattsse February 15, 2024 19:42
@klkvr klkvr merged commit a170021 into foundry-rs:master Feb 15, 2024
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants