| Summary: | Fetcher code incorrectly forces fetch of files which are in the download directory or mirror | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Build System, Metadata & Runtime] Meta-yocto | Reporter: | Gary Thomas <gary> | ||||
| Component: | meta-yocto | Assignee: | Richard Purdie <richard.purdie> | ||||
| Status: | VERIFIED FIXED | QA Contact: | |||||
| Severity: | critical | ||||||
| Priority: | High | CC: | laurentiu.serban, poky.bs.watcher, poky.watcher, sgw, shane.wang | ||||
| Version: | 1.2 | ||||||
| Target Milestone: | 1.3 M1 | ||||||
| Hardware: | x86 | ||||||
| OS: | Multiple | ||||||
| Whiteboard: | Issue debugged and patch under discussion/testing | ||||||
| OS type for building Yocto: | --- | Type of Regression: | --- | ||||
| Verified: | Documentation change: | --- | |||||
| Attachments: |
|
||||||
|
Description
Gary Thomas
2012-06-07 22:10:35 UTC
This isn't as simple as you're describing it since I tried setting BB_NO_NETWORK = "1" in my local.conf (confirmed set with -e) and my fetch for gtk+ suceeded. I then ran a -c cleanall, and the fetch then failed afterwards. So is there something more specific about your environment needed to reproduce this? I'm wondering what values of PREMIRRORS and MIRRORS you're using? (In reply to comment #2) > I'm wondering what values of PREMIRRORS and MIRRORS you're using? I use "own-mirrors" set to a local directory, e.g. SOURCE_MIRROR_URL ?= "file:///work/misc/Poky/sources/" INHERIT += "own-mirrors" My comment about BB_NO_NETWORK was just to show when the file is being downloaded, not that setting it causes the problem. Sorry for any confusion. The real issue is that the source tarball is being fetched from the network even if it exists in the mirror. Created attachment 572 [details]
Log showing fetch behaviour
A quick question: Are you only seeing this for gtk+ ?
I think this patch might fix things:
--- a/bitbake/lib/bb/fetch2/local.py
+++ b/bitbake/lib/bb/fetch2/local.py
@@ -26,6 +26,7 @@ BitBake build tools.
# Based on functions from the base bb module, Copyright 2003 Holger Schurig
import os
+import urllib
import bb
import bb.utils
from bb import data
@@ -40,7 +41,7 @@ class Local(FetchMethod):
def urldata_init(self, ud, d):
# We don't set localfile as for this fetcher the file is already local!
- ud.basename = os.path.basename(ud.url.split("://")[1].split(";")[0])
+ ud.basename = os.path.basename(urllib.unquote(ud.url.split("://")[1].split(";")[0]))
return
def localpath(self, url, urldata, d):
@@ -49,6 +50,7 @@ class Local(FetchMethod):
"""
path = url.split("://")[1]
path = path.split(";")[0]
+ path = urllib.unquote(path)
newpath = path
if path[0] != "/":
filespath = data.getVar('FILESPATH', d, True)
*** Bug 2546 has been marked as a duplicate of this bug. *** (In reply to comment #5) > A quick question: Are you only seeing this for gtk+ ? Correct. It appears to be related to the '+' in the URL > > I think this patch might fix things: Tested this patch and it does work - the gtk+ tarball is no longer fetched from the network. > > --- a/bitbake/lib/bb/fetch2/local.py > +++ b/bitbake/lib/bb/fetch2/local.py > @@ -26,6 +26,7 @@ BitBake build tools. > # Based on functions from the base bb module, Copyright 2003 Holger Schurig > > import os > +import urllib > import bb > import bb.utils > from bb import data > @@ -40,7 +41,7 @@ class Local(FetchMethod): > > def urldata_init(self, ud, d): > # We don't set localfile as for this fetcher the file is already > local! > - ud.basename = os.path.basename(ud.url.split("://")[1].split(";")[0]) > + ud.basename = > os.path.basename(urllib.unquote(ud.url.split("://")[1].split(";")[0])) > return > > def localpath(self, url, urldata, d): > @@ -49,6 +50,7 @@ class Local(FetchMethod): > """ > path = url.split("://")[1] > path = path.split(";")[0] > + path = urllib.unquote(path) > newpath = path > if path[0] != "/": > filespath = data.getVar('FILESPATH', d, True) With the patch above, there is now a slight change in behaviour. As mentioned, I use "own-mirrors" set up like this: BB_GENERATE_MIRROR_TARBALLS ?= "1" SOURCE_MIRROR_URL ?= "file:///work/misc/Poky/sources/" INHERIT += "own-mirrors" Before, all files which exist on the mirror create a soft link in the local "downloads" directory, e.g. $ ls -l downloads/*v4l* lrwxrwxrwx 1 gthomas gthomas 63 Mar 27 10:57 downloads/git2_linuxtv.org.v4l-utils.git.tar.gz -> /local/poky-multi/sources/git2_linuxtv.org.v4l-utils.git.tar.gz After this change, they are not fetched from the network but seem to be copied from the mirror. I just ran this sequence: $ bitbake v4l-utils -c cleansstate $ rm downloads/*v4l* $ bitbake v4l-utils -c fetch which now shows $ ls -l downloads/*v4l* -rw-rw-r-- 1 gthomas gthomas 1439674 Jun 13 09:53 downloads/git2_linuxtv.org.v4l-utils.git.tar.gz I'll try to verify that the patch caused this change. (In reply to comment #8) > With the patch above, there is now a slight change in behaviour. As > mentioned, > I use "own-mirrors" set up like this: > BB_GENERATE_MIRROR_TARBALLS ?= "1" > SOURCE_MIRROR_URL ?= "file:///work/misc/Poky/sources/" > INHERIT += "own-mirrors" > > Before, all files which exist on the mirror create a soft link in the local > "downloads" directory, e.g. > $ ls -l downloads/*v4l* > lrwxrwxrwx 1 gthomas gthomas 63 Mar 27 10:57 > downloads/git2_linuxtv.org.v4l-utils.git.tar.gz -> > /local/poky-multi/sources/git2_linuxtv.org.v4l-utils.git.tar.gz > > After this change, they are not fetched from the network but seem to be > copied from the mirror. I just ran this sequence: > $ bitbake v4l-utils -c cleansstate > $ rm downloads/*v4l* > $ bitbake v4l-utils -c fetch > which now shows > $ ls -l downloads/*v4l* > -rw-rw-r-- 1 gthomas gthomas 1439674 Jun 13 09:53 > downloads/git2_linuxtv.org.v4l-utils.git.tar.gz > > I'll try to verify that the patch caused this change. Indeed, the patch is not the cause of this difference. Since it seems to be benign (still no network activity which is my main concern), I'm going to just note it but not worry about it. Fixed in master: http://git.yoctoproject.org/cgit.cgi/poky/commit/?id=1faf02599af12a62bbed0bce5fda6a72df63ec30 Verified |