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.52% 76.51% -0.01%
==========================================
Files 85 85
Lines 14820 14827 +7
Branches 2214 2217 +3
==========================================
+ Hits 11341 11345 +4
- Misses 2802 2806 +4
+ Partials 677 676 -1 ☔ View full report in Codecov by Sentry. |
3c858c2 to
f203dcf
Compare
|
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 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.
f203dcf to
50e6d21
Compare
|
btw, if you address feedback by changing the code, maybe give a short answer to the feedback and/or click on "resolve" if you think it is done. |
ThomasWaldmann
left a comment
There was a problem hiding this comment.
one nitpick, rest looks good.
can you add a is_msystem-only test that it does not put the windows paths into an archive?
|
|
||
| if not is_serve: | ||
| if is_win32 and is_msystem: | ||
| if "MSYS2_ARG_CONV_EXCL" not in os.environ or "MSYS2_ENV_CONV_EXCL" not in os.environ: |
There was a problem hiding this comment.
as there is no "else" here, you could join the 3 if-conditions using "and".
There was a problem hiding this comment.
also, since you are checking is_win32 already when is_msystem is assigned, you don't need it here.
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.