Open andrea993 opened 12 months ago
How did you install Julia?
I'm using the package Julia-bin from AUR https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=julia-bin That should download the official release
@andrea993 , I think the problem is in the file examples/MyLib/build/Manifest.toml
, in this section:
[[PackageCompiler]]
deps = ["Artifacts", "Glob", "LazyArtifacts", "Libdl", "Pkg", "Printf", "RelocatableFolders", "TOML", "UUIDs"]
path = "../../.."
uuid = "9b87118b-4619-50d2-8e1e-99f35a4d4d9d"
version = "2.1.7"
I got this problem too. If you copy the examples/MyLib
outside the PackageCompiler repo, this relative path ../../..
breaks. So I deleted this line and then it worked.
Begin edit
I forgot to say that after deleting the line, I started the Julia REPL and reinstalled the PackageCompiler:
julia> ]
(@v1.10) pkg> activate build/
Activating project at `~/Sources/MyLib/build`
(build) pkg> st
Status `~/Sources/MyLib/build/Project.toml`
ERROR: Could not locate the source code for the PackageCompiler package. Are you trying to use a manifest generated by a different version of Julia?
(build) pkg> remove PackageCompiler
[...]
(build) pkg> add PackageCompiler
[...]
And then it worked.
End edit
However, I ended with another problem:
gcc my_application.c -o my_application.out -I"MyLibCompiled"/include -L"MyLibCompiled"/lib -ljulia -lmylib
/usr/bin/ld: /tmp/cc0RSZVq.o: in function `main':
my_application.c:(.text+0x26): undefined reference to `increment32'
collect2: error: ld returned 1 exit status
make: *** [Makefile:20: build-executable] Error 1
When inspecting the generated library, I noticed that increment32
is marked as a LOCAL symbol:
~/S/P/e/MyLib (master)> readelf MyLibCompiled/lib/libmylib.so -s | grep -i increment32
21758: 0000000000167b10 281 FUNC LOCAL DEFAULT 11 increment32
~/S/P/e/MyLib (master)> readelf MyLibCompiled/lib/libmylib.so -s | grep -i _julia
110: 0000000000568390 5 FUNC GLOBAL DEFAULT 11 shutdown_julia
118: 0000000000568330 93 FUNC GLOBAL DEFAULT 11 init_julia
1391: 0000000000320170 70 FUNC LOCAL DEFAULT 11 jfptr_load_julia[...]
5157: 00000000001bc830 576 FUNC LOCAL DEFAULT 11 julia_load_julia[...]
24793: 0000000000568390 5 FUNC GLOBAL DEFAULT 11 shutdown_julia
24878: 0000000000568330 93 FUNC GLOBAL DEFAULT 11 init_julia
Does anyone have an idea on how I can mark the symbol increment32
as global?
Edit 2:
Nevermind. Actually, this symbol problem happens only in Julia 1.10-beta2. It worked in Julia 1.9.3.
I already solved the .toml
error directly deleting the file (as I wrote) but the real problem of this topic is about the error
ERROR: LoadError: IOError: open("/usr/lib/ssh/ssh-keysign", 0, 0): permission denied (EACCES)
I have the same error also if I try to build package written by myself without root
Ok. I was able to reproduce your problem and I think I found the cause:
[10] bundle_julia_libraries(dest_dir::String)
@ PackageCompiler ~/.julia/packages/PackageCompiler/b2smD/src/PackageCompiler.jl:1118
In PackageCompiler.jl:1118
:
cp(julia_libdir(), app_libdir; force=true)
For distribuition packages / system installations like julia-bin
in AUR, the package compiler will try to copy the entire /usr/bin
directory to MyLibCompiled
folder, since julia_libdir()
evaluates to "/usr/lib" (at least on my computer).
julia> isdebugbuild() = ccall(:jl_is_debugbuild, Cint, ()) != 0
isdebugbuild (generic function with 1 method)
julia> using Libdl
julia> function julia_libdir()
libname = isdebugbuild() ? "libjulia-debug" :
"libjulia"
return dirname(abspath(Libdl.dlpath(libname)))
end
julia_libdir (generic function with 1 method)
julia> julia_libdir()
"/usr/lib"
Although it is not the problem cause itself, copying the entire "/usr/lib" directory seems as an undesirable behavior.
Thanks this sound like an issue imho.
In other kinds of installation which is the output of julia_libdir()
?
In any case the aur package is only a script that download Julia from the official release and copy it to the system directories so I think that it's should not be a package problem. You can look at the package source that I linked
Manjaro (julia installed by sudo pacman -S julia
): "/usr/lib"
Juliaup: "/home/me/.julia/juliaup/julia-1.9.3+0.x64.linux.gnu/lib"
Julia docker image (docker run -it julia:1.9 bash
): "/usr/local/julia/lib"
PackageCompiler doesn't need dbus or cups libraries, which read permissions are denied, but it tries to copy the files anyway if they are in same directory as libjulia.so
.
I think this should be fixed now. Would be good if someone can confirm.
I use Arch Linux with Julia 1.9.3 and PackageCompiler v2.1.7. I'm trying to build the example "MyLib" from PackageCompiler source.
I installed PackageCompiler with
Pkg.Add('PackageCompiler')
I copied the "examples" directory and I tried to run
make
in the "MyLib" subdirectory I get the error:To avoid this problem I have deleted
build\Manifest.toml
I then tried again withmake
.I get the error:
The program is trying to run
/usr/lib/dbus-1.0/dbus-daemon-launch-helper
that is not executable by a normal userSo I tried again for test with
sudo -g dbus make
I get a new error
My user can run this file in theory
Definitely as root the
make
command works but not as user.