@@ -2239,7 +2239,7 @@ end
22392239
22402240const PRECOMPILE_TRACE_COMPILE = Ref {String} ()
22412241function create_expr_cache (pkg:: PkgId , input:: String , output:: String , output_o:: Union{Nothing, String} ,
2242- concrete_deps:: typeof (_concrete_dependencies), internal_stderr:: IO = stderr , internal_stdout:: IO = stdout )
2242+ concrete_deps:: typeof (_concrete_dependencies), flags :: Cmd = ` ` , internal_stderr:: IO = stderr , internal_stdout:: IO = stdout )
22432243 @nospecialize internal_stderr internal_stdout
22442244 rm (output, force= true ) # Remove file if it exists
22452245 output_o === nothing || rm (output_o, force= true )
@@ -2281,6 +2281,7 @@ function create_expr_cache(pkg::PkgId, input::String, output::String, output_o::
22812281 io = open (pipeline (addenv (` $(julia_cmd (;cpu_target):: Cmd ) $(opts)
22822282 --startup-file=no --history-file=no --warn-overwrite=yes
22832283 --color=$(have_color === nothing ? " auto" : have_color ? " yes" : " no" )
2284+ $flags
22842285 $trace
22852286 -` ,
22862287 " OPENBLAS_NUM_THREADS" => 1 ,
@@ -2335,17 +2336,17 @@ This can be used to reduce package load times. Cache files are stored in
23352336`DEPOT_PATH[1]/compiled`. See [Module initialization and precompilation](@ref)
23362337for important notes.
23372338"""
2338- function compilecache (pkg:: PkgId , internal_stderr:: IO = stderr , internal_stdout:: IO = stdout )
2339+ function compilecache (pkg:: PkgId , internal_stderr:: IO = stderr , internal_stdout:: IO = stdout ; flags :: Cmd = ` ` )
23392340 @nospecialize internal_stderr internal_stdout
23402341 path = locate_package (pkg)
2341- path === nothing && throw (ArgumentError (" $pkg not found during precompilation" ))
2342- return compilecache (pkg, path, internal_stderr, internal_stdout)
2342+ path === nothing && throw (ArgumentError (" $( repr ( " text/plain " , pkg)) not found during precompilation" ))
2343+ return compilecache (pkg, path, internal_stderr, internal_stdout; flags )
23432344end
23442345
23452346const MAX_NUM_PRECOMPILE_FILES = Ref (10 )
23462347
23472348function compilecache (pkg:: PkgId , path:: String , internal_stderr:: IO = stderr , internal_stdout:: IO = stdout ,
2348- keep_loaded_modules:: Bool = true )
2349+ keep_loaded_modules:: Bool = true ; flags :: Cmd = ` ` )
23492350
23502351 @nospecialize internal_stderr internal_stdout
23512352 # decide where to put the resulting cache file
@@ -2383,7 +2384,7 @@ function compilecache(pkg::PkgId, path::String, internal_stderr::IO = stderr, in
23832384 close (tmpio_o)
23842385 close (tmpio_so)
23852386 end
2386- p = create_expr_cache (pkg, path, tmppath, tmppath_o, concrete_deps, internal_stderr, internal_stdout)
2387+ p = create_expr_cache (pkg, path, tmppath, tmppath_o, concrete_deps, flags, internal_stderr, internal_stdout)
23872388
23882389 if success (p)
23892390 if cache_objects
@@ -3249,5 +3250,5 @@ end
32493250
32503251precompile (include_package_for_output, (PkgId, String, Vector{String}, Vector{String}, Vector{String}, typeof (_concrete_dependencies), Nothing))
32513252precompile (include_package_for_output, (PkgId, String, Vector{String}, Vector{String}, Vector{String}, typeof (_concrete_dependencies), String))
3252- precompile (create_expr_cache, (PkgId, String, String, String, typeof (_concrete_dependencies), IO, IO))
3253- precompile (create_expr_cache, (PkgId, String, String, Nothing, typeof (_concrete_dependencies), IO, IO))
3253+ precompile (create_expr_cache, (PkgId, String, String, String, typeof (_concrete_dependencies), IO, IO, Cmd ))
3254+ precompile (create_expr_cache, (PkgId, String, String, Nothing, typeof (_concrete_dependencies), IO, IO, Cmd ))
0 commit comments