Compile_package fails on nonregistered package

precompilation
#1

I am trying to use compile_package or compile_incremental from PackageCompiler.jl to compile an internal package that is not registered in METADATA. When trying compile_increemental, the process fails with

[ Info: used 227 out of 227 precompile statements
┌ Info: activating new environment at ~/.julia/packages/PackageCompiler/oT98U/packages/Project.toml.
└ @ Pkg.API /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.1/Pkg/src/API.jl:519
  Updating registry at `~/.julia/registries/General`
  Updating git-repo `https://github.com/JuliaRegistries/General.git`
ERROR: LoadError: LoadError: ArgumentError: Package Robotlab [8223e05c-3ffc-11e9-04f8-dd73b465bce1] is required but does not seem to be installed:
 - Run `Pkg.instantiate()` to install all recorded dependencies.

Stacktrace:
 [1] _require(::Base.PkgId) at ./loading.jl:929
 [2] require(::Base.PkgId) at ./loading.jl:858
 [3] require(::Module, ::Symbol) at ./loading.jl:853
 [4] include at ./boot.jl:326 [inlined]
 [5] include_relative(::Module, ::String) at ./loading.jl:1038
 [6] include(::Module, ::String) at ./sysimg.jl:29
 [7] top-level scope at none:0
in expression starting at /local/home/fredrikb/.julia/packages/PackageCompiler/oT98U/packages/incremental_precompile.jl:17
in expression starting at /local/home/fredrikb/.julia/packages/PackageCompiler/oT98U/sysimg/run_julia_code.jl:10

and when trying compile_package, the process fails with the same error and a segmentation fault at that. I can’t find any related issues in the repo for PackageCompiler. Is compilation of a non-registered package not supported or have I run into a bug?

The package in question (Robotlab.jl) passes tests and is usable locally.
Setup:

julia> versioninfo()
Julia Version 1.1.0
Commit 80516ca202 (2019-01-21 21:24 UTC)
Platform Info:
  OS: Linux (x86_64-pc-linux-gnu)
  CPU: Intel(R) Core(TM) i7-4790 CPU @ 3.60GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-6.0.1 (ORCJIT, haswell)
Environment:
  JULIA_NUM_THREADS = 4
  JULIA_SVG_BROWSER = Google Chrome.app

(v1.1) pkg> st
    Status `~/.julia/environments/v1.1/Project.toml`
  [9b87118b] PackageCompiler v0.6.3
  [d3a5d4b2] Robotlab v0.0.0 [`~/.julia/dev/Robotlab`]

Edit:
I just noticed that the last release is called fix for unregistered packages, unfortunately, it did not seem to fix the issue in my case :open_mouth:

0 Likes

#2

I think you need to push the path to your local package to Base.LOAD_PATH before calling compile_incremental (see here).

Should presumably be documented somewhere, so do open issues/PRs! :wink:

0 Likes

#3

Unfortunately, that does not solve the problem, after having pushed the following to LOAD_PATH, the same error persists

julia> LOAD_PATH
6-element Array{String,1}:
 "@"                                            
 "@v#.#"                                        
 "@stdlib"                                      
 "/local/home/fredrikb/.julia/dev/Robotlab/"    
 "/local/home/fredrikb/.julia/dev/"             
 "/local/home/fredrikb/.julia/dev/Robotlab/src/"
0 Likes