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

Removes absolute paths from mamba.bat and mamba_hook.bat #3709

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

pchemguy
Copy link

Replaces macros expanded to absolute paths with prefix-independent code.
Fixes #3708

Replaces macros expanded to absolute paths with prefix-independent code.
@JohanMabille JohanMabille added the release::bug_fixes For PRs fixing bugs label Jan 2, 2025
Copy link
Member

@JohanMabille JohanMabille left a comment

Choose a reason for hiding this comment

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

What is the issue with having absolute paths in these scripts? They are generated when installing mamba / micromamba, so the paths should be the correct ones.

@CD /d "%~dp0.."
@SET "MAMBA_ROOT_PREFIX=%CD%"
@SET "MAMBA_EXE=%CD%\Library\bin\mamba.exe"
@CD /d "%CURDIR%"
Copy link
Member

@JohanMabille JohanMabille Jan 8, 2025

Choose a reason for hiding this comment

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

This will break micromamba installs, which install path can be anything and is independent from the root prefix.

@pchemguy
Copy link
Author

pchemguy commented Jan 8, 2025

What is the issue with ahving absolute paths in these scripts? They are generated when installing mamba / micromamba, so the paths should be the correct.

The issue is that this is a bad practice. There is absolutely no reason for Miniforge not to be portable, except for these hardcoded absolute paths. Absolute paths should alomst never be hardcoded in scripts. This is definitely true about Python infrastructure.

I often move Python directories after installation and this is completely normal. Python is by design portable, at least on Windows, and there is no reason for tooling to break this porability.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release::bug_fixes For PRs fixing bugs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Hardcoded absolute path in mamba.bat and mamba_hook.bat
2 participants