Skip to content

Align tests with explicit symlink preservation flag - #2142

Merged
oferchen merged 1 commit into
masterfrom
implement-rsync-3.4.1-parity-in-rust
Nov 13, 2025
Merged

oferchen merged 1 commit into
masterfrom
implement-rsync-3.4.1-parity-in-rust

Conversation

@oferchen

@oferchen oferchen commented Nov 13, 2025 •

Copy link
Copy Markdown
Owner

Summary

  • update CLI list-only test to request --links so list output still shows targets
  • set .links(true) in symlink-focused client tests and integration test to match new default
  • fill in the new links field in the fallback test fixture

Testing

  • cargo test --workspace --all-features

[Codex Task](

@oferchen
oferchen merged commit 3f48463 into master Nov 13, 2025
@oferchen
oferchen deleted the implement-rsync-3.4.1-parity-in-rust branch November 13, 2025 22:42

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines 286 to +308
non_empty_path(relative.as_path()),
root_device,
)?;
} else if file_type.is_symlink() && !context.copy_links_enabled() {
copy_symlink(
context,
source_path,
&target,
&metadata,
&metadata_options,
record_path,
)?;
} else if file_type.is_symlink() {
if context.links_enabled() && !context.copy_links_enabled() {
copy_symlink(
context,
source_path,
&target,
&metadata,
&metadata_options,
record_path,
)?;
} else if context.links_enabled() {
copy_symlink(
context,
source_path,
&target,
&metadata,
&metadata_options,
record_path,
)?;
} else {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge copy-links no longer dereferences special symlink targets

The new links_enabled() gate in the symlink branch means the file_type.is_symlink() block now executes for every symlink before the FIFO/device branches are considered, regardless of whether --copy-links was supplied. When copy_links is true and the symlink points to something other than a file/dir (e.g. a FIFO or device), the code at lines 289‑308 either preserves the symlink (if --links is in effect via -a) or skips it entirely (when --links is absent), and the subsequent is_fifo(&effective_type)/is_device(&effective_type) branches are never reached. Before this commit the symlink branch was guarded by !context.copy_links_enabled(), so --copy-links correctly dereferenced these entries. As a result, oc-rsync --copy-links src dest no longer copies the referent when the symlink targets a FIFO/device, which is a regression of the flag’s semantics.

Useful? React with 👍 / 👎.

oferchen added a commit that referenced this pull request May 14, 2026
Upstream rsync 3.4.1 negotiates the CF_INPLACE_PARTIAL_DIR capability
bit (compat.c:117 `#define CF_INPLACE_PARTIAL_DIR (1<<6)`, enabled at
compat.c:777-778 when both peers advertise the 'I' capability char).
With that bit set, the receiver enables per-file inplace for basis
files retrieved from the partial directory, so the otherwise
conflicting --inplace/--append plus --partial-dir combination runs
successfully.

Add ClientConfigBuilder::validate_with_capabilities alongside the
strict validate() default. The capability-aware variant accepts the
pair when the negotiated bitfield contains
CompatibilityFlags::INPLACE_PARTIAL_DIR; the strict default keeps the
upstream parse-time rejection (options.c:2406-2414) for callers that
have not yet seen the negotiated bits.

Pin the wire encoding for CF_INPLACE_PARTIAL_DIR alone (0x40) and
combined with CF_INC_RECURSE (0x41) so future varint refactors cannot
silently drift from upstream's write_varint payload.

Resolves G2 in
docs/audits/compatibility-flags-mutual-exclusion-matrix.md.
Refs #2142, #2143, #2144.
oferchen added a commit that referenced this pull request May 18, 2026
Upstream rsync 3.4.1 negotiates the CF_INPLACE_PARTIAL_DIR capability
bit (compat.c:117 `#define CF_INPLACE_PARTIAL_DIR (1<<6)`, enabled at
compat.c:777-778 when both peers advertise the 'I' capability char).
With that bit set, the receiver enables per-file inplace for basis
files retrieved from the partial directory, so the otherwise
conflicting --inplace/--append plus --partial-dir combination runs
successfully.

Add ClientConfigBuilder::validate_with_capabilities alongside the
strict validate() default. The capability-aware variant accepts the
pair when the negotiated bitfield contains
CompatibilityFlags::INPLACE_PARTIAL_DIR; the strict default keeps the
upstream parse-time rejection (options.c:2406-2414) for callers that
have not yet seen the negotiated bits.

Pin the wire encoding for CF_INPLACE_PARTIAL_DIR alone (0x40) and
combined with CF_INC_RECURSE (0x41) so future varint refactors cannot
silently drift from upstream's write_varint payload.

Resolves G2 in
docs/audits/compatibility-flags-mutual-exclusion-matrix.md.
Refs #2142, #2143, #2144.
oferchen added a commit that referenced this pull request May 18, 2026
Upstream rsync 3.4.1 negotiates the CF_INPLACE_PARTIAL_DIR capability
bit (compat.c:117 `#define CF_INPLACE_PARTIAL_DIR (1<<6)`, enabled at
compat.c:777-778 when both peers advertise the 'I' capability char).
With that bit set, the receiver enables per-file inplace for basis
files retrieved from the partial directory, so the otherwise
conflicting --inplace/--append plus --partial-dir combination runs
successfully.

Add ClientConfigBuilder::validate_with_capabilities alongside the
strict validate() default. The capability-aware variant accepts the
pair when the negotiated bitfield contains
CompatibilityFlags::INPLACE_PARTIAL_DIR; the strict default keeps the
upstream parse-time rejection (options.c:2406-2414) for callers that
have not yet seen the negotiated bits.

Pin the wire encoding for CF_INPLACE_PARTIAL_DIR alone (0x40) and
combined with CF_INC_RECURSE (0x41) so future varint refactors cannot
silently drift from upstream's write_varint payload.

Resolves G2 in
docs/audits/compatibility-flags-mutual-exclusion-matrix.md.
Refs #2142, #2143, #2144.
oferchen added a commit that referenced this pull request Aug 24, 2026
Upstream rsync 3.4.1 negotiates the CF_INPLACE_PARTIAL_DIR capability
bit (compat.c:117 `#define CF_INPLACE_PARTIAL_DIR (1<<6)`, enabled at
compat.c:777-778 when both peers advertise the 'I' capability char).
With that bit set, the receiver enables per-file inplace for basis
files retrieved from the partial directory, so the otherwise
conflicting --inplace/--append plus --partial-dir combination runs
successfully.

Add ClientConfigBuilder::validate_with_capabilities alongside the
strict validate() default. The capability-aware variant accepts the
pair when the negotiated bitfield contains
CompatibilityFlags::INPLACE_PARTIAL_DIR; the strict default keeps the
upstream parse-time rejection (options.c:2406-2414) for callers that
have not yet seen the negotiated bits.

Pin the wire encoding for CF_INPLACE_PARTIAL_DIR alone (0x40) and
combined with CF_INC_RECURSE (0x41) so future varint refactors cannot
silently drift from upstream's write_varint payload.

Resolves G2 in
docs/audits/compatibility-flags-mutual-exclusion-matrix.md.
Refs #2142, #2143, #2144.
oferchen added a commit that referenced this pull request Aug 24, 2026
Upstream rsync 3.4.1 negotiates the CF_INPLACE_PARTIAL_DIR capability
bit (compat.c:117 `#define CF_INPLACE_PARTIAL_DIR (1<<6)`, enabled at
compat.c:777-778 when both peers advertise the 'I' capability char).
With that bit set, the receiver enables per-file inplace for basis
files retrieved from the partial directory, so the otherwise
conflicting --inplace/--append plus --partial-dir combination runs
successfully.

Add ClientConfigBuilder::validate_with_capabilities alongside the
strict validate() default. The capability-aware variant accepts the
pair when the negotiated bitfield contains
CompatibilityFlags::INPLACE_PARTIAL_DIR; the strict default keeps the
upstream parse-time rejection (options.c:2406-2414) for callers that
have not yet seen the negotiated bits.

Pin the wire encoding for CF_INPLACE_PARTIAL_DIR alone (0x40) and
combined with CF_INC_RECURSE (0x41) so future varint refactors cannot
silently drift from upstream's write_varint payload.

Resolves G2 in
docs/audits/compatibility-flags-mutual-exclusion-matrix.md.
Refs #2142, #2143, #2144.
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