Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I fix a bitbake failed to fetch git error?

While bitbaking a Yocto rocko build I got this error:

WARNING: go-systemd-4+gitb4a58d95188dd092ae20072bac14cece0e67c388-r0 do_fetch: Failed to fetch URL git://github.com/coreos/go-systemd.git, attempting MIRRORS if available
ERROR: go-systemd-4+gitb4a58d95188dd092ae20072bac14cece0e67c388-r0 do_fetch: Fetcher failure: Unable to find revision b4a58d95188dd092ae20072bac14cece0e67c388 in branch master even from upstream
ERROR: go-systemd-4+gitb4a58d95188dd092ae20072bac14cece0e67c388-r0 do_fetch: Fetcher failure for URL: 'git://github.com/coreos/go-systemd.git'. Unable to fetch URL from any source.
ERROR: go-systemd-4+gitb4a58d95188dd092ae20072bac14cece0e67c388-r0 do_fetch: Function failed: base_do_fetch
ERROR: Logfile of failure stored in: /home/ubu/build/build-rpb/tmp-rpb-glibc/work/aarch64-linaro-linux/go-systemd/4+gitb4a58d95188dd092ae20072bac14cece0e67c388-r0/temp/log.do_fetch.3021
ERROR: Task (/home/ubu/build/build-rpb/conf/../../layers/meta-virtualization/recipes-devtools/go/go-systemd_git.bb:do_fetch) failed with exit code '1'

go-systemd_git.bb file:

DESCRIPTION = "Go bindings to systemd socket activation, journal, D-Bus, and unit files"
HOMEPAGE = "https://github.com/coreos/go-systemd"
SECTION = "devel/go"
LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://LICENSE;md5=19cbd64715b51267a47bf3750cc6a8a5"

SRCNAME = "systemd"

PKG_NAME = "github.com/coreos/go-${SRCNAME}"
SRC_URI = "git://${PKG_NAME}.git"

SRCREV = "f2399026b73c57c99648e1e5f8f0cacf9282001f"
PV = "4+git${SRCREV}"

RDEPENDS_${PN} += "bash"

S = "${WORKDIR}/git"

do_install() {
    install -d ${D}${prefix}/local/go/src/${PKG_NAME}
    cp -r ${S}/* ${D}${prefix}/local/go/src/${PKG_NAME}/
}

SYSROOT_PREPROCESS_FUNCS += "go_systemd_sysroot_preprocess"

go_systemd_sysroot_preprocess () {
    install -d ${SYSROOT_DESTDIR}${prefix}/local/go/src/${PKG_NAME}
    cp -r ${D}${prefix}/local/go/src/${PKG_NAME} ${SYSROOT_DESTDIR}${prefix}/local/go/src/$(dirname ${PKG_NAME})
}

FILES_${PN} += "${prefix}/local/go/src/${PKG_NAME}/*"

I've manually cloned the repo, confirmed the commit b4a58d95188dd092ae20072bac14cece0e67c388 is in master, and manually put it into my build folder but I am still getting this error.

like image 269
Quintin Kerns Avatar asked Jul 01 '21 18:07

Quintin Kerns


1 Answers

Your problem is bitbake is looking for the commit hash in the master branch which was renamed to main.

SRC_URI = "git://github.com/coreos/go-systemd.git;branch=main"
like image 145
Oleksandr Kravchuk Avatar answered Oct 18 '22 19:10

Oleksandr Kravchuk