Using Package in startup.jl causes build problems

I have a bunch of using statements in my startup.jl. It seems this is causing problems when other packages are building. An example below. If I remove using Plots from startup.jlthe problem goes away. I remember having this same problem a long time ago where.juliarc.jl` was loaded when the package manager was updating things, but it was solved. Is this intended or known behavor?

 Building WebIO → `~/.julia/packages/WebIO/myl19/deps/build.log`
┌ Error: Error building `WebIO`: 
│ ERROR: LoadError: ArgumentError: Package Plots not found in current path:
│ - Run `Pkg.add("Plots")` to install the Plots package.
│ 
│ Stacktrace:
│  [1] require(::Module, ::Symbol) at ./loading.jl:817
│  [2] include at ./boot.jl:317 [inlined]
│  [3] include_relative(::Module, ::String) at ./loading.jl:1038
│  [4] include at ./sysimg.jl:29 [inlined]
│  [5] include_ifexists at ./client.jl:201 [inlined]
│  [6] load_julia_startup() at ./client.jl:298
│  [7] exec_options(::Base.JLOptions) at ./logging.jl:312
│  [8] _start() at ./client.jl:432
│ in expression starting at /local/home/fredrikb/.julia/config/startup.jl:5
└ @ Pkg.Operations /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v0.7/Pkg/src/Operations.jl:1068
  Building Blink → `~/.julia/packages/Blink/vKGzM/deps/build.log`
┌ Error: Error building `Blink`: 
│ ERROR: LoadError: ArgumentError: Package Plots not found in current path:
│ - Run `Pkg.add("Plots")` to install the Plots package.
│ 
│ Stacktrace:
│  [1] require(::Module, ::Symbol) at ./loading.jl:817
│  [2] include at ./boot.jl:317 [inlined]
│  [3] include_relative(::Module, ::String) at ./loading.jl:1038
│  [4] include at ./sysimg.jl:29 [inlined]
│  [5] include_ifexists at ./client.jl:201 [inlined]
│  [6] load_julia_startup() at ./client.jl:298
│  [7] exec_options(::Base.JLOptions) at ./logging.jl:312
│  [8] _start() at ./client.jl:432
│ in expression starting at /local/home/fredrikb/.julia/config/startup.jl:5
└ @ Pkg.Operations /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v0.7/Pkg/src/Operations.jl:1068

Make your startup.jl look like this:

try
    @eval using Plots
catch err
    nothing
end

Or, instead of nothing, you could have it emit a warning.

Taken from here:
https://github.com/KristofferC/OhMyREPL.jl/issues/68

2 Likes

This is fixed in julia 1.0.1.

2 Likes