Skip to content

JuliaLibWrapping-v0.2.0

Choose a tag to compare

@github-actions github-actions released this 01 Sep 07:41
· 16 commits to main since this release
1bb2b11

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 encodes Cvoid as a null type id, and the earlier encoding — a
    zero-field Nothing struct 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_type and
    PointerDesc.pointee_type are Union{Int,Nothing}, with nothing meaning
    void and void *. Code that walks an ABIInfo must handle nothing in
    those two positions.
  • PrimitiveTypeDesc's bits, size, and alignment fields are Int,
    previously UInt.
  • Generated Python type names carry carrier ownership: CString is now
    CString_borrowed, CVector_Float32 is now CVector_borrowed_Float32, and
    so on. A hand-edited _facade.py imports these names from _lowlevel and
    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_library writes a <libname>.jlw.json metadata sidecar for entry
    points declared with JLWInterop.@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
    JLWResult carriers, converting owning returns to Python objects and
    releasing them through jlw_free / jlw_free_strings. Release entry point
    signatures are validated at build time.
  • Julia Base.Enum types are emitted as Python enum.IntEnum, with coercion
    from a member, a name, or an integer.
  • Generated ctypes structures 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.toml uses 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 @api wrappers 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)