Skip to content

Commit

Permalink
git: enable libgit2's OpenSSH feature
Browse files Browse the repository at this point in the history
  • Loading branch information
bnjmnt4n committed Jul 3, 2024
1 parent 0388334 commit ca22436
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 22 deletions.
15 changes: 0 additions & 15 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,11 @@ dirs = "5.0.1"
either = "1.13.0"
esl01-renderdag = "0.3.0"
futures = "0.3.30"
git2 = { git = "https://github.com/bnjmnt4n/git2-rs.git", rev = "8fd23a45f" }
git2 = { git = "https://github.com/bnjmnt4n/git2-rs.git", rev = "8fd23a45f", default-features = false, features = [
"https",
"ssh-openssh",
"vendored-libgit2",
] }
gix = { version = "0.63.0", default-features = false, features = [
"index",
"max-performance-safe",
Expand Down
4 changes: 2 additions & 2 deletions cli/src/commands/git/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ fn map_git_error(err: git2::Error) -> CommandError {
successfully load certificates. Try setting it to the path of a directory that \
contains a `.ssh` directory."
} else {
"Jujutsu uses libssh2, which doesn't respect ~/.ssh/config. Does `ssh -F \
/dev/null` to the host work?"
"There was an error creating an SSH connection. Does `ssh -F /dev/null` to the \
host work?"
};

user_error_with_hint(err, hint)
Expand Down
6 changes: 2 additions & 4 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,10 @@
openssh
] ++ linuxNativeDeps;
buildInputs = with pkgs; [
openssl zstd libgit2 libssh2
openssl zstd libgit2 openssh
] ++ darwinDeps;

ZSTD_SYS_USE_PKG_CONFIG = "1";
LIBSSH2_SYS_USE_PKG_CONFIG = "1";
RUSTFLAGS = pkgs.lib.optionalString pkgs.stdenv.isLinux "-C link-arg=-fuse-ld=mold";
NIX_JJ_GIT_HASH = self.rev or "";
CARGO_INCREMENTAL = "0";
Expand Down Expand Up @@ -153,7 +152,7 @@
ourRustVersion

# Foreign dependencies
openssl zstd libgit2 libssh2
openssl zstd libgit2
pkg-config

# Additional tools recommended by contributing.md
Expand All @@ -179,7 +178,6 @@
shellHook = ''
export RUST_BACKTRACE=1
export ZSTD_SYS_USE_PKG_CONFIG=1
export LIBSSH2_SYS_USE_PKG_CONFIG=1
export RUSTFLAGS="-Zthreads=0 ${rustLinkFlagsString}"
'';
Expand Down

0 comments on commit ca22436

Please sign in to comment.