@@ -1152,7 +1152,7 @@ end
1152
1152
@assert precompile (include_package_for_output, (PkgId,String,Vector{String},Vector{String},Vector{String},typeof (_concrete_dependencies),Nothing))
1153
1153
@assert precompile (include_package_for_output, (PkgId,String,Vector{String},Vector{String},Vector{String},typeof (_concrete_dependencies),String))
1154
1154
1155
- function create_expr_cache (pkg:: PkgId , input:: String , output:: String , concrete_deps:: typeof (_concrete_dependencies))
1155
+ function create_expr_cache (pkg:: PkgId , input:: String , output:: String , concrete_deps:: typeof (_concrete_dependencies), show_errors :: Bool = true )
1156
1156
rm (output, force= true ) # Remove file if it exists
1157
1157
depot_path = map (abspath, DEPOT_PATH )
1158
1158
dl_load_path = map (abspath, DL_LOAD_PATH)
@@ -1178,7 +1178,7 @@ function create_expr_cache(pkg::PkgId, input::String, output::String, concrete_d
1178
1178
--output-ji $output --output-incremental=yes
1179
1179
--startup-file=no --history-file=no --warn-overwrite=yes
1180
1180
--color=$(have_color === nothing ? " auto" : have_color ? " yes" : " no" )
1181
- --eval 'eval(Meta.parse(read(stdin,String)))'` , stderr = stderr ),
1181
+ --eval 'eval(Meta.parse(read(stdin,String)))'` , stderr = show_errors ? stderr : devnull ),
1182
1182
" w" , stdout )
1183
1183
# write data over stdin to avoid the (unlikely) case of exceeding max command line size
1184
1184
write (io. in, """
@@ -1189,8 +1189,8 @@ function create_expr_cache(pkg::PkgId, input::String, output::String, concrete_d
1189
1189
return io
1190
1190
end
1191
1191
1192
- @assert precompile (create_expr_cache, (PkgId, String, String, typeof (_concrete_dependencies)))
1193
- @assert precompile (create_expr_cache, (PkgId, String, String, typeof (_concrete_dependencies)))
1192
+ @assert precompile (create_expr_cache, (PkgId, String, String, typeof (_concrete_dependencies), Bool ))
1193
+ @assert precompile (create_expr_cache, (PkgId, String, String, typeof (_concrete_dependencies), Bool ))
1194
1194
1195
1195
function compilecache_path (pkg:: PkgId ):: String
1196
1196
entrypath, entryfile = cache_file_entry (pkg)
@@ -1223,7 +1223,8 @@ end
1223
1223
1224
1224
const MAX_NUM_PRECOMPILE_FILES = 10
1225
1225
1226
- function compilecache (pkg:: PkgId , path:: String )
1226
+ # `show_errors` is an "internal" interface for Pkg.precompile
1227
+ function compilecache (pkg:: PkgId , path:: String , show_errors:: Bool = true )
1227
1228
# decide where to put the resulting cache file
1228
1229
cachefile = compilecache_path (pkg)
1229
1230
cachepath = dirname (cachefile)
@@ -1253,7 +1254,7 @@ function compilecache(pkg::PkgId, path::String)
1253
1254
local p
1254
1255
try
1255
1256
close (tmpio)
1256
- p = create_expr_cache (pkg, path, tmppath, concrete_deps)
1257
+ p = create_expr_cache (pkg, path, tmppath, concrete_deps, show_errors )
1257
1258
if success (p)
1258
1259
# append checksum to the end of the .ji file:
1259
1260
open (tmppath, " a+" ) do f
0 commit comments