Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Ensure root prefix's conda-meta folder presence #3752

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions micromamba/src/update.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,14 @@ update_self(Configuration& config, const std::optional<std::string>& version)
// the conda-meta folder of the target_prefix)
ctx.prefix_params.target_prefix = ctx.prefix_params.root_prefix;

// We need to ensure that the `conda-meta` folder exists so that all further
// operations can be performed.
const fs::u8path conda_meta_path = ctx.prefix_params.target_prefix / "conda-meta";
if (!fs::exists(conda_meta_path))
{
fs::create_directories(conda_meta_path);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My understanding is that create_directories will not fail and is no-op if the path already exists, so the if doesnt seem necessary.

}

auto channel_context = ChannelContext::make_conda_compatible(ctx);

solver::libsolv::Database db{ channel_context.params() };
Expand Down
Loading