Repository navigation
fix(cli): ensure --server receiver creates dest root with --copy-dest (UTS-12.REOPEN) - #5726
Merged
Merged
Conversation
2 tasks
oferchen
added a commit
that referenced
this pull request
Jun 12, 2026
* chore: fix master fmt drift + filter_map_bool_then clippy lint
Master CI broke on rustfmt 1.88 and clippy 1.88:
1. `crates/cli/src/frontend/server/run.rs:244` - `use fast_io::landlock::{...}`
collapses to a single line under rustfmt 1.88 (introduced by PR #5724's
landlock wire-in).
2. `crates/transfer/src/generator/filters.rs:589` - `let split = ...` long-form
collapses to single-line under rustfmt 1.88.
3. `crates/transfer/src/generator/file_list/mod.rs:267` - rewrite
`filter_map(|(b, rel)| (b == &entry.base).then(|| rel.clone()))` as the
equivalent `filter(...).map(...)` pair so clippy 1.88's new
`filter_map_bool_then` lint stays clean. Behaviour-identical.
Unblocks PRs #5725, #5726, #5727 once they rebase onto this.
* fix: drop extraneous deref in filter predicate
In .filter(), the destructured 'b' is already &PathBuf since iter() yields
&(PathBuf, PathBuf) and filter receives &Self::Item. The extra deref made it
PathBuf, causing E0277 'can't compare PathBuf with &PathBuf'.
* chore(cli): inline format args in --partial-dir test (clippy 1.88)
uninlined_format_args lint denies the build under clippy 1.88.
… (UTS-12.REOPEN)
Upstream `options.c::server_options()` emits `--copy-dest`, `--link-dest`,
`--compare-dest`, `--files-from`, `--backup-dir`, and `--temp-dir` as two
adjacent argv slots via `safe_arg("", value)` (`alt_dest_opt(0)` at
options.c:2939-2940 and the matching per-flag emission sites). The
`--server` argument parser only recognised the joined `--flag=value`
form, so the bare `--copy-dest /path` form left the basis path in
`positional_args[0]`, displacing the actual destination root.
`setup_transfer` reads `config.args.first()` as the dest operand and
calls `ensure_dest_root_exists` with it. With the wrong path, the
pre-flight ran against the already-existing alt-dest basis (returning
`Ok(false)`) and the real destination root was never created. The
alt-dest interop test running over `lsh.sh`
(`-ave lsh.sh --copy-dest=/alt /src/ host:/dest/`) failed with
`FileNotFoundError: /dest` when the test harness ls-lR'd the never-
materialised dest.
`is_two_arg_server_long_flag` enumerates every bare-form path-bearing
flag upstream emits; `parse_server_flag_string_and_args` drains the
value slot so it never lands as a positional, and `parse_server_long_flags`
routes the value into `reference_directories` / `files_from` so the
receiver still honours the alt-dest semantics. `--partial-dir` keeps
its existing branch because it was wired in UTS-SLDB; the new helper
covers the remaining flags without touching that path.
Regression coverage:
- `parse_server_args_handles_split_copy_dest_form` + siblings in
`crates/cli/src/frontend/server/tests.rs` pin the parser fix.
- `uts_12_reopen_altdest_server_mkdir.rs` in `crates/transfer/tests/`
drives `ensure_dest_root_exists` with the resolved dest to prove the
helper materialises the missing root once the parser hands it the
correct path.
The mkdir stays receiver-local (no MSG_* frame is emitted) so wire-byte
parity with upstream is preserved.
oferchen
force-pushed
the
fix/uts12-reopen-altdest-server-mkdir
branch
from
June 12, 2026 01:40
1c7e60f to
b2f43bb
Compare
oferchen
added a commit
that referenced
this pull request
Aug 24, 2026
* chore: fix master fmt drift + filter_map_bool_then clippy lint
Master CI broke on rustfmt 1.88 and clippy 1.88:
1. `crates/cli/src/frontend/server/run.rs:244` - `use fast_io::landlock::{...}`
collapses to a single line under rustfmt 1.88 (introduced by PR #5724's
landlock wire-in).
2. `crates/transfer/src/generator/filters.rs:589` - `let split = ...` long-form
collapses to single-line under rustfmt 1.88.
3. `crates/transfer/src/generator/file_list/mod.rs:267` - rewrite
`filter_map(|(b, rel)| (b == &entry.base).then(|| rel.clone()))` as the
equivalent `filter(...).map(...)` pair so clippy 1.88's new
`filter_map_bool_then` lint stays clean. Behaviour-identical.
Unblocks PRs #5725, #5726, #5727 once they rebase onto this.
* fix: drop extraneous deref in filter predicate
In .filter(), the destructured 'b' is already &PathBuf since iter() yields
&(PathBuf, PathBuf) and filter receives &Self::Item. The extra deref made it
PathBuf, causing E0277 'can't compare PathBuf with &PathBuf'.
* chore(cli): inline format args in --partial-dir test (clippy 1.88)
uninlined_format_args lint denies the build under clippy 1.88.
oferchen
added a commit
that referenced
this pull request
Aug 24, 2026
… (UTS-12.REOPEN) (#5726) Upstream `options.c::server_options()` emits `--copy-dest`, `--link-dest`, `--compare-dest`, `--files-from`, `--backup-dir`, and `--temp-dir` as two adjacent argv slots via `safe_arg("", value)` (`alt_dest_opt(0)` at options.c:2939-2940 and the matching per-flag emission sites). The `--server` argument parser only recognised the joined `--flag=value` form, so the bare `--copy-dest /path` form left the basis path in `positional_args[0]`, displacing the actual destination root. `setup_transfer` reads `config.args.first()` as the dest operand and calls `ensure_dest_root_exists` with it. With the wrong path, the pre-flight ran against the already-existing alt-dest basis (returning `Ok(false)`) and the real destination root was never created. The alt-dest interop test running over `lsh.sh` (`-ave lsh.sh --copy-dest=/alt /src/ host:/dest/`) failed with `FileNotFoundError: /dest` when the test harness ls-lR'd the never- materialised dest. `is_two_arg_server_long_flag` enumerates every bare-form path-bearing flag upstream emits; `parse_server_flag_string_and_args` drains the value slot so it never lands as a positional, and `parse_server_long_flags` routes the value into `reference_directories` / `files_from` so the receiver still honours the alt-dest semantics. `--partial-dir` keeps its existing branch because it was wired in UTS-SLDB; the new helper covers the remaining flags without touching that path. Regression coverage: - `parse_server_args_handles_split_copy_dest_form` + siblings in `crates/cli/src/frontend/server/tests.rs` pin the parser fix. - `uts_12_reopen_altdest_server_mkdir.rs` in `crates/transfer/tests/` drives `ensure_dest_root_exists` with the resolved dest to prove the helper materialises the missing root once the parser hands it the correct path. The mkdir stays receiver-local (no MSG_* frame is emitted) so wire-byte parity with upstream is preserved.
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.
Summary
--copy-dest <path>(and--link-dest,--compare-dest,--files-from,--backup-dir,--temp-dir) in the--serverargument parser so the value slot never lands as a positional destination.ServerLongFlags::reference_directories/files_fromso the receiver still honours alt-dest semantics.--partial-dirkeeps its existing UTS-SLDB branch.crates/cli/src/frontend/server/tests.rs(parser fix) andcrates/transfer/tests/uts_12_reopen_altdest_server_mkdir.rs(helper materialises the missing dest once the parser hands it the correct path).Root cause
Upstream
options.c::server_options()emits these path-bearing flags as two argv slots viasafe_arg("", value)(alt_dest_opt(0)at options.c:2939-2940 et al.). The previous parser only recognised the--flag=valuejoined form, so the bare form left the basis path inpositional_args[0].setup_transferthen calledensure_dest_root_existsagainst the already-existing alt-dest basis (returningOk(false)), so the actual destination root was never created.The alt-dest interop test running over
lsh.sh(
-ave lsh.sh --copy-dest=/alt /src/ host:/dest/) failed withFileNotFoundError: /destbecause the test harness ls-lR'd the never-materialised dest.Constraints honoured
MSG_*frame is emitted (UTS-2.d.6).#[allow(...)]added.Test plan
lsh.sh)