Glyphy.jl icon indicating copy to clipboard operation
Glyphy.jl copied to clipboard

`ERROR: cfunction: closures are not supported on this platform` on M1 Macs

Open singularitti opened this issue 2 years ago • 7 comments

Example:

julia> glyphy("peacock")
ERROR: cfunction: closures are not supported on this platform
Stacktrace:
 [1] register(db::SQLite.DB, func::Function; nargs::Int64, name::String, isdeterm::Bool)
   @ SQLite ~/.julia/packages/SQLite/aeqsS/src/UDF.jl:247
 [2] register
   @ ~/.julia/packages/SQLite/aeqsS/src/UDF.jl:233 [inlined]
 [3] _query_db(querystring::String)
   @ Glyphy ~/.julia/packages/Glyphy/jvwwz/src/Glyphy.jl:21
 [4] glyphy(s::String; showall::Bool)
   @ Glyphy ~/.julia/packages/Glyphy/jvwwz/src/Glyphy.jl:83
 [5] glyphy(s::String)
   @ Glyphy ~/.julia/packages/Glyphy/jvwwz/src/Glyphy.jl:75
 [6] top-level scope
   @ REPL[8]:1
julia> Pkg.status("Glyphy")
Status `~/.julia/environments/v1.8/Project.toml`
  [e3b492bb] Glyphy v1.0.0

julia> versioninfo()
Julia Version 1.8.4
Commit 00177ebc4fc (2022-12-23 21:32 UTC)
Platform Info:
  OS: macOS (arm64-apple-darwin21.5.0)
  CPU: 10 × Apple M1 Pro
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-13.0.1 (ORCJIT, apple-m1)
  Threads: 1 on 8 virtual cores

I am running on macOS 13.1 on an M1 Pro mac.

singularitti avatar Dec 26 '22 22:12 singularitti

That's fun! I don't understand that message at all. 😂

It tested OK on my Mac (not M1) earlier today.

cormullion avatar Dec 26 '22 22:12 cormullion

What's the version of Sqlite.jl?

https://github.com/JuliaDatabases/SQLite.jl/issues/282

cormullion avatar Dec 26 '22 22:12 cormullion

It's v1.6.0.

julia> Pkg.status("SQLite")
Status `~/.julia/environments/v1.8/Project.toml`
  [0aa819cd] SQLite v1.6.0

singularitti avatar Dec 26 '22 22:12 singularitti

Oh, I assumed it was fixed in 1.6... Perhaps not...

cormullion avatar Dec 26 '22 23:12 cormullion

The same issue here.

It can also be seen by running the the tests:

(@v1.10) pkg> test Glyphy
     Testing Glyphy
      Status `/private/var/folders/y5/2skz3gn12mv457mxv694d5pw0000gn/T/jl_7CSgR5/Project.toml`
  [e3b492bb] Glyphy v1.3.0
  [0aa819cd] SQLite v1.6.0
  [bd369af6] Tables v1.11.1
  [8dfed614] Test
      Status `/private/var/folders/y5/2skz3gn12mv457mxv694d5pw0000gn/T/jl_7CSgR5/Manifest.toml`
  [a10d1c49] DBInterface v2.5.0
  [9a962f9c] DataAPI v1.15.0
  [e2d170a0] DataValueInterfaces v1.0.0
  [e3b492bb] Glyphy v1.3.0
  [842dd82b] InlineStrings v1.4.0
  [82899510] IteratorInterfaceExtensions v1.0.0
  [692b3bcd] JLLWrappers v1.5.0
  [bac558e1] OrderedCollections v1.6.3
  [69de0a69] Parsers v2.8.1
  [aea7be01] PrecompileTools v1.2.0
  [21216c6a] Preferences v1.4.1
  [0aa819cd] SQLite v1.6.0
  [3783bdb8] TableTraits v1.0.1
  [bd369af6] Tables v1.11.1
  [ea10d353] WeakRefStrings v1.4.2
  [76ed43ae] SQLite_jll v3.43.0+0
  [56f22d72] Artifacts
  [2a0f44e3] Base64
  [ade2ca70] Dates
  [b77e0a4c] InteractiveUtils
  [8f399da3] Libdl
  [37e2e46d] LinearAlgebra
  [56ddb016] Logging
  [d6f4376e] Markdown
  [de0858da] Printf
  [9a3f8284] Random
  [ea8e919c] SHA v0.7.0
  [9e88b42a] Serialization
  [fa267f1f] TOML v1.0.3
  [8dfed614] Test
  [cf7118a7] UUIDs
  [4ec0a83e] Unicode
  [e66e0078] CompilerSupportLibraries_jll v1.0.5+1
  [4536629a] OpenBLAS_jll v0.3.23+2
  [83775a58] Zlib_jll v1.2.13+1
  [8e850b90] libblastrampoline_jll v5.8.0+1
Precompiling project...
  17 dependencies successfully precompiled in 13 seconds. 2 already precompiled.
     Testing Running tests...
Glyphy.jl: Error During Test at /Users/hurak/.julia/packages/Glyphy/8GJJw/test/runtests.jl:4
  Got exception outside of a @test
  cfunction: closures are not supported on this platform
  Stacktrace:
    [1] register(db::SQLite.DB, func::Function; nargs::Int64, name::String, isdeterm::Bool)
      @ SQLite ~/.julia/packages/SQLite/aeqsS/src/UDF.jl:247
    [2] register
      @ SQLite ~/.julia/packages/SQLite/aeqsS/src/UDF.jl:233 [inlined]
    [3] _query_db(querystring::String)
      @ Glyphy ~/.julia/packages/Glyphy/8GJJw/src/Glyphy.jl:21
    [4] glyphy(s::String; showall::Bool)
      @ Glyphy ~/.julia/packages/Glyphy/8GJJw/src/Glyphy.jl:83
    [5] glyphy(s::String)
      @ Glyphy ~/.julia/packages/Glyphy/8GJJw/src/Glyphy.jl:75
    [6] macro expansion
      @ ~/.julia/packages/Glyphy/8GJJw/test/runtests.jl:5 [inlined]
    [7] macro expansion
      @ /Applications/Julia-1.10.app/Contents/Resources/julia/share/julia/stdlib/v1.10/Test/src/Test.jl:1577 [inlined]
    [8] top-level scope
      @ ~/.julia/packages/Glyphy/8GJJw/test/runtests.jl:5
    [9] include(fname::String)
      @ Base.MainInclude ./client.jl:489
   [10] top-level scope
      @ none:6
   [11] eval
      @ Core ./boot.jl:385 [inlined]
   [12] exec_options(opts::Base.JLOptions)
      @ Base ./client.jl:291
   [13] _start()
      @ Base ./client.jl:552
Test Summary: | Error  Total  Time
Glyphy.jl     |     1      1  0.4s
ERROR: LoadError: Some tests did not pass: 0 passed, 0 failed, 1 errored, 0 broken.
in expression starting at /Users/hurak/.julia/packages/Glyphy/8GJJw/test/runtests.jl:4
ERROR: Package Glyphy errored during testing

Here are the details of my setup:

julia> versioninfo()
Julia Version 1.10.0
Commit 3120989f39b (2023-12-25 18:01 UTC)
Build Info:
  Official https://julialang.org/ release
Platform Info:
  OS: macOS (arm64-apple-darwin22.4.0)
  CPU: 8 × Apple M2
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-15.0.7 (ORCJIT, apple-m1)
  Threads: 1 on 4 virtual cores
Environment:
  DYLD_LIBRARY_PATH = /Library/knitro/lib

(@v1.10) pkg> status Glyphy 
Status `~/.julia/environments/v1.10/Project.toml`
  [e3b492bb] Glyphy v1.3.0

hurak avatar Jan 07 '24 20:01 hurak

This issue is nearly a year old: https://github.com/JuliaDatabases/SQLite.jl/issues/319 😢

cormullion avatar Jan 07 '24 20:01 cormullion

@hurak It might be fixed on SQLite master. Santa didn’t bring me a new Mac this year either 😀

cormullion avatar Jan 08 '24 12:01 cormullion