Skip to content

Fix unused io import under Windows for preallocation#1796

Merged
oferchen merged 1 commit into
masterfrom
fix-unused-import-in-rsync-engine
Oct 31, 2025
Merged

Fix unused io import under Windows for preallocation#1796
oferchen merged 1 commit into
masterfrom
fix-unused-import-in-rsync-engine

Conversation

@oferchen
Copy link
Copy Markdown
Owner

Summary

  • gate the std::io import in the file preallocation helper behind cfg(unix) so Windows builds no longer warn

Testing

  • cargo fmt --all
  • cargo --locked zigbuild --release --target x86_64-pc-windows-gnu --bin oc-rsync (fails: cargo command zigbuild is not installed in the environment)

https://chatgpt.com/codex/tasks/task_e_690541710df083238f16060e5cf0422c

@oferchen oferchen merged commit 94682a4 into master Oct 31, 2025
@oferchen oferchen deleted the fix-unused-import-in-rsync-engine branch October 31, 2025 23:12
oferchen added a commit that referenced this pull request May 16, 2026
Expand the placeholder async migration plan into a comprehensive,
opinionated design covering: current synchronous threading model per
subsystem, per-subsystem cost/benefit, a phased incremental adoption
strategy, tokio runtime choice with rejected alternatives, sync/async
bridge patterns, backward-compat strategy, risk register, and open
questions.

Cross-references existing async-related tasks (#1367, #1411, #1591,
#1593, #1595, #1674, #1751, #1779, #1780, #1782, #1796, #1797, #1805,
#1806, #1889, #1890, #1891, #1892, #1934, #1935, #2136) and related
design notes so future planners have a single anchor.
oferchen added a commit that referenced this pull request May 16, 2026
Expand the placeholder async migration plan into a comprehensive,
opinionated design covering: current synchronous threading model per
subsystem, per-subsystem cost/benefit, a phased incremental adoption
strategy, tokio runtime choice with rejected alternatives, sync/async
bridge patterns, backward-compat strategy, risk register, and open
questions.

Cross-references existing async-related tasks (#1367, #1411, #1591,
#1593, #1595, #1674, #1751, #1779, #1780, #1782, #1796, #1797, #1805,
#1806, #1889, #1890, #1891, #1892, #1934, #1935, #2136) and related
design notes so future planners have a single anchor.
oferchen added a commit that referenced this pull request May 17, 2026
…e) (#1795) (#4266)

Introduce a structured connection primitive that wraps the existing
`SshCommand` builder behind explicit `SshConnectConfig` and
`KeepAliveConfig` structs. This is the first concrete step in the SSH
transport chain (#1795 -> #1796 -> #1797 -> #1805 -> #1806) and lets
upstream call sites compose connect, auth, and session-setup steps from
a single config value instead of a long sequence of builder setters.

The new `SshConnection::connect_with_config(remote, &config)` entry point
stays synchronous and reuses the existing watchdog + stderr-drain
plumbing. Defaults mirror the historical `SshCommand::new` behaviour
(30 s connect timeout, 20 s keepalive interval, 3 allowed failures); a
`None` field disables the corresponding `-o ConnectTimeout` or
`-o ServerAlive*` injection. The async variant is reserved for task
#1801 and intentionally not introduced here, so no new runtime
dependencies land in this PR.

Unit coverage exercises the config defaults, the builder-setter round
trip, the rendered argv (timeout, keepalive, remote command ordering),
keepalive disabled / custom-value cases, sub-second rounding, and
user/host splitting. A unix-gated, env-guarded smoke test
(`OC_RSYNC_SSH_NET=1`) confirms an unreachable host surfaces an
io::Error within ~2x the configured timeout.
oferchen added a commit that referenced this pull request May 17, 2026
…1797) (#4271)

Bridge `tokio::sync::mpsc` channel pairs to `tokio::io::AsyncRead` and
`AsyncWrite` so async transports (for example, the in-flight async SSH
transport in #1796) can be composed with traits that expect raw async
streams.

The new `channel_adapter` module is gated behind a new `async-ssh`
feature so default builds are unaffected. `pair(capacity)` builds two
cross-connected halves for a fully in-memory duplex stream.

Unit tests cover round-trip, oversized-chunk re-draining, backpressure,
EOF on writer drop, EOF on explicit shutdown, broken-pipe surfacing on
both writer-side and reader-side closes, and bidirectional `pair()`
exchange.
oferchen added a commit that referenced this pull request May 17, 2026
Introduce `AsyncSshTransport::execute_remote_rsync` as the tokio-backed
counterpart to `SshConnection::connect_with_config`. Argv composition is
delegated through the existing `SshCommand` builder so the sync and
async paths render byte-identical SSH command lines for any given
(remote, args, config) triple.

The new module is gated behind `--features async-ssh`, opt-in only.
Default builds remain on the synchronous `std::process` transport with
no tokio dependency. The downstream `ChannelReader`/`ChannelWriter`
adapters that bridge these halves into the multiplex framing layer are
tracked separately as task #1797.
oferchen added a commit that referenced this pull request May 17, 2026
… (#4273)

Introduce `AsyncSshTransport::execute_remote_rsync` as the tokio-backed
counterpart to `SshConnection::connect_with_config`. Argv composition is
delegated through the existing `SshCommand` builder so the sync and
async paths render byte-identical SSH command lines for any given
(remote, args, config) triple.

The new module is gated behind `--features async-ssh`, opt-in only.
Default builds remain on the synchronous `std::process` transport with
no tokio dependency. The downstream `ChannelReader`/`ChannelWriter`
adapters that bridge these halves into the multiplex framing layer are
tracked separately as task #1797.
oferchen added a commit that referenced this pull request May 18, 2026
Expand the placeholder async migration plan into a comprehensive,
opinionated design covering: current synchronous threading model per
subsystem, per-subsystem cost/benefit, a phased incremental adoption
strategy, tokio runtime choice with rejected alternatives, sync/async
bridge patterns, backward-compat strategy, risk register, and open
questions.

Cross-references existing async-related tasks (#1367, #1411, #1591,
#1593, #1595, #1674, #1751, #1779, #1780, #1782, #1796, #1797, #1805,
#1806, #1889, #1890, #1891, #1892, #1934, #1935, #2136) and related
design notes so future planners have a single anchor.
oferchen added a commit that referenced this pull request May 18, 2026
…e) (#1795) (#4266)

Introduce a structured connection primitive that wraps the existing
`SshCommand` builder behind explicit `SshConnectConfig` and
`KeepAliveConfig` structs. This is the first concrete step in the SSH
transport chain (#1795 -> #1796 -> #1797 -> #1805 -> #1806) and lets
upstream call sites compose connect, auth, and session-setup steps from
a single config value instead of a long sequence of builder setters.

The new `SshConnection::connect_with_config(remote, &config)` entry point
stays synchronous and reuses the existing watchdog + stderr-drain
plumbing. Defaults mirror the historical `SshCommand::new` behaviour
(30 s connect timeout, 20 s keepalive interval, 3 allowed failures); a
`None` field disables the corresponding `-o ConnectTimeout` or
`-o ServerAlive*` injection. The async variant is reserved for task
#1801 and intentionally not introduced here, so no new runtime
dependencies land in this PR.

Unit coverage exercises the config defaults, the builder-setter round
trip, the rendered argv (timeout, keepalive, remote command ordering),
keepalive disabled / custom-value cases, sub-second rounding, and
user/host splitting. A unix-gated, env-guarded smoke test
(`OC_RSYNC_SSH_NET=1`) confirms an unreachable host surfaces an
io::Error within ~2x the configured timeout.
oferchen added a commit that referenced this pull request May 18, 2026
…1797) (#4271)

Bridge `tokio::sync::mpsc` channel pairs to `tokio::io::AsyncRead` and
`AsyncWrite` so async transports (for example, the in-flight async SSH
transport in #1796) can be composed with traits that expect raw async
streams.

The new `channel_adapter` module is gated behind a new `async-ssh`
feature so default builds are unaffected. `pair(capacity)` builds two
cross-connected halves for a fully in-memory duplex stream.

Unit tests cover round-trip, oversized-chunk re-draining, backpressure,
EOF on writer drop, EOF on explicit shutdown, broken-pipe surfacing on
both writer-side and reader-side closes, and bidirectional `pair()`
exchange.
oferchen added a commit that referenced this pull request May 18, 2026
… (#4273)

Introduce `AsyncSshTransport::execute_remote_rsync` as the tokio-backed
counterpart to `SshConnection::connect_with_config`. Argv composition is
delegated through the existing `SshCommand` builder so the sync and
async paths render byte-identical SSH command lines for any given
(remote, args, config) triple.

The new module is gated behind `--features async-ssh`, opt-in only.
Default builds remain on the synchronous `std::process` transport with
no tokio dependency. The downstream `ChannelReader`/`ChannelWriter`
adapters that bridge these halves into the multiplex framing layer are
tracked separately as task #1797.
oferchen added a commit that referenced this pull request May 18, 2026
Expand the placeholder async migration plan into a comprehensive,
opinionated design covering: current synchronous threading model per
subsystem, per-subsystem cost/benefit, a phased incremental adoption
strategy, tokio runtime choice with rejected alternatives, sync/async
bridge patterns, backward-compat strategy, risk register, and open
questions.

Cross-references existing async-related tasks (#1367, #1411, #1591,
#1593, #1595, #1674, #1751, #1779, #1780, #1782, #1796, #1797, #1805,
#1806, #1889, #1890, #1891, #1892, #1934, #1935, #2136) and related
design notes so future planners have a single anchor.
oferchen added a commit that referenced this pull request May 18, 2026
…e) (#1795) (#4266)

Introduce a structured connection primitive that wraps the existing
`SshCommand` builder behind explicit `SshConnectConfig` and
`KeepAliveConfig` structs. This is the first concrete step in the SSH
transport chain (#1795 -> #1796 -> #1797 -> #1805 -> #1806) and lets
upstream call sites compose connect, auth, and session-setup steps from
a single config value instead of a long sequence of builder setters.

The new `SshConnection::connect_with_config(remote, &config)` entry point
stays synchronous and reuses the existing watchdog + stderr-drain
plumbing. Defaults mirror the historical `SshCommand::new` behaviour
(30 s connect timeout, 20 s keepalive interval, 3 allowed failures); a
`None` field disables the corresponding `-o ConnectTimeout` or
`-o ServerAlive*` injection. The async variant is reserved for task
#1801 and intentionally not introduced here, so no new runtime
dependencies land in this PR.

Unit coverage exercises the config defaults, the builder-setter round
trip, the rendered argv (timeout, keepalive, remote command ordering),
keepalive disabled / custom-value cases, sub-second rounding, and
user/host splitting. A unix-gated, env-guarded smoke test
(`OC_RSYNC_SSH_NET=1`) confirms an unreachable host surfaces an
io::Error within ~2x the configured timeout.
oferchen added a commit that referenced this pull request May 18, 2026
…1797) (#4271)

Bridge `tokio::sync::mpsc` channel pairs to `tokio::io::AsyncRead` and
`AsyncWrite` so async transports (for example, the in-flight async SSH
transport in #1796) can be composed with traits that expect raw async
streams.

The new `channel_adapter` module is gated behind a new `async-ssh`
feature so default builds are unaffected. `pair(capacity)` builds two
cross-connected halves for a fully in-memory duplex stream.

Unit tests cover round-trip, oversized-chunk re-draining, backpressure,
EOF on writer drop, EOF on explicit shutdown, broken-pipe surfacing on
both writer-side and reader-side closes, and bidirectional `pair()`
exchange.
oferchen added a commit that referenced this pull request May 18, 2026
… (#4273)

Introduce `AsyncSshTransport::execute_remote_rsync` as the tokio-backed
counterpart to `SshConnection::connect_with_config`. Argv composition is
delegated through the existing `SshCommand` builder so the sync and
async paths render byte-identical SSH command lines for any given
(remote, args, config) triple.

The new module is gated behind `--features async-ssh`, opt-in only.
Default builds remain on the synchronous `std::process` transport with
no tokio dependency. The downstream `ChannelReader`/`ChannelWriter`
adapters that bridge these halves into the multiplex framing layer are
tracked separately as task #1797.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant