@@ -2447,7 +2447,7 @@ end
24472447
24482448const PRECOMPILE_TRACE_COMPILE = Ref {String} ()
24492449function create_expr_cache (pkg:: PkgId , input:: String , output:: String , output_o:: Union{Nothing, String} ,
2450- concrete_deps:: typeof (_concrete_dependencies), internal_stderr:: IO = stderr , internal_stdout:: IO = stdout )
2450+ concrete_deps:: typeof (_concrete_dependencies), flags :: Cmd = ` ` , internal_stderr:: IO = stderr , internal_stdout:: IO = stdout )
24512451 @nospecialize internal_stderr internal_stdout
24522452 rm (output, force= true ) # Remove file if it exists
24532453 output_o === nothing || rm (output_o, force= true )
@@ -2503,6 +2503,7 @@ function create_expr_cache(pkg::PkgId, input::String, output::String, output_o::
25032503 io = open (pipeline (addenv (` $(julia_cmd (;cpu_target):: Cmd ) $(opts)
25042504 --startup-file=no --history-file=no --warn-overwrite=yes
25052505 --color=$(have_color === nothing ? " auto" : have_color ? " yes" : " no" )
2506+ $flags
25062507 $trace
25072508 -` ,
25082509 " OPENBLAS_NUM_THREADS" => 1 ,
@@ -2570,17 +2571,17 @@ This can be used to reduce package load times. Cache files are stored in
25702571`DEPOT_PATH[1]/compiled`. See [Module initialization and precompilation](@ref)
25712572for important notes.
25722573"""
2573- function compilecache (pkg:: PkgId , internal_stderr:: IO = stderr , internal_stdout:: IO = stdout ; reasons:: Union{Dict{String,Int},Nothing} = Dict {String,Int} ())
2574+ function compilecache (pkg:: PkgId , internal_stderr:: IO = stderr , internal_stdout:: IO = stdout ; flags :: Cmd = ` ` , reasons:: Union{Dict{String,Int},Nothing} = Dict {String,Int} ())
25742575 @nospecialize internal_stderr internal_stdout
25752576 path = locate_package (pkg)
25762577 path === nothing && throw (ArgumentError (" $(repr (" text/plain" , pkg)) not found during precompilation" ))
2577- return compilecache (pkg, path, internal_stderr, internal_stdout; reasons)
2578+ return compilecache (pkg, path, internal_stderr, internal_stdout; flags, reasons)
25782579end
25792580
25802581const MAX_NUM_PRECOMPILE_FILES = Ref (10 )
25812582
25822583function compilecache (pkg:: PkgId , path:: String , internal_stderr:: IO = stderr , internal_stdout:: IO = stdout ,
2583- keep_loaded_modules:: Bool = true ; reasons:: Union{Dict{String,Int},Nothing} = Dict {String,Int} ())
2584+ keep_loaded_modules:: Bool = true ; flags :: Cmd = ` ` , reasons:: Union{Dict{String,Int},Nothing} = Dict {String,Int} ())
25842585
25852586 @nospecialize internal_stderr internal_stdout
25862587 # decide where to put the resulting cache file
@@ -2618,7 +2619,7 @@ function compilecache(pkg::PkgId, path::String, internal_stderr::IO = stderr, in
26182619 close (tmpio_o)
26192620 close (tmpio_so)
26202621 end
2621- p = create_expr_cache (pkg, path, tmppath, tmppath_o, concrete_deps, internal_stderr, internal_stdout)
2622+ p = create_expr_cache (pkg, path, tmppath, tmppath_o, concrete_deps, flags, internal_stderr, internal_stdout)
26222623
26232624 if success (p)
26242625 if cache_objects
@@ -3627,5 +3628,5 @@ end
36273628
36283629precompile (include_package_for_output, (PkgId, String, Vector{String}, Vector{String}, Vector{String}, typeof (_concrete_dependencies), Nothing))
36293630precompile (include_package_for_output, (PkgId, String, Vector{String}, Vector{String}, Vector{String}, typeof (_concrete_dependencies), String))
3630- precompile (create_expr_cache, (PkgId, String, String, String, typeof (_concrete_dependencies), IO, IO))
3631- precompile (create_expr_cache, (PkgId, String, String, Nothing, typeof (_concrete_dependencies), IO, IO))
3631+ precompile (create_expr_cache, (PkgId, String, String, String, typeof (_concrete_dependencies), IO, IO, Cmd ))
3632+ precompile (create_expr_cache, (PkgId, String, String, Nothing, typeof (_concrete_dependencies), IO, IO, Cmd ))
0 commit comments