# Errors when creating sysimage

**URL:** https://discourse.julialang.org/t/errors-when-creating-sysimage/104801
**Category:** General Usage
**Created:** [October 10, 2023, 11:49am UTC](https://discourse.julialang.org/t/errors-when-creating-sysimage/104801 "2023-10-10T11:49:31Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Kruxigt](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kruxigt/32/11694_2.png) [@Kruxigt](https://discourse.julialang.org/u/Kruxigt)
#### Post date: [October 10, 2023, 11:49am UTC](https://discourse.julialang.org/t/errors-when-creating-sysimage/104801/1 "2023-10-10T11:49:31Z")

</div>

Hi good folks!

I am trying to create a sysimage to distribute a package I have created. I also don’t want the source code of the package to be available. As a first step I am trying to create such a sysimage for the CSV package, just to try things out before I try it with my own package.

To remove the source code I am passing the `--strip-ir` command when creating the sysimage:  
`create_sysimage(["CSV"]; sysimage_path="CSVSysimageir.so", sysimage_build_args=Cmd(["--strip-ir"]))`

However, when I try to use the sysimage with `julia -JCSVSysimageir.so --startup-file=no`, then as soon as I move the cursor a bit in the REPL I get the following error

> source not available for (::REPL.LineEdit.var"#27#28"{REPL.LineEdit.var"#156#212", String})(Any, Any) from (::REPL.LineEdit.var"#27#28"{f, c})(Any, Any)  
> source not available for (::Type{NamedTuple{(:exception,), T} where T\<:Tuple})(Tuple{Tuple{ErrorException, Array{Union{Ptr{Nothing}, Base.InterpreterIP}, 1}}}) from (::Type{NamedTuple{names, T} where T\<:Tuple})(Tuple) where {names}  
> source not available for logging\_error(Any, Any, Any, Any, Any, Any, Any, Any, Bool) from logging\_error(Any, Any, Any, Any, Any, Any, Any, Any, Bool)  
> source not available for (::Type{NamedTuple{(:exception, :backtrace), T} where T\<:Tuple})(Tuple{ErrorException, Array{Union{Ptr{Nothing}, Base.InterpreterIP}, 1}}) from (::Type{NamedTuple{names, T} where T\<:Tuple})(Tuple) where {names}  
> source not available for (::Type{NamedTuple{(:exception, :backtrace), T} where T\<:Tuple})(Tuple{ErrorException, Array{Union{Ptr{Nothing}, Base.InterpreterIP}, 1}}) from (::Type{NamedTuple{names, T} where T\<:Tuple})(Tuple) where {names}  
> source not available for print(Core.CoreSTDERR, String) from print(IO, String)  
> source not available for (::REPL.var"#60#66"{REPL.REPLBackendRef})() from (::REPL.var"#60#66"{backend\_ref})()  
> ^Cfatal: error thrown and no exception handler available.  
> InterruptException()

How do I avoid this? I don’t need to strip IR from everything by the way. It would be enough for just CSV in this case.

Thanks in advance!

---

<div class="post-metadata">

### Author: ![Kruxigt](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kruxigt/32/11694_2.png) [@Kruxigt](https://discourse.julialang.org/u/Kruxigt)
#### Post date: [October 10, 2023, 4:40pm UTC](https://discourse.julialang.org/t/errors-when-creating-sysimage/104801/2 "2023-10-10T16:40:33Z")

</div>

OK so I solved that problem by adding the flag `--combile=all`. However. If I compile the sysimage with `--strip-ir --strip-metadata --compile=all` and then open it, I still am able to view the source code with for example @less CSV.read(“test”). How do I get rid of that?
