timholy / SnoopCompile.jl

Provide insights about latency (TTFX) for Julia packages
https://timholy.github.io/SnoopCompile.jl/dev/
Other
309 stars 48 forks source link

Using mocked functions in runtests.jl leading to `ERROR: UndefVarError: not defined` #147

Closed casabre closed 3 years ago

casabre commented 3 years ago

Running SnoopCompileBot with the runtests.jl script which had a lot of @patches in it leads to the following error

[ Info: Processsing the generated precompile signatures
m = (::var"##fancynize_patch#253#2")(normal::AbstractString) in Main at /home/carsten/SnoopCompileWithMocking.jl/test/runtests.jl:13
m.name = Symbol("##fancynize_patch#253#2")
ERROR: UndefVarError:  not defined

Just saw the other issues regarding anonymous functions but excluding would lead to almost no snooped function in my main project. Thus, how can I deal with Mocking in combination with SnoopCompile in general?

In order to reproduce it easily, I have prepared a minimal example.

timholy commented 3 years ago

There's not enough of a backtrace here to know where the error is coming from, but with #149 I can't replicate the error. If there's a Bot-free way to trigger it I could take a look though.

Note that the current version of SnoopCompile is 2.x and that now you'd use CompileBot.

timholy commented 3 years ago

Oh, I see there's a more complete stacktrace in the README (thanks!). This seems to be a CompileBot issue, so I'll close this here. You might consider re-opening there if you can replicate this on the latest release of both packages.