archiver: warn about MSYS2 path translation, fixes #9339#9348
Open
trxvorr wants to merge 1 commit intoborgbackup:masterfrom
Open
archiver: warn about MSYS2 path translation, fixes #9339#9348trxvorr wants to merge 1 commit intoborgbackup:masterfrom
trxvorr 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 |
Member
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 |
Member
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 |
Member
There was a problem hiding this comment.
hmm, shall we add "is_win32 and ..." here?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.