chitralverma opened a new pull request, #9402:
URL: https://github.com/apache/opendal/pull/9402
# Which issue does this PR close?
Part of #9323 (tracker #9320).
# Rationale for this change
Generate the existing C and Go `CopyOptions` from core, as #9335, #9350,
#9368, #9379, #9385, and #9389 did for the other option structs. This is the
last C and Go step-1 struct.
# What changes are included in this PR?
- The C/Go options generator gets a `CopyOptions` table with `main`'s 8 C
members in order. Each field uses an encoding that the generator already has.
- C: the conversion is an `unsafe fn to_core` with a `# Safety` contract,
not a safe `From` that read raw pointers. The 7 core fields that C and Go do
not expose keep their defaults.
- Go: `WithCopyFn` and the 6 `CopyWith*` options move to `options.go` with
the same signatures and C call order.
- A `Self::x` code span uses the binding name of `x`, so the hint doc names
`source_version` in C and `CopyWithSourceVersion` in Go.
- C/Go wording where core names Rust-only items:
- `concurrent` names `opendal_operator_copy_with()` and the copier from
`opendal_operator_copier_with()` (Go: `Operator.Copy` and `Operator.Copier`)
instead of "this copier".
- The `source_content_length_hint` doc drops the returned metadata and "a
service can ignore this value", because C and Go copy calls return no metadata.
- New tests: frozen C layout and prototypes, setters, conversion, Go
signatures and exports, copies on `fs`, docs from core.
Verified: header declarations match `main` with comments removed (only the
`_free` prototype moves); exported symbols and `go doc -short` unchanged; a C
probe built with `main`'s header gives identical output on both libraries, and
`main`'s Go tests pass on the new library; sizeof and offsets match on Linux
x86-64; 23 scratch mutations each fail a test or generation; doc claims hold on
`fs` and Azurite (conditions) through C and Go, and on Silo S3 (source version,
chunk, hint) through C; C (ASan, valgrind) and Go CI steps pass in an Ubuntu
24.04 container.
Not verified: AWS S3 and Azure Blob Storage, only their emulators; Windows.
# Are there any user-facing changes?
Doc comments only. A C copy option string that is not valid UTF-8 still
panics; the message now names the field.
# Breaking changes
None.
# AI Usage Statement
- **Harness:** Claude Code via T3 Code | **Model:** Claude Opus 5.5 |
**Effort:** xhigh
- **Role:** Implemented the generator entry, docs, and tests; ran the checks
above; drafted this description. The author reviews every change and claim.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]