Skip to content

Update to LibGit2 v0.26.0 - #22614

Merged
tkelman merged 2 commits into
masterfrom
cv/libgit2-0.26.0
Jul 3, 2017
Merged

tkelman merged 2 commits into
masterfrom
cv/libgit2-0.26.0

Conversation

@omus

@omus omus commented Jun 29, 2017 •

Copy link
Copy Markdown
Member

Updates the version of LibGit2 to version 0.26.0 which includes various fixes. The change caused a few changes to the state of the libgit2 patches:

Additionally the new libgit2-mbedtls.patch addresses libgit2/libgit2#3935 (comment) and should also fix #19135 (comment) and #20439

TODOs:

@ararslan ararslan added building Build system, or building Julia or its dependencies libgit2 The libgit2 library or the LibGit2 stdlib module labels Jun 29, 2017
-{
- if (!strcasecmp(name, host))
- return 0;
- if (!strcasecmp(name, host))

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like GitHub diff can't handle diffing diffs. The original patch removed the check_host_name function and used the mbedtls function for doing cert verification instead of rolling our own in libgit2

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To elaborate on my question mark, it appears the changes in the patch change the indentation. Seems unnecessary and kind of bloats the patch. Am I missing something?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, is it just that the diff diffing is weird?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is totally possible the indentation was changed from spaces into tabs. libgit2/libgit2#4173 made the indentation into tabs so when I revised this patch there are now differences in the whitespace.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gotcha. Thanks.

Comment thread base/libgit2/libgit2.jl Outdated
ENV["SSL_CERT_FILE"]
else
# If we have a bundled ca cert file, point libgit2 at that so SSL connections work.
abspath(ccall(:jl_get_julia_home, Any, ()),Base.DATAROOTDIR,"julia","cert.pem")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[minor style point] few more spaces after the commas here?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure. I didn't modify the styling when I moved this.

Comment thread deps/libgit2.mk
@@ -78,29 +78,14 @@ $(LIBGIT2_SRC_PATH)/libgit2-agent-nonfatal.patch-applied: $(LIBGIT2_SRC_PATH)/so
patch -p1 -f < $(SRCDIR)/patches/libgit2-agent-nonfatal.patch

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we didn't upstream this one?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, I'll double check

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment thread deps/libgit2.version
LIBGIT2_BRANCH=v0.25.1
LIBGIT2_SHA1=2fcb8705e584ca61f6c4657525c9d2713f6a39d2
LIBGIT2_BRANCH=v0.26.0
LIBGIT2_SHA1=15e119375018fba121cf58e02a9f17fe22df0df8

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should delete the old checksum files, and add the new ones

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't interacted with our checksum files before. What's the standard procedure?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

git rm -r deps/checksums/libgit2-2fcb8705e584ca61f6c4657525c9d2713f6a39d2.tar.gz
git add deps/checksums/libgit2-15e119375018fba121cf58e02a9f17fe22df0df8.tar.gz

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh interesting. I was thinking I would have to retrieve the checksum myself.

@tkelman tkelman Jun 29, 2017 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if you locally build a new dependency version and the checksum files aren't already present, it'll create them the first time - we add them to git so they get checked for everyone else

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

// OPTIONAL because REQUIRED drops the certificate as soon as the check
// is made, so we can never see the certificate and override it.
mbedtls_ssl_conf_authmode(git__ssl_conf, MBEDTLS_SSL_VERIFY_OPTIONAL);
+ //mbedtls_ssl_conf_authmode(git__ssl_conf, MBEDTLS_SSL_VERIFY_NONE);

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was me trying to get the cert tests to co-operate. I'll remove this yet.

Comment thread test/libgit2.jl Outdated
catch e
@test typeof(e) == LibGit2.GitError
@test startswith(sprint(show,e),"GitError(Code:ENOTFOUND, Class:OS, Failed to resolve path")
@test startswith(sprint(show,e),"GitError(Code:ENOTFOUND, Class:OS, failed to resolve path")

@tkelman tkelman Jun 29, 2017 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks like this makes the windows CI sad, since it uses libgit2 from the nightly binary instead of compiling from source

for the sake of distro packagers who might not be able to upgrade libgit2 versions right away, how about making this conditional on libgit2 version?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good

@omus
omus force-pushed the cv/libgit2-0.26.0 branch from 15274dd to 268d157 Compare June 30, 2017 16:57
@omus

omus commented Jun 30, 2017

Copy link
Copy Markdown
Member Author

One of my patches isn't applying on Travis. Attempting to reproduce locally.

Comment thread test/libgit2.jl Outdated
end
@test err.code == LibGit2.Error.ERROR
@test err.msg == "Invalid Content-Type: text/plain"
@test err.msg == "invalid Content-Type: text/plain"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should probably be version dependent as well

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These tests only run on Linux so they should always be using the specified version. I could and the conditional if it is still preferable

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unless a distro packager uses a different version of libgit2

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😱 fair enough

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I'll update this and #22614 (comment) to be case insensitive

@omus

omus commented Jun 30, 2017 •

Copy link
Copy Markdown
Member Author

One of my patches isn't applying on Travis. Attempting to reproduce locally.

I can't seem to reproduce the issue locally. I think I'll push these commits individually to isolate the issue.

@omus
omus force-pushed the cv/libgit2-0.26.0 branch 2 times, most recently from 6700ba7 to 82a1229 Compare June 30, 2017 21:56
@omus

omus commented Jul 1, 2017

Copy link
Copy Markdown
Member Author

Looks like it was an issue with the Travis CI cache

@omus

omus commented Jul 1, 2017 •

Copy link
Copy Markdown
Member Author

Trying a new PR to see if I can work around the Travis CI caching issues I'm encountering.

@omus
omus force-pushed the cv/libgit2-0.26.0 branch from 9233148 to 158d655 Compare July 2, 2017 15:29
@omus omus changed the title WIP: Update to LibGit2 v0.26.0 Update to LibGit2 v0.26.0 Jul 2, 2017
@omus

omus commented Jul 2, 2017

Copy link
Copy Markdown
Member Author

Should be ready for final review. I've commented on libgit2/libgit2#4173 with the new changes this PR includes in the patches.

Comment thread deps/libgit2.mk
$(LIBGIT2_SRC_PATH)/libgit2-mbedtls-writer-fix.patch-applied \
$(LIBGIT2_SRC_PATH)/libgit2-mbedtls-verify.patch-applied \
$(LIBGIT2_SRC_PATH)/libgit2-gitconfig-symlink.patch-applied \
$(LIBGIT2_SRC_PATH)/libgit2-free-config.patch-applied \

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this file be deleted?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes it should. Good catch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

building Build system, or building Julia or its dependencies libgit2 The libgit2 library or the LibGit2 stdlib module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants