remove --remote-path, --rsh, --upload-ratelimit, --upload-buffer, --iec and --debug-profile options#9952
Merged
ThomasWaldmann merged 9 commits intoJul 26, 2026
Conversation
The --remote-path option was only honoured on the legacy (borg 1.x, ssh://) code path in legacy/remote.py. For borg2 rest:// repositories, the remote borg is determined by rest_serve_command(), which only ever looked at the BORG_REMOTE_PATH environment variable - so giving --remote-path silently had no effect and the far end failed with "command not found: borg". Rather than plumbing args into rest_serve_command(), drop the option completely and use BORG_REMOTE_PATH consistently for both repo types. Also apply replace_placeholders() to it for rest:// repos, as the legacy code path already did.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #9952 +/- ##
==========================================
+ Coverage 85.49% 85.61% +0.11%
==========================================
Files 93 93
Lines 16122 16096 -26
Branches 2466 2458 -8
==========================================
- Hits 13783 13780 -3
+ Misses 1632 1614 -18
+ Partials 707 702 -5 ☔ View full report in Codecov by Harness. |
Like --remote-path, --rsh was only honoured on the legacy (borg 1.x, ssh://) code path. For borg2 repositories the remote shell command comes from borgstore, which reads its own BORGSTORE_RSH environment variable, so --rsh silently had no effect there. Remove the option; BORG_RSH is now the only way to set the remote shell command. For borgstore-based repositories, borg gives the BORG_RSH value to borgstore as BORGSTORE_RSH, except if that was set explicitly (then the user wants a different command for borgstore). borg benchmark crud does not need to inherit --rsh / --remote-path into its sub-invocations any more (environment variables are inherited anyway), so the parse_args wrapper is gone.
Both were only ever read by the legacy (borg 1.x, ssh://) remote repository code, so they had no effect on borg2 repositories - borgstore does not do rate limiting or upload buffering at all. For the legacy code path they are not worth keeping either: we only support transferring FROM borg1 repos, so there is not much traffic in the upload direction of a borg1 repo anyway. Removes the SleepingBandwidthLimiter class with them; the only thing left from it is write_to_fd(), which turns a BrokenPipeError into the nicer ConnectionBrokenWithHint. Without an upload buffer size limit, the "queue more calls" condition simplifies to "the send buffer is empty".
borg has no --socket option (any more), so do not complete it.
--remote-ratelimit was not replaced by --upload-ratelimit for long: that one is gone now, too. Fix the upgrade note and the FAQ, which still told users to use the (long removed) --remote-ratelimit option.
Unlike the other options removed recently, --iec did work for borg2 repos - but the same setting is better placed in the environment: it is a display preference one usually wants for all borg invocations, not per command. BORG_IEC=yes now selects IEC units (1KiB = 1024B); "true" and "1" are accepted, too, because jsonargparse's automatic BORG_<OPTION> environment variables accepted these for --iec. Note that removing the option also removes that automatic environment variable, so the new use_iec_units() helper reads BORG_IEC explicitly. The iec=... plumbing through Archive, Statistics, ArchiveFormatter and Cache is unchanged, only the places reading args.iec now call use_iec_units().
Set BORG_DEBUG_PROFILE to a filename to get an execution profile written there; a ".pyprof" suffix still selects the Python-compatible format. Note that this now applies to EVERY borg invocation while the variable is set, not just to a single command like the option did - the docs say so and the test switches it off around the "borg debug convert-profile" call, which would otherwise profile itself over the profile it is reading.
The command is "borg debug convert-profile", not "profile-convert". Also, scripts/msgpack2marshal.py does not exist any more - that command does the same job.
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.
Removes six common ("global") options. Four of them were dead weight for borg2 repositories, two are settings that belong into the environment rather than onto every command line.
Dead for borg2:
--remote-path,--rsh,--upload-ratelimit,--upload-bufferAll four were only ever honoured on the legacy (borg 1.x,
ssh://) code path inlegacy/remote.py:For borg2 repositories they did nothing:
rest_serve_command()inrepository.py, which only ever looked atBORG_REMOTE_PATHBORGSTORE_RSHThey were accepted for every command and silently ignored. For
--remote-paththe failure only showed up as a confusing error from the far end:Rather than plumbing
argsdown into the borgstore code paths, the options are gone and the environment variables are the one way to set these, for legacy and borg2 repositories alike. Being consistent beats failing silently for borg2 repos.BORG_RSHis given to borgstore asBORGSTORE_RSH, except if that was set explicitly - then the user wants a different command for borgstore (newpropagate_rsh()inrepository.py, called fromRepository.__init__)replace_placeholders()is applied toBORG_REMOTE_PATHon therest://path, which the legacy path already did--upload-ratelimit/--upload-bufferhave no replacement: we only support transferring from borg1 repos, so there is not much traffic in the upload direction of a borg1 repo anyway. TheSleepingBandwidthLimiterclass goes with them; what remains of it iswrite_to_fd(), which turns aBrokenPipeErrorinto the nicerConnectionBrokenWithHint. Without an upload buffer size limit, the "queue more calls" condition simplifies to "the send buffer is empty".Better placed in the environment:
--iecand--debug-profileThese two did work for borg2, but both are settings one wants for all invocations rather than per command:
BORG_IEC=yesselects IEC units (1KiB = 1024B).trueand1are accepted too, because jsonargparse's automaticBORG_<OPTION>environment variables accepted those for--iec.BORG_DEBUG_PROFILE=FILEwrites an execution profile; a.pyprofsuffix still selects the Python-compatible format.Note that removing an option also removes its automatic jsonargparse environment variable, so both are now read explicitly (
use_iec_units()inhelpers/parseformat.py,os.environinarchiver/__init__.py).BORG_DEBUG_PROFILEapplies to every borg invocation while it is set, unlike the option - documented, and the profile test switches it off around theborg debug convert-profilecall, which would otherwise profile itself over the profile it is reading.Everything else
borg benchmark crudno longer inherits these options into its sub-invocations - environment variables are inherited by the subprocess anyway, so theparse_argswrapper is goneborg help placeholders: placeholders are supported inBORG_REMOTE_PATH(was:--remote-path)BORG_IECandBORG_DEBUG_PROFILEare documented for the first time, changelog entries under the removed options,deployment/pull-backup.rstexamples useBORG_RSH=...instead of--rsh ..., the FAQ no longer recommends the long-removed--remote-ratelimit, usage/man regenerated, fish completions dropped--socketfish completion (not a borg option for a while), and the docs naming the profile converterborg debug profile-convertwhen it isconvert-profileVerification
Manually verified against a
rest://user@localhost/...repo (repo-create + 2 archives + repo-list), withBORG_REMOTE_PATHpointing at a borg outside ofPATHandBORG_RSH(withBORGSTORE_RSHunset) selecting a specific ssh identity - both are picked up.BORG_IEC=yesswitchesborg infofrom336.68 kBto328.79 KiB;BORG_DEBUG_PROFILEwrites a profile thatborg debug convert-profileconverts andpstatsreads. Each removed option now fails fast witherror: Unrecognized arguments: ....Full test suite passes locally after each step, including the
remotetests that exercise the legacy transport: 2048 passed, 110 skipped.