feat(core): wire IconvSetting to FilenameConverter at config build (#1911)#3529
Merged
Conversation
…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.
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.
Closes #1911.
Summary
Completes the local-copy bridge between the parsed
IconvSettingonClientConfigand the engine'sLocalCopyOptions, mirroring the SSH / daemon bridge that PR #3458 wired throughapply_common_server_flags. The audit atdocs/audits/iconv-inert.md(PR #3526) labels #1911 as "Partial" because the local-copy path bypassesapply_common_server_flagsand had no route by which a resolvedFilenameConvertercould reach the engine.After this PR, every transport that hands a
ClientConfigto the engine has anOption<FilenameConverter>available onLocalCopyOptions::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::LocalCopyOptionsandLocalCopyOptionsBuildergain aniconv: Option<FilenameConverter>field with awith_iconvsetter andiconv()accessor on the options struct, plus aniconv()setter on the builder.core::client::run::LocalCopyOptionsBuilder::build(the internal wrapper around the engine builder) callsconfig.iconv().resolve_converter()via a newapply_iconvstep and propagates the result ontoLocalCopyOptions.crates/engine/src/local_copy/options/filters.rscover default-none, attach, and clear semantics.crates/core/src/client/run/mod.rscover theIconvSetting -> LocalCopyOptions.iconvmapping forUnspecified,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.mdsection 4.2:Net source change is +189 lines including tests and rustdoc. No new types.
Upstream references in the new code:
flist.c::iconv_for_localoptions.c::recv_iconv_settingscompat.c:716-718Out 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
iconvfeature gate work is needed here.Test plan
cargo fmt --all -- --checkclean.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).