Skip to content

feat(core): wire IconvSetting to FilenameConverter at config build (#1911)#3529

Merged
oferchen merged 2 commits into
masterfrom
feat/iconv-config-wiring-1911
May 1, 2026
Merged

feat(core): wire IconvSetting to FilenameConverter at config build (#1911)#3529
oferchen merged 2 commits into
masterfrom
feat/iconv-config-wiring-1911

Conversation

@oferchen
Copy link
Copy Markdown
Owner

@oferchen oferchen commented May 1, 2026

Closes #1911.

Summary

Completes the local-copy bridge between the parsed IconvSetting on ClientConfig and the engine's LocalCopyOptions, mirroring the SSH / daemon bridge that PR #3458 wired through apply_common_server_flags. The audit at docs/audits/iconv-inert.md (PR #3526) labels #1911 as "Partial" because the local-copy path bypasses apply_common_server_flags and had no route by which a resolved FilenameConverter could reach the engine.

After this PR, every transport that hands a ClientConfig to the engine has an Option<FilenameConverter> available on LocalCopyOptions::iconv() for downstream wiring sites (#1912 sender emit, #1913 receiver ingest, #1914 filter-rule path matching) to consume. Wire encoding, application semantics, and producer-site changes remain out of scope and are tracked separately.

Changes

  • engine::local_copy::LocalCopyOptions and LocalCopyOptionsBuilder gain an iconv: Option<FilenameConverter> field with a with_iconv setter and iconv() accessor on the options struct, plus an iconv() setter on the builder.
  • core::client::run::LocalCopyOptionsBuilder::build (the internal wrapper around the engine builder) calls config.iconv().resolve_converter() via a new apply_iconv step and propagates the result onto LocalCopyOptions.
  • Unit tests at crates/engine/src/local_copy/options/filters.rs cover default-none, attach, and clear semantics.
  • Unit tests at crates/core/src/client/run/mod.rs cover the IconvSetting -> LocalCopyOptions.iconv mapping for Unspecified, Disabled, LocaleDefault, Explicit, and unsupported-charset variants.

Audit alignment

This is exactly the work called out as "Smallest-PR-first sequence" step 1 in docs/audits/iconv-inert.md section 4.2:

#1911 local-copy bridge - extend LocalCopyOptions (in crates/engine/src/local_copy/) with iconv: Option<FilenameConverter> and call config.iconv().resolve_converter() from crates/core/src/client/run/mod.rs::build_local_copy_options. Roughly +20 lines, no new types.

Net source change is +189 lines including tests and rustdoc. No new types.

Upstream references in the new code:

  • flist.c::iconv_for_local
  • options.c::recv_iconv_settings
  • compat.c:716-718

Out of scope

This PR does not apply the converter on emit, ingest, or filter matching. Those producer wirings are #1912, #1913, and #1914 respectively. The hard-error-when-feature-off check is already in tree (#1915, PR #3458) so no iconv feature gate work is needed here.

Test plan

  • cargo fmt --all -- --check clean.
  • cargo nextest run -p engine --all-features -E 'test(iconv) + test(local_copy_options)' -> 56 tests passed (locally).
  • cargo nextest run -p core --all-features -E 'test(iconv)' -> 24 tests passed (locally).
  • cargo nextest run -p core --all-features -E 'test(iconv_wiring)' -> 5 new tests passed (locally).
  • Full CI: fmt+clippy, nextest (stable), Windows (stable), macOS (stable), Linux musl (stable), interop.

…1911)

Closes #1911 by completing the local-copy bridge between the parsed
`IconvSetting` on `ClientConfig` and the engine's `LocalCopyOptions`,
mirroring the SSH/daemon bridge that PR #3458 wired through
`apply_common_server_flags`.

The audit at `docs/audits/iconv-inert.md` (PR #3526) labels #1911 as
"Partial" because the local-copy path bypasses
`apply_common_server_flags` and therefore had no route by which a
resolved `FilenameConverter` could reach the engine.

Changes:

- `engine::local_copy::LocalCopyOptions` and
  `LocalCopyOptionsBuilder` gain an `iconv: Option<FilenameConverter>`
  field with a `with_iconv` setter and `iconv()` accessor on the
  options struct, plus an `iconv()` setter on the builder.
- `core::client::run::LocalCopyOptionsBuilder::build` (the internal
  wrapper around the engine builder) calls
  `config.iconv().resolve_converter()` and propagates the result via
  the new setter.
- Unit tests in `crates/engine/src/local_copy/options/filters.rs`
  cover default-none, attach, and clear.
- Unit tests in `crates/core/src/client/run/mod.rs` cover the
  `IconvSetting -> LocalCopyOptions.iconv` mapping for unspecified,
  disabled, locale-default, explicit, and unsupported-charset variants.

This PR plumbs the converter only; it does not yet apply it on
sender file-list emit (#1912), receiver file-list ingest (#1913),
or filter-rule path matching (#1914). Those are tracked separately.
@github-actions github-actions Bot added the enhancement New feature or request label May 1, 2026
@oferchen oferchen merged commit c09b8ae into master May 1, 2026
17 checks passed
@oferchen oferchen deleted the feat/iconv-config-wiring-1911 branch May 1, 2026 21:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant