JuliaLang / PackageCompiler.jl

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

Too few special library names specified error when calling init_julia #830

Open reyntjesr opened 1 year ago

reyntjesr commented 1 year ago

I created a library with package compiler that I want to use on windows, For the code to work in windows I had to change the libjulia.dll like described in issue #658. When compiling and changing the libjulia.dll the compilation script produces the message below:

Info: Found embedded libpath │ libpath = │ 6-element Vector{SubString{String}}: │ "../bin/libgcc_s_seh-1.dll" │ "../bin/libopenlibm.dll" │ "@" │ "@../bin/libjulia-internal.dll" │ "@../bin/libjulia-codegen.dll" │ "" └ libpath_offset = 14337 ┌ Info: Filtered libpath │ libpath = │ 6-element Vector{AbstractString}: │ "libgcc_s_seh-1.dll" │ "libopenlibm.dll" │ "@" │ "@libjulia-internal.dll" │ "@libjulia-codegen.dll" └ ""

So the ../bin references in the libjulia.dll are removed.

It all used to work a few weeks ago but now I'm getting an error when calling init_julia. The error is: _ERROR: Too few special library names specified, check LOADER_BUILD_DEPLIBS and friends!

I searched for this error and it's called from the Julia cli and loader code: (lines where the error is called)

Do I get this error because of a new packagecompiler.jl version or Julia version? In the comments of the cli code is mentioned that it searches for 3 libraries with an @ prefix: libstdc++, libjulia-internal, libjulia-codegen. I see no libstdc++-6.dll file but there's a libstdc++-6.dll file. Could that be the problem? The libstdc++-6.dll is also missing in the libpath above. I'm a beginner with the Julia language so I'm just guessing here.

versioninfo() Julia Version 1.9.2 Commit e4ee485e90 (2023-07-05 09:39 UTC) Platform Info: OS: Windows (x86_64-w64-mingw32) CPU: 8 × Intel(R) Core(TM) i7-6700 CPU @ 3.40GHz WORD_SIZE: 64 LIBM: libopenlibm LLVM: libLLVM-14.0.6 (ORCJIT, skylake) Threads: 1 on 8 virtual cores Environment: JULIA_EDITOR = code JULIA_NUM_THREADS =

KristofferC commented 1 year ago

Do I get this error because of a new packagecompiler.jl version or Julia version?

You could try go back to either an earlier PackageCompiler or julia version and see if the problem still occurs and thereby see what change caused the error.

reyntjesr commented 1 year ago

I don't know what I did but the original error is gone but now I'm getting other errors. At first I got an error:

fatal: error thrown and no exception handler available.
InitError(mod=:fzf_jll, error=ErrorException("Artifact "fzf" was not found by looking in the path "C:\Users\rreij\OneDrive\Documenten\Julia\testing\PackageCompiler\MyLib\ConsoleApp\bin\Debug\share\julia\artifacts\f6c03516faa072e36705d507fd333114e66ca189". Try `using Pkg; Pkg.instantiate()` to re-install all missing resources if the artifact is part of a package or call `Pkg.ensure_artifact_installed` (https://pkgdocs.julialang.org/v1/api/#Pkg.Artifacts.ensure_artifact_installed) if not."))
error at .\error.jl:35
_artifact_str at C:\Users\rreij\AppData\Local\Programs\Julia-1.9.2\share\julia\stdlib\v1.9\Artifacts\src\Artifacts.jl:569
unknown function (ip: 0000018f8a1d5fd4)
jl_apply at C:/workdir/src\julia.h:1879 [inlined]
jl_f__call_latest at C:/workdir/src\builtins.c:774
#invokelatest#2 at .\essentials.jl:816 [inlined]
invokelatest at .\essentials.jl:813 [inlined]
macro expansion at C:\Users\rreij\AppData\Local\Programs\Julia-1.9.2\share\julia\stdlib\v1.9\Artifacts\src\Artifacts.jl:703 [inlined]
find_artifact_dir at C:\Users\rreij\.julia\packages\JLLWrappers\QpMQW\src\wrapper_generators.jl:17 [inlined]
__init__ at C:\Users\rreij\.julia\packages\fzf_jll\lUgCJ\src\wrappers\x86_64-w64-mingw32.jl:7
jfptr___init___45569 at C:\Users\rreij\OneDrive\Documenten\Julia\testing\PackageCompiler\MyLib\ConsoleApp\bin\Debug\net7.0-windows\libinc.dll (unknown line)
jl_apply at C:/workdir/src\julia.h:1879 [inlined]
jl_module_run_initializer at C:/workdir/src\toplevel.c:75
_finish_julia_init at C:/workdir/src\init.c:855
init_julia at C:\Users\rreij\OneDrive\Documenten\Julia\testing\PackageCompiler\MyLib\ConsoleApp\bin\Debug\net7.0-windows\libinc.dll (unknown line)
unknown function (ip: 00007ff8f4d19ca1)
unknown function (ip: 00007ff8f4d17fe1)
coreclr_shutdown_2 at C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.9\coreclr.dll (unknown line)
unknown function (ip: 00007ff9546a38f4)
MetaDataGetDispenser at C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.9\coreclr.dll (unknown line)
MetaDataGetDispenser at C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.9\coreclr.dll (unknown line)
MetaDataGetDispenser at C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.9\coreclr.dll (unknown line)
unknown function (ip: 00007ff954719ddd)
coreclr_execute_assembly at C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.9\coreclr.dll (unknown line)
unknown function (ip: 00007ffa4abe9949)
unknown function (ip: 00007ffa4abe9c1b)
corehost_main at C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.9\hostpolicy.dll (unknown line)
hostfxr_close at C:\Program Files\dotnet\host\fxr\7.0.9\hostfxr.dll (unknown line)
hostfxr_close at C:\Program Files\dotnet\host\fxr\7.0.9\hostfxr.dll (unknown line)
hostfxr_close at C:\Program Files\dotnet\host\fxr\7.0.9\hostfxr.dll (unknown line)
hostfxr_close at C:\Program Files\dotnet\host\fxr\7.0.9\hostfxr.dll (unknown line)
hostfxr_main_startupinfo at C:\Program Files\dotnet\host\fxr\7.0.9\hostfxr.dll (unknown line)
unknown function (ip: 00007ff6d7eb2a7f)
unknown function (ip: 00007ff6d7eb2dfa)
unknown function (ip: 00007ff6d7eb42a7)
BaseThreadInitThunk at C:\WINDOWS\System32\KERNEL32.DLL (unknown line)
RtlUserThreadStart at C:\WINDOWS\SYSTEM32\ntdll.dll (unknown line)

But after I copied the share and include folders to one folder below my program folder, this error stopped recurring. Is there also a hardcoded ../share relative path in another library?

After this error was solved I got a new one:

fatal: error thrown and no exception handler available.
InitError(mod=:OhMyREPL, error=LoadError(at "C:\Users\rreij\.julia\packages\OhMyREPL\h1QCu\src\refresh_lines.jl" line 1: ArgumentError(msg="Package OhMyREPL does not have REPL in its dependencies:
- You may have a partially installed environment. Try `Pkg.instantiate()`
  to ensure all packages in the environment are installed.
- Or, if you have OhMyREPL checked out for development and have
  added REPL 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 OhMyREPL")))
macro expansion at .\loading.jl:1634 [inlined]
macro expansion at .\lock.jl:267 [inlined]
require at .\loading.jl:1611
jfptr_require_43650 at C:\Users\rreij\OneDrive\Documenten\Julia\testing\PackageCompiler\MyLib\ConsoleApp\bin\Debug\net7.0-windows\libinc.dll (unknown line)

I have OhMyREPL installed on my system, so I don't know why I get this error.