Commit 43c389a
committed
Check for conflicting
This turns the existing segfault into an error:
```julia
julia> using Foo, Bar
ERROR: @ccallable: symbol 'foo' conflicts with existing symbol
Stacktrace:
[1] _include_from_serialized(pkg::Base.PkgId, path::String, ocachepath::String, depmods::Vector{…}, ignore_native::Nothing; register::Bool)
@ Base ./loading.jl:1241
[2] _include_from_serialized (repeats 2 times)
@ ./loading.jl:1206 [inlined]
[3] _require_search_from_serialized(pkg::Base.PkgId, sourcepath::String, build_id::UInt128, stalecheck::Bool; reasons::Dict{…}, DEPOT_PATH::Vector{…})
@ Base ./loading.jl:2018
[4] _require(pkg::Base.PkgId, env::String)
@ Base ./loading.jl:2477
[5] __require_prelocked(uuidkey::Base.PkgId, env::String)
@ Base ./loading.jl:2343
[6] #invoke_in_world#2
@ ./essentials.jl:1082 [inlined]
[7] invoke_in_world
@ ./essentials.jl:1079 [inlined]
[8] _require_prelocked(uuidkey::Base.PkgId, env::String)
@ Base ./loading.jl:2330
[9] macro expansion
@ ./loading.jl:2269 [inlined]
[10] macro expansion
@ ./lock.jl:287 [inlined]
[11] __require(into::Module, mod::Symbol)
@ Base ./loading.jl:2226
[12] #invoke_in_world#2
@ ./essentials.jl:1082 [inlined]
[13] invoke_in_world
@ ./essentials.jl:1079 [inlined]
[14] require(into::Module, mod::Symbol)
@ Base ./loading.jl:2219
Some type information was truncated. Use `show(err)` to see complete types.
```
Ideally the loading code would know to anticipate this and display a
better error to the user (w/o the useless stack-trace)
Resolves #54878, although we may wish to make this a warning or provide
an alternative `using` / `import` pathway that can allow `@ccallable`
registration to fail.@ccallable name before JIT registration1 parent a73ba3b commit 43c389a
1 file changed
+7
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7619 | 7619 | | |
7620 | 7620 | | |
7621 | 7621 | | |
7622 | | - | |
7623 | | - | |
7624 | | - | |
7625 | | - | |
| 7622 | + | |
| 7623 | + | |
| 7624 | + | |
| 7625 | + | |
| 7626 | + | |
| 7627 | + | |
7626 | 7628 | | |
7627 | 7629 | | |
| 7630 | + | |
7628 | 7631 | | |
7629 | 7632 | | |
7630 | 7633 | | |
| |||
0 commit comments