archiver: warn about MSYS2 path translation, fixes #9339#9348
archiver: warn about MSYS2 path translation, fixes #9339#9348trxvorr wants to merge 1 commit intoborgbackup:masterfrom
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #9348 +/- ##
==========================================
- Coverage 76.03% 76.02% -0.02%
==========================================
Files 85 85
Lines 14744 14751 +7
Branches 2194 2197 +3
==========================================
+ Hits 11211 11214 +3
- Misses 2856 2860 +4
Partials 677 677 ☔ View full report in Codecov by Sentry. |
This adds a runtime warning when running under MSYS2/Git Bash without the necessary environment variables to disable automatic path translation. The documentation is also updated to explain this behavior and how to mitigate it.
3c858c2 to
f203dcf
Compare
| MSYS2 Path Translation | ||
| ++++++++++++++++++++++ | ||
|
|
||
| When running Borg within an MSYS2 (including Git Bash) environment, the shell |
There was a problem hiding this comment.
not sure why "Git Bash" is mentioned here?
| ++++++++++++++++++++++ | ||
|
|
||
| When running Borg within an MSYS2 (including Git Bash) environment, the shell | ||
| automatically translates POSIX-style paths (like ``/tmp`` or ``/c/Users``) to |
There was a problem hiding this comment.
is msys2 normalizing to always lowercase "/c" ?
| is_haiku = sys.platform.startswith("haiku") | ||
|
|
||
| # MSYS2/Git Bash (on Windows) | ||
| is_msystem = "MSYSTEM" in os.environ |
There was a problem hiding this comment.
hmm, shall we add "is_win32 and ..." here?
|
Please update your local master branch and then rebase this branch onto that master and force push. That should solve the CI test failures that are unrelated to your work. |
This PR addresses issue #9339 by adding a runtime warning when Borg detects it is running under an MSYS2/Git Bash environment without the necessary configuration to prevent path translation.
In MSYS2 environments, POSIX-style paths (e.g., /tmp) are automatically translated to Windows paths (e.g., C:/msys64/tmp) by the shell before being passed to the application. This causes unintended absolute Windows paths to be stored in archives, reducing portability.
Validated that the warning triggers when running in an unmodified MSYS2 shell.
Validated that setting the environment variables suppresses the warning.