Repository navigation
JuliaLibWrapping-v0.2.0
·
16 commits
to main
since this release
JuliaLibWrapping JuliaLibWrapping-v0.2.0
Diff since JuliaLibWrapping-v0.1.2
Breaking changes
- JuliaC v0.3.9 or later is required (the compat bound was
0.3.3). JuliaC
v0.3.9 encodesCvoidas a null type id, and the earlier encoding — a
zero-fieldNothingstruct referenced by id — is no longer accepted. ABI
JSON produced by an older JuliaC must be regenerated. - The descriptor model follows that encoding:
MethodDesc.return_typeand
PointerDesc.pointee_typeareUnion{Int,Nothing}, withnothingmeaning
voidandvoid *. Code that walks anABIInfomust handlenothingin
those two positions. PrimitiveTypeDesc'sbits,size, andalignmentfields areInt,
previouslyUInt.- Generated Python type names carry carrier ownership:
CStringis now
CString_borrowed,CVector_Float32is nowCVector_borrowed_Float32, and
so on. A hand-edited_facade.pyimports these names from_lowleveland
must be updated. Generated structures also use 64-bit dimensions and lengths,
matching JLWInterop v0.2, so a library and its bindings must be rebuilt
together. - Carrier recognition returns target-agnostic descriptions in Julia-level terms
and each emitter maps them to its own type names; a custom target that used
the recognizers needs updating. Raw-pointer warnings now cover every
Ptr{<primitive>}argument rather than only those with a numpy dtype.
New features
build_librarywrites a<libname>.jlw.jsonmetadata sidecar for entry
points declared withJLWInterop.@api, and returns its path as
metadata_path. The Python façade generator uses the sidecar to emit
keyword arguments, defaults, and docstrings.- The C and Python emitters support the
CStrArray,CDict,COpt, and
JLWResultcarriers, converting owning returns to Python objects and
releasing them throughjlw_free/jlw_free_strings. Release entry point
signatures are validated at build time. - Julia
Base.Enumtypes are emitted as Pythonenum.IntEnum, with coercion
from a member, a name, or an integer. - Generated
ctypesstructures check their size and field offsets against the
compiled ABI metadata at import, raising if the bindings do not match the
platform's ABI. - Projects whose
Project.tomluses relative source paths are supported: the
build materializes a temporary project with absolute paths when relocation
would change their meaning. - The documentation is reorganized into quickstart, concepts, annotations,
types, building, Python, architecture, and extending pages, and is deployed
per released version.
Merged pull requests:
- C: map Nothing to void (#6) (@fredrikekre)
- Layer 1: CStrArray, CDict, COpt carriers + Python emitter support (#62) (@el-oso)
- Clean up the prose (#64) (@timholy)
- Run the example Python smoke tests in tests (#65) (@timholy)
- Recognizers return target-agnostic descriptions (#66) (@timholy)
- Replace 'own-out'/'borrow-in' with standard ownership terms (#67) (@timholy)
- Make CArray ownership a type parameter (#68) (@timholy)
- Bump actions/setup-python from 5 to 7 (#69) (@dependabot[bot])
- Bump actions/checkout from 4 to 7 (#70) (@dependabot[bot])
- Bump julia-actions/setup-julia from 2 to 3 (#71) (@dependabot[bot])
- Bump actions/upload-artifact from 4 to 7 (#72) (@dependabot[bot])
- Bump julia-actions/cache from 2 to 3 (#73) (@dependabot[bot])
- Layer 2: @api annotation macro and metadata sidecar (#74) (@el-oso)
- More ownership in type parameters (#77) (@timholy)
- Encode CString ownership in its type (#78) (@timholy)
- Use Int64 for carrier lengths and dimensions (#79) (@timholy)
- Support relative project source paths (#80) (@timholy)
- Harden
@apiwrappers and generated Python bindings (#81) (@timholy) - Use dense ABI array interfaces (#82) (@timholy)
- More followups (#84) (@timholy)
- Support Base.Enum types in @api declarations (#85) (@timholy)
- Deploy versioned docs for prefixed release tags (#86) (@timholy)
- Restructure documentation for v0.2 (#87) (@timholy)