Skip to content

UDFs don't work on ARM #335

@aplavin

Description

@aplavin

On ARM processors, like Apple Silicon, registering an UDF throws with cfunction: closures are not supported on this platform:

julia> using SQLite
julia> db = SQLite.DB(":memory:")
julia> SQLite.register(db, exp, name="myfunc")
ERROR: cfunction: closures are not supported on this platform

This errors both before and after #333. As I understand, the issue is not in anonymous functions, but in closing over func here

SQLite.jl/src/UDF.jl

Lines 215 to 218 in dce0b6c

f =
(context, nargs, values) ->
wrap_scalarfunc(func, context, nargs, values)
cfunc = @cfunction($f, Cvoid, (Ptr{Cvoid}, Cint, Ptr{Ptr{Cvoid}}))

Do not know how to fix this exactly, but should be possible – given discussion at JuliaLang/julia#27174 and in linked issues.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions