Giter Club home page Giter Club logo

compilebot.jl's Introduction

CompileBot

CompileBot automatically generates precompilation data for your Julia packages, which results in reducing the time it takes for runtime compilation, loading, and startup.

Dev CI workflow_CI codecov

Installation and Usage

using Pkg
Pkg.add("CompileBot")
using CompileBot

Documentation

Click on the badge: Dev

Notice: CompileBot is now in a separate repository, and the API is changed because of that. Call using CompileBot directly in your snoop scripts and update your workflow based on this guide: Configure the bot to run with a GitHub Action file

Projects that use CompileBot:

compilebot.jl's People

Contributors

aminya avatar beastyblacksmith avatar casabre avatar dependabot[bot] avatar fingolfin avatar github-actions[bot] avatar stefanmathis avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

compilebot.jl's Issues

Difference between _precompile_() and __precompile__()

Hello,
this is probably a stupid question, but why does CompileBot.jl create a _precompile_() call (with one underscore per side) inside the precompile_includer.jl file instead of a __precompile__() command (with two underscores per side)? What is the difference between those functions (if there is any) and where is _precompile_() defined? I couldn't find a function definition in the Julia source code itself not in the CompileBot source code.

Error while processing precompile statements

For one of our packages we tried to get the CompileBot integration with Github working. I attempted following the documentation, but so far, I've been running into the following error:

[ Info: Processsing the generated precompile signatures
ERROR: UndefVarError: Dict not defined
Stacktrace:
 [1] top-level scope
   @ none:1
 [2] eval
   @ ./boot.jl:368 [inlined]
 [3] parcel(tinf::Vector{Tuple{Float64, Core.MethodInstance}}; subst::Vector{Pair{Union{Regex, AbstractChar, AbstractString}, Union{Regex, AbstractChar, AbstractString}}}, exclusions::Vector{Union{Regex, AbstractChar, AbstractString}}, remove_exclusions::Bool, check_eval::Bool, has_bodyfunction::Bool, blacklist::Nothing, remove_blacklist::Nothing)
   @ SnoopCompile ~/.julia/packages/SnoopCompile/ed3u0/src/parcel_snoopi.jl:332
 [4] top-level scope
   @ none:20

(full log available at action)

Any insight as to where this is coming from would be greatly appreciated.

Spawning Julia process fails

Hello,

I set up the CompileBot as described for a local (non-GitHub) package on Windows 10:

using CompileBot

snoop_bot(BotConfig("MyPackage"))

However, when running this file, I get the following error:

LoadError: IOError: could not spawn `julia --code-coverage=none --project=@. -e "

Any idea on what goes wrong here?

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

Originally raised at SnoopCompile #147 but identified as CompileBot issue.

Just wrapping up. Using @patches from Mocking is leading to errors like this

m = (::var"##basic_cancel_patch#268#61")(chan::AMQPClient.MessageChannel, consumer_tag::AbstractString; nowait, timeout) in Main at /home/carsten/AmqpUtils.jl/test/runtests.jl:129
m.name = Symbol("##basic_cancel_patch#268#61")
ERROR: UndefVarError:  not defined
Stacktrace:
 [1] handle_kwbody(::Module, ::Method, ::Array{String,1}, ::Type{T} where T, ::String; check_eval::Bool) at /home/carsten/.julia/packages/SnoopCompile/qKfrD/src/parcel_snoopi.jl:196
 [2] parcel(::Array{Tuple{Float64,Core.MethodInstance},1}; subst::Array{Pair{Union{Regex, AbstractChar, AbstractString},Union{Regex, AbstractChar, AbstractString}},1}, exclusions::Array{Union{Regex, AbstractChar, AbstractString},1}, remove_exclusions::Bool, check_eval::Bool, blacklist::Nothing, remove_blacklist::Nothing) at /home/carsten/.julia/packages/SnoopCompile/qKfrD/src/parcel_snoopi.jl:292
 [3] top-level scope at none:22
ERROR: failed process: Process(`julia --code-coverage=none --project=@. -e "
    #= /home/carsten/.julia/packages/CompileBot/nABzu/src/snoop_bot.jl:4 =#
    using SnoopCompileCore
    #= /home/carsten/.julia/packages/CompileBot/nABzu/src/snoop_bot.jl:6 =#
    data = #= /home/carsten/.julia/packages/CompileBot/nABzu/src/snoop_bot.jl:6 =# @snoopi(tmin = 0.01, begin
                #= /home/carsten/.julia/packages/CompileBot/nABzu/src/snoop_bot.jl:7 =#
                begin
                    #= /home/carsten/.julia/packages/CompileBot/nABzu/src/snoop_bot.jl:157 =#
                    using AmqpUtils
                    #= /home/carsten/.julia/packages/CompileBot/nABzu/src/snoop_bot.jl:158 =#
                    include(\"/home/carsten/AmqpUtils.jl/test/runtests.jl\")
                end
            end)
; 
    #= /home/carsten/.julia/packages/CompileBot/nABzu/src/snoop_bot.jl:29 =#
    packageSym = Symbol(\"AmqpUtils\")
    #= /home/carsten/.julia/packages/CompileBot/nABzu/src/snoop_bot.jl:32 =#
    #= /home/carsten/.julia/packages/CompileBot/nABzu/src/snoop_bot.jl:32 =# @info \"Processsing the generated precompile signatures\"
    #= /home/carsten/.julia/packages/CompileBot/nABzu/src/snoop_bot.jl:34 =#
    using SnoopCompile
    #= /home/carsten/.julia/packages/CompileBot/nABzu/src/snoop_bot.jl:37 =#
    pc = SnoopCompile.parcel(data; subst = Pair{Union{Regex, AbstractChar, AbstractString},Union{Regex, AbstractChar, AbstractString}}[], exclusions = Union{Regex, AbstractChar, AbstractString}[], check_eval = true)
    #= /home/carsten/.julia/packages/CompileBot/nABzu/src/snoop_bot.jl:38 =#
    if !(haskey(pc, packageSym))
        #= /home/carsten/.julia/packages/CompileBot/nABzu/src/snoop_bot.jl:39 =#
        #= /home/carsten/.julia/packages/CompileBot/nABzu/src/snoop_bot.jl:39 =# @warn \"no precompile signature is found for AmqpUtils. Don't load the package before snooping. Restart your Julia session.\"
        #= /home/carsten/.julia/packages/CompileBot/nABzu/src/snoop_bot.jl:40 =#
        if !(isdir(\"/home/carsten/AmqpUtils.jl/deps/SnoopCompile/precompile\"))
            #= /home/carsten/.julia/packages/CompileBot/nABzu/src/snoop_bot.jl:41 =#
            mkpath(\"/home/carsten/AmqpUtils.jl/deps/SnoopCompile/precompile\")
        end
        #= /home/carsten/.julia/packages/CompileBot/nABzu/src/snoop_bot.jl:43 =#
        Base.write(\"/home/carsten/AmqpUtils.jl/deps/SnoopCompile/precompile/precompile_AmqpUtils.jl\", \"function _precompile_()\n    # nothing\nend\n\")
    else
        #= /home/carsten/.julia/packages/CompileBot/nABzu/src/snoop_bot.jl:49 =#
        onlypackage = Dict(packageSym => sort(pc[packageSym]))
        #= /home/carsten/.julia/packages/CompileBot/nABzu/src/snoop_bot.jl:50 =#
        SnoopCompile.write(\"/home/carsten/AmqpUtils.jl/deps/SnoopCompile/precompile\", onlypackage)
        #= /home/carsten/.julia/packages/CompileBot/nABzu/src/snoop_bot.jl:51 =#
        #= /home/carsten/.julia/packages/CompileBot/nABzu/src/snoop_bot.jl:51 =# @info \"precompile signatures were written to /home/carsten/AmqpUtils.jl/deps/SnoopCompile/precompile\"
    end
;"`, ProcessExited(1)) [1]

Stacktrace:
 [1] pipeline_error at ./process.jl:525 [inlined]
 [2] run(::Cmd; wait::Bool) at ./process.jl:440
 [3] run(::Cmd) at ./process.jl:438
 [4] top-level scope at /home/carsten/.julia/packages/CompileBot/nABzu/src/snoop_bot.jl:139
 [5] eval at ./boot.jl:331 [inlined]
 [6] #snoop_bot#13 at /home/carsten/.julia/packages/CompileBot/nABzu/src/snoop_bot.jl:214 [inlined]
 [7] snoop_bot(::BotConfig, ::Module) at /home/carsten/.julia/packages/CompileBot/nABzu/src/snoop_bot.jl:213 (repeats 2 times)
 [8] top-level scope at /home/carsten/AmqpUtils.jl/deps/SnoopCompile/snoop_bot.jl:3
 [9] include(::String) at ./client.jl:457
 [10] top-level scope at REPL[5]:1

for instance with the following patch

connection_handle = AMQPClient.Connection();
channel_handle = AMQPClient.MessageChannel(AMQPClient.DEFAULT_CHANNEL, connection_handle);
connection_patch = @patch AMQPClient.connection(;virtualhost="/", host="localhost", port=AMQPClient.AMQP_DEFAULT_PORT, auth_params=AMQPClient.DEFAULT_AUTH_PARAMS, channelmax=AMQPClient.DEFAULT_CHANNELMAX, framemax=0, heartbeat=0, connect_timeout=AMQPClient.DEFAULT_CONNECT_TIMEOUT) = channel_handle

apply(connection_patch) do
      @test AmqpUtils.get_amqp_connection() == channel_handle
end

Just wanted to provide a minimal example in order make it reproducible. I started first with SnoopCompileBot v1.7.2 which leads to the same error as the previous one โ†’ check the README. After upgrading to CompileBot v1.0.1, the error did not occur anymore. However, running latest CompileBot with my private package did not fix it. The error is still occurring.

Thus, how can I deal with Mocking in combination with CompileBot in general?

TagBot trigger issue

This issue is used to trigger TagBot; feel free to unsubscribe.

If you haven't already, you should update your TagBot.yml to include issue comment triggers.
Please see this post on Discourse for instructions and more details.

If you'd like for me to do this for you, comment TagBot fix on this issue.
I'll open a PR within a few hours, please be patient!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.