@@ -2239,7 +2239,7 @@ end
2239
2239
2240
2240
const PRECOMPILE_TRACE_COMPILE = Ref {String} ()
2241
2241
function 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 )
2243
2243
@nospecialize internal_stderr internal_stdout
2244
2244
rm (output, force= true ) # Remove file if it exists
2245
2245
output_o === nothing || rm (output_o, force= true )
@@ -2281,6 +2281,7 @@ function create_expr_cache(pkg::PkgId, input::String, output::String, output_o::
2281
2281
io = open (pipeline (addenv (` $(julia_cmd (;cpu_target):: Cmd ) $(opts)
2282
2282
--startup-file=no --history-file=no --warn-overwrite=yes
2283
2283
--color=$(have_color === nothing ? " auto" : have_color ? " yes" : " no" )
2284
+ $flags
2284
2285
$trace
2285
2286
-` ,
2286
2287
" OPENBLAS_NUM_THREADS" => 1 ,
@@ -2335,17 +2336,17 @@ This can be used to reduce package load times. Cache files are stored in
2335
2336
`DEPOT_PATH[1]/compiled`. See [Module initialization and precompilation](@ref)
2336
2337
for important notes.
2337
2338
"""
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 = ` ` )
2339
2340
@nospecialize internal_stderr internal_stdout
2340
2341
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 )
2343
2344
end
2344
2345
2345
2346
const MAX_NUM_PRECOMPILE_FILES = Ref (10 )
2346
2347
2347
2348
function 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 = ` ` )
2349
2350
2350
2351
@nospecialize internal_stderr internal_stdout
2351
2352
# decide where to put the resulting cache file
@@ -2383,7 +2384,7 @@ function compilecache(pkg::PkgId, path::String, internal_stderr::IO = stderr, in
2383
2384
close (tmpio_o)
2384
2385
close (tmpio_so)
2385
2386
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)
2387
2388
2388
2389
if success (p)
2389
2390
if cache_objects
@@ -3249,5 +3250,5 @@ end
3249
3250
3250
3251
precompile (include_package_for_output, (PkgId, String, Vector{String}, Vector{String}, Vector{String}, typeof (_concrete_dependencies), Nothing))
3251
3252
precompile (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