Closed DaniPopes closed 1 month ago
We have version 0.4.0 on the making which takes care of all of these lazy and more modular. But we are releasing slowly. This release aimed sub-dependencies and an improved git support.
Version: 0.4.0 will have more improvements
Currently lots of assumptions are made about CWD, dependencies directory, ... due to heavy usage of global Lazy statics and getter functions which have no state, meaning none of these variables are configurable.
Random example 1: deep in "health check" is usage of global
DEPENDENCY_DIR
https://github.com/mario-eth/soldeer/blob/b31317860b576d40fa72df4ee52c969e2d65d02d/src/janitor.rs#L24Random example 2:
utils::get_base_url
has to use an environment variable to override the value oncfg(test)
https://github.com/mario-eth/soldeer/blob/660b6c95e33965e532dabedce30d0e48c5d174bc/src/utils.rs#L89-L95An example fix would be something like
struct Project
or whatever you want to call it (like Rust crate) that containsdependency_dir: PathBuf
, and these global functions are instead methods on this struct.There are more ways to do this, but the main point is removing the global state to make it configurable.