# Adding a \`userimg.jl\` to base for custom build

**URL:** <https://discourse.julialang.org/t/adding-a-userimg-jl-to-base-for-custom-build/3180>\
**Category:** General Usage\
**Created:** [April 12, 2017, 1:39pm UTC](https://discourse.julialang.org/t/adding-a-userimg-jl-to-base-for-custom-build/3180 "2017-04-12T13:39:09Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![m-j-w](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/m-j-w/32/4541_2.png) [@m-j-w](https://discourse.julialang.org/u/m-j-w)\
**Post date:** [April 12, 2017, 1:39pm UTC](https://discourse.julialang.org/t/adding-a-userimg-jl-to-base-for-custom-build/3180/1 "2017-04-12T13:39:09Z")

</div>

I’ve started trying to use a user image to add default packages, make the REPL a bit more responsive after start and implement a few custom changes to base. I’m now also primarily using Julia 0.6 master, rebuilding more or less on a daily basis. Hence, I want to avoid building the system image twice and not use the `build_sysimg.jl` script.

The current setup is basically a local git branch that is rebased after each pull on top of master, including the build configuration and the mentioned additional customizations.

However, in doing so, I ran into a few fundamental issues in understanding how user images are supposed to work; and the manual is a bit short there.

What can and should go into a `base/userimg.jl`? Just `using` statements or also real code? Can I define new modules there or should these go into separate packages?  
If separate packages, then were should I place those on disk, such that after building the sysimg the source files would still be found e.g. by `@edit`? Can I add additional precompile statements? And finally, how do I prevent Julia trying to subsequently precompile packages ('precompiling stale cache files`) that I already included in the user image?

I would assume that for the last points I should place those packages into some other directory than the default `Pkg.dir()`?

Thanks in advance for any advice!
