new feature: generate C and Go operation options from core
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 35/100
- Issue type
- Feature
- Clarity
- Clearly specified
- Activity status
- Active
- Domain
- backend-api-design, build-system
Research direction
Start with dev/src/generate/c.rs, the handwritten option definitions in bindings/c/src/types.rs, and the Go option functions under bindings/go. Trace generated output through bindings/c/build.rs and the frozen-surface tests. Done means the intended C and Go options are generated and exposed as specified, with ABI and release-impact notes updated.
Written by the indexing model from the issue text.
Description
Drafted with AI assistance; the author is accountable for it.
Feature Description
Generate the C option structs and the Go options that fill them from core (one generate -l c run; Zig re-exports the header), then expose what both lack. Part of #9320, whose rules apply to every PR here.
Progress
One item per options struct, covering C and Go. A struct is done when its options are generated from core and every core field is exposed. New fields change struct layout, so they wait for one batched C/C++ layout break.
-
ListOptions- Generated from core (#9335)
-
glob
-
StatOptions- Generated from core (#9350)
- Version conditions
-
ReadOptions- Generated from core (#9379)
-
limitand version conditions
-
ReaderOptions- Generated from core (#9385)
- Version conditions
-
WriteOptions- Generated from core (#9389)
- Borrowed string rules for write entry points (#9409)
-
content_language,expires, version conditions,if_not_changed
-
DeleteOptions- Generated from core (#9368)
- Conditions
-
CopyOptions- Generated from core (#9402)
- Conditions and destination metadata
-
RenameOptions: needs a C entry point -
RestoreOptions,DeleterOptions,ComposeOptions: need entry points (core blocking compose: #9423) -
checksum(#9316)
Problem and Solution
Reference PRs: #9335 and #9350 (RELEASED_OPTIONS in dev/src/generate/c/options.rs). Regenerate with cargo run --manifest-path=dev/Cargo.toml -- generate -l c, then build the C binding so cbindgen refreshes opendal.h.
C and Go invariants
opendal.his ABI: member order, types,sizeof, offsets, and setter signatures stay as onmain.- Each field keeps its unset encoding, pointer constness, and string ownership, and the docs state them.
- Docs write
ErrorKind::Xas theopendal_codeand GoErrorCodefrombindings/c/src/error.rs. - Conversions reading caller pointers are
pub(crate) unsafe fnwith# Safety, called under// SAFETY:, never safeFrom. - Generating existing options adds no
#[no_mangle]symbol: Go resolves all C symbols at load, so new ones need rebuiltopendal-go-servicesand abindings/go/upgrade.mdnote. - New fields change
sizeof: declare it inbindings/c/upgrade.mdandrelease_impact.pyformat for C and Go.
Design questions for new fields: entry points for rename and the deleter, compose and restore functions, suffix ranges, and a copied const opendal_metadata * for if_not_changed.
Additional Context
Generating existing options is not release-impacting. New fields change the C ABI layout and the Go companion requirements.
Are you willing to contribute to the development of this feature?
- Yes, I am willing to contribute to the development of this feature.
- Dominant language
- Rust
- Stars
- 5.5k
- Forks
- 869
- Avg merge
- 8h 2m
- Merged PRs (30d)
- 862
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from apache/opendal
-
bug(services/fs): deleting "/" removes the configured root directoryPossibly taken @xgbtxy claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 81/100
apache/opendal#9635 · 1 comment · 1 reaction ·
Maintainers usually reply within 1 day
-
core enhancement
Difficulty 5/5 Over a week Newbie friendliness 35/100
apache/opendal#9572 · 1 reaction ·
Maintainers usually reply within 1 day
-
fix(bindings/nodejs): reject negative and overflowing BigInt values in WriteOptions.chunk and Read/ReaderOptions.gapPossibly taken @rohan4naik claimed this today. Openbindings/nodejs bug
Difficulty 3/5 1-2 days Newbie friendliness 76/100
apache/opendal#9569 · 1 comment · 1 reaction ·
Maintainers usually reply within 1 day
-
bug(layers/throttle): throttle streaming ReadStream bytes instead of pre-charging ReadOptions::limit upper bounds on open()Possibly taken @Xuanwo claimed this today. Openbug core
Difficulty 5/5 Over a week Newbie friendliness 25/100
apache/opendal#9567 · 1 reaction ·
Maintainers usually reply within 1 day
-
bindings/c bindings/dotnet bindings/go bindings/java bindings/python bindings/ruby core integrations/object_store release release-blocker services/azblob services/azdls services/dropbox services/gcs_grpc services/git services/hf3fs services/redis services/remotestorage services/s3 website
Difficulty 5/5 Over a week Newbie friendliness 20/100
apache/opendal#9560 · 3 comments · 1 reaction ·
Maintainers usually reply within 1 day
Similar issues
-
Android bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
anefzaoui/misterdownloadmanager#2516 ·
Maintainers usually reply within 1 day
-
editor ui
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
state:triage tech-debt
Difficulty 2/5 1-3 hours Newbie friendliness 89/100
agent8-cash/ethpayserver#731 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
marketing
Difficulty 2/5 1-3 hours Newbie friendliness 87/100
Maintainers usually reply within 1 day