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

BUG: Compatibility problems with libgit2 0.25.0 #19793

Closed
musically-ut opened this issue Dec 31, 2016 · 16 comments
Closed

BUG: Compatibility problems with libgit2 0.25.0 #19793

musically-ut opened this issue Dec 31, 2016 · 16 comments
Labels
libgit2 The libgit2 library or the LibGit2 stdlib module

Comments

@musically-ut
Copy link

musically-ut commented Dec 31, 2016

I recently upgraded to Julia 0.5.0 and ran into the following problem while trying to do a Pkg.add:

~ via ⬢ v6.2.1
➔  julia
               _
   _       _ _(_)_     |  A fresh approach to technical computing
  (_)     | (_) (_)    |  Documentation: http://docs.julialang.org
   _ _   _| |_  __ _   |  Type "?help" for help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 0.5.0 (2016-09-19 18:14 UTC)
 _/ |\__'_|_|_|\__'_|  |
|__/                   |  x86_64-apple-darwin16.0.0

julia> Pkg.add("IJulia")
INFO: Initializing package repository /Users/musically_ut/.julia/v0.5
INFO: Cloning METADATA from https://github.com/JuliaLang/METADATA.jl
ERROR: GitError(Code:ERROR, Class:Invalid, Invalid version 0 on git_proxy_options)
 in macro expansion at ./libgit2/error.jl:99 [inlined]
 in clone(::String, ::String, ::Base.LibGit2.CloneOptions) at ./libgit2/repository.jl:191
 in #clone#109(::String, ::Bool, ::Ptr{Void}, ::Nullable{Base.LibGit2.AbstractCredentials}, ::Function, ::String, ::String) at ./libgit2/libgit2.jl:327
 in (::Base.LibGit2.#kw##clone)(::Array{Any,1}, ::Base.LibGit2.#clone, ::String, ::String) at ./<missing>:0
 in (::Base.Pkg.Dir.##4#6{String,String})() at ./pkg/dir.jl:49
 in cd(::Base.Pkg.Dir.##4#6{String,String}, ::String) at ./file.jl:59
 in init(::String, ::String) at ./pkg/dir.jl:47
 in #cd#1(::Array{Any,1}, ::Function, ::Function, ::String, ::Vararg{Any,N}) at ./pkg/dir.jl:28
 in add(::String) at ./pkg/pkg.jl:100

julia>

Downgrading from libgit2 version 0.25.0 (which was released 11 days ago at the time of writing) to 0.24.1 solves the problem for me:


~ via ⬢ v6.2.1
➔  brew info libgit2
libgit2: stable 0.25.0 (bottled), HEAD
C library of Git core methods that is re-entrant and linkable
https://libgit2.github.com/
/usr/local/Cellar/libgit2/0.23.4 (100 files, 1.6M)
  Poured from bottle on 2016-01-07 at 18:02:04
/usr/local/Cellar/libgit2/0.24.1 (100 files, 1.7M)
  Poured from bottle on 2016-07-20 at 02:21:38
/usr/local/Cellar/libgit2/0.25.0 (105 files, 1.8M) *
  Poured from bottle on 2016-12-30 at 21:37:26
From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/libgit2.rb
==> Dependencies
Build: pkg-config ✔, cmake ✘
Recommended: libssh2 ✔
==> Options
--universal
        Build a universal binary
--without-libssh2
        Build without libssh2 support
--HEAD
        Install HEAD version

~ via ⬢ v6.2.1
➔  brew switch libgit2 0.24.1
Cleaning /usr/local/Cellar/libgit2/0.23.4
Cleaning /usr/local/Cellar/libgit2/0.24.1
Cleaning /usr/local/Cellar/libgit2/0.25.0
7 links created for /usr/local/Cellar/libgit2/0.24.1

~ via ⬢ v6.2.1
➔  julia
               _
   _       _ _(_)_     |  A fresh approach to technical computing
  (_)     | (_) (_)    |  Documentation: http://docs.julialang.org
   _ _   _| |_  __ _   |  Type "?help" for help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 0.5.0 (2016-09-19 18:14 UTC)
 _/ |\__'_|_|_|\__'_|  |
|__/                   |  x86_64-apple-darwin16.0.0

julia> Pkg.add("IJulia")
INFO: Initializing package repository /Users/musically_ut/.julia/v0.5
INFO: Cloning METADATA from https://github.com/JuliaLang/METADATA.jl
INFO: Updating cache of BinDeps...
INFO: Updating cache of Compat...
INFO: Updating cache of Conda...
INFO: Updating cache of Homebrew...
INFO: Updating cache of IJulia...
INFO: Updating cache of JSON...
...

My version info:

julia> versioninfo()
Julia Version 0.5.0
Commit 3c9d753* (2016-09-19 18:14 UTC)
Platform Info:
  System: Darwin (x86_64-apple-darwin16.0.0)
  CPU: Intel(R) Core(TM) i5-4260U CPU @ 1.40GHz
  WORD_SIZE: 64
  BLAS: libopenblas (DYNAMIC_ARCH NO_AFFINITY Haswell)
  LAPACK: libopenblas
  LIBM: libopenlibm
  LLVM: libLLVM-3.7.1 (ORCJIT, haswell)

This problem was not limited to only IJulia package.

@tkelman tkelman added the libgit2 The libgit2 library or the LibGit2 stdlib module label Dec 31, 2016
@tkelman
Copy link
Contributor

tkelman commented Dec 31, 2016

How did you install julia? We haven't updated the bindings to be compatible with 0.25.0 yet. Would welcome a PR that did so, as long as it also kept compatibility with the existing working versions via appropriate if statements.

@musically-ut
Copy link
Author

I used homebrew to update Julia.

musically_ut at Schiaparelli in ~ via ⬢ v6.2.1
➔  brew info julia
staticfloat/julia/julia: stable 0.5.0 (bottled), HEAD
http://julialang.org
/usr/local/Cellar/julia/0.3.8 (500 files, 80.4M)
  Poured from bottle on 2015-05-22 at 00:33:41
/usr/local/Cellar/julia/0.3.11 (499 files, 81.8M)
  Built from source on 2015-11-11 at 23:01:16
/usr/local/Cellar/julia/0.4.1 (678 files, 122.4M)
  Poured from bottle on 2015-11-06 at 17:53:33
/usr/local/Cellar/julia/0.4.2 (679 files, 122.7M)
  Poured from bottle on 2016-03-28 at 00:05:47
/usr/local/Cellar/julia/0.4.5 (676 files, 101.5M)
  Poured from bottle on 2016-04-23 at 22:33:02
/usr/local/Cellar/julia/0.4.6_1 (681 files, 122.2M)
  Poured from bottle on 2016-07-20 at 02:21:59
/usr/local/Cellar/julia/0.5.0 (755 files, 143.3M) *
  Poured from bottle on 2016-12-30 at 21:38:59
From: https://github.com/staticfloat/homebrew-julia/blob/master/julia.rb
==> Dependencies
Build: cmake ✘
Required: staticfloat/julia/llvm37-julia ✔, pcre2 ✔, gmp ✔, fftw ✔, mpfr ✔, libgit2 ✔, mbedtls ✔, staticfloat/julia/arpack-julia ✔, staticfloat/julia/openblas-julia ✔, staticfloat/julia/suite-sparse-julia ✔
==> Requirements
Build: git ✔
Required: fortran ✔
==> Options
--system-libm
	Use system's libm instead of openlibm
--HEAD
	Install HEAD version
==> Caveats
Documentation and Examples have been installed into:
/usr/local/Cellar/julia/0.5.0/share/julia

Test suite has been installed into:
/usr/local/Cellar/julia/0.5.0/share/julia/test

To perform a quick sanity check, run the command:
brew test -v julia

To crunch through the full test suite, run the command:
/usr/local/Cellar/julia/0.5.0/bin/julia -e "Base.runtests()"

I see what you are getting at for the fix; something like this:

    @static if LibGit2.VERSION >= v"0.24.0"
        custom_headers::StrArrayStruct
    end

in CloneOptions.

If I get sufficient free time over this weekend, I might take a stab at it.

@tkelman
Copy link
Contributor

tkelman commented Dec 31, 2016

Ah right, then this is a bug with https://github.com/staticfloat/homebrew-julia (specifically this line https://github.com/staticfloat/homebrew-julia/blob/409e324c5a15d5a49af2d5eadd81d28c77054cb7/julia.rb#L44 needs to be more specific about acceptable versions, if homebrew is capable of that nowadays). Would still be good to unblock ourselves from upgrading.

I guess if julia were ever added to the main homebrew-core then this kind of thing might be found by their buildbots first. Ref Homebrew/homebrew-core#8221 and Homebrew/homebrew-core#8275.

@simonbyrne
Copy link
Contributor

@simonbyrne
Copy link
Contributor

simonbyrne commented Jan 3, 2017

I've made what I think are the necessary changes in this branch https://github.com/JuliaLang/julia/tree/sb/libgit2/25

However I haven't tried it as the patches no longer apply cleanly: would someone else be able to update these?

@tkelman
Copy link
Contributor

tkelman commented Jan 4, 2017

Sure, I'll take a look.

@tkelman
Copy link
Contributor

tkelman commented Jan 4, 2017

Rebased the patches and seems to work for me locally on Linux, should I push to your branch and open it as a PR?

@simonbyrne
Copy link
Contributor

simonbyrne commented Jan 4, 2017 via email

@tkelman tkelman closed this as completed in 99b5d34 Jan 5, 2017
vtjnash pushed a commit that referenced this issue Feb 7, 2017
rebase patches

fixes #19793

(cherry picked from commit 99b5d34,
but dropping libgit2-mbedtls patch: see PR #18658)
@RatanRSur
Copy link

So is there no stable package managed way to have this fix on macOS? I have to get the 0.6 pre alpha or build from source?

@simonbyrne
Copy link
Contributor

The official .dmg should still be okay: http://julialang.org/downloads/

@simonbyrne
Copy link
Contributor

Further discussion of the homebrew issue should continue at staticfloat/homebrew-julia#231

@tkelman
Copy link
Contributor

tkelman commented Mar 5, 2017

use homebrew-cask (which wraps the official dmg installer) if you want something "package managed"

@sivark
Copy link

sivark commented Apr 25, 2017

I've hit the same problem after upgrading to libgit2 0.25.1-1 on Arch Linux.

Is there any solution other than downgrading my libgit2 installation? I'm afraid downgrading is hard because I have other packages which depend on the updated libgit2.

@nalimilan
Copy link
Member

@sivark At this point, the best solution is to upgrade Julia to 0.6 beta if you can.

@sivark
Copy link

sivark commented Apr 25, 2017

I see. Thanks.

@simonbyrne
Copy link
Contributor

The prebuilt tarball from http://julialang.org/downloads/ should also still be okay.

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