File tree 6 files changed +28
-17
lines changed
6 files changed +28
-17
lines changed Original file line number Diff line number Diff line change @@ -10127,21 +10127,6 @@ no effect outside of compilation.
10127
10127
"""
10128
10128
include_dependency
10129
10129
10130
- """
10131
- __precompile__(isprecompilable::Bool=true)
10132
-
10133
- Specify whether the file calling this function is precompilable. If `isprecompilable` is
10134
- `true`, then `__precompile__` throws an exception when the file is loaded by
10135
- `using`/`import`/`require` *unless* the file is being precompiled, and in a module file it
10136
- causes the module to be automatically precompiled when it is imported. Typically,
10137
- `__precompile__()` should occur before the `module` declaration in the file, or better yet
10138
- `VERSION >= v"0.4" && __precompile__()` in order to be backward-compatible with Julia 0.3.
10139
-
10140
- If a module or file is *not* safely precompilable, it should call `__precompile__(false)` in
10141
- order to throw an error if Julia attempts to precompile it.
10142
- """
10143
- __precompile__
10144
-
10145
10130
"""
10146
10131
randn!([rng], A::Array{Float64,N})
10147
10132
Original file line number Diff line number Diff line change @@ -239,6 +239,22 @@ precompilableerror(ex, c) = false
239
239
# Call __precompile__ at the top of a file to force it to be precompiled (true), or
240
240
# to be prevent it from being precompiled (false). __precompile__(true) is
241
241
# ignored except within "require" call.
242
+ """
243
+ __precompile__(isprecompilable::Bool=true)
244
+
245
+ Specify whether the file calling this function is precompilable. If `isprecompilable` is
246
+ `true`, then `__precompile__` throws an exception when the file is loaded by
247
+ `using`/`import`/`require` *unless* the file is being precompiled, and in a module file it
248
+ causes the module to be automatically precompiled when it is imported. Typically,
249
+ `__precompile__()` should occur before the `module` declaration in the file, or better yet
250
+ `VERSION >= v"0.4" && __precompile__()` in order to be backward-compatible with Julia 0.3.
251
+
252
+ If a module or file is *not* safely precompilable, it should call `__precompile__(false)` in
253
+ order to throw an error if Julia attempts to precompile it.
254
+
255
+ `__precompile__()` should *not* be used in a module unless all of its dependencies are also
256
+ using `__precompile__()`. Failure to do so can result in a runtime error when loading the module.
257
+ """
242
258
function __precompile__ (isprecompilable:: Bool = true )
243
259
if (myid () == 1 &&
244
260
JLOptions (). use_compilecache != 0 &&
Original file line number Diff line number Diff line change @@ -282,6 +282,10 @@ therein. If you know that it is *not* safe to precompile your module
282
282
throw an error (and thereby prevent the module from being imported by
283
283
any other precompiled module).
284
284
285
+ ``__precompile__() `` should *not * be used in a module unless all of its
286
+ dependencies are also using ``__precompile__() ``. Failure to do so can result
287
+ in a runtime error when loading the module.
288
+
285
289
In order to make your module work with precompilation,
286
290
however, you may need to change your module to explicitly separate any
287
291
initialization steps that must occur at *runtime * from steps that can
Original file line number Diff line number Diff line change @@ -142,6 +142,8 @@ Getting Around
142
142
143
143
If a module or file is *not * safely precompilable, it should call ``__precompile__(false) `` in order to throw an error if Julia attempts to precompile it.
144
144
145
+ ``__precompile__() `` should *not * be used in a module unless all of its dependencies are also using ``__precompile__() ``\ . Failure to do so can result in a runtime error when loading the module.
146
+
145
147
.. function :: include(path::AbstractString)
146
148
147
149
.. Docstring generated from Julia source
Original file line number Diff line number Diff line change @@ -150,7 +150,7 @@ General I/O
150
150
151
151
.. Docstring generated from Julia source
152
152
153
- Read binary data from a stream, filling in the argument ``array ``\ .
153
+ Read binary data from a stream or file , filling in the argument ``array ``\ .
154
154
155
155
.. function :: readbytes!(stream, b::Vector{UInt8}, nb=length(b); all=true)
156
156
Original file line number Diff line number Diff line change @@ -1647,7 +1647,11 @@ static int jl_deserialize_verify_mod_list(ios_t *s)
1647
1647
jl_errorf ("invalid module path (%s does not name a module)" , name );
1648
1648
}
1649
1649
if (m -> uuid != uuid ) {
1650
- jl_printf (JL_STDERR , "WARNING: Module %s uuid did not match cache file\n" , name );
1650
+ jl_printf (JL_STDERR ,
1651
+ "WARNING: Module %s uuid did not match cache file\n"
1652
+ " This is likely because module %s does not support"
1653
+ " precompilation but is imported by a module that does.\n" ,
1654
+ name , name );
1651
1655
return 0 ;
1652
1656
}
1653
1657
}
You can’t perform that action at this time.
0 commit comments