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 Jun 8, 2024
1 parent 4078fe6 commit fb9179c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
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.12.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
3 changes: 1 addition & 2 deletions cli/src/commands/git.rs
Original file line number Diff line number Diff line change
Expand Up @@ -289,8 +289,7 @@ 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. Are you able to SSH to the host?"
};

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 @@ -97,11 +97,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 useMoldLinker "-C link-arg=-fuse-ld=mold";
NIX_JJ_GIT_HASH = self.rev or "";
CARGO_INCREMENTAL = "0";
Expand Down Expand Up @@ -164,7 +163,7 @@
})

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

# Make sure rust-analyzer is present
Expand All @@ -190,7 +189,6 @@
shellHook = ''
export RUST_BACKTRACE=1
export ZSTD_SYS_USE_PKG_CONFIG=1
export LIBSSH2_SYS_USE_PKG_CONFIG=1
'' + pkgs.lib.optionalString useMoldLinker ''
export RUSTFLAGS="-C link-arg=-fuse-ld=mold"
'' + darwinNextestHack;
Expand Down

0 comments on commit fb9179c

Please sign in to comment.