Skip to content

archiver: warn about MSYS2 path translation, fixes #9339#9348

Open
trxvorr wants to merge 1 commit intoborgbackup:masterfrom
trxvorr:fix-9339-msys2-paths
Open

archiver: warn about MSYS2 path translation, fixes #9339#9348
trxvorr wants to merge 1 commit intoborgbackup:masterfrom
trxvorr:fix-9339-msys2-paths

Conversation

@trxvorr
Copy link
Contributor

@trxvorr trxvorr commented Feb 15, 2026

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.

@codecov
Copy link

codecov bot commented Feb 15, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.35%. Comparing base (a2ea1e9) to head (d7bbcfb).
⚠️ Report is 1 commits behind head on master.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #9348      +/-   ##
==========================================
- Coverage   83.37%   83.35%   -0.02%     
==========================================
  Files          87       87              
  Lines       15439    15444       +5     
  Branches     2309     2310       +1     
==========================================
+ Hits        12872    12874       +2     
- Misses       1818     1819       +1     
- Partials      749      751       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@trxvorr trxvorr force-pushed the fix-9339-msys2-paths branch from 3c858c2 to f203dcf Compare February 15, 2026 21:38
@trxvorr trxvorr marked this pull request as draft February 22, 2026 13:12
@ThomasWaldmann
Copy link
Member

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.

@trxvorr trxvorr force-pushed the fix-9339-msys2-paths branch from f203dcf to 50e6d21 Compare March 1, 2026 14:20
@trxvorr trxvorr marked this pull request as ready for review March 1, 2026 14:22
@ThomasWaldmann
Copy link
Member

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.

Copy link
Member

@ThomasWaldmann ThomasWaldmann left a comment

Choose a reason for hiding this comment

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

one nitpick, rest looks good.

can you add a is_msystem-only test that it does not put the windows paths into an archive?

@trxvorr trxvorr force-pushed the fix-9339-msys2-paths branch from 50e6d21 to 81e1a46 Compare March 14, 2026 14:50
@trxvorr trxvorr requested a review from ThomasWaldmann March 14, 2026 14:50
@trxvorr trxvorr force-pushed the fix-9339-msys2-paths branch 2 times, most recently from dfe557a to 2f5b9c9 Compare March 14, 2026 18:24
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.
@trxvorr trxvorr force-pushed the fix-9339-msys2-paths branch from 2f5b9c9 to d7bbcfb Compare March 15, 2026 15:25
@trxvorr trxvorr requested a review from ThomasWaldmann March 15, 2026 15:25
Copy link
Member

@ThomasWaldmann ThomasWaldmann left a comment

Choose a reason for hiding this comment

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

LGTM!

@trxvorr
Copy link
Contributor Author

trxvorr commented Mar 15, 2026

@ThomasWaldmann are the codecov failures fine?

@ThomasWaldmann
Copy link
Member

Yes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants