Skip to content

Conversation

@silvekkk
Copy link
Contributor

Warns when git revision in soldeer.lock differs from actual dependency revision.

Closes #12357

Not sure If should add test here, let me know if need

@grandizzy
Copy link
Collaborator

@silvekkk I think that could work too (cc @mario-eth ) but the original ticket was meant for foundry.lock and deps installed with forge install and updated with forge update

@grandizzy
Copy link
Collaborator

updated ticket name to reflect that. thank you!

@mario-eth
Copy link
Contributor

cc @beeb

@beeb
Copy link
Contributor

beeb commented Oct 29, 2025

Ideally, this check would be more thorough and do the same consistency check we do in soldeer install (hashing all the files in the dependencies). It would be best if it reused the logic and types from soldeer_core too.

@silvekkk
Copy link
Contributor Author

  • Add SHA256 checksum verification for dependencies
  • Check both checksum and git revision
  • Provide clear warnings for integrity failures
  • Follow soldeer's verification approach

is this what in your mind? @beeb cc @grandizzy @mario-eth

@beeb
Copy link
Contributor

beeb commented Oct 30, 2025

@silvekkk You reimplemented everything which is not great, because if we ever decide to change something about the lockfile or dependencies folder structure, your code will break.

Please add a dependency to soldeer_core in forge/Cargo.toml using soldeer-core.workspace = true.

You can then use the following:

@silvekkk
Copy link
Contributor Author

@beeb Thanks for the feedback! I'vereverted and refactored to use the soldeer_core APIs:

  • Added soldeer-core dependency
  • Using read_lockfile() and check_dependency_integrity() as you suggested
  • Removed all custom implementation

@beeb
Copy link
Contributor

beeb commented Oct 31, 2025

Thanks for the changes. Although this all feels very LLM generated, I left some comments.

@silvekkk
Copy link
Contributor Author

Thanks for the changes. Although this all feels very LLM generated, I left some comments.

Yeah, about 50–60% of the later commits were actually done with Claude’s help. I asked it to add comments, clean up the structure, and handle a few checks I probably overlooked, and final review.
Haha, trust me—if you’d seen my original code, you probably wouldn’t even have felt like leaving a comment. (It was that bad.) best 20$ I paid ever

@silvekkk silvekkk requested a review from beeb October 31, 2025 09:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

feat: Add warning on forge build with inconsistent rev in foundry.lock file

4 participants