I just discovered that oxidized hasn't been pushing commits to the remote repo for 2 weeks. The error in the logs is: Hook push_to_remote (#<GithubRepo:0x00001e2179a94968>) failed (#<Rugged::NetworkError: unsupported URL protocol>) for event :post_store I found https://github.com/ytti/oxidized/issues/3132 and tried patching the port to add `--with-ssh` to CONFIGURE_ARGS but that didn't help.
Looks to have been caused by https://cgit.freebsd.org/ports/commit/?id=782c642c8a10cdaeff59df09f00990e76d0392d5
Reverting to rubygem-rugged-1.7.2 and libgit2-1.7.2 fixed the error
(In reply to Einar Bjarni Halldórsson from comment #2) > Reverting to rubygem-rugged-1.7.2 and libgit2-1.7.2 fixed the error Patch from 782c642 fixes liggit2 detection >1.7.0 and in fact rubygem-rugged builds fine with libgit2 1.8.*: =>> Checking shared library dependencies 0x0000000000000001 NEEDED Shared library: [libc.so.7] 0x0000000000000001 NEEDED Shared library: [libgit2.so.1.8] 0x0000000000000001 NEEDED Shared library: [libm.so.5] 0x0000000000000001 NEEDED Shared library: [libruby32.so.32] 0x0000000000000001 NEEDED Shared library: [libthr.so.3] Could you take a look at following PR and check if it is related? https://github.com/ytti/oxidized/pull/3298 Is there a way of testing git/ssh connection with this port so a upstream PR could be submited? Thanks
(In reply to Nuno Teixeira from comment #3) Yes, it builds fine, but rugged, which oxidized uses for git operations, apparently doesn't have ssh support. Oxidized starts, and can ssh into switches to fetch the configrations, it then commits the configs to the git repo. What fails is that I have a hook on 'post_store' which pushes commits to another git repo. For that, oxidized uses rugged, and that is the operation that fails. The relevant part of the oxidized config looks like this: hooks: push_to_remote: type: githubrepo events: [post_store] remote_repo: git@gitlab.isnic.is:is/nic/network-configs.git publickey: /var/db/oxidized/.ssh/id_rsa.pub privatekey: /var/db/oxidized/.ssh/id_rsa
(In reply to Einar Bjarni Halldórsson from comment #4) Digging a bit more I found that: https://github.com/libgit2/rugged#use-the-system-provided-libgit2 "However, note that Rugged does only support specific versions of libgit2." Port is using CONFIGURE_ARGS= --use-system-libraries. Could you give a try building with bundled libgit2?
With rubygem-rugged-1.7.2_3 and libgit2-1.8.4: $ ruby -e 'require "rugged"; puts Rugged.features' threads https With rubygem-rugged-1.7.2 and libgit2-1.7.2: $ ruby -e 'require "rugged"; puts Rugged.features' threads https ssh
(In reply to Nuno Teixeira from comment #5) Before we should try building bundled libgit2 we should try first using: CONFIGURE_ARGS= --use-system-libraries --with-ssh I'm away from my PC to check this. I will took a look in a few hours
Created attachment 254997 [details] v0: bundle libgit2 root@rpi4:/usr/ports/devel/rubygem-rugged # ruby -e 'require "rugged"; puts Rugged.features' threads https ssh NOTES: bundled libgit2 - ssh is enabled - adicional files added, check pkg-plist file Please test this port revision 3 and share results. I will continue to try toadd ssh support to original (unbundled) port.
(In reply to Nuno Teixeira from comment #8) > Please test this port revision 3 and share results. Tested and confirm that it works. I see you added cmake:indirect to 'USES', but I don't see 'indirect' in the docs at https://docs.freebsd.org/en/books/porters-handbook/uses/#uses-cmake Is it just missing from the docs?
(In reply to Einar Bjarni Halldórsson from comment #9) > Is it just missing from the docs? Looked through Mk/Uses/cmake.mk and I see it there. That's exactly the arg I was looking for when I was trying to build it, but I hadn't thought of going to the makefile itself.
(In reply to Einar Bjarni Halldórsson from comment #10) My opinion is to use bundled version until upstream add support for higher libgit2 versions and then switch back to system lib build. Any clues if we need a cleanup of aditional files? Some binaries seems not stripped...
(In reply to Nuno Teixeira from comment #11) I've checked pkg plist from original port and this one adds files to: @dir %%GEM_LIB_DIR%%/vendor/libgit2/build/CMakeFiles/... I will give a try to $RM -rf %%GEM_LIB_DIR%%/vendor/libgit2/build since .../build/* shouldn't be installed and update patch.
(In reply to Nuno Teixeira from comment #11) > My opinion is to use bundled version until upstream add support for higher libgit2 versions and then switch back to system lib build. I agree, but I found this deeper in the rugged readme: > if you want to build with the system libgit2 rather than the vendored version. In this case, note that the major and minor versions of libgit2 and rugged must match. Seeing as rugged is now lagging behind libgit2, I have a feeling this will be a regular occurrence if we keep switching to system lib build.
Created attachment 254999 [details] v1: bundled libgit2 + cleanup cmake build - port revision 4 - cleaned build dir from cmake NOTE: gitlab depends on this port, exp-run and run-test recommended
(In reply to Einar Bjarni Halldórsson from comment #13) I agreed with you but in a technical point of view we should use system libs when possible and avoid bundled ones. Lets @mfechner do some tests and decide. Cheers
(In reply to Nuno Teixeira from comment #15) could you please make clear which patch I should test?
(In reply to Matthias Fechner from comment #16) v1: bundled libgit2 + cleanup cmake build https://bugs.freebsd.org/bugzilla/attachment.cgi?id=254999 While at it it may be worth to remove dep: "Warning: you might not need LIB_DEPENDS on libgmp.so" As it seems that its not linked to it in bundled port.
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=e72515028ca9a44595cc728401c341e4858699de commit e72515028ca9a44595cc728401c341e4858699de Author: Nuno Teixeira <eduardo@FreeBSD.org> AuthorDate: 2024-11-07 16:23:01 +0000 Commit: Matthias Fechner <mfechner@FreeBSD.org> CommitDate: 2024-11-07 16:25:16 +0000 devel/rubygem-rugged: use bundled ligbit2 the current libgit2 (1.8.x) is not compatible with rugged and is causing problem with ssh support. PR: 282593 Reported by: einar@isnic.is devel/rubygem-rugged/Makefile | 19 +++++++---- .../files/patch-ext_rugged_extconf.rb (gone) | 37 ---------------------- 2 files changed, 13 insertions(+), 43 deletions(-)
Thanks a lot for the report, the analysis and the provided patch. I switched to bundled libgit, I hope that fixes your problem. Gitlab showed no problem using this version while I did some tests.
A commit in branch 2024Q4 references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=8f668fba0d28f6faef186bfdc1e9d233c559e237 commit 8f668fba0d28f6faef186bfdc1e9d233c559e237 Author: Nuno Teixeira <eduardo@FreeBSD.org> AuthorDate: 2024-11-07 16:23:01 +0000 Commit: Matthias Fechner <mfechner@FreeBSD.org> CommitDate: 2024-11-15 15:56:44 +0000 devel/rubygem-rugged: use bundled ligbit2 the current libgit2 (1.8.x) is not compatible with rugged and is causing problem with ssh support. PR: 282593 Reported by: einar@isnic.is (cherry picked from commit e72515028ca9a44595cc728401c341e4858699de) devel/rubygem-rugged/Makefile | 18 ++++++++--- .../files/patch-ext_rugged_extconf.rb (gone) | 37 ---------------------- 2 files changed, 13 insertions(+), 42 deletions(-)