-
Notifications
You must be signed in to change notification settings - Fork 372
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
Use envs_dirs settings during environment creation #2475
Conversation
3e40cb8
to
3747525
Compare
Hi @katringoogoo, is this related to #2465 ? |
Hi @AntoinePrv! Yes that is related to this issue ... I'm going to look into the failing test as soon as possible. Is there anything else I need to take care of to get the PR accepted? |
libmamba/src/api/create.cpp
Outdated
fs::u8path target_prefix = ctx.target_prefix; | ||
for (auto& env_dir : ctx.envs_dirs) | ||
{ | ||
if (fs::exists(env_dir) && fs::is_directory(env_dir) && mamba::path::is_writable(env_dir)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be reasonable to create env_dir
if it does not exist.
libmamba/src/api/create.cpp
Outdated
@@ -29,23 +28,32 @@ namespace mamba | |||
auto& create_specs = config.at("specs").value<std::vector<std::string>>(); | |||
auto& use_explicit = config.at("explicit_install").value<bool>(); | |||
|
|||
fs::u8path target_prefix = ctx.target_prefix; | |||
for (auto& env_dir : ctx.envs_dirs) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, maybe this could be a method of the Context (not sure yet how it would play with ctx.target_prefix
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ideally, this should be part of the deduction of target_prefix
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you mean like in a set_post_context_hook for example?
libmamba/src/core/fsutil.cpp
Outdated
// If it is a directory we created a subitem in that directory and need to delete it | ||
// If the path didn't exist before we created a file that needs to be removed as well | ||
if (is_directory || path_exists == false) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you modify libmamba/tests/src/core/test_util.cpp
with a test for that behavior?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i added an assertion to test for this as well
Hi @katringoogoo, I had to look more into the
The mamba/libmamba/src/api/configuration.cpp Line 440 in 75b49fc
And here we ignore envs_dirs mamba/libmamba/src/api/configuration.cpp Line 475 in 75b49fc
My recommendation is
Does that seem reasonable? |
eb23687
to
2417aed
Compare
Waiting for the CI to go 🟢 before sending more changes. |
761bbe3
to
4cef0f2
Compare
The CI is red in Windows because of winreg-feedstock#7. This is fixed in #2520. |
df9e727
to
5734a4f
Compare
5734a4f
to
4a4d544
Compare
Closing in favor of #2538, this is much out of sync with main. |
Edit: Adresses the issue mentioned in #2465
Open Question: can i somehow distinguish between environment creation by name and by target prefix?