Skip to content
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

libgit2 1.8: TreeToTreeDiffTest#test_each_line_patch_header fails #978

Open
dvzrv opened this issue Apr 23, 2024 · 3 comments
Open

libgit2 1.8: TreeToTreeDiffTest#test_each_line_patch_header fails #978

dvzrv opened this issue Apr 23, 2024 · 3 comments

Comments

@dvzrv
Copy link

dvzrv commented Apr 23, 2024

Hi! 👋

We're currently rebuilding everything against libgit2 1.8 on Arch Linux.
With current ruby-rugged 1.7.2 I noticed one test failure when rebuilding:

Finished in 6.331293s, 87.0280 runs/s, 368.0133 assertions/s.

  1) Skipped:
RemoteNetworkTest#test_remote_check_connection_push [/build/ruby-rugged/src/rugged-1.7.2/test/remote_test.rb:10]:
no local git-daemon

  2) Skipped:
RemoteNetworkTest#test_remote_network_connect [/build/ruby-rugged/src/rugged-1.7.2/test/remote_test.rb:10]:
no local git-daemon

  3) Skipped:
RemoteNetworkTest#test_remote_check_connection_fetch [/build/ruby-rugged/src/rugged-1.7.2/test/remote_test.rb:10]:
no local git-daemon

  4) Skipped:
RemoteNetworkTest#test_remote_check_connection_push_credentials [/build/ruby-rugged/src/rugged-1.7.2/test/remote_test.rb:32]:
Skipped, no message given

  5) Skipped:
RemoteNetworkTest#test_remote_check_connection_invalid [/build/ruby-rugged/src/rugged-1.7.2/test/remote_test.rb:10]:
no local git-daemon

  6) Failure:
TreeToTreeDiffTest#test_each_line_patch_header [/build/ruby-rugged/src/rugged-1.7.2/test/diff_test.rb:922]:
Expected: 2
  Actual: 0

551 runs, 2330 assertions, 1 failures, 0 errors, 5 skips
rake aborted!
Command failed with status (1): [ruby -w -I"lib:lib:test" /usr/lib/ruby/gems/3.0.0/gems/rake-13.0.6/lib/rake/rake_test_loader.rb "test/blame_test.rb" "test/blob_test.rb" "test/branch_test.rb" "test/cherrypick_test.rb" "test/commit_test.rb" "test/config_test.rb" "test/diff_test.rb" "test/dotgit_test.rb" "test/errors_test.rb" "test/index_test.rb" "test/lib_test.rb" "test/merge_test.rb" "test/note_test.rb" "test/object_test.rb" "test/patch_test.rb" "test/rebase_test.rb" "test/reference_test.rb" "test/remote_test.rb" "test/repo_apply_test.rb" "test/repo_ignore_test.rb" "test/repo_pack_test.rb" "test/repo_reset_test.rb" "test/repo_test.rb" "test/revert_test.rb" "test/settings_test.rb" "test/signature_test.rb" "test/status_test.rb" "test/submodule_test.rb" "test/tag_test.rb" "test/tree_test.rb" "test/walker_test.rb" --verbose]
/usr/lib/ruby/gems/3.0.0/gems/rake-13.0.6/lib/rake/testtask.rb:130:in `block (3 levels) in define'
/usr/lib/ruby/gems/3.0.0/gems/rake-13.0.6/lib/rake/file_utils.rb:57:in `sh'
/usr/lib/ruby/gems/3.0.0/gems/rake-13.0.6/lib/rake/file_utils.rb:104:in `ruby'
/usr/lib/ruby/gems/3.0.0/gems/rake-13.0.6/lib/rake/testtask.rb:117:in `block (2 levels) in define'
/usr/lib/ruby/gems/3.0.0/gems/rake-13.0.6/lib/rake/file_utils_ext.rb:58:in `verbose'
/usr/lib/ruby/gems/3.0.0/gems/rake-13.0.6/lib/rake/testtask.rb:111:in `block in define'
/usr/lib/ruby/gems/3.0.0/gems/rake-13.0.6/lib/rake/task.rb:281:in `block in execute'
/usr/lib/ruby/gems/3.0.0/gems/rake-13.0.6/lib/rake/task.rb:281:in `each'
/usr/lib/ruby/gems/3.0.0/gems/rake-13.0.6/lib/rake/task.rb:281:in `execute'
/usr/lib/ruby/gems/3.0.0/gems/rake-13.0.6/lib/rake/task.rb:219:in `block in invoke_with_call_chain'
/usr/lib/ruby/gems/3.0.0/gems/rake-13.0.6/lib/rake/task.rb:199:in `synchronize'
/usr/lib/ruby/gems/3.0.0/gems/rake-13.0.6/lib/rake/task.rb:199:in `invoke_with_call_chain'
/usr/lib/ruby/gems/3.0.0/gems/rake-13.0.6/lib/rake/task.rb:188:in `invoke'
/usr/lib/ruby/gems/3.0.0/gems/rake-13.0.6/lib/rake/application.rb:160:in `invoke_task'
/usr/lib/ruby/gems/3.0.0/gems/rake-13.0.6/lib/rake/application.rb:116:in `block (2 levels) in top_level'
/usr/lib/ruby/gems/3.0.0/gems/rake-13.0.6/lib/rake/application.rb:116:in `each'
/usr/lib/ruby/gems/3.0.0/gems/rake-13.0.6/lib/rake/application.rb:116:in `block in top_level'
/usr/lib/ruby/gems/3.0.0/gems/rake-13.0.6/lib/rake/application.rb:125:in `run_with_threads'
/usr/lib/ruby/gems/3.0.0/gems/rake-13.0.6/lib/rake/application.rb:110:in `top_level'
/usr/lib/ruby/gems/3.0.0/gems/rake-13.0.6/lib/rake/application.rb:83:in `block in run'
/usr/lib/ruby/gems/3.0.0/gems/rake-13.0.6/lib/rake/application.rb:186:in `standard_exception_handling'
/usr/lib/ruby/gems/3.0.0/gems/rake-13.0.6/lib/rake/application.rb:80:in `run'
/usr/lib/ruby/gems/3.0.0/gems/rake-13.0.6/exe/rake:27:in `<top (required)>'
/usr/bin/rake:23:in `load'
/usr/bin/rake:23:in `<main>'
Tasks: TOP => testz

ruby-rugged-1.7.2-2-x86_64-check.log
ruby-rugged-1.7.2-2-x86_64-build.log

@carlosmn
Copy link
Member

This is a bug in libgit2 AFAICT, see libgit2/libgit2#5893 (comment)

@nunotexbsd
Copy link

Hello,

Doing build at FreeBSD with libgit2 1.8.1 and buid fails with:

<snip>
Building native extensions with: '--use-system-libraries'
This could take a while...
ERROR:  Error installing rugged-1.7.2.gem:
	ERROR: Failed to build gem native extension.

    current directory: /wrkdirs/usr/ports/devel/rubygem-rugged/work/stage/usr/local/lib/ruby/gems/3.2/gems/rugged-1.7.2/ext/rugged
/usr/local/bin/ruby32 extconf.rb --use-system-libraries
checking for gmake... no
checking for make... yes
Building Rugged using system libraries.
libgit2 version is not compatible, expected ~> 1.7.0
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.
<snip>

Am I missing something here or libgit2 1.8.1 isn't supported yet?

Full log here

Thanks

Thanks

@papoteur-mga
Copy link

Building in Mageia v 1.7.2 against libgit2 v1.8.1 and GCC 14, I get:

creating Makefile
current directory: /builddir/build/BUILD/rugged-1.7.2/usr/share/gems/gems/rugged-1.7.2/ext/rugged
["make", "DESTDIR=", "sitearchdir=./.gem.20240920-1084143-urqap1", "sitelibdir=./.gem.20240920-1084143-urqap1", "clean"]
rm -f 
rm -fr rugged.so false *.o  *.bak mkmf.log .*.time
current directory: /builddir/build/BUILD/rugged-1.7.2/usr/share/gems/gems/rugged-1.7.2/ext/rugged
["make", "DESTDIR=", "sitearchdir=./.gem.20240920-1084143-urqap1", "sitelibdir=./.gem.20240920-1084143-urqap1"]
ERROR:  Error installing rugged-1.7.2.gem:
        ERROR: Failed to build gem native extension.

    current directory: /builddir/build/BUILD/rugged-1.7.2/usr/share/gems/gems/rugged-1.7.2/ext/rugged
/usr/bin/ruby -I /usr/share/rubygems extconf.rb
current directory: /builddir/build/BUILD/rugged-1.7.2/usr/share/gems/gems/rugged-1.7.2/ext/rugged
make DESTDIR\= sitearchdir\=./.gem.20240920-1084143-urqap1 sitelibdir\=./.gem.20240920-1084143-urqap1 clean
current directory: /builddir/build/BUILD/rugged-1.7.2/usr/share/gems/gems/rugged-1.7.2/ext/rugged
make DESTDIR\= sitearchdir\=./.gem.20240920-1084143-urqap1 sitelibdir\=./.gem.20240920-1084143-urqap1
Building has failed. See above output for more information on the failure.
make failed, exit code 2

Gem files will remain installed in /builddir/build/BUILD/rugged-1.7.2/usr/share/gems/gems/rugged-1.7.2 for inspection.
Results logged to /builddir/build/BUILD/rugged-1.7.2/usr/lib64/gems/ruby/rugged-1.7.2/gem_make.out
gcc -I. -I/usr/include -I/usr/include/ruby/backward -I/usr/include -I.  -DHAVE_GIT2_H    -fPIC -O2 -g -pipe -Wformat -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -m64 -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection=full  -g -Wall -Wno-comment  -m64 -o rugged.o -c rugged.c
gcc -I. -I/usr/include -I/usr/include/ruby/backward -I/usr/include -I.  -DHAVE_GIT2_H    -fPIC -O2 -g -pipe -Wformat -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -m64 -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection=full  -g -Wall -Wno-comment  -m64 -o rugged_allocator.o -c rugged_allocator.c
gcc -I. -I/usr/include -I/usr/include/ruby/backward -I/usr/include -I.  -DHAVE_GIT2_H    -fPIC -O2 -g -pipe -Wformat -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -m64 -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection=full  -g -Wall -Wno-comment  -m64 -o rugged_backend.o -c rugged_backend.c
gcc -I. -I/usr/include -I/usr/include/ruby/backward -I/usr/include -I.  -DHAVE_GIT2_H    -fPIC -O2 -g -pipe -Wformat -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -m64 -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection=full  -g -Wall -Wno-comment  -m64 -o rugged_blame.o -c rugged_blame.c
gcc -I. -I/usr/include -I/usr/include/ruby/backward -I/usr/include -I.  -DHAVE_GIT2_H    -fPIC -O2 -g -pipe -Wformat -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -m64 -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection=full  -g -Wall -Wno-comment  -m64 -o rugged_blob.o -c rugged_blob.c
gcc -I. -I/usr/include -I/usr/include/ruby/backward -I/usr/include -I.  -DHAVE_GIT2_H    -fPIC -O2 -g -pipe -Wformat -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -m64 -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection=full  -g -Wall -Wno-comment  -m64 -o rugged_branch.o -c rugged_branch.c
gcc -I. -I/usr/include -I/usr/include/ruby/backward -I/usr/include -I.  -DHAVE_GIT2_H    -fPIC -O2 -g -pipe -Wformat -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -m64 -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection=full  -g -Wall -Wno-comment  -m64 -o rugged_branch_collection.o -c rugged_branch_collection.c
gcc -I. -I/usr/include -I/usr/include/ruby/backward -I/usr/include -I.  -DHAVE_GIT2_H    -fPIC -O2 -g -pipe -Wformat -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -m64 -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection=full  -g -Wall -Wno-comment  -m64 -o rugged_commit.o -c rugged_commit.c
rugged_commit.c: In function 'rb_git_commit_create':
rugged_commit.c:567:28: error: passing argument 10 of 'git_commit_create' from incompatible pointer type [-Wincompatible-pointer-types]
  567 |                 commit_data.parents);
      |                 ~~~~~~~~~~~^~~~~~~~
      |                            |
      |                            const git_commit **
In file included from /usr/include/git2/repository.h:14,
                 from /usr/include/git2/annotated_commit.h:11,
                 from /usr/include/git2.h:11,
                 from rugged.h:26,
                 from rugged_commit.c:8:
/usr/include/git2/commit.h:369:28: note: expected 'git_commit * const*' but argument is of type 'const git_commit **'
  369 |         git_commit * const parents[]);
      |         ~~~~~~~~~~~~~~~~~~~^~~~~~~~~
rugged_commit.c: In function 'rb_git_commit_create_to_s':
rugged_commit.c:816:28: error: passing argument 9 of 'git_commit_create_buffer' from incompatible pointer type [-Wincompatible-pointer-types]
  816 |                 commit_data.parents);
      |                 ~~~~~~~~~~~^~~~~~~~
      |                            |
      |                            const git_commit **
/usr/include/git2/commit.h:515:28: note: expected 'git_commit * const*' but argument is of type 'const git_commit **'
  515 |         git_commit * const parents[]);
      |         ~~~~~~~~~~~~~~~~~~~^~~~~~~~~
make: *** [Makefile:248: rugged_commit.o] Error 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants