Skip to content

Centralize branding metadata from workspace manifest#1392

Merged
oferchen merged 1 commit into
masterfrom
optimize-production-release-for-oc-rsync
Oct 28, 2025
Merged

Centralize branding metadata from workspace manifest#1392
oferchen merged 1 commit into
masterfrom
optimize-production-release-for-oc-rsync

Conversation

@oferchen
Copy link
Copy Markdown
Owner

Summary

  • parse the workspace oc_rsync metadata during the core build to expose rustc-env branding constants
  • add a core::workspace module that provides compile-time program names and configuration paths from the manifest
  • update branding and version helpers (and tests) to consume the centralized metadata values

Testing

  • cargo test -p rsync-core workspace

https://chatgpt.com/codex/tasks/task_e_6900e954aff08323888447dc61ec9260

@oferchen oferchen merged commit faabf50 into master Oct 28, 2025
@oferchen oferchen deleted the optimize-production-release-for-oc-rsync branch October 28, 2025 16:16
Copy link
Copy Markdown

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

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 thread crates/core/build.rs
Comment on lines 26 to 27
workspace_root.display()
);
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 Building without git panics when loading workspace metadata

When the build script cannot determine the workspace root via git (for example, when compiling from a source tarball or in environments that lack a .git directory or the git binary), it falls back to manifest_dir and still calls load_workspace_metadata on that directory. The crate‐local Cargo.toml does not contain [workspace.metadata.oc_rsync], so the new code panics with “workspace.metadata.oc_rsync missing …” and the build aborts. Previous versions compiled fine from a vendored tree; now any build without git present will fail. Consider searching upward for the real workspace root or providing defaults instead of hard failing in this scenario.

Useful? React with 👍 / 👎.

oferchen added a commit that referenced this pull request May 1, 2026
Adds an integration test suite covering the cross-layer ACL negotiation
flow when the remote peer was compiled without `--enable-acl-support`.

Upstream rsync gates ACL transfer on two layers:
1. Protocol-version gate (compat.c:655-661) - errors when proto < 30.
2. Local-binary feature gate (options.c:1842-1857 + acls.c:25,1141) -
   when the peer was built without SUPPORT_ACLS, the entire acls.c
   compilation unit is empty and the binary never advertises `-A` in
   the compact server flag string.

oc-rsync mirrors layer (1) verbatim in
`transfer::setup::restrictions::apply_protocol_restrictions` and
covers layer (2) in `ParsedServerFlags::clear_unsupported_features`
plus the warning emission in `transfer::lib`. The new tests
(`crates/transfer/tests/acl_negotiation_missing_remote.rs`) exercise
the cross-layer behaviour end-to-end so future refactors cannot
silently regress to either:

- panicking when the peer advertises no ACL support, or
- sending ACL bytes on the wire when the peer cannot decode them.

Coverage:
- Wire-level: server flag string without `A` yields acls=false.
- Restriction layer: protocol 30+ does NOT reject --acls.
- Restriction layer: protocol < 30 rejects with the exact upstream
  error message format byte-for-byte.
- Restriction layer: local_server bypasses the protocol gate at any
  protocol (matching upstream's `!local_server` guard).
- Cross-layer: protocol 32 + remote without `-A` results in graceful
  skip, no panic, no spurious warnings, no wire-level ACL data.
- Ordering: when both gates fire (proto 29 + remote without -A), the
  protocol-version error wins, matching upstream's check order.
- Idempotency: clear_unsupported_features must not double-report when
  the flag was already false from the wire.

Findings:
- oc-rsync matches upstream behaviour for the rejection path
  (byte-for-byte error message at restrictions.rs:96-101).
- For the local-feature path, oc-rsync chooses graceful fallback
  (warn + continue) where upstream errors out - this is documented
  in flags.rs:144-146 and is the user-preferred behaviour.
- Gate locations: crates/transfer/src/setup/restrictions.rs:96-101
  (protocol gate) and crates/transfer/src/flags.rs:153 (local
  feature gate).
oferchen added a commit that referenced this pull request May 5, 2026
Adds an integration test suite covering the cross-layer ACL negotiation
flow when the remote peer was compiled without `--enable-acl-support`.

Upstream rsync gates ACL transfer on two layers:
1. Protocol-version gate (compat.c:655-661) - errors when proto < 30.
2. Local-binary feature gate (options.c:1842-1857 + acls.c:25,1141) -
   when the peer was built without SUPPORT_ACLS, the entire acls.c
   compilation unit is empty and the binary never advertises `-A` in
   the compact server flag string.

oc-rsync mirrors layer (1) verbatim in
`transfer::setup::restrictions::apply_protocol_restrictions` and
covers layer (2) in `ParsedServerFlags::clear_unsupported_features`
plus the warning emission in `transfer::lib`. The new tests
(`crates/transfer/tests/acl_negotiation_missing_remote.rs`) exercise
the cross-layer behaviour end-to-end so future refactors cannot
silently regress to either:

- panicking when the peer advertises no ACL support, or
- sending ACL bytes on the wire when the peer cannot decode them.

Coverage:
- Wire-level: server flag string without `A` yields acls=false.
- Restriction layer: protocol 30+ does NOT reject --acls.
- Restriction layer: protocol < 30 rejects with the exact upstream
  error message format byte-for-byte.
- Restriction layer: local_server bypasses the protocol gate at any
  protocol (matching upstream's `!local_server` guard).
- Cross-layer: protocol 32 + remote without `-A` results in graceful
  skip, no panic, no spurious warnings, no wire-level ACL data.
- Ordering: when both gates fire (proto 29 + remote without -A), the
  protocol-version error wins, matching upstream's check order.
- Idempotency: clear_unsupported_features must not double-report when
  the flag was already false from the wire.

Findings:
- oc-rsync matches upstream behaviour for the rejection path
  (byte-for-byte error message at restrictions.rs:96-101).
- For the local-feature path, oc-rsync chooses graceful fallback
  (warn + continue) where upstream errors out - this is documented
  in flags.rs:144-146 and is the user-preferred behaviour.
- Gate locations: crates/transfer/src/setup/restrictions.rs:96-101
  (protocol gate) and crates/transfer/src/flags.rs:153 (local
  feature gate).
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