Skip to content

libssh2-sys dependency won't compile on windows #3984

@Zoybean

Description

@Zoybean

Description

I've regularly compiled from source before (though on a different win10 computer). Currently, though, the libssh2-sys dependency is failing to compile. I've tried compiling the both ssh2-rs repo (which uses 0.3.0 of the sys crate) and the libssh2-sys crate (at 0.3.0) directly with no apparent issue, so I suspect the failure is somehow tied to jj.

Steps to Reproduce the Problem

  1. cargo install --locked --bin jj jj-cli --features vendored-openssl

Expected Behavior

jj installs successfully

Actual Behavior

The following warnings were emitted during compilation:

warning: libssh2-sys@0.3.0: ToolExecError: Command "C:\\Program Files\\Microsoft Visual Studio\\2022\\Professional\\VC\\Tools\\MSVC\\14.40.33807\\bin\\HostX64\\x64\\cl.exe" "-nologo" "-MD" "-O2" "-Brepro" "-I" "C:\\redacted\\Repositories\\Program_Sources\\jj\\target\\release\\build\\libssh2-sys-ded426dd75c5c457\\out\\include" "-I" "libssh2/src" "-I" "libssh2/win32" "-I" "C:\\redacted\\Repositories\\Program_Sources\\jj\\target\\release\\build\\libz-sys-a0ac929a610bcef1\\out/include" "-DHAVE_LONGLONG" "-DLIBSSH2_WIN32" "-DLIBSSH2_WINCNG" "-DLIBSSH2_DH_GEX_NEW" "-DLIBSSH2_HAVE_ZLIB" "-FoC:\\redacted\\Repositories\\Program_Sources\\jj\\target\\release\\build\\libssh2-sys-ded426dd75c5c457\\out\\build\\903bc623e643396f-wincng.o" "-c" "libssh2/src/wincng.c" with args cl.exe did not execute successfully (status code exit code: 2).

error: failed to run custom build command for `libssh2-sys v0.3.0`

Caused by:
  process didn't exit successfully: `C:\redacted\Repositories\Program_Sources\jj\target\release\build\libssh2-sys-d4d64422b0d336c7\build-script-build` (exit code: 1)
  --- stdout
  cargo:rerun-if-env-changed=LIBSSH2_SYS_USE_PKG_CONFIG
  cargo:include=C:\redacted\Repositories\Program_Sources\jj\target\release\build\libssh2-sys-ded426dd75c5c457\out\include
  cargo:root=C:\redacted\Repositories\Program_Sources\jj\target\release\build\libssh2-sys-ded426dd75c5c457\out
  cargo:rerun-if-env-changed=DEP_Z_INCLUDE
  cargo:rerun-if-env-changed=DEP_OPENSSL_INCLUDE
  TARGET = Some("x86_64-pc-windows-msvc")
  OPT_LEVEL = Some("3")
  HOST = Some("x86_64-pc-windows-msvc")
  cargo:rerun-if-env-changed=CC_x86_64-pc-windows-msvc
  CC_x86_64-pc-windows-msvc = None
  cargo:rerun-if-env-changed=CC_x86_64_pc_windows_msvc
  CC_x86_64_pc_windows_msvc = None
  cargo:rerun-if-env-changed=HOST_CC
  HOST_CC = None
  cargo:rerun-if-env-changed=CC
  CC = None
  cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS
  CRATE_CC_NO_DEFAULTS = None
  CARGO_CFG_TARGET_FEATURE = Some("cmpxchg16b,fxsr,sse,sse2,sse3")
  DEBUG = Some("false")
  cargo:rerun-if-env-changed=CFLAGS_x86_64-pc-windows-msvc
  CFLAGS_x86_64-pc-windows-msvc = None
  cargo:rerun-if-env-changed=CFLAGS_x86_64_pc_windows_msvc
  CFLAGS_x86_64_pc_windows_msvc = None
  cargo:rerun-if-env-changed=HOST_CFLAGS
  HOST_CFLAGS = None
  cargo:rerun-if-env-changed=CFLAGS
  CFLAGS = None
  cargo:rerun-if-env-changed=CC_ENABLE_DEBUG_OUTPUT
  agent.c
  bcrypt_pbkdf.c
  blowfish.c
  channel.c
  comp.c
  crypt.c
  global.c
  hostkey.c
  keepalive.c
  kex.c
  knownhost.c
  mac.c
  misc.c
  packet.c
  pem.c
  exit code: 0
  exit code: 0
  exit code: 0
  exit code: 0
  exit code: 0
  exit code: 0
  exit code: 0
  exit code: 0
  exit code: 0
  publickey.c
  scp.c
  session.c
  sftp.c
  transport.c
  userauth.c
  userauth_kbd_packet.c
  agent_win.c
  wincng.c
  libssh2/src/session.c(519): warning C4068: unknown pragma 'GCC'
  libssh2/src/session.c(520): warning C4068: unknown pragma 'GCC'
  libssh2/src/session.c(568): warning C4068: unknown pragma 'GCC'
  C:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\shared\ntstatus.h(1): warning C4821: Unable to determine Unicode encoding type, please save the file with signature (BOM)
  libssh2/src/wincng.c(2578): error C2065: 'STATUS_NOT_SUPPORTED': undeclared identifier
  libssh2/src/wincng.c(2596): error C2065: 'STATUS_NOT_SUPPORTED': undeclared identifier
  libssh2/src/wincng.c(2625): error C2065: 'STATUS_NOT_SUPPORTED': undeclared identifier
  exit code: 0
  exit code: 0
  exit code: 0
  exit code: 0
  exit code: 0
  exit code: 0
  exit code: 0
  exit code: 0
  exit code: 0
  exit code: 0
  exit code: 0
  exit code: 0
  exit code: 0
  exit code: 0
  exit code: 2
  cargo:warning=ToolExecError: Command "C:\\Program Files\\Microsoft Visual Studio\\2022\\Professional\\VC\\Tools\\MSVC\\14.40.33807\\bin\\HostX64\\x64\\cl.exe" "-nologo" "-MD" "-O2" "-Brepro" "-I" "C:\\redacted\\Repositories\\Program_Sources\\jj\\target\\release\\build\\libssh2-sys-ded426dd75c5c457\\out\\include" "-I" "libssh2/src" "-I" "libssh2/win32" "-I" "C:\\redacted\\Repositories\\Program_Sources\\jj\\target\\release\\build\\libz-sys-a0ac929a610bcef1\\out/include" "-DHAVE_LONGLONG" "-DLIBSSH2_WIN32" "-DLIBSSH2_WINCNG" "-DLIBSSH2_DH_GEX_NEW" "-DLIBSSH2_HAVE_ZLIB" "-FoC:\\redacted\\Repositories\\Program_Sources\\jj\\target\\release\\build\\libssh2-sys-ded426dd75c5c457\\out\\build\\903bc623e643396f-wincng.o" "-c" "libssh2/src/wincng.c" with args cl.exe did not execute successfully (status code exit code: 2).

  --- stderr
  fatal: not a git repository (or any of the parent directories): .git


  error occurred: Command "C:\\Program Files\\Microsoft Visual Studio\\2022\\Professional\\VC\\Tools\\MSVC\\14.40.33807\\bin\\HostX64\\x64\\cl.exe" "-nologo" "-MD" "-O2" "-Brepro" "-I" "C:\\redacted\\Repositories\\Program_Sources\\jj\\target\\release\\build\\libssh2-sys-ded426dd75c5c457\\out\\include" "-I" "libssh2/src" "-I" "libssh2/win32" "-I" "C:\\redacted\\Repositories\\Program_Sources\\jj\\target\\release\\build\\libz-sys-a0ac929a610bcef1\\out/include" "-DHAVE_LONGLONG" "-DLIBSSH2_WIN32" "-DLIBSSH2_WINCNG" "-DLIBSSH2_DH_GEX_NEW" "-DLIBSSH2_HAVE_ZLIB" "-FoC:\\redacted\\Repositories\\Program_Sources\\jj\\target\\release\\build\\libssh2-sys-ded426dd75c5c457\\out\\build\\903bc623e643396f-wincng.o" "-c" "libssh2/src/wincng.c" with args cl.exe did not execute successfully (status code exit code: 2).


error: failed to compile `jj-cli v0.18.0 (C:\redacted\Repositories\Program_Sources\jj\cli)`, intermediate artifacts can be found at `C:\redacted\Repositories\Program_Sources\jj\target`.
To reuse those artifacts with a future compilation, set the environment variable `CARGO_TARGET_DIR` to that path.

Specifications

  • Platform: Windows 10
  • Version: 76ff35e

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions