Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Julia 1.2.0 could not load library "libgit2" #33038

Closed
schwartx opened this issue Aug 23, 2019 · 5 comments
Closed

Julia 1.2.0 could not load library "libgit2" #33038

schwartx opened this issue Aug 23, 2019 · 5 comments
Labels
libgit2 The libgit2 library or the LibGit2 stdlib module

Comments

@schwartx
Copy link

schwartx commented Aug 23, 2019

My OS is Arch Linux x86_64 5.2.9-arch1-1-ARCH.
I installed julia 1.2.0 from archlinux official repositories
# pacman -S julia
but when i ran julia and tried to update the packages
$ julia
]update

it came an error, i looked it up and simply followed this issue
i deleted the entire dictionary ~/.julia/registries/General/
$ rm -rf ~/.julia/registries/General/

then, i went back to update the packages again:
$ julia
]update

it came a error like this:

(v1.2) pkg> update
   Cloning default registries into `~/.julia`
   Cloning registry from "https://github.com/JuliaRegistries/General.git"
ERROR: could not load library "libgit2"
libcurl.so.4: ELF load command address/offset not properly aligned
Stacktrace:
 [1] #up#43(::Pkg.Types.UpgradeLevel, ::Pkg.Types.PackageMode, ::Bool, ::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::typeof(Pkg.API.up), ::Pkg.Types.Context, ::Array{Pkg.Types.PackageSpec,1}) at /build/julia/src/julia-1.2.0/usr/share/julia/stdlib/v1.2/Pkg/src/API.jl:149
 [2] up at /build/julia/src/julia-1.2.0/usr/share/julia/stdlib/v1.2/Pkg/src/API.jl:143 [inlined]
 [3] do_up!(::Dict{Symbol,Any}, ::Array{Pkg.Types.PackageSpec,1}, ::Dict{Symbol,Any}) at /build/julia/src/julia-1.2.0/usr/share/julia/stdlib/v1.2/Pkg/src/REPLMode.jl:483
 [4] invokelatest(::Any, ::Any, ::Vararg{Any,N} where N) at ./essentials.jl:789

(v1.2) pkg> 

I tried to find the answer from the internet, but i couldn't find anything useful.
so i had to solve it myself, and did this:

 ~ $ ldd /usr/lib/julia/libgit2.so
/usr/lib/julia/libgit2.so: error while loading shared libraries: libcurl.so.4: ELF load command address/offset not properly aligned

i don't know how it means,
but i thought the problem was in the libgit2.so file,
so i just linked it with the system's libgit2.so, and did this:

# ln -sf /usr/lib/libgit2.so /usr/lib/julia/libgit2.so 

and it worked, no more errors show up.

@ViralBShah ViralBShah added the libgit2 The libgit2 library or the LibGit2 stdlib module label Aug 23, 2019
@ararslan
Copy link
Member

Please use the official binaries rather than those provided by system package managers. Is this reproducible using the official binaries?

@goggle
Copy link
Contributor

goggle commented Aug 23, 2019

I have reported this issue on the Arch Linux bug tracker: https://bugs.archlinux.org/task/63536
Let's figure out what the cause of this issue is.

@ghost
Copy link

ghost commented Aug 23, 2019

Another Arch user there,

@ararslan The official binaries work fine---I checked. It's a problem with the file Make.user in the Arch package. @goggle You have to download all files from https://git.archlinux.org/svntogit/community.git/tree/trunk?h=packages/julia
and set line 11 of Make.user to

override USE_SYSTEM_LIBGIT2 = 1

I recompiled and voilà. Unfortunately I deleted the registry instead of renaming (found the same link as @goggle ... and I leave on the edge) so julia thinks I don't have any packages installed. Renaming the environment from path/to/julia/conf/environments/v1.1 to path/to/julia/conf/environments/v1.2
sorted things out.

@Lecrapouille
Copy link

@ararslan I know this ticket is closed but I have this error but produced by different way. In a ipynb file I called this code:

using Pkg; Pkg.add(PackageSpec(url="https://github.com/xxx/yyy.jl"));

on github, nbviewer.jupyter.org or on my own jupyter-lab which produced the error:

error compiling #add_or_develop#13: error compiling shred!: error compiling #26: error compiling with: error compiling #27: could not load library "libgit2"
/usr/lib/x86_64-linux-gnu/libmbedx509.so.0: undefined symbol: mbedtls_mutex_unlock

Stacktrace:
 [1] #add_or_develop at ./none:0 [inlined]
 [2] #add_or_develop#12 at /build/julia-wJr69F/julia-1.0.3+dfsg/usr/share/julia/stdlib/v1.0/Pkg/src/API.jl:29 [inlined]
 [3] #add_or_develop at ./none:0 [inlined]
 [4] #add_or_develop#10 at /build/julia-wJr69F/julia-1.0.3+dfsg/usr/share/julia/stdlib/v1.0/Pkg/src/API.jl:27 [inlined]
 [5] #add_or_develop at ./none:0 [inlined]
 [6] #add#18 at /build/julia-wJr69F/julia-1.0.3+dfsg/usr/share/julia/stdlib/v1.0/Pkg/src/API.jl:69 [inlined]
 [7] add(::Pkg.Types.PackageSpec) at /build/julia-wJr69F/julia-1.0.3+dfsg/usr/share/julia/stdlib/v1.0/Pkg/src/API.jl:69
 [8] top-level scope at In[1]:1

What do you think this can come from ?

@vtjnash
Copy link
Member

vtjnash commented Aug 29, 2019

Looks like the builds of the libgit2 and libmbedtls libraries got out-of-sync. Sorry I can’t be of more help than that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
libgit2 The libgit2 library or the LibGit2 stdlib module
Projects
None yet
Development

No branches or pull requests

6 participants