Skip to content

Commit 54c0c12

Browse files
authored
Merge pull request #218 from JuliaLang/sd-include
make include well behaved
2 parents 123cb2e + cfa6c1e commit 54c0c12

File tree

1 file changed

+19
-20
lines changed

1 file changed

+19
-20
lines changed

src/incremental.jl

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,28 +2,27 @@
22
Init basic C libraries
33
"""
44
function InitBase()
5-
"""
6-
Base.__init__()
7-
Sys.__init__() #fix https://github.com/JuliaLang/julia/issues/30479
8-
"""
5+
"""
6+
Base.__init__()
7+
Sys.__init__() #fix https://github.com/JuliaLang/julia/issues/30479
8+
"""
99
end
1010

1111
"""
1212
# Initialize REPL module for Docs
1313
"""
1414
function InitREPL()
15-
"""
16-
using REPL
17-
Base.REPL_MODULE_REF[] = REPL
18-
"""
15+
"""
16+
using REPL
17+
Base.REPL_MODULE_REF[] = REPL
18+
"""
1919
end
20-
2120
function Include(path)
22-
"""
23-
M = Module()
24-
# Include into anonymous module to not polute namespace
25-
@eval(M, (Base.include(\$M, $(repr(path)))))
26-
"""
21+
"""
22+
Mod = @eval module \$(gensym("anon_module")) end
23+
# Include into anonymous module to not polute namespace
24+
Mod.include($(repr(path)))
25+
"""
2726
end
2827

2928
"""
@@ -155,22 +154,22 @@ end
155154
156155
Incrementally compile `package` into the current system image.
157156
`force = true` will replace the old system image with the new one.
158-
This process requires a script that julia will run in order to determine
159-
which functions to compile. A package may define a script called `snoopfile.jl`
157+
This process requires a script that julia will run in order to determine
158+
which functions to compile. A package may define a script called `snoopfile.jl`
160159
for this purpose. If this file cannot be found the package's test script
161-
`Package/test/runtests.jl` will be used. `compile_incremental` will search
160+
`Package/test/runtests.jl` will be used. `compile_incremental` will search
162161
for `snoopfile.jl` in the package's root directory and in the folders
163-
`Package/src` and `Package/snoop`. For a more explicit version of compile_incremental,
162+
`Package/src` and `Package/snoop`. For a more explicit version of compile_incremental,
164163
see: `compile_incremental(toml_path::String, snoopfile::String)`
165164
166165
Not all packages can currently be compiled into the system image. By default,
167166
`compile_incremental(:Package) will also compile all of Package's dependencies.
168167
It can still be desirable to compile packages with dependencies that cannot be
169168
compiled. For this reason `compile_incremental` offers
170169
the ability for the user to pass a list of blacklisted packages
171-
that will be ignored during the compilation process. These are passed as a
170+
that will be ignored during the compilation process. These are passed as a
172171
vector of package names (defined as either strings or symbols) using the
173-
`blacklist keyword argument`
172+
`blacklist keyword argument`
174173
"""
175174
function compile_incremental(pkg::Symbol, packages::Symbol...;
176175
blacklist::Vector=[], kw...)

0 commit comments

Comments
 (0)