JuliaLang / PackageCompiler.jl

Compile your Julia Package
https://julialang.github.io/PackageCompiler.jl/dev/
MIT License
1.42k stars 190 forks source link

Interaction error? #182

Closed musm closed 4 years ago

musm commented 5 years ago

(v1.1) pkg> st
    Status `C:\Users\Mus\.julia\environments\v1.1\Project.toml`
  [537997a7] AbstractPlotting v0.9.4
  [79e6a3ab] Adapt v0.4.2
  [7d9fca2a] Arpack v0.3.0
  [39de3d68] AxisArrays v0.3.0
  [6e4b80f9] BenchmarkTools v0.4.2
  [b99e7846] BinaryProvider v0.5.3
  [3895d2a7] CUDAapi v0.5.4
  [c5f51814] CUDAdrv v1.0.1
  [be33ccc6] CUDAnative v1.0.1
  [159f3aea] Cairo v0.5.6
  [7057c7e9] Cassette v0.2.2
  [40e3b903] Clang v0.8.1
  [5ae59095] Colors v0.9.5
  [861a8166] Combinatorics v0.7.0
  [34da2185] Compat v1.5.1
  [8f4d0f93] Conda v1.2.0
  [3a865a2d] CuArrays v0.9.1
  [1f15a43c] CxxWrap v0.8.1
  [a93c6f00] DataFrames v0.17.1
  [864edb3b] DataStructures v0.15.0
  [0c46a032] DifferentialEquations v6.2.0
  [aaf54ef3] DistributedArrays v0.6.0
  [31c24e10] Distributions v0.16.4
  [e30172f5] Documenter v0.21.2
  [61744808] DynamicalSystems v1.1.0
  [8f5d6c58] EzXML v0.9.0
  [7a1cc6ca] FFTW v0.2.4
  [53c48c17] FixedPointNumbers v0.5.3
  [587475ba] Flux v0.7.3
  [186bb1d3] Fontconfig v0.2.0
  [f6369f11] ForwardDiff v0.10.2
  [b38be410] FreeType v2.1.1
  [663a7486] FreeTypeAbstraction v0.4.2
  [f7f18e0c] GLFW v2.3.0
  [e9467ef8] GLMakie v0.0.4
  [0c68f7d7] GPUArrays v0.6.1
  [28b8d3ca] GR v0.37.0
  [c91e804a] Gadfly v1.0.1
  [4d00f742] GeometryTypes v0.7.2
  [a2cc645c] GraphPlot v0.3.1
  [f67ccb44] HDF5 v0.11.0
  [cd3eb016] HTTP v0.8.0
  [7073ff75] IJulia v1.16.0
  [6a3955dd] ImageFiltering v0.5.3
  [6218d12a] ImageMagick v0.7.1
  [6deec6e2] IndexedTables v0.10.0
  [d0351b0e] InspectDR v0.3.3
  [682c06a0] JSON v0.20.0
  [b964fa9f] LaTeXStrings v1.0.3
  [2ee39098] LabelledArrays v0.4.0
  [2b0e0bc5] LanguageServer v0.5.1
  [522f3ed2] LibExpat v0.5.0
  [093fc24a] LightGraphs v1.2.0
  [9c8b4983] LightXML v0.8.0
  [ae8d54c2] Luxor v1.1.5
  [10e44e05] MATLAB v0.7.3
  [1914dd2f] MacroTools v0.4.4
  [ee78f7c6] Makie v0.9.1
  [dbd62bd0] MakieGallery v0.0.2
  [66fc600b] ModernGL v1.0.0
  [872c559c] NNlib v0.4.3
  [8d0e9305] Nuklear v0.1.0
  [510215fc] Observables v0.2.3
  [5fb14364] OhMyREPL v0.5.0
  [429524aa] Optim v0.17.2
  [bac558e1] OrderedCollections v1.0.2
  [1dea7af3] OrdinaryDiffEq v5.0.0
  [9b87118b] PackageCompiler v0.6.3
  [14b8a8f1] PkgTemplates v0.4.1
  [91a5bcdd] Plots v0.23.0
  [438e738f] PyCall v1.18.5
  [d330b81b] PyPlot v2.7.0
  [ce6b1742] RDatasets v0.6.1
  [a223df75] Reactive v0.8.3
  [ee283ea6] Rebugger v0.2.2
  [ae029012] Requires v0.5.2
  [295af30f] Revise v1.0.2
  [fdea26ae] SIMD v2.3.0
  [3e6341c9] SLEEF v0.5.1
  [276daf66] SpecialFunctions v0.7.2
  [90137ffa] StaticArrays v0.10.2
  [65254759] StatsMakie v0.0.2
  [789caeaf] StochasticDiffEq v6.0.0
  [fd094767] Suppressor v0.1.1
  [24249f21] SymPy v0.8.3
  [b4f28e30] TikzGraphs v1.0.1
  [37f6aa50] TikzPictures v3.0.4
  [37b6cedf] Traceur v0.3.0
  [b8865327] UnicodePlots v1.1.0
  [1986cc42] Unitful v0.14.0
  [e88e6eb3] Zygote v0.1.0
  [37e2e46d] LinearAlgebra
  [d6f4376e] Markdown
  [8dfed614] Test

julia> versioninfo()
Julia Version 1.1.0
Commit 80516ca202 (2019-01-21 21:24 UTC)
Platform Info:
  OS: Windows (x86_64-w64-mingw32)
  CPU: Intel(R) Core(TM) i7-4510U CPU @ 2.00GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-6.0.1 (ORCJIT, haswell)
Environment:
  JULIA_EDITOR = subl
  JULIA_NUM_THREADS = 4

julia> using PackageCompiler; PackageCompiler.compile_incremental(:AbstractPlotting)
  Updating registry at `C:\Users\Mus\.julia\registries\General`
  Updating git-repo `https://github.com/JuliaRegistries/General.git`
 Resolving package versions...
  Updating `C:\Users\Mus\.julia\packages\PackageCompiler\oT98U\packages\AbstractPlotting\Project.toml`
  [a2cac450] + ColorBrewer v0.4.0
  [3da002f7] + ColorTypes v0.7.5
  [5ae59095] + Colors v0.9.5
  [d38c429a] + Contour v0.5.1
  [5789e2e9] + FileIO v1.0.5
  [53c48c17] + FixedPointNumbers v0.5.3
  [b38be410] + FreeType v2.1.1
  [663a7486] + FreeTypeAbstraction v0.4.2
  [4d00f742] + GeometryTypes v0.7.2
  [6218d12a] + ImageMagick v0.7.1
  [8197267c] + IntervalSets v0.3.1
  [510215fc] + Observables v0.2.3
  [19eb6ba3] + Packing v0.3.0
  [995b91a9] + PlotUtils v0.5.5
  [992d4aef] + Showoff v0.2.1
  [73760f76] + SignedDistanceFields v0.4.0
  [90137ffa] + StaticArrays v0.10.2
  [1cfade01] + UnicodeFun v0.4.0
  [37e2e46d] + LinearAlgebra
  [d6f4376e] + Markdown
  [de0858da] + Printf
  [9a3f8284] + Random
  [9e88b42a] + Serialization
  [10745b16] + Statistics
  Updating `C:\Users\Mus\.julia\packages\PackageCompiler\oT98U\packages\AbstractPlotting\Manifest.toml`
  [621f4979] + AbstractFFTs v0.3.2
  [9e28174c] + BinDeps v0.8.10
  [b99e7846] + BinaryProvider v0.5.3
  [a2cac450] + ColorBrewer v0.4.0
  [3da002f7] + ColorTypes v0.7.5
  [c3611d14] + ColorVectorSpace v0.6.2
  [5ae59095] + Colors v0.9.5
  [34da2185] + Compat v1.5.1
  [8f4d0f93] + Conda v1.2.0
  [d38c429a] + Contour v0.5.1
  [864edb3b] + DataStructures v0.15.0
  [7a1cc6ca] + FFTW v0.2.4
  [5789e2e9] + FileIO v1.0.5
  [53c48c17] + FixedPointNumbers v0.5.3
  [b38be410] + FreeType v2.1.1
  [663a7486] + FreeTypeAbstraction v0.4.2
  [4d00f742] + GeometryTypes v0.7.2
  [a2bd30eb] + Graphics v0.4.0
  [a09fc81d] + ImageCore v0.7.4
  [6218d12a] + ImageMagick v0.7.1
  [8197267c] + IntervalSets v0.3.1
  [c8e1da08] + IterTools v1.1.1
  [682c06a0] + JSON v0.20.0
  [dbb5928d] + MappedArrays v0.2.1
  [e1d29d7a] + Missings v0.4.0
  [77ba4419] + NaNMath v0.3.2
  [510215fc] + Observables v0.2.3
  [6fe1bfb0] + OffsetArrays v0.10.0
  [bac558e1] + OrderedCollections v1.0.2
  [19eb6ba3] + Packing v0.3.0
  [5432bcbf] + PaddedViews v0.4.2
  [995b91a9] + PlotUtils v0.5.5
  [189a3867] + Reexport v0.2.0
  [992d4aef] + Showoff v0.2.1
  [73760f76] + SignedDistanceFields v0.4.0
  [a2af1166] + SortingAlgorithms v0.3.1
  [276daf66] + SpecialFunctions v0.7.2
  [90137ffa] + StaticArrays v0.10.2
  [2913bbd2] + StatsBase v0.27.0
  [30578b45] + URIParser v0.4.0
  [1cfade01] + UnicodeFun v0.4.0
  [81def892] + VersionParsing v1.1.3
  [2a0f44e3] + Base64
  [ade2ca70] + Dates
  [8bb1440f] + DelimitedFiles
  [8ba89e20] + Distributed
  [b77e0a4c] + InteractiveUtils
  [76f85450] + LibGit2
  [8f399da3] + Libdl
  [37e2e46d] + LinearAlgebra
  [56ddb016] + Logging
  [d6f4376e] + Markdown
  [a63ad114] + Mmap
  [44cfe95a] + Pkg
  [de0858da] + Printf
  [3fa0cd96] + REPL
  [9a3f8284] + Random
  [ea8e919c] + SHA
  [9e88b42a] + Serialization
  [1a1011a3] + SharedArrays
  [6462fe0b] + Sockets
  [2f01184e] + SparseArrays
  [10745b16] + Statistics
  [8dfed614] + Test
  [cf7118a7] + UUIDs
  [4ec0a83e] + Unicode
 Resolving package versions...
  Updating `C:\Users\Mus\.julia\packages\PackageCompiler\oT98U\packages\AbstractPlotting\Project.toml`
  [9b87118b] + PackageCompiler v0.6.3
  [44cfe95a] + Pkg
  Updating `C:\Users\Mus\.julia\packages\PackageCompiler\oT98U\packages\AbstractPlotting\Manifest.toml`
  [c7e460c6] + ArgParse v0.6.1
  [e1450e63] + BufferedStreams v1.0.0
  [0862f596] + HTTPClient v0.2.1
  [b27032c2] + LibCURL v0.4.1
  [522f3ed2] + LibExpat v0.5.0
  [2ec943e9] + Libz v1.0.0
  [9b87118b] + PackageCompiler v0.6.3
  [b718987f] + TextWrap v0.3.0
  [c17dfb99] + WinRPM v0.4.2
[ Info: activating new environment at C:\Users\Mus\.julia\packages\PackageCompiler\oT98U\packages\AbstractPlotting\Project.toml.
  Updating registry at `C:\Users\Mus\.julia\registries\General`
  Updating git-repo `https://github.com/JuliaRegistries/General.git`
[ Info: used 251 out of 251 precompile statements
┌ Info: activating new environment at C:\Users\Mus\.julia\packages\PackageCompiler\oT98U\packages\Project.toml.
└ @ Pkg.API C:\cygwin\home\Administrator\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.1\Pkg\src\API.jl:519
  Updating registry at `C:\Users\Mus\.julia\registries\General`
  Updating git-repo `https://github.com/JuliaRegistries/General.git`
WARNING: both Contour and AbstractPlotting export "Contour"; uses of it in module anonymous must be qualified
ERROR: LoadError: LoadError: UndefVarError: Contour not defined
Stacktrace:
 [1] top-level scope at .\none:0
 [2] include at .\boot.jl:326 [inlined]
 [3] include_relative(::Module, ::String) at .\loading.jl:1038
 [4] include(::Module, ::String) at .\sysimg.jl:29
 [5] top-level scope at none:0
in expression starting at C:\Users\Mus\.julia\packages\PackageCompiler\oT98U\packages\incremental_precompile.jl:18
in expression starting at C:\Users\Mus\.julia\packages\PackageCompiler\oT98U\sysimg\run_julia_code.jl:10
ERROR: failed process: Process(`'C:\tools\Julia\julia-1.x\bin\julia.exe' --optimize=3 '--output-o=C:\Users\Mus\.julia\packages\PackageCompiler\oT98U\sysimg\sys.a' -g1 --track-allocation=none --startup-file=no --code-coverage=none --history-file=yes --inline=yes --math-mode=ieee --handle-signals=yes --warn-overwrite=no --compile=yes --depwarn=yes --cpu-target=native --track-allocation=none --sysimage-native-code=yes '--sysimage=C:\tools\Julia\julia-1.x\lib\julia\sys.dll' -g1 --compiled-modules=yes --optimize=2 'C:\Users\Mus\.julia\packages\PackageCompiler\oT98U\sysimg\run_julia_code.jl'`, ProcessExited(1)) [1]
Stacktrace:
 [1] error(::String, ::Base.Process, ::String, ::Int64, ::String) at .\error.jl:42
 [2] pipeline_error at .\process.jl:785 [inlined]
 [3] #run#515(::Bool, ::Function, ::Cmd) at .\process.jl:726
 [4] run at .\process.jl:724 [inlined]
 [5] #run_julia#1 at C:\Users\Mus\.julia\packages\PackageCompiler\oT98U\src\compiler_flags.jl:225 [inlined]
 [6] #run_julia at .\none:0 [inlined]
 [7] #compile_incremental#62(::Bool, ::Bool, ::Bool, ::Nothing, ::Function, ::String, ::String) at C:\Users\Mus\.julia\packages\PackageCompiler\oT98U\src\incremental.jl:82
 [8] compile_incremental at C:\Users\Mus\.julia\packages\PackageCompiler\oT98U\src\incremental.jl:79 [inlined]
 [9] #compile_incremental#63 at C:\Users\Mus\.julia\packages\PackageCompiler\oT98U\src\incremental.jl:109 [inlined]
 [10] compile_incremental(::Symbol) at C:\Users\Mus\.julia\packages\PackageCompiler\oT98U\src\incremental.jl:108
 [11] top-level scope at none:0
musm commented 5 years ago

I tried debugging: I ran all the statements in the increment_precompile.jl file in a REPL and they all worked without throwing any errors

SimonDanisch commented 5 years ago

can you post what's around: C:\Users\Mus.julia\packages\PackageCompiler\oT98U\packages\incremental_precompile.jl:18

musm commented 5 years ago

# We need to use all used packages in the precompile file for maximum
# usage of the precompile statements.
# Since this can be any recursive dependency of the package we AOT compile,
# we decided to just use them without installing them. An added
# benefit is, that we can call __init__ this way more easily, since
# incremental sysimage compilation won't call __init__ on `using`
# https://github.com/JuliaLang/julia/issues/22910
using Pkg, Test, Random, Serialization, Packing, SignedDistanceFields, PlotUtils, ImageMagick, GeometryTypes, StaticArrays, Markdown, Statistics, Observables, Showoff, IntervalSets, FixedPointNumbers, LinearAlgebra, FreeType, ColorTypes, AbstractPlotting, ColorBrewer, Colors, FileIO, UnicodeFun, PackageCompiler, FreeTypeAbstraction, Contour, Printf
for Mod in [Pkg, Test, Random, Serialization, Packing, SignedDistanceFields, PlotUtils, ImageMagick, GeometryTypes, StaticArrays, Markdown, Statistics, Observables, Showoff, IntervalSets, FixedPointNumbers, LinearAlgebra, FreeType, ColorTypes, AbstractPlotting, ColorBrewer, Colors, FileIO, UnicodeFun, PackageCompiler, FreeTypeAbstraction, Contour, Printf]
    isdefined(Mod, :__init__) && Mod.__init__()
end

# bring recursive dependencies of used packages and standard libraries into namespace
for Mod in Base.loaded_modules_array()
    if !Core.isdefined(@__MODULE__, nameof(Mod))
        Core.eval(@__MODULE__, Expr(:const, Expr(:(=), nameof(Mod), Mod)))
    end
end