<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>752</bug_id>
          
          <creation_ts>2011-02-22 13:15:43 +0000</creation_ts>
          <short_desc>Unable to build with BB_NO_NETWORK=1</short_desc>
          <delta_ts>2011-02-23 15:44:23 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>7</classification_id>
          <classification>Build System, Metadata &amp; Runtime</classification>
          <product>Meta-yocto</product>
          <component>meta-yocto</component>
          <version>unspecified</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>1.0 M4</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Gary Thomas">gary</reporter>
          <assigned_to name="Richard Purdie">richard.purdie</assigned_to>
          <cc>poky.bs.watcher</cc>
    
    <cc>poky.watcher</cc>
    
    <cc>sgw</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>---</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>11953</commentid>
    <comment_count>0</comment_count>
    <who name="Gary Thomas">gary</who>
    <bug_when>2011-02-22 13:15:43 +0000</bug_when>
    <thetext>Using mainline 9a28ad6b0291e0d4c4aae6ba25a9f7752d5c2e11 (2011-02-22)

I get this error immediately.  If I disable BB_NO_NETWORK, the parsing completes
and no gypsy stuff is ever downloaded.

ERROR: Error parsing /home/local/poky-amltd/meta/recipes-connectivity/gypsy/gypsy_git.bb: Network access disabled through BB_NO_NETWORK but access rquested with command git ls-remote anongit.freedesktop.org/gypsy master (for url None)
ERROR: Command execution failed: Exited with 1

Is this because of this line in the recipe?
  PV = &quot;0.8+git${SRCPV}&quot;

The problem seems to be because of this line:
  ./meta/conf/distro/include/poky-default-revisions.inc:SRCREV_pn-gypsy ??= &quot;3652e1f37e82b8e63983e30fda3482cd099a8cf5&quot;

Changing the ??= to ?= lets it work with BB_NO_NETWORK=1</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>11984</commentid>
    <comment_count>1</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2011-02-23 02:21:40 +0000</bug_when>
    <thetext>Does:
diff --git a/bitbake/lib/bb/data_smart.py b/bitbake/lib/bb/data_smart.py
index 83e6f70..e76fbbf 100644
--- a/bitbake/lib/bb/data_smart.py
+++ b/bitbake/lib/bb/data_smart.py
@@ -298,6 +298,8 @@ class DataSmart(MutableMapping):
         if local_var:
             if flag in local_var:
                 value = copy.copy(local_var[flag])
+            elif flag == &quot;content&quot; and &quot;defaultval&quot; in local_var:
+                value = copy.copy(local_var[&quot;defaultval&quot;])
         if expand and value:
             value = self.expand(value, None)
         return value

fix this?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>11994</commentid>
    <comment_count>2</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2011-02-23 03:51:12 +0000</bug_when>
    <thetext>I&apos;ve pushed some changes into master regarding this, please try http://git.pokylinux.org/cgit.cgi/poky/commit/?id=6ea24f04cd635295d826f03d9c7d8a08cc1d5b31

(and you&apos;ll need the previous commit too to avoid parsing failures)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>11998</commentid>
    <comment_count>3</comment_count>
    <who name="Gary Thomas">gary</who>
    <bug_when>2011-02-23 05:10:48 +0000</bug_when>
    <thetext>This worked well (although I did have to add the change made for bug #753 which
is not yet checked in), up to this point:

ERROR: Function &apos;Network access disabled through BB_NO_NETWORK but access rquested with command git ls-remote git.infradead.org/mtd-utils.git master (for url None)&apos; failed
ERROR: Build of do_fetch failed
ERROR: Traceback (most recent call last):
  File &quot;/home/local/poky-amltd/bitbake/lib/bb/build.py&quot;, line 361, in exec_task
    return _exec_task(fn, task, d, quieterr)
  File &quot;/home/local/poky-amltd/bitbake/lib/bb/build.py&quot;, line 324, in _exec_task
    event.fire(TaskFailed(exc.name, logfn, localdata), localdata)
  File &quot;/home/local/poky-amltd/bitbake/lib/bb/event.py&quot;, line 122, in fire
    fire_class_handlers(event, d)
  File &quot;/home/local/poky-amltd/bitbake/lib/bb/event.py&quot;, line 71, in fire_class_handlers
    ret = bb.utils.better_eval(&quot;tmpHandler(e)&quot;, locals)
  File &quot;/home/local/poky-amltd/bitbake/lib/bb/utils.py&quot;, line 387, in better_eval
    return eval(source, _context, locals)
  File &quot;&lt;string&gt;&quot;, line 1, in &lt;module&gt;
  File &quot;tmpHandler(e)&quot;, line 112, in tmpHandler
  File &quot;/usr/lib/python2.6/posixpath.py&quot;, line 65, in join
    if b.startswith(&apos;/&apos;):
AttributeError: &apos;NetworkAccess&apos; object has no attribute &apos;startswith&apos;

ERROR: Task 84 (virtual:native:/home/local/poky-amltd/meta/recipes-devtools/mtd/mtd-utils_1.4.1.bb, do_fetch) failed with exit code &apos;1&apos;

That recipe has not changed and the git tarball for it is in the mirror.

Ideas?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>12002</commentid>
    <comment_count>4</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2011-02-23 07:10:42 +0000</bug_when>
    <thetext>The annoying traceback in this bug is fixed in http://git.pokylinux.org/cgit.cgi/poky/commit/?id=91c0b3a2e6d006224d8d2b661ca7528e9d036f1b</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>12003</commentid>
    <comment_count>5</comment_count>
    <who name="Gary Thomas">gary</who>
    <bug_when>2011-02-23 07:18:54 +0000</bug_when>
    <thetext>I&apos;ve traced the rest of the issue like this:

Richard has made some changes which nearly fixes that bug, except
for the mtd-utils_1.4.1.bb recipe.  The problem with this recipe
is that it specifies a git tag, not a fixed revision.  The fetcher
fails in this case as it has to interrogate the git tree to find
the tag and that&apos;s not allowed because of BB_NO_NETWORK=1

I tried to move this to a fixed revision which corresponds to tag v1.4.1
like this:

diff --git a/meta/recipes-devtools/mtd/mtd-utils_1.4.1.bb b/meta/recipes-devtools/mtd/mtd-utils_1.4.1.bb
index 5e6db0e..2c4e276 100644
--- a/meta/recipes-devtools/mtd/mtd-utils_1.4.1.bb
+++ b/meta/recipes-devtools/mtd/mtd-utils_1.4.1.bb
@@ -6,11 +6,12 @@ LICENSE = &quot;GPLv2+&quot;
 LIC_FILES_CHKSUM = &quot;file://COPYING;md5=0636e73ff0215e8d672dc4c32c317bb3 \
                     file://include/common.h;beginline=1;endline=17;md5=ba05b07912a44ea2bf81ce409380049c&quot;
 
-SRC_URI = &quot;git://git.infradead.org/mtd-utils.git;protocol=git;tag=v${PV} \
+SRC_URI = &quot;git://git.infradead.org/mtd-utils.git;protocol=git \
                file://add-exclusion-to-mkfs-jffs2-git-2.patch;patch=1&quot;
 
 S = &quot;${WORKDIR}/git/&quot;
 
+PV = &quot;1.4.1${SRCPV}&quot;
 PR = &quot;r1&quot;
 
 EXTRA_OEMAKE = &quot;&apos;CC=${CC}&apos; &apos;CFLAGS=${CFLAGS} -I${S}/include -DWITHOUT_XATTR&apos; &apos;BUILDDIR=${S}&apos;&quot;

I also added this to my fixed-revisions.inc
SRCREV_pn-mtd-utils ??= &quot;3c3674a6e1d3f59554b0ff68ca59be2fd4134e0c&quot;

Finally, I had to move recipes-devtools/mtd/mtd-utils-1.4.1/add-exclusion-to-mkfs-jffs2-git-2.patch
to recipes-devtools/mtd/mtd-utils or else it could not be found.

Is there an easier way to solve these issues?  Once I understand the whole process, I can
propose a patch.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>12004</commentid>
    <comment_count>6</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2011-02-23 07:21:49 +0000</bug_when>
    <thetext>I came to the same conclusion locally and found this patch worked too:
diff --git a/meta/recipes-devtools/mtd/mtd-utils_1.4.1.bb b/meta/recipes-devtools/mtd/mtd-utils_1.4.1.bb
index 5e6db0e..f2de74d 100644
--- a/meta/recipes-devtools/mtd/mtd-utils_1.4.1.bb
+++ b/meta/recipes-devtools/mtd/mtd-utils_1.4.1.bb
@@ -6,7 +6,7 @@ LICENSE = &quot;GPLv2+&quot;
 LIC_FILES_CHKSUM = &quot;file://COPYING;md5=0636e73ff0215e8d672dc4c32c317bb3 \
                     file://include/common.h;beginline=1;endline=17;md5=ba05b07912a44ea2bf81ce409380049c&quot;
 
-SRC_URI = &quot;git://git.infradead.org/mtd-utils.git;protocol=git;tag=v${PV} \
+SRC_URI = &quot;git://git.infradead.org/mtd-utils.git;protocol=git;tag=3c3674a6e1d3f59554b0ff68ca59be2fd4134e0c \
                file://add-exclusion-to-mkfs-jffs2-git-2.patch;patch=1&quot;
 
 S = &quot;${WORKDIR}/git/&quot;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>12005</commentid>
    <comment_count>7</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2011-02-23 07:23:06 +0000</bug_when>
    <thetext>Incidentally the reason you had to move the patch was because you changed PV.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>12006</commentid>
    <comment_count>8</comment_count>
    <who name="Gary Thomas">gary</who>
    <bug_when>2011-02-23 07:27:14 +0000</bug_when>
    <thetext>Changing PV was necessary for the SRCREV_pn-mtd-utils to be used.  Without it,
that line seems to be ignored.  Is that expected?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>12017</commentid>
    <comment_count>9</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2011-02-23 15:44:23 +0000</bug_when>
    <thetext>Fix pushed in 982955ec922a0ecc649f7cbfb1e79fc95d0bd833</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>