Skip to content

ssh2/libgit2: Disable openssl and zlib detection #290

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

Merged
merged 1 commit into from
May 30, 2025

Conversation

Faless
Copy link
Contributor

@Faless Faless commented May 28, 2025

This seems to only be used with the OpenSSL backend (which we plan to drop).

libgit2 already use builtin ZLIB, I'm not even sure we if it would be used in libssh2 (we only use libssh2 to provide git ssh access, and git already compress objects.

Should fix the Fedora issue reported in #199 (comment) .

akien-mga
akien-mga previously approved these changes May 30, 2025
@akien-mga
Copy link
Member

Actually this doesn't work for me:

g++ -o godot-git-plugin/src/git_wrappers.os -c -fno-gnu-unique -fno-exceptions -std=c++17 -fPIC -Wwrite-strings -m64 -march=x86-64 -O2 -fvisibility=hidden -fPIC -DHOT_RELOAD_ENABLED -DLINUX_ENABLED -DUNIX_ENABLED -DTOOLS_ENABLED -DDEBUG_ENABLED -DDEBUG_METHODS_ENABLED -DNDEBUG -Ibin/thirdparty/openssl/linux/x86_64/dest/include -Igodot-cpp/gdextension -Igodot-cpp/include -Igodot-cpp/gen/include -Ithirdparty/ssh2/libssh2/include -Ithirdparty/git2/libgit2/include -Igodot-git-plugin -Igodot-git-plugin/src -Ithirdparty/git2/libgit2/include godot-git-plugin/src/git_wrappers.cpp
-- The C compiler identification is GNU 15.1.1
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/gcc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Found PkgConfig: /usr/bin/pkg-config (found version "2.3.0")
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
-- Performing Test HAVE_STRUCT_STAT_ST_MTIM
-- Performing Test HAVE_STRUCT_STAT_ST_MTIM - Success
-- Performing Test HAVE_STRUCT_STAT_ST_MTIMESPEC
-- Performing Test HAVE_STRUCT_STAT_ST_MTIMESPEC - Failed
-- Performing Test HAVE_STRUCT_STAT_MTIME_NSEC
-- Performing Test HAVE_STRUCT_STAT_MTIME_NSEC - Failed
-- Performing Test HAVE_STRUCT_STAT_NSEC
-- Performing Test HAVE_STRUCT_STAT_NSEC - Success
-- Looking for futimens
-- Looking for futimens - found
-- Performing Test IS_WALL_SUPPORTED
-- Performing Test IS_WALL_SUPPORTED - Success
-- Performing Test IS_WEXTRA_SUPPORTED
-- Performing Test IS_WEXTRA_SUPPORTED - Success
-- Performing Test IS_WDOCUMENTATION_SUPPORTED
-- Performing Test IS_WDOCUMENTATION_SUPPORTED - Failed
-- Performing Test IS_WNO_DOCUMENTATION_DEPRECATED_SYNC_SUPPORTED
-- Performing Test IS_WNO_DOCUMENTATION_DEPRECATED_SYNC_SUPPORTED - Success
-- Performing Test IS_WNO_MISSING_FIELD_INITIALIZERS_SUPPORTED
-- Performing Test IS_WNO_MISSING_FIELD_INITIALIZERS_SUPPORTED - Success
-- Performing Test IS_WMISSING_DECLARATIONS_SUPPORTED
-- Performing Test IS_WMISSING_DECLARATIONS_SUPPORTED - Success
-- Performing Test IS_WSTRICT_ALIASING_SUPPORTED
-- Performing Test IS_WSTRICT_ALIASING_SUPPORTED - Success
-- Performing Test IS_WSTRICT_PROTOTYPES_SUPPORTED
-- Performing Test IS_WSTRICT_PROTOTYPES_SUPPORTED - Success
-- Performing Test IS_WDECLARATION_AFTER_STATEMENT_SUPPORTED
-- Performing Test IS_WDECLARATION_AFTER_STATEMENT_SUPPORTED - Success
-- Performing Test IS_WSHIFT_COUNT_OVERFLOW_SUPPORTED
-- Performing Test IS_WSHIFT_COUNT_OVERFLOW_SUPPORTED - Success
-- Performing Test IS_WUNUSED_CONST_VARIABLE_SUPPORTED
-- Performing Test IS_WUNUSED_CONST_VARIABLE_SUPPORTED - Success
-- Performing Test IS_WUNUSED_FUNCTION_SUPPORTED
-- Performing Test IS_WUNUSED_FUNCTION_SUPPORTED - Success
-- Performing Test IS_WINT_CONVERSION_SUPPORTED
-- Performing Test IS_WINT_CONVERSION_SUPPORTED - Success
-- Performing Test IS_WC11_EXTENSIONS_SUPPORTED
-- Performing Test IS_WC11_EXTENSIONS_SUPPORTED - Failed
-- Performing Test IS_WC99_C11_COMPAT_SUPPORTED
-- Performing Test IS_WC99_C11_COMPAT_SUPPORTED - Success
-- Performing Test IS_WFORMAT_SUPPORTED
-- Performing Test IS_WFORMAT_SUPPORTED - Success
-- Performing Test IS_WFORMAT_SECURITY_SUPPORTED
-- Performing Test IS_WFORMAT_SECURITY_SUPPORTED - Success
-- Could NOT find GSSAPI (missing: GSSAPI_LIBRARIES) 
-- Could NOT find ZLIB (missing: ZLIB_LIBRARY) (found version "1.3.1")
-- Found OpenSSL: /home/akien/Godot/godot-git-plugin/bin/thirdparty/openssl/linux/x86_64/libcrypto.a (found version "3.1.1")
-- http-parser version 2 was not found or disabled; using bundled 3rd-party sources.
-- Performing Test IS_WIMPLICIT_FALLTHROUGH_1_SUPPORTED
-- Performing Test IS_WIMPLICIT_FALLTHROUGH_1_SUPPORTED - Success
-- Could NOT find PCRE (missing: PCRE_LIBRARY PCRE_INCLUDE_DIR) 
-- Looking for dirent.h
-- Looking for dirent.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for inttypes.h
-- Looking for inttypes.h - found
-- Looking for sys/stat.h
-- Looking for sys/stat.h - found
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for unistd.h
-- Looking for unistd.h - found
-- Looking for windows.h
-- Looking for windows.h - not found
-- Looking for bcopy
-- Looking for bcopy - found
-- Looking for memmove
-- Looking for memmove - found
-- Looking for strerror
-- Looking for strerror - found
-- Looking for strtoll
-- Looking for strtoll - found
-- Looking for strtoq
-- Looking for strtoq - found
-- Looking for _strtoi64
-- Looking for _strtoi64 - not found
-- Looking for stddef.h
-- Looking for stddef.h - found
-- Check size of long long
-- Check size of long long - done
-- Check size of unsigned long long
-- Check size of unsigned long long - done
-- Performing Test IS_WNO_UNUSED_FUNCTION_SUPPORTED
-- Performing Test IS_WNO_UNUSED_FUNCTION_SUPPORTED - Success
-- Performing Test IS_WNO_IMPLICIT_FALLTHROUGH_SUPPORTED
-- Performing Test IS_WNO_IMPLICIT_FALLTHROUGH_SUPPORTED - Success
-- Checking for module 'ssh2'
--   Package 'ssh2' not found
-- Found LibSSH2: /home/akien/Godot/godot-git-plugin/bin/thirdparty/ssh2/linux/x86_64/src/libssh2.a
-- Looking for libssh2_userauth_publickey_frommemory in /home/akien/Godot/godot-git-plugin/bin/thirdparty/ssh2/linux/x86_64/src/libssh2.a
-- Looking for libssh2_userauth_publickey_frommemory in /home/akien/Godot/godot-git-plugin/bin/thirdparty/ssh2/linux/x86_64/src/libssh2.a - not found
-- Performing Test IS_WNO_UNUSED_PARAMETER_SUPPORTED
-- Performing Test IS_WNO_UNUSED_PARAMETER_SUPPORTED - Success
-- Checking prototype qsort_r for GIT_QSORT_BSD
-- Checking prototype qsort_r for GIT_QSORT_BSD - False
-- Checking prototype qsort_r for GIT_QSORT_GNU
-- Checking prototype qsort_r for GIT_QSORT_GNU - True
-- Checking prototype qsort_s for GIT_QSORT_C11
-- Checking prototype qsort_s for GIT_QSORT_C11 - False
-- Checking prototype qsort_s for GIT_QSORT_MSC
-- Checking prototype qsort_s for GIT_QSORT_MSC - False
-- Looking for getentropy
-- Looking for getentropy - found
-- Looking for getloadavg
-- Looking for getloadavg - found
-- Looking for poll
-- Looking for poll - found
-- Looking for select
-- Looking for select - found
-- Looking for clock_gettime in rt
-- Looking for clock_gettime in rt - found
-- Enabled features:
 * nanoseconds, support nanosecond precision file mtimes and ctimes
 * HTTPS, using OpenSSL
 * SHA1, using OpenSSL
 * SHA256, using OpenSSL
 * http-parser, http-parser support (bundled)
 * regex, using bundled PCRE
 * xdiff, xdiff support (bundled)
 * SSH, SSH transport support
 * zlib, using bundled zlib
 * futimens, futimens support
 * threadsafe, threadsafe support
 * ntlmclient, NTLM authentication support for Unix

-- Disabled features:
 * SHA256 API, experimental SHA256 APIs
 * debugpool, debug pool allocator
 * debugalloc, debug strict allocators
 * debugopen, path validation in open
 * GSSAPI, GSSAPI support for SPNEGO authentication
 * iconv, iconv encoding conversion support

-- Configuring done (4.1s)
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
ZLIB_LIBRARY
    linked by target "libgit2package" in directory /home/akien/Godot/godot-git-plugin/thirdparty/git2/libgit2/src/libgit2

-- Generating done (0.0s)
CMake Warning:
  Manually-specified variables were not used by the project:

    CMAKE_CXX_COMPILER
    CMAKE_CXX_FLAGS
    STATIC_CRT
    USE_WINHTTP


CMake Generate step failed.  Build files cannot be regenerated correctly.
scons: *** [bin/thirdparty/git2/linux/x86_64/CMakeCache.txt] Error 1
scons: building terminated because of errors.

@akien-mga akien-mga dismissed their stale review May 30, 2025 13:01

Doesn't work yet.

@Faless
Copy link
Contributor Author

Faless commented May 30, 2025

I'm pretty clueless at this point, the error you are seeing now is about libgit2 (and no longer libssh2), the config says:

zlib, using bundled zlib

But then fails saying:

CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
ZLIB_LIBRARY
    linked by target "libgit2package" in directory /home/akien/Godot/godot-git-plugin/thirdparty/git2/libgit2/src/libgit2

How can it have the bundled zlib as NOTFOUND if it's using the bundled one?

This seems to only be used with the OpenSSL backend (which we plan to
drop).

libgit2 already use builtin ZLIB, I'm not even sure we if it would be
used in libssh2 (we only use libssh2 to provide git ssh access, and git
already compress objects.
@Faless Faless force-pushed the fix/disable_zlib_detection branch from 55a9ef2 to 94db3a7 Compare May 30, 2025 22:44
@Faless
Copy link
Contributor Author

Faless commented May 30, 2025

Alright, so it turns out the issue was coming from the openssl-devel dependency, and the find_package(openssl) which was coming from the OS.

Force-disabling also the openssl find package fixes it.

Copy link
Member

@akien-mga akien-mga left a comment

Choose a reason for hiding this comment

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

Confirmed working on Fedora 42 with openssl-devel installed.

@akien-mga akien-mga merged commit b51e8ee into godotengine:master May 30, 2025
4 checks passed
@akien-mga
Copy link
Member

Thanks!

@akien-mga akien-mga changed the title ssh2: Disable zlib detection ssh2/libgit2: Disable openssl and zlib detection May 30, 2025
@Faless Faless deleted the fix/disable_zlib_detection branch May 30, 2025 23:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants