Skip to content

Commit

Permalink
fix: warn if failure installing default packages (#2102)
Browse files Browse the repository at this point in the history
  • Loading branch information
jdx authored May 14, 2024
1 parent 7af4432 commit 343f985
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 6 deletions.
4 changes: 3 additions & 1 deletion src/plugins/core/go.rs
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,9 @@ impl GoPlugin {

fn verify(&self, tv: &ToolVersion, pr: &dyn SingleReport) -> eyre::Result<()> {
self.test_go(tv, pr)?;
self.install_default_packages(tv, pr)?;
if let Err(err) = self.install_default_packages(tv, pr) {
warn!("failed to install default go packages: {err:#}");
}
let settings = Settings::get();
if settings.go_set_gopath {
warn!("setting go_set_gopath is deprecated");
Expand Down
4 changes: 3 additions & 1 deletion src/plugins/core/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,9 @@ impl Forge for NodePlugin {
self.test_node(&config, &ctx.tv, ctx.pr.as_ref())?;
self.install_npm_shim(&ctx.tv)?;
self.test_npm(&config, &ctx.tv, ctx.pr.as_ref())?;
self.install_default_packages(&config, &ctx.tv, ctx.pr.as_ref())?;
if let Err(err) = self.install_default_packages(&config, &ctx.tv, ctx.pr.as_ref()) {
warn!("failed to install default npm packages: {err:#}");
}
if *env::MISE_NODE_COREPACK && self.corepack_path(&ctx.tv).exists() {
self.enable_default_corepack_shims(&ctx.tv, ctx.pr.as_ref())?;
}
Expand Down
8 changes: 6 additions & 2 deletions src/plugins/core/python.rs
Original file line number Diff line number Diff line change
Expand Up @@ -340,10 +340,14 @@ impl Forge for PythonPlugin {
}
self.test_python(&config, &ctx.tv, ctx.pr.as_ref())?;
if let Err(e) = self.get_virtualenv(&config, &ctx.tv, Some(ctx.pr.as_ref())) {
warn!("failed to get virtualenv: {e}");
warn!("failed to get virtualenv: {e:#}");
}
if let Some(default_file) = &settings.python_default_packages_file {
self.install_default_packages(&config, default_file, &ctx.tv, ctx.pr.as_ref())?;
if let Err(err) =
self.install_default_packages(&config, default_file, &ctx.tv, ctx.pr.as_ref())
{
warn!("failed to install default python packages: {err:#}");
}
}
Ok(())
}
Expand Down
4 changes: 2 additions & 2 deletions src/plugins/core/ruby.rs
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ impl Forge for RubyPlugin {
#[requires(matches!(ctx.tv.request, ToolVersionRequest::Version { .. } | ToolVersionRequest::Prefix { .. }), "unsupported tool version request type")]
fn install_version_impl(&self, ctx: &InstallContext) -> Result<()> {
if let Err(err) = self.update_build_tool() {
warn!("{err}");
warn!("ruby build tool update error: {err:#}");
}
ctx.pr.set_message("running ruby-build".into());
let config = Config::get();
Expand All @@ -371,7 +371,7 @@ impl Forge for RubyPlugin {
self.install_rubygems_hook(&ctx.tv)?;
self.test_gem(&config, &ctx.tv, ctx.pr.as_ref())?;
if let Err(err) = self.install_default_gems(&config, &ctx.tv, ctx.pr.as_ref()) {
warn!("{err}");
warn!("failed to install default ruby gems {err:#}");
}
Ok(())
}
Expand Down

0 comments on commit 343f985

Please sign in to comment.