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

Bump libgit2 to 1.0 #35233

Merged
merged 7 commits into from
Sep 9, 2020
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ Julia's `stdlib` uses the following external libraries, which have their own lic
- [OPENLIBM](https://github.com/JuliaMath/openlibm/blob/master/LICENSE.md) [MIT, BSD-2, ISC]
- [GMP](https://gmplib.org/manual/Copying.html#Copying) [LGPL3+ or GPL2+]
- [LIBGIT2](https://github.com/libgit2/libgit2/blob/development/COPYING) [GPL2+ with unlimited linking exception]
- [CURL](https://curl.haxx.se/docs/copyright.html) [MIT/X derivative]
- [LIBSSH2](https://github.com/libssh2/libssh2/blob/master/COPYING) [BSD-3]
- [MBEDTLS](https://tls.mbed.org/how-to-get) [either GPLv2 or Apache 2.0]
- [MPFR](https://www.mpfr.org/mpfr-current/mpfr.html#Copying) [LGPL3+]
Expand Down
3 changes: 1 addition & 2 deletions Make.inc
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ USE_SYSTEM_LIBUV:=0
USE_SYSTEM_UTF8PROC:=0
USE_SYSTEM_MBEDTLS:=0
USE_SYSTEM_LIBSSH2:=0
USE_SYSTEM_CURL:=0
USE_SYSTEM_LIBGIT2:=0
USE_SYSTEM_PATCHELF:=0
USE_SYSTEM_ZLIB:=0
Expand Down Expand Up @@ -1098,7 +1097,7 @@ USE_BINARYBUILDER ?= 0
endif

# This is the set of projects that BinaryBuilder dependencies are hooked up for.
BB_PROJECTS := OPENBLAS LLVM SUITESPARSE OPENLIBM GMP MBEDTLS LIBSSH2 MPFR CURL LIBGIT2 PCRE LIBUV LIBUNWIND DSFMT OBJCONV ZLIB P7ZIP
BB_PROJECTS := OPENBLAS LLVM SUITESPARSE OPENLIBM GMP MBEDTLS LIBSSH2 MPFR LIBGIT2 PCRE LIBUV LIBUNWIND DSFMT OBJCONV ZLIB P7ZIP
define SET_BB_DEFAULT
# First, check to see if BB is disabled on a global setting
ifeq ($$(USE_BINARYBUILDER),0)
Expand Down
1 change: 0 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,6 @@ JL_PRIVATE_LIBS-$(USE_SYSTEM_GMP) += libgmp
JL_PRIVATE_LIBS-$(USE_SYSTEM_MPFR) += libmpfr
JL_PRIVATE_LIBS-$(USE_SYSTEM_LIBSSH2) += libssh2
JL_PRIVATE_LIBS-$(USE_SYSTEM_MBEDTLS) += libmbedtls libmbedcrypto libmbedx509
JL_PRIVATE_LIBS-$(USE_SYSTEM_CURL) += libcurl
JL_PRIVATE_LIBS-$(USE_SYSTEM_LIBGIT2) += libgit2
ifeq ($(OS),WINNT)
JL_PRIVATE_LIBS-$(USE_SYSTEM_ZLIB) += zlib
Expand Down
1 change: 0 additions & 1 deletion base/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,6 @@ $(eval $(call symlink_system_library,libmbedtls,MBEDTLS))
$(eval $(call symlink_system_library,libmbedcrypto,MBEDTLS))
$(eval $(call symlink_system_library,libmbedx509,MBEDTLS))
$(eval $(call symlink_system_library,libssh2,LIBSSH2))
$(eval $(call symlink_system_library,libcurl,CURL))
$(eval $(call symlink_system_library,libgit2,LIBGIT2))
$(eval $(call symlink_system_library,libamd,SUITESPARSE))
$(eval $(call symlink_system_library,libcamd,SUITESPARSE))
Expand Down
2 changes: 1 addition & 1 deletion contrib/refresh_bb_tarballs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
TRIPLETS="i686-linux-gnu x86_64-linux-gnu aarch64-linux-gnu armv7l-linux-gnueabihf powerpc64le-linux-gnu i686-linux-musl x86_64-linux-musl aarch64-linux-musl armv7l-linux-musleabihf x86_64-apple-darwin14 x86_64-unknown-freebsd11.1 i686-w64-mingw32 x86_64-w64-mingw32"

# These are the projects currently using BinaryBuilder; both GCC-expanded and non-GCC-expanded:
BB_PROJECTS="mbedtls libssh2 mpfr curl libgit2 pcre libuv unwind osxunwind dsfmt objconv p7zip zlib suitesparse openlibm"
BB_PROJECTS="mbedtls libssh2 mpfr libgit2 pcre libuv unwind osxunwind dsfmt objconv p7zip zlib suitesparse openlibm"
BB_GCC_EXPANDED_PROJECTS="openblas"
BB_CXX_EXPANDED_PROJECTS="gmp llvm"

Expand Down
11 changes: 2 additions & 9 deletions deps/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ BUILDDIR := $(BUILDDIR)$(MAYBE_HOST)
# additionally all targets should be listed in the getall target for easier off-line compilation
# if you are adding a new target, it can help to copy an similar, existing target
#
# autoconf configure-driven scripts: pcre unwind gmp mpfr patchelf libuv curl
# autoconf configure-driven scripts: pcre unwind gmp mpfr patchelf libuv
# custom Makefile rules: openlibm dsfmt suitesparse-wrapper suitesparse lapack openblas utf8proc objconv osxunwind libwhich
# CMake libs: llvm libgit2 libssh2 mbedtls
#
Expand Down Expand Up @@ -111,12 +111,6 @@ ifeq ($(USE_SYSTEM_LIBSSH2), 0)
DEP_LIBS += libssh2
endif

ifneq ($(OS), WINNT)
ifeq ($(USE_SYSTEM_CURL), 0)
DEP_LIBS += curl
endif
endif

DEP_LIBS += libgit2
endif # USE_SYSTEM_LIBGIT2

Expand Down Expand Up @@ -178,7 +172,7 @@ install: $(addprefix install-, $(DEP_LIBS))
cleanall: $(addprefix clean-, $(DEP_LIBS))
distcleanall: $(addprefix distclean-, $(DEP_LIBS))
rm -rf $(build_prefix)
getall: get-llvm get-libuv get-pcre get-openlibm get-dsfmt get-openblas get-lapack get-suitesparse get-unwind get-osxunwind get-gmp get-mpfr get-patchelf get-utf8proc get-objconv get-mbedtls get-libssh2 get-curl get-libgit2 get-libwhich
getall: get-llvm get-libuv get-pcre get-openlibm get-dsfmt get-openblas get-lapack get-suitesparse get-unwind get-osxunwind get-gmp get-mpfr get-patchelf get-utf8proc get-objconv get-mbedtls get-libssh2 get-libgit2 get-libwhich

include $(SRCDIR)/llvm.mk
include $(SRCDIR)/libuv.mk
Expand All @@ -195,7 +189,6 @@ include $(SRCDIR)/mpfr.mk
include $(SRCDIR)/patchelf.mk
include $(SRCDIR)/mbedtls.mk
include $(SRCDIR)/libssh2.mk
include $(SRCDIR)/curl.mk
include $(SRCDIR)/libgit2.mk
include $(SRCDIR)/libwhich.mk
include $(SRCDIR)/zlib.mk
Expand Down
4 changes: 1 addition & 3 deletions deps/Versions.make
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,7 @@ MBEDTLS_VER = 2.16.0
MBEDTLS_BB_REL = 1
LIBSSH2_VER = 1.9.0
LIBSSH2_BB_REL = 1
CURL_VER = 7.66.0
CURL_BB_REL = 1
LIBGIT2_VER = 0.28.5
LIBGIT2_VER = 1.0.0
nalimilan marked this conversation as resolved.
Show resolved Hide resolved
LIBGIT2_BB_REL = 0
LIBUV_VER = 1.29.1
LIBUV_BB_REL = 8
Expand Down
77 changes: 0 additions & 77 deletions deps/curl.mk

This file was deleted.

8 changes: 0 additions & 8 deletions deps/libgit2.mk
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,6 @@ ifeq ($(USE_SYSTEM_MBEDTLS), 0)
$(BUILDDIR)/$(LIBGIT2_SRC_DIR)/build-configured: | $(build_prefix)/manifest/mbedtls
endif

ifneq ($(OS),WINNT)
ifeq ($(USE_SYSTEM_CURL), 0)
$(BUILDDIR)/$(LIBGIT2_SRC_DIR)/build-configured: | $(build_prefix)/manifest/curl
endif
endif

ifneq ($(USE_BINARYBUILDER_LIBGIT2),1)

LIBGIT2_OPTS := $(CMAKE_COMMON) -DCMAKE_BUILD_TYPE=Release -DTHREADSAFE=ON -DUSE_BUNDLED_ZLIB=ON
Expand All @@ -34,8 +28,6 @@ else
LIBGIT2_OPTS += -DBUILD_CLAR=OFF -DDLLTOOL=`which $(CROSS_COMPILE)dlltool`
LIBGIT2_OPTS += -DCMAKE_FIND_ROOT_PATH=/usr/$(XC_HOST) -DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=ONLY
endif
else
LIBGIT2_OPTS += -DCURL_INCLUDE_DIRS=$(build_includedir) -DCURL_LIBRARIES="curl"
endif

ifneq (,$(findstring $(OS),Linux FreeBSD))
Expand Down
4 changes: 2 additions & 2 deletions deps/libgit2.version
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
LIBGIT2_BRANCH=v0.28.5
LIBGIT2_SHA1=7a2b969d559b83798d93728f24d1729ffc97b717
LIBGIT2_BRANCH=v1.0.0
LIBGIT2_SHA1=7d3c7057f0e774aecd6fc4ef8333e69e5c4873e0
nalimilan marked this conversation as resolved.
Show resolved Hide resolved
2 changes: 0 additions & 2 deletions doc/build/build.md
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,6 @@ uses are listed in [`deps/Versions.make`](https://github.com/JuliaLang/julia/blo
- **[GMP]** — GNU multiple precision arithmetic library, needed for `BigInt` support.
- **[MPFR]** — GNU multiple precision floating point library, needed for arbitrary precision floating point (`BigFloat`) support.
- **[libgit2]** — Git linkable library, used by Julia's package manager.
- **[curl]** — libcurl provides download and proxy support for Julia's package manager.
- **[libssh2]** — library for SSH transport, used by libgit2 for packages with SSH remotes.
- **[mbedtls]** — library used for cryptography and transport layer security, used by libssh2
- **[utf8proc]** — a library for processing UTF-8 encoded Unicode strings.
Expand All @@ -196,7 +195,6 @@ uses are listed in [`deps/Versions.make`](https://github.com/JuliaLang/julia/blo
[clang]: https://clang.llvm.org
[python]: https://www.python.org/
[gfortran]: https://gcc.gnu.org/fortran/
[curl]: https://curl.haxx.se
[fetch]: https://www.freebsd.org/cgi/man.cgi?fetch(1)
[perl]: https://www.perl.org
[cmake]: https://www.cmake.org
Expand Down
2 changes: 1 addition & 1 deletion stdlib/LibGit2/src/LibGit2.jl
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ const REFCOUNT = Threads.Atomic{Int}(0)

function ensure_initialized end

include("error.jl")
include("utils.jl")
include("consts.jl")
include("types.jl")
include("error.jl")
include("signature.jl")
include("oid.jl")
include("reference.jl")
Expand Down
2 changes: 1 addition & 1 deletion stdlib/LibGit2/src/blob.jl
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ id = LibGit2.addblob!(repo, blob_file)
function addblob!(repo::GitRepo, path::AbstractString)
ensure_initialized()
id_ref = Ref{GitHash}()
@check ccall((:git_blob_create_fromdisk, :libgit2), Cint,
@check ccall((:git_blob_create_from_disk, :libgit2), Cint,
(Ptr{GitHash}, Ptr{Cvoid}, Cstring),
id_ref, repo.ptr, path)
return id_ref[]
Expand Down
8 changes: 6 additions & 2 deletions stdlib/LibGit2/src/error.jl
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,13 @@ export GitError
ECERTIFICATE = Cint(-17), # server certificate is invalid
EAPPLIED = Cint(-18), # patch/merge has already been applied
EPEEL = Cint(-19), # the requested peel operation is not possible
EEOF = Cint(-20), # Unexpted EOF
EEOF = Cint(-20), # unexpected EOF
PASSTHROUGH = Cint(-30), # internal only
ITEROVER = Cint(-31)) # signals end of iteration
ITEROVER = Cint(-31), # signals end of iteration
RETRY = Cint(-32), # internal only
EMISMATCH = Cint(-33), # hashsum mismatch in object
EINDEXDIRTY = Cint(-34), # unsaved changes in the index would be overwritten
EAPPLYFAIL = Cint(-35)) # patch application failed

@enum(Class, None,
NoMemory,
Expand Down
3 changes: 2 additions & 1 deletion stdlib/LibGit2/src/oid.jl
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ function GitHash(ptr::Ptr{UInt8})
end
ensure_initialized()
oid_ptr = Ref(GitHash())
ccall((:git_oid_fromraw, :libgit2), Cvoid, (Ptr{GitHash}, Ptr{UInt8}), oid_ptr, ptr)
@check ccall((:git_oid_fromraw, :libgit2), Cint,
(Ptr{GitHash}, Ptr{UInt8}), oid_ptr, ptr)
return oid_ptr[]
end

Expand Down
2 changes: 1 addition & 1 deletion stdlib/LibGit2/src/repository.jl
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ end
function cleanup(r::GitRepo)
if r.ptr != C_NULL
ensure_initialized()
ccall((:git_repository__cleanup, :libgit2), Cvoid, (Ptr{Cvoid},), r.ptr)
@check ccall((:git_repository__cleanup, :libgit2), Cint, (Ptr{Cvoid},), r.ptr)
end
end

Expand Down
10 changes: 3 additions & 7 deletions stdlib/LibGit2/src/types.jl
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ end
LibGit2.TransferProgress

Transfer progress information used by the `transfer_progress` remote callback.
Matches the [`git_transfer_progress`](https://libgit2.org/libgit2/#HEAD/type/git_transfer_progress) struct.
Matches the [`git_indexer_progress`](https://libgit2.org/libgit2/#HEAD/type/git_indexer_progress) struct.
"""
@kwdef struct TransferProgress
total_objects::Cuint = Cuint(0)
Expand Down Expand Up @@ -328,12 +328,8 @@ end
prune::Cint = Consts.FETCH_PRUNE_UNSPECIFIED
update_fetchhead::Cint = Cint(1)
download_tags::Cint = Consts.REMOTE_DOWNLOAD_TAGS_AUTO
@static if LibGit2.VERSION >= v"0.25.0"
proxy_opts::ProxyOptions = ProxyOptions()
end
@static if LibGit2.VERSION >= v"0.24.0"
custom_headers::StrArrayStruct = StrArrayStruct()
end
proxy_opts::ProxyOptions = ProxyOptions()
custom_headers::StrArrayStruct = StrArrayStruct()
end

"""
Expand Down
4 changes: 2 additions & 2 deletions stdlib/LibGit2/src/utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ function version()
major = Ref{Cint}(0)
minor = Ref{Cint}(0)
patch = Ref{Cint}(0)
ccall((:git_libgit2_version, :libgit2), Cvoid,
(Ref{Cint}, Ref{Cint}, Ref{Cint}), major, minor, patch)
@check ccall((:git_libgit2_version, :libgit2), Cint,
(Ref{Cint}, Ref{Cint}, Ref{Cint}), major, minor, patch)
return VersionNumber(major[], minor[], patch[])
end
const VERSION = version()
Expand Down
2 changes: 1 addition & 1 deletion stdlib/LibGit2/src/walker.jl
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ end
function Base.sort!(w::GitRevWalker; by::Cint = Consts.SORT_NONE, rev::Bool=false)
ensure_initialized()
rev && (by |= Consts.SORT_REVERSE)
ccall((:git_revwalk_sorting, :libgit2), Cvoid, (Ptr{Cvoid}, Cint), w.ptr, by)
@check ccall((:git_revwalk_sorting, :libgit2), Cint, (Ptr{Cvoid}, Cint), w.ptr, by)
return w
end

Expand Down
2 changes: 1 addition & 1 deletion stdlib/LibGit2/test/libgit2.jl
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ function challenge_prompt(cmd::Cmd, challenges; timeout::Integer=60, debug::Bool
nothing
end

const LIBGIT2_MIN_VER = v"0.23.0"
const LIBGIT2_MIN_VER = v"1.0.0"
const LIBGIT2_HELPER_PATH = joinpath(@__DIR__, "libgit2-helpers.jl")

const KEY_DIR = joinpath(@__DIR__, "keys")
Expand Down