Skip to content

Define stable C API and/or reexport jl_arrayref and jl_array_size since it's still there, and broke at least one package #56805

Open
@PallHaraldsson

Description

Memory PR unexported jl_arrayref and broke Mousetrap.jl, which is unregistered, and in AutoGrad.jl and Knet.jl https://juliahub.com/ui/Search?q=jl_arrayref&type=code [EDIT: older wrong link or showing 2/3 more, probably false positives...:
https://juliahub.com/ui/Search?q=jl_array&type=packages ]

The search may be unreliable, it told me also used in ArrayAllez.jl but it at least passed tests for me. I also don't see where it's used in Mousetrap.jl or if more needs to be added/reexported:

https://www.reddit.com/r/Julia/comments/1h27zay/the_mousetrap_is_a_trap/

jl_arrayref is still defined and used by Julia itself (with a changed definition in a different file src/builtins.c now, array.c before, but I think the definitions may actually be equivalent, not sure). Not sure where @adienes is searing in answer below.

Adding to the top here, this was unexported, used by three packages, e.g. ArraysofArrays.jl (and Enzyme):
https://juliahub.com/ui/Search?type=code&q=jl_array_size

@thautwarm, @songjhaha TyJuliaCAPI.jl is likely broken because of this since it uses jl_array_size but it fails test (despite of this?! why PkgEval didn't catch it). Tests DO pass for ArraysofArrays but likely shouldn't have...

If you do decide to reexport, then while you're at it why not also merge my #56340, one other unexport that broke (R) package. I could add reexports to that PR if wanted.

jl_array_sizehint is in 1.10, no longer in 1.11 (since alpha1), still referenced (no actual use?) by Enzyme.jl:

julia/src/array.c

Line 1153 in 4976d05

JL_DLLEXPORT void jl_array_sizehint(jl_array_t *a, size_t sz)

Mooncake.jl (formerly Tapir.jl) seems to use (or do something with this unexported function in foreigncall.jl/reference in tests:
https://github.com/compintell/Mooncake.jl/blob/v0.4.60/test/rrules/foreigncall.jl#L15

I'm testing ⌅ [da2b9cff] + Mooncake v0.4.40 it just takes a long time, so will go to sleep.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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