Skip to content

Commit

Permalink
Pkg don't use startup.jl when building and testing (#29364)
Browse files Browse the repository at this point in the history
* don't use startup.jl when precompiling, building and testing (#470)

unless the user has explicitly asked for it with
  --startup-file=yes

(cherry picked from commit 40d7f27f2ff08ec466df536f267129a9f5e950b4)

* do not precompile packages that have opt out to precompilation

(cherry picked from commit 57f7380a2641944be12695e92a3ad9f4cc20e6f2)
  • Loading branch information
KristofferC authored and fredrikekre committed Sep 26, 2018
1 parent 7698523 commit 48f53d5
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
7 changes: 3 additions & 4 deletions stdlib/Pkg/src/API.jl
Original file line number Diff line number Diff line change
Expand Up @@ -494,10 +494,9 @@ function precompile(ctx::Context)
for pkg in pkgids
paths = Base.find_all_in_cache_path(pkg)
sourcepath = Base.locate_package(pkg)
if sourcepath == nothing
# XXX: this isn't supposed to be fatal
pkgerror("couldn't find path to $(pkg.name) when trying to precompile project")
end
sourcepath == nothing && continue
# Heuristic for when precompilation is disabled
occursin(r"\b__precompile__\(\s*false\s*\)", read(sourcepath, String)) && continue
stale = true
for path_to_try in paths::Vector{String}
staledeps = Base.stale_cachefile(sourcepath, path_to_try)
Expand Down
2 changes: 1 addition & 1 deletion stdlib/Pkg/src/Operations.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1046,7 +1046,7 @@ function build_versions(ctx::Context, uuids::Vector{UUID}; might_need_to_resolve
"""
cmd = ```
$(Base.julia_cmd()) -O0 --color=no --history-file=no
--startup-file=$(Base.JLOptions().startupfile != 2 ? "yes" : "no")
--startup-file=$(Base.JLOptions().startupfile == 1 ? "yes" : "no")
--compiled-modules=$(Bool(Base.JLOptions().use_compiled_modules) ? "yes" : "no")
--eval $code
```
Expand Down
1 change: 0 additions & 1 deletion stdlib/Pkg/src/REPLMode.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1246,7 +1246,6 @@ Create a project called `pkgname` in the current folder.
precompile
Precompile all the dependencies of the project by running `import` on all of them in a new process.
The `startup.jl` file is disabled during precompilation unless julia is started with `--startup-file=yes`.
""",
),( CMD_STATUS,
["status", "st"],
Expand Down

0 comments on commit 48f53d5

Please sign in to comment.