mario-eth / soldeer

Solidity Package Manager written in rust
MIT License
240 stars 26 forks source link

Recursive dependencies are installed using a subprocess #154

Open DaniPopes opened 3 months ago

DaniPopes commented 3 months ago

Recursive dependencies are installed using a subprocess:

https://github.com/mario-eth/soldeer/blob/660b6c95e33965e532dabedce30d0e48c5d174bc/src/dependency_downloader.rs#L317-L325

This assumes that there is a forge, that it has a soldeer subcommand, and that it will behave the same as the currently running process.

Obviously this is not ideal since any of those things could be not true, and many more.

mario-eth commented 3 months ago

Someone is using the flowing command to install dependencies: forge soldeer install...

So the assumption is correct in this case because otherwise that would have not be triggered. The subprocess is called by a parent process and the subprocess is a clone of the parent basically.

But thanks for bringing into my attention, i have to take care of the case when someone is trying to install a dependency using soldeer cli

beeb commented 2 months ago

Now that we have more flexibility about invoking soldeer with configurable paths, it might be possible to run soldeer install programmatically without calling to the subprocess.

beeb commented 1 week ago

At the moment, the soldeer_core::install::install_dependencies function doesn't really like recursivity. I tried to modify the install_subdependencies to call install_dependencies but I get an error that some future is not Send: https://github.com/beeb/soldeer/commit/b46231d49fb8159f240a0221bb67200f09c11e62