Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 949505 - sys-apps/bat-0.25.0: fails to compile with dev-libs/libgit2-1.9.0
Summary: sys-apps/bat-0.25.0: fails to compile with dev-libs/libgit2-1.9.0
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Violet Purcell
URL:
Whiteboard:
Keywords: PullRequest
: 949794 (view as bug list)
Depends on:
Blocks:
 
Reported: 2025-02-09 11:38 UTC by Weezer
Modified: 2025-02-15 15:52 UTC (History)
12 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Requested build.log (build.log,160.56 KB, text/x-log)
2025-02-10 18:35 UTC, Weezer
Details
Requested emerge --info (emerge_info_sys_apps_bat.log,6.68 KB, text/x-log)
2025-02-10 18:36 UTC, Weezer
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Weezer 2025-02-09 11:38:57 UTC
Greetings,

sys-apps/bat-0.25.0 fails to compile against dev-libs/libgit2-1.9.0.

Downgrading dev-libs/libgit2 to version 1.8.4 will allow upgrade to sys-apps/bat-0.25.0.

Conversely, downgrading sys-apps/bat to version 0.24.0-r2 will build against dev-libs/libgit2-1.9.0.

Error (Snippet) from build:
-----------
     Running `/var/tmp/portage/sys-apps/bat-0.25.0/work/bat-0.25.0/target/release/build/libgit2-sys-1187f21fa6bd7a0f/build-script-build`
warning: libgit2-sys@0.17.0+1.8.1: failed to probe system libgit2: `PKG_CONFIG_ALLOW_SYSTEM_CFLAGS="1" PKG_CONFIG_ALLOW_SYSTEM_LIBS="1" "x86_64-pc-linux-gnu-pkg-config" "--libs" "--cflags" "libgit2" "libgit2 >= 1.8.1" "libgit2 < 1.9.0"` did not exit successfully: exit status: 1
error: failed to run custom build command for `libgit2-sys v0.17.0+1.8.1`

Caused by:
  process didn't exit successfully: `/var/tmp/portage/sys-apps/bat-0.25.0/work/bat-0.25.0/target/release/build/libgit2-sys-1187f21fa6bd7a0f/build-script-build` (exit status: 101)
  --- stdout
  cargo:rerun-if-env-changed=LIBGIT2_NO_VENDOR
  cargo:rerun-if-env-changed=LIBGIT2_NO_PKG_CONFIG
  cargo:rerun-if-env-changed=PKG_CONFIG_x86_64-unknown-linux-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_x86_64_unknown_linux_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG
  cargo:rerun-if-env-changed=PKG_CONFIG
  cargo:rerun-if-env-changed=LIBGIT2_STATIC
  cargo:rerun-if-env-changed=LIBGIT2_DYNAMIC
  cargo:rerun-if-env-changed=PKG_CONFIG_ALL_STATIC
  cargo:rerun-if-env-changed=PKG_CONFIG_ALL_DYNAMIC
  cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64-unknown-linux-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64_unknown_linux_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG_PATH
  cargo:rerun-if-env-changed=PKG_CONFIG_PATH
  cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64-unknown-linux-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64_unknown_linux_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG_LIBDIR
  cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64-unknown-linux-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64_unknown_linux_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG_SYSROOT_DIR
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR
  cargo:warning=failed to probe system libgit2: `PKG_CONFIG_ALLOW_SYSTEM_CFLAGS="1" PKG_CONFIG_ALLOW_SYSTEM_LIBS="1" "x86_64-pc-linux-gnu-pkg-config" "--libs" "--cflags" "libgit2" "libgit2 >= 1.8.1" "libgit2 < 1.9.0"` did not exit successfully: exit status: 1
  error: could not find system library 'libgit2' required by the 'libgit2-sys' crate

  --- stderr
  Package dependency requirement 'libgit2 < 1.9.0' could not be satisfied.
  Package 'libgit2' has version '1.9.0', required version is '< 1.9.0'


  --- stderr
----------

I tried adjusting versions in the ebuild for dev-libs/libgit2 but it fails when downloading the .crate.  (This may have been me doing something incorrectly)

Reproducible: Always

Steps to Reproduce:
1. Emerge update
2. Update system
3.
Comment 1 Weezer 2025-02-09 11:48:12 UTC
I also tried to add this snippet from the 0.24.0-r2 ebuild to the ebuild for 0.25.0 as it seems to deal with this:

-----------
src_prepare() {
	default

	# libgit2-sys unnecessarily(?) requests <libgit2-1.8.0, bump to 2 for now
	sed -e '/range_version/s/1\.8\.0/2/' \
		-i "${ECARGO_VENDOR}"/libgit2-sys-0.16.1+1.7.1/build.rs || die
}
-----------

This failed to work and I'm sure I've missed something.  This issue seems to have been prevelant prior to this however.
Comment 2 Mike Gilbert gentoo-dev 2025-02-10 16:42:35 UTC
Please attach a build log and provide emerge --info. Then change the bug status to UNCONFIRMED.
Comment 3 Weezer 2025-02-10 18:35:08 UTC
Created attachment 918618 [details]
Requested build.log
Comment 4 Weezer 2025-02-10 18:36:11 UTC
Created attachment 918619 [details]
Requested emerge --info
Comment 5 Weezer 2025-02-10 18:38:24 UTC
Added requested info.  I should also add that I have three different machines with this issue so this is not isolated.

Thanks
Comment 6 Weezer 2025-02-11 21:01:48 UTC
Applied the patch to the ebuild locally and tested with success on two machines.

----------
src_prepare() {
	default

	# libgit2-sys unnecessarily(?) requests <libgit2-1.9.0, bump to 2 for now
	sed -e '/range_version/s/1\.9\.0/2/' \
		-i "${ECARGO_VENDOR}"/libgit2-sys-0.17.0+1.8.1/build.rs || die
}
----------

During my testing I missed the second part of the version bumps:

[ -i "${ECARGO_VENDOR}"/libgit2-sys-0.17.0+1.8.1/build.rs ]

So at least I was close ...

This will fix it for me.  I will close this bug when it goes live or soon thereafter (or someone else can if preferred).

Thanks.
Comment 7 Larry the Git Cow gentoo-dev 2025-02-14 05:18:26 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ca6c0b500eaff6fef1242ef7c800456cc74c42a4

commit ca6c0b500eaff6fef1242ef7c800456cc74c42a4
Author:     Violet Purcell <vimproved@inventati.org>
AuthorDate: 2025-02-11 18:03:13 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2025-02-14 05:15:17 +0000

    sys-apps/bat: fix build with libgit2 1.9.0
    
    Missed this in the bump since I have sys-apps/eza pinning it currently.
    
    Closes: https://bugs.gentoo.org/949505
    Closes: https://bugs.gentoo.org/949536
    Signed-off-by: Violet Purcell <vimproved@inventati.org>
    Closes: https://github.com/gentoo/gentoo/pull/40536
    Signed-off-by: Sam James <sam@gentoo.org>

 sys-apps/bat/bat-0.25.0.ebuild | 8 ++++++++
 1 file changed, 8 insertions(+)
Comment 8 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2025-02-15 15:52:19 UTC
*** Bug 949794 has been marked as a duplicate of this bug. ***