# Warnings upon loading a custom sysimage

**URL:** <https://discourse.julialang.org/t/warnings-upon-loading-a-custom-sysimage/50141>\
**Category:** New to Julia\
**Tags:** sysimage\
**Created:** [November 14, 2020, 12:55pm UTC](https://discourse.julialang.org/t/warnings-upon-loading-a-custom-sysimage/50141 "2020-11-14T12:55:58Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Peter\_Adelman](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/peter_adelman/32/11907_2.png) [@Peter\_Adelman](https://discourse.julialang.org/u/Peter_Adelman)\
**Post date:** [November 14, 2020, 12:55pm UTC](https://discourse.julialang.org/t/warnings-upon-loading-a-custom-sysimage/50141/1 "2020-11-14T12:55:58Z")

</div>

I have a script (simplified a bit [here](https://gist.github.com/Byrth/998e38b7af1d4ca9669711afb0876c8d)) that I use to make a custom sysimage with over 100 packages, including Weave. It has been amazingly useful for speeding up development / tests and works great.

It parses the Manifest of the current package and making a [new Project.toml](https://gist.github.com/Byrth/7a3c7fe4e7f26dd5b46166d77e1803aa) with all those indirect dependencies now explicit. In practice, I also exclude locally dev’d packages from this, which is why I do not use the Project.toml directly.

My weekend problem, however, is trying to figure out why it throws warnings like this whenever I start julia:

```julia
Warning: Error requiring Plots from Weave:
LoadError: ArgumentError: Package Weave does not have Base64 in its dependencies:
If you have Weave checked out for development and have
added Base64 as a dependency but haven't updated your primary
environment's manifest file, try `Pkg.resolve()`. - Otherwise you may need to report an issue with Weave
  Stacktrace:
  [1] require(::Module, ::Symbol) at ./loading.jl:906
  [2] include(::Function, ::Module, ::String) at ./Base.jl:380
  [3] include(::Module, ::String) at ./Base.jl:368
  [4] top-level scope at /root/.julia/packages/Requires/vyVBT/src/Requires.jl:22
  [5] eval at ./boot.jl:331 [inlined]
  [6] eval at /root/.julia/packages/Weave/BarbQ/src/Weave.jl:1 [inlined]
  [7] (::Weave.var"#3#9")() at /root/.julia/packages/Requires/vyVBT/src/require.jl:97
  [8] err(::Any, ::Module, ::String) at /root/.julia/packages/Requires/vyVBT/src/require.jl:42
  [9] (::Weave.var"#2#8")() at /root/.julia/packages/Requires/vyVBT/src/require.jl:96
  [10] withpath(::Any, ::String) at /root/.julia/packages/Requires/vyVBT/src/require.jl:32
  [11] (::Weave.var"#1#7")() at /root/.julia/packages/Requires/vyVBT/src/require.jl:95
  [12] listenpkg(::Any, ::Base.PkgId) at /root/.julia/packages/Requires/vyVBT/src/require.jl:15
  [13] macro expansion at /root/.julia/packages/Requires/vyVBT/src/require.jl:93 [inlined]
  [14] __init__ () at /root/.julia/packages/Weave/BarbQ/src/Weave.jl:27
 in expression starting at /root/.julia/packages/Weave/BarbQ/src/plots.jl:3
 @ Requires ~/.julia/packages/Requires/vyVBT/src/require.jl:44

```

It’s harmless because Base64 is part of the image, but confusing because Base64 is part of Weave’s dependencies in my current Manifest.toml [and has been forever](https://github.com/JuliaRegistries/General/blob/master/W/Weave/Deps.toml).

I see the dreaded `Requires` in the stack trace, and Weave does indeed use Requires, but it uses it for [Plots and Gadfly](https://github.com/JunoLab/Weave.jl/blob/master/src/Weave.jl#L27), not Base64.

Base64 is required without qualifications [here](https://github.com/JunoLab/Weave.jl/blob/196d4ca7ce80e65f7365642218c43a8c94d5f286/src/run.jl#L1), and this file is directly `include()`d in the main file.

My best guess at the moment is:

1. PackageCompiler.jl is using some logic to untangle @requires calls and determine the order in which to compile things
2. Weave does not depend on Plots, and it only includes Base64 when it knows it is needed (not by Plots, because that is hidden behind an `@requires` and not listed as a Weave dependency, but by Weave directly in `run.jl`)
3. When the sysimage is deserialized, it correctly notes that Weave’s call to Plots cannot _yet_ access Base64 because `include("run.jl")` is after `@require Plots` in the file.
4. For some reason this is the error that is generated
5. When I embed a Base64 .png Plot with Weave.jl, it works anyway because Base64 is available almost immediately after this warning is thrown by the time that `run.jl` is hit.

Because you are inevitably who this question will go to, @kristoffer.carlsson, what do you think?

---

<div class="post-metadata">

**Author:** ![Peter\_Adelman](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/peter_adelman/32/11907_2.png) [@Peter\_Adelman](https://discourse.julialang.org/u/Peter_Adelman)\
**Post date:** [December 18, 2020, 3:34pm UTC](https://discourse.julialang.org/t/warnings-upon-loading-a-custom-sysimage/50141/2 "2020-12-18T15:34:21Z")

</div>

After continuing to use the same process to generate sysimages for a month, I observe that occasionally the warnings change and the resulting sysimage is always functional.

Is there just some way to suppress this warning on load? It mostly just annoys me when I Control-F for “error” in my Jenkins logs.
