Skip to content

Problems installing #949

Open
Open
@martinber

Description

@martinber

Hello, I'm trying to install rugged in Termux for Android and I'm having problems:

Running gem install rugged, or downloading the github repo and running gem install -g produces:

LD_LIBRARY_PATH=.:/data/data/com.termux/files/usr/lib /data/data/com.termux/files/usr/bin/make
[  0%] Building C object deps/http-parser/CMakeFiles/http-parser.dir/http_parser.c.o
[  0%] Built target http-parser
[  0%] Building C object deps/pcre/CMakeFiles/pcre.dir/pcre_byte_order.c.o
[  1%] Building C object deps/pcre/CMakeFiles/pcre.dir/pcre_chartables.c.o
[  1%] Building C object deps/pcre/CMakeFiles/pcre.dir/pcre_compile.c.o
/data/data/com.termux/files/usr/lib/ruby/gems/3.2.0/gems/rugged-1.5.1/vendor/libgit2/deps/pcre/pcre_compile.c:4558:7: warning: variable 'class_has_8bitchar' set but not used [-Wunused-but-set-variable]
  int class_has_8bitchar;
      ^
1 warning generated.
[  2%] Building C object deps/pcre/CMakeFiles/pcre.dir/pcre_config.c.o
[  2%] Building C object deps/pcre/CMakeFiles/pcre.dir/pcre_dfa_exec.c.o
[  3%] Building C object deps/pcre/CMakeFiles/pcre.dir/pcre_exec.c.o
[  3%] Building C object deps/pcre/CMakeFiles/pcre.dir/pcre_fullinfo.c.o
[  4%] Building C object deps/pcre/CMakeFiles/pcre.dir/pcre_get.c.o
[  4%] Building C object deps/pcre/CMakeFiles/pcre.dir/pcre_globals.c.o
[  5%] Building C object deps/pcre/CMakeFiles/pcre.dir/pcre_jit_compile.c.o
[  5%] Building C object deps/pcre/CMakeFiles/pcre.dir/pcre_maketables.c.o
[  6%] Building C object deps/pcre/CMakeFiles/pcre.dir/pcre_newline.c.o
[  6%] Building C object deps/pcre/CMakeFiles/pcre.dir/pcre_ord2utf8.c.o
[  7%] Building C object deps/pcre/CMakeFiles/pcre.dir/pcre_refcount.c.o
[  7%] Building C object deps/pcre/CMakeFiles/pcre.dir/pcre_string_utils.c.o
[  8%] Building C object deps/pcre/CMakeFiles/pcre.dir/pcre_study.c.o
[  8%] Building C object deps/pcre/CMakeFiles/pcre.dir/pcre_tables.c.o
[  9%] Building C object deps/pcre/CMakeFiles/pcre.dir/pcre_ucd.c.o
[  9%] Building C object deps/pcre/CMakeFiles/pcre.dir/pcre_valid_utf8.c.o
[ 10%] Building C object deps/pcre/CMakeFiles/pcre.dir/pcre_version.c.o
[ 10%] Building C object deps/pcre/CMakeFiles/pcre.dir/pcre_xclass.c.o
[ 11%] Building C object deps/pcre/CMakeFiles/pcre.dir/pcreposix.c.o
[ 11%] Built target pcre
[ 11%] Building C object deps/ntlmclient/CMakeFiles/ntlmclient.dir/ntlm.c.o
[ 12%] Building C object deps/ntlmclient/CMakeFiles/ntlmclient.dir/util.c.o
[ 12%] Building C object deps/ntlmclient/CMakeFiles/ntlmclient.dir/unicode_builtin.c.o
[ 13%] Building C object deps/ntlmclient/CMakeFiles/ntlmclient.dir/crypt_openssl.c.o
/data/data/com.termux/files/usr/lib/ruby/gems/3.2.0/gems/rugged-1.5.1/vendor/libgit2/deps/ntlmclient/crypt_openssl.c:130:35: warning: 'DES_set_key' is deprecated [-Wdeprecated-declarations]
        ntlm->crypt_ctx.des_set_key_fn = DES_set_key;
                                         ^
/data/data/com.termux/files/usr/include/openssl/des.h:185:1: note: 'DES_set_key' has been explicitly marked deprecated here
OSSL_DEPRECATEDIN_3_0
^
/data/data/com.termux/files/usr/include/openssl/macros.h:182:49: note: expanded from macro 'OSSL_DEPRECATEDIN_3_0'
#   define OSSL_DEPRECATEDIN_3_0                OSSL_DEPRECATED(3.0)
                                                ^
/data/data/com.termux/files/usr/include/openssl/macros.h:62:52: note: expanded from macro 'OSSL_DEPRECATED'
#     define OSSL_DEPRECATED(since) __attribute__((deprecated))
                                                   ^
/data/data/com.termux/files/usr/lib/ruby/gems/3.2.0/gems/rugged-1.5.1/vendor/libgit2/deps/ntlmclient/crypt_openssl.c:131:39: warning: 'DES_ecb_encrypt' is deprecated [-Wdeprecated-declarations]
        ntlm->crypt_ctx.des_ecb_encrypt_fn = DES_ecb_encrypt;
                                             ^
/data/data/com.termux/files/usr/include/openssl/des.h:104:1: note: 'DES_ecb_encrypt' has been explicitly marked deprecated here
OSSL_DEPRECATEDIN_3_0
^
/data/data/com.termux/files/usr/include/openssl/macros.h:182:49: note: expanded from macro 'OSSL_DEPRECATEDIN_3_0'
#   define OSSL_DEPRECATEDIN_3_0                OSSL_DEPRECATED(3.0)
                                                ^
/data/data/com.termux/files/usr/include/openssl/macros.h:62:52: note: expanded from macro 'OSSL_DEPRECATED'
#     define OSSL_DEPRECATED(since) __attribute__((deprecated))
                                                   ^
/data/data/com.termux/files/usr/lib/ruby/gems/3.2.0/gems/rugged-1.5.1/vendor/libgit2/deps/ntlmclient/crypt_openssl.c:135:36: warning: 'HMAC_CTX_new' is deprecated [-Wdeprecated-declarations]
        ntlm->crypt_ctx.hmac_ctx_new_fn = HMAC_CTX_new;
                                          ^
/data/data/com.termux/files/usr/include/openssl/hmac.h:33:1: note: 'HMAC_CTX_new' has been explicitly marked deprecated here
OSSL_DEPRECATEDIN_3_0 HMAC_CTX *HMAC_CTX_new(void);
^
/data/data/com.termux/files/usr/include/openssl/macros.h:182:49: note: expanded from macro 'OSSL_DEPRECATEDIN_3_0'
#   define OSSL_DEPRECATEDIN_3_0                OSSL_DEPRECATED(3.0)
                                                ^
/data/data/com.termux/files/usr/include/openssl/macros.h:62:52: note: expanded from macro 'OSSL_DEPRECATED'
#     define OSSL_DEPRECATED(since) __attribute__((deprecated))
                                                   ^
/data/data/com.termux/files/usr/lib/ruby/gems/3.2.0/gems/rugged-1.5.1/vendor/libgit2/deps/ntlmclient/crypt_openssl.c:136:37: warning: 'HMAC_CTX_free' is deprecated [-Wdeprecated-declarations]
        ntlm->crypt_ctx.hmac_ctx_free_fn = HMAC_CTX_free;
                                           ^
/data/data/com.termux/files/usr/include/openssl/hmac.h:35:1: note: 'HMAC_CTX_free' has been explicitly marked deprecated here
OSSL_DEPRECATEDIN_3_0 void HMAC_CTX_free(HMAC_CTX *ctx);
^
/data/data/com.termux/files/usr/include/openssl/macros.h:182:49: note: expanded from macro 'OSSL_DEPRECATEDIN_3_0'
#   define OSSL_DEPRECATEDIN_3_0                OSSL_DEPRECATED(3.0)
                                                ^
/data/data/com.termux/files/usr/include/openssl/macros.h:62:52: note: expanded from macro 'OSSL_DEPRECATED'
#     define OSSL_DEPRECATED(since) __attribute__((deprecated))
                                                   ^
/data/data/com.termux/files/usr/lib/ruby/gems/3.2.0/gems/rugged-1.5.1/vendor/libgit2/deps/ntlmclient/crypt_openssl.c:137:38: warning: 'HMAC_CTX_reset' is deprecated [-Wdeprecated-declarations]
        ntlm->crypt_ctx.hmac_ctx_reset_fn = HMAC_CTX_reset;
                                            ^
/data/data/com.termux/files/usr/include/openssl/hmac.h:34:1: note: 'HMAC_CTX_reset' has been explicitly marked deprecated here
OSSL_DEPRECATEDIN_3_0 int HMAC_CTX_reset(HMAC_CTX *ctx);
^
/data/data/com.termux/files/usr/include/openssl/macros.h:182:49: note: expanded from macro 'OSSL_DEPRECATEDIN_3_0'
#   define OSSL_DEPRECATEDIN_3_0                OSSL_DEPRECATED(3.0)
                                                ^
/data/data/com.termux/files/usr/include/openssl/macros.h:62:52: note: expanded from macro 'OSSL_DEPRECATED'
#     define OSSL_DEPRECATED(since) __attribute__((deprecated))
                                                   ^
/data/data/com.termux/files/usr/lib/ruby/gems/3.2.0/gems/rugged-1.5.1/vendor/libgit2/deps/ntlmclient/crypt_openssl.c:139:36: warning: 'HMAC_Init_ex' is deprecated [-Wdeprecated-declarations]
        ntlm->crypt_ctx.hmac_init_ex_fn = HMAC_Init_ex;
                                          ^
/data/data/com.termux/files/usr/include/openssl/hmac.h:43:1: note: 'HMAC_Init_ex' has been explicitly marked deprecated here
OSSL_DEPRECATEDIN_3_0 int HMAC_Init_ex(HMAC_CTX *ctx, const void *key, int len,
^
/data/data/com.termux/files/usr/include/openssl/macros.h:182:49: note: expanded from macro 'OSSL_DEPRECATEDIN_3_0'
#   define OSSL_DEPRECATEDIN_3_0                OSSL_DEPRECATED(3.0)
                                                ^
/data/data/com.termux/files/usr/include/openssl/macros.h:62:52: note: expanded from macro 'OSSL_DEPRECATED'
#     define OSSL_DEPRECATED(since) __attribute__((deprecated))
                                                   ^
/data/data/com.termux/files/usr/lib/ruby/gems/3.2.0/gems/rugged-1.5.1/vendor/libgit2/deps/ntlmclient/crypt_openssl.c:140:35: warning: 'HMAC_Update' is deprecated [-Wdeprecated-declarations]
        ntlm->crypt_ctx.hmac_update_fn = HMAC_Update;
                                         ^
/data/data/com.termux/files/usr/include/openssl/hmac.h:45:1: note: 'HMAC_Update' has been explicitly marked deprecated here
OSSL_DEPRECATEDIN_3_0 int HMAC_Update(HMAC_CTX *ctx, const unsigned char *data,
^
/data/data/com.termux/files/usr/include/openssl/macros.h:182:49: note: expanded from macro 'OSSL_DEPRECATEDIN_3_0'
#   define OSSL_DEPRECATEDIN_3_0                OSSL_DEPRECATED(3.0)
                                                ^
/data/data/com.termux/files/usr/include/openssl/macros.h:62:52: note: expanded from macro 'OSSL_DEPRECATED'
#     define OSSL_DEPRECATED(since) __attribute__((deprecated))
                                                   ^
/data/data/com.termux/files/usr/lib/ruby/gems/3.2.0/gems/rugged-1.5.1/vendor/libgit2/deps/ntlmclient/crypt_openssl.c:141:34: warning: 'HMAC_Final' is deprecated [-Wdeprecated-declarations]
        ntlm->crypt_ctx.hmac_final_fn = HMAC_Final;
                                        ^
/data/data/com.termux/files/usr/include/openssl/hmac.h:47:1: note: 'HMAC_Final' has been explicitly marked deprecated here
OSSL_DEPRECATEDIN_3_0 int HMAC_Final(HMAC_CTX *ctx, unsigned char *md,
^
/data/data/com.termux/files/usr/include/openssl/macros.h:182:49: note: expanded from macro 'OSSL_DEPRECATEDIN_3_0'
#   define OSSL_DEPRECATEDIN_3_0                OSSL_DEPRECATED(3.0)
                                                ^
/data/data/com.termux/files/usr/include/openssl/macros.h:62:52: note: expanded from macro 'OSSL_DEPRECATED'
#     define OSSL_DEPRECATED(since) __attribute__((deprecated))
                                                   ^
/data/data/com.termux/files/usr/lib/ruby/gems/3.2.0/gems/rugged-1.5.1/vendor/libgit2/deps/ntlmclient/crypt_openssl.c:142:27: warning: 'MD4' is deprecated [-Wdeprecated-declarations]
        ntlm->crypt_ctx.md4_fn = MD4;
                                 ^
/data/data/com.termux/files/usr/include/openssl/md4.h:53:1: note: 'MD4' has been explicitly marked deprecated here
OSSL_DEPRECATEDIN_3_0 unsigned char *MD4(const unsigned char *d, size_t n,
^
/data/data/com.termux/files/usr/include/openssl/macros.h:182:49: note: expanded from macro 'OSSL_DEPRECATEDIN_3_0'
#   define OSSL_DEPRECATEDIN_3_0                OSSL_DEPRECATED(3.0)
                                                ^
/data/data/com.termux/files/usr/include/openssl/macros.h:62:52: note: expanded from macro 'OSSL_DEPRECATED'
#     define OSSL_DEPRECATED(since) __attribute__((deprecated))
                                                   ^
9 warnings generated.
[ 13%] Built target ntlmclient
[ 14%] Building C object src/libgit2/CMakeFiles/libgit2.dir/annotated_commit.c.o
In file included from /data/data/com.termux/files/usr/lib/ruby/gems/3.2.0/gems/rugged-1.5.1/vendor/libgit2/src/libgit2/annotated_commit.c:8:
In file included from /data/data/com.termux/files/usr/lib/ruby/gems/3.2.0/gems/rugged-1.5.1/vendor/libgit2/src/libgit2/annotated_commit.h:10:
In file included from /data/data/com.termux/files/usr/lib/ruby/gems/3.2.0/gems/rugged-1.5.1/vendor/libgit2/src/libgit2/common.h:10:
In file included from /data/data/com.termux/files/usr/lib/ruby/gems/3.2.0/gems/rugged-1.5.1/vendor/libgit2/src/util/git2_util.h:96:
In file included from /data/data/com.termux/files/usr/include/arpa/inet.h:32:
In file included from /data/data/com.termux/files/usr/include/netinet/in.h:45:
In file included from /data/data/com.termux/files/usr/include/linux/in.h:238:
In file included from /data/data/com.termux/files/usr/include/aarch64-linux-android/asm/byteorder.h:24:
In file included from /data/data/com.termux/files/usr/include/linux/byteorder/little_endian.h:29:
/data/data/com.termux/files/usr/include/linux/swab.h:40:8: error: unknown type name 'inline'
static inline __attribute__((__const__)) __u32 __fswahw32(__u32 val) {
       ^
/data/data/com.termux/files/usr/include/linux/swab.h:40:47: error: expected ';' after top level declarator
static inline __attribute__((__const__)) __u32 __fswahw32(__u32 val) {
                                              ^
2 errors generated.
make[2]: *** [src/libgit2/CMakeFiles/libgit2.dir/build.make:76: src/libgit2/CMakeFiles/libgit2.dir/annotated_commit.c.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:265: src/libgit2/CMakeFiles/libgit2.dir/all] Error 2
make: *** [Makefile:136: all] Error 2

That looks like a problem related to the fact that I'm using clang instead of gcc maybe? or a problem with Termux and not your fault?

Then I tried running gem install -g -- --use-system-libraries and I get this:

LD_LIBRARY_PATH=.:/data/data/com.termux/files/usr/lib pkg-config --exists libgit2
LD_LIBRARY_PATH=.:/data/data/com.termux/files/usr/lib pkg-config --libs libgit2 |
=> "-L/data/data/com.termux/files/usr/lib -lgit2\n"
LD_LIBRARY_PATH=.:/data/data/com.termux/files/usr/lib "aarch64-linux-android-clang -o conftest -I/data/data/com.termux/files/usr/include/ruby-3.2.0/aarch64-linux-android -I/data/data/com.termux/files/usr/include/ruby-3.2.0/ruby/backward -I/data/data/com.termux/files/usr/include/ruby-3.2.0 -I.  -I/data/data/com.termux/files/usr/include   -fstack-protector-strong -Oz -fno-strict-aliasing -fdeclspec -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wextra-tokens -Wdeprecated-declarations -Wdivision-by-zero -Wdiv-by-zero -Wimplicit-function-declaration -Wimplicit-int -Wmisleading-indentation -Wpointer-arith -Wshorten-64-to-32 -Wwrite-strings -Wold-style-definition -Wmissing-noreturn -Wno-cast-function-type -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wunused-variable -Wundef -fPIC  -g -O3 -Wall -Wno-comment conftest.c  -L. -L/data/data/com.termux/files/usr/lib -L. -L/data/data/com.termux/files/usr/lib -Wl,-rpath=/data/data/com.termux/files/usr/lib -fopenmp -static-openmp -Wl,--enable-new-dtags -Wl,--as-needed -Wl,-z,relro,-z,now -Wl,--no-as-needed,-landroid-support,--as-needed -fstack-protector-strong -rdynamic -Wl,-export-dynamic -Wl,--no-as-needed     -lruby  -lm  -lc"
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: int main(int argc, char **argv)
4: {
5:   return !!argv[argc];
6: }
/* end */

LD_LIBRARY_PATH=.:/data/data/com.termux/files/usr/lib "aarch64-linux-android-clang -o conftest -I/data/data/com.termux/files/usr/include/ruby-3.2.0/aarch64-linux-android -I/data/data/com.termux/files/usr/include/ruby-3.2.0/ruby/backward -I/data/data/com.termux/files/usr/include/ruby-3.2.0 -I.  -I/data/data/com.termux/files/usr/include   -fstack-protector-strong -Oz -fno-strict-aliasing -fdeclspec -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wextra-tokens -Wdeprecated-declarations -Wdivision-by-zero -Wdiv-by-zero -Wimplicit-function-declaration -Wimplicit-int -Wmisleading-indentation -Wpointer-arith -Wshorten-64-to-32 -Wwrite-strings -Wold-style-definition -Wmissing-noreturn -Wno-cast-function-type -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wunused-variable -Wundef -fPIC  -g -O3 -Wall -Wno-comment conftest.c  -L. -L/data/data/com.termux/files/usr/lib -L. -L/data/data/com.termux/files/usr/lib -Wl,-rpath=/data/data/com.termux/files/usr/lib -fopenmp -static-openmp -Wl,--enable-new-dtags -Wl,--as-needed -Wl,-z,relro,-z,now -Wl,--no-as-needed,-landroid-support,--as-needed -fstack-protector-strong -rdynamic -Wl,-export-dynamic -Wl,--no-as-needed     -lruby -L/data/data/com.termux/files/usr/lib -lgit2 -lm  -lc"
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: int main(int argc, char **argv)
4: {
5:   return !!argv[argc];
6: }
/* end */

LD_LIBRARY_PATH=.:/data/data/com.termux/files/usr/lib pkg-config --cflags-only-I libgit2 |
=> "-I/data/data/com.termux/files/usr/include\n"
LD_LIBRARY_PATH=.:/data/data/com.termux/files/usr/lib pkg-config --cflags-only-other libgit2 |
=> "\n"
LD_LIBRARY_PATH=.:/data/data/com.termux/files/usr/lib pkg-config --libs-only-l libgit2 |
=> "-lgit2\n"
package configuration for libgit2
incflags: -I/data/data/com.termux/files/usr/include
cflags: 
ldflags: -L/data/data/com.termux/files/usr/lib
libs: -lgit2

LD_LIBRARY_PATH=.:/data/data/com.termux/files/usr/lib "aarch64-linux-android-clang -I/data/data/com.termux/files/usr/include/ruby-3.2.0/aarch64-linux-android -I/data/data/com.termux/files/usr/include/ruby-3.2.0/ruby/backward -I/data/data/com.termux/files/usr/include/ruby-3.2.0 -I. -I/data/data/com.termux/files/usr/include  -I/data/data/com.termux/files/usr/include   -fstack-protector-strong -Oz -fno-strict-aliasing -fdeclspec -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wextra-tokens -Wdeprecated-declarations -Wdivision-by-zero -Wdiv-by-zero -Wimplicit-function-declaration -Wimplicit-int -Wmisleading-indentation -Wpointer-arith -Wshorten-64-to-32 -Wwrite-strings -Wold-style-definition -Wmissing-noreturn -Wno-cast-function-type -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wunused-variable -Wundef -fPIC  -g -O3 -Wall -Wno-comment    -c conftest.c"
conftest.c:5:27: error: invalid token at start of a preprocessor expression
#if LIBGIT2_VER_MAJOR !=  || LIBGIT2_VER_MINOR !=
                          ^
1 error generated.
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: #include <git2/version.h>
4: 
5: #if LIBGIT2_VER_MAJOR !=  || LIBGIT2_VER_MINOR !=
6: #error libgit2 version is not compatible
7: #endif
/* end */

This time I don't know what is happening. I have the libgit2 package installed which includes the .h headers. If I read /usr/include/git2/version.h I see that the version is 1.5.1, and the version of rugged is 1.5.1 too.

Apparently it is a problem in ext/rugged/extconf.rb. I tried to edit it but apparently my changes are not used when I run gem install again

Any ideas? Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions