Install josh binaries into a local directory#53
Conversation
|
Could this be in |
|
That would be this, right? I don't just want to hardcode it for Linux :P |
|
I was thinking this one https://docs.rs/dirs/latest/dirs/fn.executable_dir.html but maybe data dir is better since this needs a subdirectory. The same Or configurable via env would be fine, just preferably some way to avoid a new top-level directory in |
|
I wanted to avoid depending on a new dependency, only to find out that we already depend on |
| pub fn try_install_josh_proxy(verbose: bool) -> Option<JoshProxy> { | ||
| try_install_josh_program(JoshProgram::Proxy, verbose).map(JoshProxy::from_path) | ||
| } | ||
|
|
||
| pub fn try_install_josh_filter(verbose: bool) -> Option<JoshFilter> { | ||
| // The josh-filter binary is included in the josh-cli crate | ||
| run_command( | ||
| &[ | ||
| "cargo", | ||
| "+stable", | ||
| "install", | ||
| "--locked", | ||
| "--git", | ||
| "https://github.com/josh-project/josh", | ||
| "--tag", | ||
| JOSH_VERSION, | ||
| "josh-cli", | ||
| ], | ||
| try_install_josh_program(JoshProgram::Filter, verbose).map(JoshFilter::from_path) | ||
| } |
There was a problem hiding this comment.
josh-filter is used only if the config file specifies a subtree-filter, which can be used to further transform the extracted subtree, if the subrepo contains also other stuff.
I expect that once we move to josh-cli completely, we can get rid of both josh-proxy and josh-filter and do everything via the new shared josh CLI command.
There was a problem hiding this comment.
Ah, I didn't even realize we had such a feature. :D Unfortunate that we need to install two things for that, given how long josh takes to build, but I guess long-term this will go away when we use josh-cli completely and until then there's not much else we can do.
There was a problem hiding this comment.
Don't worry, josh-filter is only installed when you use this niche feature. It is currently only used in rustc-public, AFAIK, so josh-filter shouldn't be installed for e.g. miri.
This PR changes
josh-syncso that it installjoshbinaries into a.josh-sync/cargodirectory in the user's HOME directory, to avoid clashing with global Cargo installed binaries.It also shows the installation progress, to avoid a long duration without any output.
It still installs the commands globally on CI, to make more effective use of caching (via
rust-cache).Fixes: #50