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

libgit2: Bump to v1.8.1 #1032

Merged
merged 21 commits into from
May 21, 2024
Merged

libgit2: Bump to v1.8.1 #1032

merged 21 commits into from
May 21, 2024

Conversation

bnjmnt4n
Copy link
Contributor

@bnjmnt4n bnjmnt4n commented Mar 2, 2024

This PR bumps libgit2 to v1.8.1, in preparation for #1031. I've bumped libgit2-sys to 0.17.0+1.8.1, but haven't touched the git2 version since I thought that's better left for the maintainers.

I haven't included any new Rust bindings for the new functions (e.g. git_commit_create_from_stage). Basically I've just done the bare minimum required to get git2 working with libgit2 v1.8.1.

API changes:

  • Remote:update_tips now accepts a RemoteUpdateFlags which is an integer consisting of bitfields instead of a boolean
  • FetchOptions: add report_unchanged method which updates the update_flags bitflag (similar to above)
  • PushOptions: add remote_push_options method to set remote push options
  • WorktreeAddOptions: add checkout_existing method to set the boolean checkout_existing option

References

bnjmnt4n added a commit to bnjmnt4n/git2-rs that referenced this pull request Mar 2, 2024
This commit changes the original `ssh` feature into two new ones:
`ssh-libssh2` and `ssh-openssh`. By default, the `ssh-libssh2` feature
is enabled for backwards compatibility.

To use OpenSSH instead, the following listing in `Cargo.toml` can be
used:

    git2-rs = { version = "...", default-features = false, features = ["https", "ssh-openssh"] }

This commit is stacked on top of rust-lang#1032, and should only be merged after
libgit2 v1.8.0 has been released.

Closes rust-lang#1028.
bnjmnt4n added a commit to bnjmnt4n/git2-rs that referenced this pull request Mar 2, 2024
This commit changes the original `ssh` feature into two new ones:
`ssh-libssh2` and `ssh-openssh`. By default, the `ssh-libssh2` feature
is enabled for backwards compatibility.

To use OpenSSH instead, the following listing in `Cargo.toml` can be
used:

    git2-rs = { version = "...", default-features = false, features = ["https", "ssh-openssh"] }

This commit is stacked on top of rust-lang#1032, and should only be merged after
libgit2 v1.8.0 has been released.

Closes rust-lang#1028.
@bnjmnt4n
Copy link
Contributor Author

bnjmnt4n commented Mar 7, 2024

Looks like the current test failures are due to changes made in libgit2/libgit2#6743 👀

bnjmnt4n added a commit to bnjmnt4n/git2-rs that referenced this pull request Mar 17, 2024
This commit changes the original `ssh` feature into two new ones:
`ssh-libssh2` and `ssh-openssh`. By default, the `ssh-libssh2` feature
is enabled for backwards compatibility.

To use OpenSSH instead, the following listing in `Cargo.toml` can be
used:

    git2-rs = { version = "...", default-features = false, features = ["https", "ssh-openssh"] }

This commit is stacked on top of rust-lang#1032, and should only be merged after
libgit2 v1.8.0 has been released.

Closes rust-lang#1028.
@bnjmnt4n
Copy link
Contributor Author

Looks like v1.8.0 is out! I will update the PR to bump the version.

@bnjmnt4n bnjmnt4n changed the title libgit2: Bump to v1.8.0-alpha libgit2: Bump to v1.8.0 Mar 22, 2024
@bnjmnt4n bnjmnt4n marked this pull request as draft March 22, 2024 12:41
@bnjmnt4n bnjmnt4n marked this pull request as ready for review March 22, 2024 13:24
@bnjmnt4n
Copy link
Contributor Author

This should be ready for review. (I'm pretty new to Rust and the libgit2 / this codebase, please do let me know if there are better ways to do anything.)

The test failures on Windows are related to libgit2/libgit2#6743 as mentioned above—I'm not too sure how to handle these conventionally using Rust.

libgit2-sys/lib.rs Outdated Show resolved Hide resolved
@ehuss
Copy link
Contributor

ehuss commented Mar 23, 2024

The test failures on Windows are related to libgit2/libgit2#6743 as mentioned above—I'm not too sure how to handle these conventionally using Rust.

Hm, that's awkward. I don't really understand why TempDir is returning short path. One option is to canonicalize both paths before comparing they are equal. Another option is to use same-file to check that the paths are the same. Canonicalize might be easier if it works.

@jirutka
Copy link

jirutka commented Apr 3, 2024

FYI, this blocks the upgrade of libgit2 to 1.8.0 in Alpine Linux (!63296).

@SS1823
Copy link

SS1823 commented Apr 23, 2024

Is this PR still blocked?
this may fix actions/checkout#1689

@jirutka
Copy link

jirutka commented May 14, 2024

Approved 2 weeks ago, but still not merged… why?

@kornelski
Copy link
Contributor

kornelski commented May 14, 2024

@jirutka libgit 1.8.0 has used C bitfields in its ABI, and that feature is not supported by Rust's FFI and may be compiler-specific.

libgit2/libgit2#6800

@bnjmnt4n bnjmnt4n changed the title libgit2: Bump to v1.8.0 libgit2: Bump to v1.8.1 May 16, 2024
@bnjmnt4n
Copy link
Contributor Author

libgit2 v1.8.1 was just released, and I've updated the PR to use that. Bitfields are no longer used in the new version, so we can avoid any hacks.

Copy link
Contributor

@ehuss ehuss left a comment

Choose a reason for hiding this comment

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

Thanks!

@ehuss ehuss added this pull request to the merge queue May 21, 2024
Merged via the queue into rust-lang:master with commit 324f421 May 21, 2024
7 checks passed
@bnjmnt4n bnjmnt4n deleted the libgit2-v1.8.0 branch May 21, 2024 16:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants