Repository navigation
Releases
Releases · JuliaInterop/JuliaLibWrapping.jl
JuliaLibWrapping-v0.3.3
JuliaLibWrapping-v0.3.2
JuliaLibWrapping-v0.3.1
JuliaLibWrapping-v0.3.0
JuliaLibWrapping JuliaLibWrapping-v0.3.0
Diff since JuliaLibWrapping-v0.2.0
Breaking changes
- The Python target splits the package's public module in two. Generated
wrappers are written to_generated.pyon every build._facade.pyis now
a hand-editable starter, written only when it does not already exist; it
star-imports_generatedand copies its__all__.__init__.pyre-exports
from_facade, includingfrom ._facade import __all__, so a hand-written
_facade.pymust define__all__. Building into an output directory that
already holds a_facade.pygenerated by v0.2 keeps that file, which then
hides newly generated functions: delete it once to get the starter. - JuliaC v0.3.10 or later is required (the compat bound was
0.3.9). - C symbols of
@apientry points are now valid C identifiers (this comes
from JLWInterop v0.3): characters C does not allow become_, so
@api scale!(...)exportsMod_scalerather thanMod_scale!. Two names
that become the same symbol are rejected. Bindings that look up the old
symbols must be regenerated.
New features
- MATLAB target.
MatlabTarget, orstandard_build(...; matlab_package),
emits one.mfaçade per@apideclaration in a+packagedirectory, a C
MEX gateway that convertsmxArrays to and from the carriers, and a
build_mex.mscript. Generating the files needs no MATLAB installation;
compiling the gateway does. - Tuple returns. An
@apideclaration may return aTupleof two or more
supported types. Python receives atuple, MATLAB receives multiple
outputs ([x, n] = f(a)), and C receives a struct. Each element keeps its
own ownership, and owning elements are released after conversion.
Requires JLWInterop v0.3. PythonTarget(...; coerce_arrays = true)(also astandard_buildkeyword)
makes the generated wrappers convert array arguments to the carrier's dtype
and memory layout (np.asfortranarrayfor rank two and higher,
np.ascontiguousarrayfor vectors). The default,false, keeps rejecting
mismatched arrays.@apiaccepts amutates = (a, ...)clause naming the array arguments the
function writes to (from JLWInterop v0.3). The MATLAB target copies those
arguments before the call.
Merged pull requests:
- Tuple returns (#83) (@el-oso)
- MATLAB target: façades and a MEX gateway (#90) (@el-oso)
- Split the Python façade into generated and hand-written modules (#91) (@timholy)
- Bump actions/checkout from 4 to 7 (#95) (@dependabot[bot])
- Bump matlab-actions/run-command from 2 to 3 (#96) (@dependabot[bot])
- Bump actions/upload-artifact from 4 to 7 (#97) (@dependabot[bot])
- Bump julia-actions/cache from 2 to 3 (#98) (@dependabot[bot])
- Bump matlab-actions/setup-matlab from 2 to 3 (#99) (@dependabot[bot])
- Require v0.3 in examples and docs environments (#103) (@timholy)
Closed issues:
- Proposed discourse announcement (#88)
JLWInterop-v0.3.1
JLWInterop JLWInterop-v0.3.1
Merged pull requests:
JLWInterop-v0.3.0
JLWInterop JLWInterop-v0.3.0
Breaking changes
- The C symbol an
@apideclaration exports is now a valid C identifier:
characters C does not allow become_, runs of_collapse, and a leading
digit gains a_prefix.@api scale!(...)in moduleModexports
Mod_scalerather thanMod_scale!. Two declarations whose names map to
the same symbol are rejected. ApiEntryhas a new field,mutates. The six-argument constructor is
kept and sets it to an empty list.
New features
CNTuple{N,T}carries tuple returns: a struct whose fieldvaluesholds
each element's own carrier. Tuples are return-only.@apiaccepts a trailingmutates = (a, ...)clause (ormutates = a)
naming the array arguments the function writes to. Naming an argument the
declaration does not take, or one that is not an array, is an error. A
declaration whose name ends in!and has nomutatesclause warns.
Merged pull requests:
- Tuple returns (#83) (@el-oso)
- MATLAB target: façades and a MEX gateway (#90) (@el-oso)
- Split the Python façade into generated and hand-written modules (#91) (@timholy)
- Bump actions/checkout from 4 to 7 (#95) (@dependabot[bot])
- Bump matlab-actions/run-command from 2 to 3 (#96) (@dependabot[bot])
- Bump actions/upload-artifact from 4 to 7 (#97) (@dependabot[bot])
- Bump julia-actions/cache from 2 to 3 (#98) (@dependabot[bot])
- Bump matlab-actions/setup-matlab from 2 to 3 (#99) (@dependabot[bot])
Closed issues:
- Proposed discourse announcement (#88)
JuliaLibWrapping-v0.2.0
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)
JLWInterop-v0.2.0
JLWInterop JLWInterop-v0.2.0
Breaking changes
- Carriers now encode ownership in their type.
CArray{T,N}becomes
CArray{owned,T,N}andCStringbecomesCString{owned}, whereownedis
:ownedor:borrowed; the aliases follow asCVector{owned,T}and
CMatrix{owned,T}. An entry point writtenf(v::CVector{Float64})is now
f(v::CVector{:borrowed,Float64}). Any other value for the parameter throws
anArgumentError. A target reads "release this" or "do not release this"
off the signature alone. - Carrier lengths and dimensions are
Int64, previouslyInt32:
CArray.dims::NTuple{N,Int64}andCString.length::Int64. This changes the
struct layout, so a library and the bindings generated for it must both be
rebuilt against v0.2. CArrayis now aDenseArray{T,N}rather than anAbstractArray{T,N}, and
supportspointer,Base.unsafe_convert,Base.elsize, and aliasing
queries. Code that defined its own pointer or strided methods forCArray
may now conflict with the ones defined here.
New features
- New carriers:
CStrArray{owned}(a read-onlyAbstractVectorof
CString{owned}),CDict{owned,V}for string-keyed scalar dictionaries,
COpt{T}for optional scalars, andJLWResult{C}pairing aJLWStatuswith
a value. @apideclares a call signature as a boundary entry point. It generates the
Base.@ccallablewrapper, converts arguments and results through the
carrier_type/carrier_return_type/to_carrier/from_carrier
extension points, reports failures asJLWResult/JLWStatus, and records
the declaration for the metadata sidecar that JuliaLibWrapping reads when it
generates a binding façade.Base.Enumargument, keyword, and return types
are supported.@export_release_entrypointsexports thejlw_freeandjlw_free_strings
entry points a foreign caller needs to release owning carriers.- Allocating constructors
CArray{:owned}(A),CString{:owned}(s), and
CStrArray{:owned}(v), and the non-copyingCArray{:borrowed}(A)for
DenseArraystorage. Base.get(o::COpt, default)reads an optional value.
Merged pull requests:
- C: map Nothing to void (#6) (@fredrikekre)
- CompatHelper: add new compat entry for Documenter at version 1 for package docs, (keep existing compat) (#49) (@github-actions[bot])
- CompatHelper: add new compat entry for JLWInterop at version 0.1 for package docs, (keep existing compat) (#51) (@github-actions[bot])
- Bump codecov/codecov-action from 6 to 7 (#53) (@dependabot[bot])
- CompatHelper: add new compat entry for JuliaLibWrapping at version 0.1 for package docs, (keep existing compat) (#54) (@github-actions[bot])
- Bump actions/checkout from 6 to 7 (#55) (@dependabot[bot])
- [compat] JSON, OrderedCollections (#56) (@timholy)
- Add cpu_target to build_library (#57) (@timholy)
- Set version in generated Python packages (#58) (@timholy)
- Add reusable wheel-build workflow for wrapped libraries (#59) (@timholy)
- Improve the text (#60) (@timholy)
- Privatize bundled libjulia by default (#61) (@timholy)
- 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)
Closed issues:
JuliaLibWrapping-v0.1.2
JuliaLibWrapping JuliaLibWrapping-v0.1.2
Diff since JuliaLibWrapping-v0.1.1
Merged pull requests:
- Add cpu_target to build_library (#57) (@timholy)
- Set version in generated Python packages (#58) (@timholy)
- Add reusable wheel-build workflow for wrapped libraries (#59) (@timholy)
- Improve the text (#60) (@timholy)
- Privatize bundled libjulia by default (#61) (@timholy)
Closed issues:
JuliaLibWrapping-v0.1.1
JuliaLibWrapping JuliaLibWrapping-v0.1.1
Diff since JuliaLibWrapping-v0.1.0
Merged pull requests:
- CompatHelper: add new compat entry for Documenter at version 1 for package docs, (keep existing compat) (#49) (@github-actions[bot])
- CompatHelper: add new compat entry for JLWInterop at version 0.1 for package docs, (keep existing compat) (#51) (@github-actions[bot])
- Bump codecov/codecov-action from 6 to 7 (#53) (@dependabot[bot])
- CompatHelper: add new compat entry for JuliaLibWrapping at version 0.1 for package docs, (keep existing compat) (#54) (@github-actions[bot])
- Bump actions/checkout from 6 to 7 (#55) (@dependabot[bot])
- [compat] JSON, OrderedCollections (#56) (@timholy)