7

My question is raised because my build-yocto server ran into the error:

ERROR: Fetcher failure: Fetch command failed with exit code 128, output:
Cloning into bare repository '/mnt/wd2tb/home/Work/skrzg1h_iWg21m_QtHmi/build/downloads/git2/github.com.qtproject.qtenginio.git'...    
Fetcher failure for URL: 'git://github.com/qtproject/qtenginio.git;name=qtenginio;branch=5.6;protocol=git'. Unable to fetch URL from any source.

In the meantime, my PC can do that. So, I cloned the qtenginio repo to my local PC.

$ git clone git://github.com/qtproject/qtenginio.git;name=qtenginio;branch=5.6;protocol=git

And copy the downloaded source code above into the downloads/git2/github.com.qtproject.qtenginio.git folder of Yocto project.

Finally, I run the bitbake command.

$ bitbake qtenginio

But the fetch still fails. Anyone can help me in this case ?

Zermingore
  • 743
  • 2
  • 11
  • 28
Thảo M. Hoàng
  • 1,224
  • 3
  • 20
  • 42

3 Answers3

12

bitbake clones bare git repo, please add option '--bare' and touch a .done file to tell bitbake that do_fetch has been done already:

$ git clone --bare git://github.com/qtproject/qtenginio.git;name=qtenginio;branch=5.6 /mnt/wd2tb/home/Work/skrzg1h_iWg21m_QtHmi/build/downloads/git2/github.com.qtproject.qtenginio.git

$ touch /mnt/wd2tb/home/Work/skrzg1h_iWg21m_QtHmi/build/downloads/git2/github.com.qtproject.qtenginio.git.done

Kai
  • 356
  • 1
  • 6
  • Hi 鹦鹉河, thanks for support. I tried you method. But, it didn't work. However, I tried to remove **#CONF_VERSION = '1'** in local.conf file and also did as your comment. It worked hereby. – Thảo M. Hoàng Dec 19 '16 at 03:08
  • It is a little weird that line begins with # in local.conf is a comment line and should NOT afftect anything. – Kai Dec 20 '16 at 08:09
  • 鹦鹉河, I meant **CONF_VERSION = '1'** changed to **#CONF_VERSION = '1'** – Thảo M. Hoàng Dec 25 '16 at 01:50
  • I am not sure why CONF_VERSION affect that. :( – Kai Dec 26 '16 at 09:21
  • Word of warning. If the `SRC_URI` says `;rev=`*name*, it will be trying to contact the server anyway (at least newer versions) to resolve it. Use a sha1 id to avoid that. Might work by removing it too. – Jan Hudec Oct 07 '20 at 15:30
11

Step 1: download the package by hand (wget, git clone ...)

Step 2: copy the package into ./build/downloads

Step 3: touch a package_name.done file.

Step 4: change permission for the *.done file: chmod 777 package_name.done

Thảo M. Hoàng
  • 1,224
  • 3
  • 20
  • 42
0

Some explanation about BitBake 'Fetch' git implementation : Fetcher source code

Firstly do 'git clone --bare --mirror' of the remote repository (in first instance, bitbake fetcher is not a simple clone : fetcher works by creating a bare clone of the remote)

Note a matching pattern to identify your download/mirrortarball name (download folder is defined by an environment variable DL_DIR)

line 5:

git fetcher support the SRC_URI with format of:
SRC_URI = "git://some.host/somepath;OptionA=xxx;OptionB=xxx;..."

Secondly, server host name 'some.host' and path 'somepath' are changed manually according to following rules, and then both are concatenated to become "gitsrcname"

line 262:

gitsrcname = '%s%s' % (ud.host.replace(':', '.'), ud.path.replace('/', '.').replace('*', '.').replace(' ','_'))

Thridly 'gitsrcname' is prefixed by 'git2_' and suffixed by '.tar.gz', to become your final mirror tarball file name.

line 279:

mirrortarball = 'git2_%s.tar.gz' % gitsrcname

Finally create tarball, do a compressed archive (tar.gz) of the git bare repo, and paste it into DL_DIR.

Then verify .donestamp, so add a tarball.done into DL_DIR.

Line 483:

runfetchcmd("touch %s.done" % ud.fullmirror, d)

During git fetcher download stage, because fulltarball is found and destination actual clone dir is missing then your fulltarball will be used instead of a download.

line 357:

runfetchcmd("tar -xzf %s" % ud.fullmirror, d, workdir=ud.clonedir)
K. PANIK
  • 15
  • 1
  • 6