Skip to content

feat(version): list compiled-in Cargo features in --version output - #4522

Merged
oferchen merged 2 commits into
masterfrom
feat/version-build-features
May 19, 2026
Merged

oferchen merged 2 commits into
masterfrom
feat/version-build-features

Conversation

@oferchen

Copy link
Copy Markdown
Owner

Summary

  • Add compiled_build_features() enumerating every core-visible Cargo feature the binary was built with (zstd, lz4, zlib-ng, acl, xattr, iconv, async, embedded-ssh).
  • Wire it into the human-readable --version renderer as a new Build features: section under the existing Platform I/O: line.
  • Bin-only features (parallel, io_uring, iocp, copy_file_range, openssl, openssl-vendored, mmap-free-basis, sd-notify, mimalloc) are not core-visible and continue to surface via the existing Capabilities / Optimizations sections.

Test plan

  • oc-rsync --version shows Build features: zstd lz4 ... line on a default build
  • The list is empty (renders as none) for a no-default-features build
  • Existing renderer tests pass

@github-actions github-actions Bot added the enhancement New feature or request label May 18, 2026
@oferchen
oferchen force-pushed the feat/version-build-features branch 2 times, most recently from 499c5b0 to 16eb2d9 Compare May 18, 2026 20:19
oferchen added 2 commits May 19, 2026 13:46
Adds a "Build features:" section to the human-readable --version
banner, listing every Cargo feature visible at the core crate's
compile time: zstd, lz4, zlib-ng, acl, xattr, iconv, async,
embedded-ssh, mmap-free-basis. Each entry mirrors the canonical
feature name from Cargo.toml so users can tell at a glance what the
binary was compiled with without having to grep `Cargo.toml` or
inspect linker output.

Bin-only features that do not propagate into core (parallel,
io_uring, iocp, copy_file_range, openssl, sd-notify, mimalloc)
continue to surface via the existing Capabilities, Optimizations,
and Platform I/O sections.

Followups can teach the renderer to consume per-crate feature
manifests so the list becomes exhaustive without hardcoded cfg!()
calls here.
core's Cargo.toml does not declare the mmap-free-basis feature
(it lives at the bin level and forwards into engine + fast_io),
so referencing cfg(feature = "mmap-free-basis") from core's
renderer triggers unexpected_cfgs and fails the build.

The Build features section continues to enumerate every
core-visible feature; bin-only features remain documented in the
function's rustdoc and surface via the existing
Capabilities/Optimizations sections.
@oferchen
oferchen force-pushed the feat/version-build-features branch from 2f84218 to a8acbc8 Compare May 19, 2026 10:46
@oferchen
oferchen merged commit ebbd2cc into master May 19, 2026
50 of 55 checks passed
@oferchen
oferchen deleted the feat/version-build-features branch May 19, 2026 13:54
oferchen added a commit that referenced this pull request Jun 17, 2026
Pins the receiver-side wiring that the upstream rsync 3.4.4 testsuite
`symlink-dirlink-basis` test exercises against -K/--keep-dirlinks. The
chmod dirfd-sandbox bypass (#5793) plus the compact `K` flag parser
wire-up (#5853) close the failure; this test file is the regression
coverage for both halves together.

Each test mirrors one of the eight Test N scenarios in
`testsuite/symlink-dirlink-basis.test` (Issue #715): basic, compressed,
nested, --backup, --inplace, top-level (negative control), proto28
--partial-dir, and proto28 basic. The negative control catches a
parser regression that would silently set keep_dirlinks for the
non-symlinked top-level case.

Pins both halves of the chain:
- ParsedServerFlags::parse recognises the compact `K` byte from the
  server-side flag string the client emits in every topology.
- The parsed flag survives MetadataOptions::with_keep_dirlinks, which
  is what chmod_path_honoring_keep_dirlinks consults at apply time.

Upstream sources of truth:
- target/interop/upstream-src/rsync-3.4.4/testsuite/symlink-dirlink-basis.test
- target/interop/upstream-src/rsync-3.4.1/options.c:688 (-K mapping)
- target/interop/upstream-src/rsync-3.4.1/generator.c:1344
  (link_stat(fname, &sx.st, keep_dirlinks && is_dir))
oferchen added a commit that referenced this pull request Jun 17, 2026
Pins the receiver-side wiring that the upstream rsync 3.4.4 testsuite
`symlink-dirlink-basis` test exercises against -K/--keep-dirlinks. The
chmod dirfd-sandbox bypass (#5793) plus the compact `K` flag parser
wire-up (#5853) close the failure; this test file is the regression
coverage for both halves together.

Each test mirrors one of the eight Test N scenarios in
`testsuite/symlink-dirlink-basis.test` (Issue #715): basic, compressed,
nested, --backup, --inplace, top-level (negative control), proto28
--partial-dir, and proto28 basic. The negative control catches a
parser regression that would silently set keep_dirlinks for the
non-symlinked top-level case.

Pins both halves of the chain:
- ParsedServerFlags::parse recognises the compact `K` byte from the
  server-side flag string the client emits in every topology.
- The parsed flag survives MetadataOptions::with_keep_dirlinks, which
  is what chmod_path_honoring_keep_dirlinks consults at apply time.

Upstream sources of truth:
- target/interop/upstream-src/rsync-3.4.4/testsuite/symlink-dirlink-basis.test
- target/interop/upstream-src/rsync-3.4.1/options.c:688 (-K mapping)
- target/interop/upstream-src/rsync-3.4.1/generator.c:1344
  (link_stat(fname, &sx.st, keep_dirlinks && is_dir))
oferchen added a commit that referenced this pull request Jun 17, 2026
… (#5871)

Pins the receiver-side wiring that the upstream rsync 3.4.4 testsuite
`symlink-dirlink-basis` test exercises against -K/--keep-dirlinks. The
chmod dirfd-sandbox bypass (#5793) plus the compact `K` flag parser
wire-up (#5853) close the failure; this test file is the regression
coverage for both halves together.

Each test mirrors one of the eight Test N scenarios in
`testsuite/symlink-dirlink-basis.test` (Issue #715): basic, compressed,
nested, --backup, --inplace, top-level (negative control), proto28
--partial-dir, and proto28 basic. The negative control catches a
parser regression that would silently set keep_dirlinks for the
non-symlinked top-level case.

Pins both halves of the chain:
- ParsedServerFlags::parse recognises the compact `K` byte from the
  server-side flag string the client emits in every topology.
- The parsed flag survives MetadataOptions::with_keep_dirlinks, which
  is what chmod_path_honoring_keep_dirlinks consults at apply time.

Upstream sources of truth:
- target/interop/upstream-src/rsync-3.4.4/testsuite/symlink-dirlink-basis.test
- target/interop/upstream-src/rsync-3.4.1/options.c:688 (-K mapping)
- target/interop/upstream-src/rsync-3.4.1/generator.c:1344
  (link_stat(fname, &sx.st, keep_dirlinks && is_dir))
oferchen added a commit that referenced this pull request Aug 24, 2026
…4522)

* feat(version): list compiled-in Cargo features in --version output

Adds a "Build features:" section to the human-readable --version
banner, listing every Cargo feature visible at the core crate's
compile time: zstd, lz4, zlib-ng, acl, xattr, iconv, async,
embedded-ssh, mmap-free-basis. Each entry mirrors the canonical
feature name from Cargo.toml so users can tell at a glance what the
binary was compiled with without having to grep `Cargo.toml` or
inspect linker output.

Bin-only features that do not propagate into core (parallel,
io_uring, iocp, copy_file_range, openssl, sd-notify, mimalloc)
continue to surface via the existing Capabilities, Optimizations,
and Platform I/O sections.

Followups can teach the renderer to consume per-crate feature
manifests so the list becomes exhaustive without hardcoded cfg!()
calls here.

* fix(version): drop bin-only mmap-free-basis feature check from core

core's Cargo.toml does not declare the mmap-free-basis feature
(it lives at the bin level and forwards into engine + fast_io),
so referencing cfg(feature = "mmap-free-basis") from core's
renderer triggers unexpected_cfgs and fails the build.

The Build features section continues to enumerate every
core-visible feature; bin-only features remain documented in the
function's rustdoc and surface via the existing
Capabilities/Optimizations sections.
oferchen added a commit that referenced this pull request Aug 24, 2026
… (#5871)

Pins the receiver-side wiring that the upstream rsync 3.4.4 testsuite
`symlink-dirlink-basis` test exercises against -K/--keep-dirlinks. The
chmod dirfd-sandbox bypass (#5793) plus the compact `K` flag parser
wire-up (#5853) close the failure; this test file is the regression
coverage for both halves together.

Each test mirrors one of the eight Test N scenarios in
`testsuite/symlink-dirlink-basis.test` (Issue #715): basic, compressed,
nested, --backup, --inplace, top-level (negative control), proto28
--partial-dir, and proto28 basic. The negative control catches a
parser regression that would silently set keep_dirlinks for the
non-symlinked top-level case.

Pins both halves of the chain:
- ParsedServerFlags::parse recognises the compact `K` byte from the
  server-side flag string the client emits in every topology.
- The parsed flag survives MetadataOptions::with_keep_dirlinks, which
  is what chmod_path_honoring_keep_dirlinks consults at apply time.

Upstream sources of truth:
- target/interop/upstream-src/rsync-3.4.4/testsuite/symlink-dirlink-basis.test
- target/interop/upstream-src/rsync-3.4.1/options.c:688 (-K mapping)
- target/interop/upstream-src/rsync-3.4.1/generator.c:1344
  (link_stat(fname, &sx.st, keep_dirlinks && is_dir))
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