<?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>10412</bug_id>
          
          <creation_ts>2016-10-11 21:25:49 +0000</creation_ts>
          <short_desc>Specifying milestone with a DISTRO_VERSION in format of MM.mm.pp will cause build to fail on GetDistroVersion</short_desc>
          <delta_ts>2017-03-27 17:29:50 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>5</classification_id>
          <classification>Infrastructure</classification>
          <product>AutoBuilder</product>
          <component>autobuilder</component>
          <version>unspecified</version>
          <rep_platform>All</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>VERIFIED</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>2.3 M2</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Tracy Graydon">tracy.graydon</reporter>
          <assigned_to name="Joshua Lock">joshuagloe</assigned_to>
          <cc>infras.ab.watcher</cc>
    
    <cc>Infras.watcher</cc>
    
    <cc>jose.perez.carranza</cc>
    
    <cc>mhalstead</cc>
    
    <cc>pidge</cc>
    
    <cc>richard.purdie</cc>
    
    <cc>ross.burton</cc>
          
          <qa_contact name="oscar lopez arandas">oscarx.lopez.arandas</qa_contact>
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>Don&apos;t know</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>67154</commentid>
    <comment_count>0</comment_count>
      <attachid>3468</attachid>
    <who name="Tracy Graydon">tracy.graydon</who>
    <bug_when>2016-10-11 21:25:49 +0000</bug_when>
    <thetext>Created attachment 3468
error log for example of build failure

When generating a release candidate on the autobuilder, selecting &quot;Milestone&quot; with a DISTRO_VERSION in poky.conf in format of &quot;MM.mm.pp&quot; will cause GetDistroVersion to barf and build will fail. It will throw &quot;exceptions.ValueError: invalid literal for float(): 2.2.0&quot;, as an example. 

i.e. https://autobuilder.yoctoproject.org/main/builders/nightly/builds/1046/steps/GetDistroVersion/logs/err.html (text and a screenshot attached)

Autobuilder should probably check for a mismatch between release type and distroversion and warn or otherwise act accordingly. i.e. In this specific case, catch milestone combined with point release distro version and do something smarter.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>67155</commentid>
    <comment_count>1</comment_count>
    <who name="Tracy Graydon">tracy.graydon</who>
    <bug_when>2016-10-11 21:29:17 +0000</bug_when>
    <thetext>Snippet from poky.conf as an example of what GetDistroVersion.py does not like:

DISTRO = &quot;poky&quot;
DISTRO_NAME = &quot;Poky (Yocto Project Reference Distro)&quot;
DISTRO_VERSION = &quot;2.2.0&quot;                   &lt;------  Makes GetDistroVersion barf.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>67156</commentid>
    <comment_count>2</comment_count>
    <who name="Ross Burton">ross.burton</who>
    <bug_when>2016-10-11 21:55:42 +0000</bug_when>
    <thetext>FWIW the standard library has a &quot;version&quot; objection in distutils  (IIRC) which can represent versions like 1.2.3-rc2~beta and do comparisons etc, instead of abusing a float.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>69723</commentid>
    <comment_count>3</comment_count>
    <who name="Joshua Lock">joshuagloe</who>
    <bug_when>2017-01-11 16:43:07 +0000</bug_when>
    <thetext>(In reply to comment #0)
&gt; Autobuilder should probably check for a mismatch between release type and
&gt; distroversion and warn or otherwise act accordingly. i.e. In this specific
&gt; case, catch milestone combined with point release distro version and do
&gt; something smarter.

Any suggestion on how best to act accordingly? We can fail early here and cause the build to fail, that would certainly be smarter than throwing an exception.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>69724</commentid>
    <comment_count>4</comment_count>
    <who name="Joshua Lock">joshuagloe</who>
    <bug_when>2017-01-11 16:50:26 +0000</bug_when>
    <thetext>(In reply to comment #2)
&gt; FWIW the standard library has a &quot;version&quot; objection in distutils  (IIRC)
&gt; which can represent versions like 1.2.3-rc2~beta and do comparisons etc,
&gt; instead of abusing a float.

I don&apos;t know if that helps us here. The autobuilder is trying to be smart and automatically increase the version number for a milestone build and then check it matches the yocto number input into the build trigger form.

I think this mostly works because we:
a) we don&apos;t do milestone builds for point releases (is this true?)
b) we only bump version number in poky.conf when we&apos;re ready to release

so, for example, during milestone releases for pyro (2.3) the poky.conf DISTRO_VERSION is still 2.2 (morty&apos;s version number) and we add 0.1 to that and stringify it to get &quot;2.3&quot; for pyro milestone builds.

If we use, i.e. distutils.version.LooseVersion, there&apos;s no easy way to bump the version number for milestone releases.

I think what we should probably do is split the value of DISTRO_VERSION on .&apos;s and fail early if there are more than 2 items in the list returned from the split call.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>69725</commentid>
    <comment_count>5</comment_count>
    <who name="Joshua Lock">joshuagloe</who>
    <bug_when>2017-01-11 16:53:36 +0000</bug_when>
    <thetext>(In reply to comment #4)
&gt; (In reply to comment #2)
&gt; &gt; FWIW the standard library has a &quot;version&quot; objection in distutils  (IIRC)
&gt; &gt; which can represent versions like 1.2.3-rc2~beta and do comparisons etc,
&gt; &gt; instead of abusing a float.
&gt; 
&gt; I don&apos;t know if that helps us here. The autobuilder is trying to be smart
&gt; and automatically increase the version number for a milestone build and then
&gt; check it matches the yocto number input into the build trigger form.
&gt; 
&gt; I think this mostly works because we:
&gt; a) we don&apos;t do milestone builds for point releases (is this true?)
&gt; b) we only bump version number in poky.conf when we&apos;re ready to release
&gt; 
&gt; so, for example, during milestone releases for pyro (2.3) the poky.conf
&gt; DISTRO_VERSION is still 2.2 (morty&apos;s version number) and we add 0.1 to that
&gt; and stringify it to get &quot;2.3&quot; for pyro milestone builds.
&gt; 
&gt; If we use, i.e. distutils.version.LooseVersion, there&apos;s no easy way to bump
&gt; the version number for milestone releases.
&gt; 
&gt; I think what we should probably do is split the value of DISTRO_VERSION on
&gt; .&apos;s and fail early if there are more than 2 items in the list returned from
&gt; the split call.

And/or we could just catch the ValueError Exception and fail appropriately then.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>69854</commentid>
    <comment_count>6</comment_count>
    <who name="Joshua Lock">joshuagloe</who>
    <bug_when>2017-01-17 12:32:11 +0000</bug_when>
    <thetext>I&apos;ve updated GetDistroVersion to fail as explained in previous comments and also write a log with the reason for failing.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>69959</commentid>
    <comment_count>7</comment_count>
    <who name="Joshua Lock">joshuagloe</who>
    <bug_when>2017-01-20 13:21:54 +0000</bug_when>
    <thetext>http://git.yoctoproject.org/cgit/cgit.cgi/yocto-autobuilder/commit/?id=dbe0d927bb16500e1cadf632221fb9d32a22e31e</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>71756</commentid>
    <comment_count>8</comment_count>
    <who name="oscar lopez arandas">oscarx.lopez.arandas</who>
    <bug_when>2017-03-27 17:29:50 +0000</bug_when>
    <thetext>
ENVIRONMENT: genericx86-64 on NUC
STEPS TO REPRODUCE:
 1. Download the core-image-sato-sdk image from autobuilder.

2. Make checkout on the poky commit from the mail: 
     &quot;9fe7a69535f9443175da8289633a761f58c372ff&quot;

3. Source the environment, from poky directory

4. Edit local.conf. PATH: ~/poky/build/conf, at the en of the file adding: 

DISTRO = &quot;poky&quot;
DISTRO_NAME = &quot;Poky (Yocto Project Reference Distro)&quot;
DISTRO_VERSION = &quot;2.2.0&quot;  
 
5. In ~poky/build directory, in command line, type the following commands:

$ bitbake rpm psplash run-postinsts
$ bitbake package-index

6. $ bitbake core-image-sato-sdk -c testimage</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>3468</attachid>
            <date>2016-10-11 21:25:49 +0000</date>
            <delta_ts>2016-10-11 21:25:49 +0000</delta_ts>
            <desc>error log for example of build failure</desc>
            <filename>error_log.txt</filename>
            <type>text/plain</type>
            <size>1565</size>
            <attacher name="Tracy Graydon">tracy.graydon</attacher>
            
              <data encoding="base64">VHJhY2ViYWNrIChtb3N0IHJlY2VudCBjYWxsIGxhc3QpOgogIEZpbGUgIi9ob21lL3Bva3lidWls
ZC95b2N0by1hdXRvYnVpbGRlci9saWIvcHl0aG9uMi43L3NpdGUtcGFja2FnZXMvVHdpc3RlZC0x
Mi4yLjAtcHkyLjctbGludXgteDg2XzY0LmVnZy90d2lzdGVkL2ludGVybmV0L2RlZmVyLnB5Iiwg
bGluZSAyOTAsIGluIGFkZENhbGxiYWNrcwogICAgc2VsZi5fcnVuQ2FsbGJhY2tzKCkKICBGaWxl
ICIvaG9tZS9wb2t5YnVpbGQveW9jdG8tYXV0b2J1aWxkZXIvbGliL3B5dGhvbjIuNy9zaXRlLXBh
Y2thZ2VzL1R3aXN0ZWQtMTIuMi4wLXB5Mi43LWxpbnV4LXg4Nl82NC5lZ2cvdHdpc3RlZC9pbnRl
cm5ldC9kZWZlci5weSIsIGxpbmUgNTUxLCBpbiBfcnVuQ2FsbGJhY2tzCiAgICBjdXJyZW50LnJl
c3VsdCA9IGNhbGxiYWNrKGN1cnJlbnQucmVzdWx0LCAqYXJncywgKiprdykKICBGaWxlICIvaG9t
ZS9wb2t5YnVpbGQveW9jdG8tYXV0b2J1aWxkZXIvbGliL3B5dGhvbjIuNy9zaXRlLXBhY2thZ2Vz
L1R3aXN0ZWQtMTIuMi4wLXB5Mi43LWxpbnV4LXg4Nl82NC5lZ2cvdHdpc3RlZC9pbnRlcm5ldC9k
ZWZlci5weSIsIGxpbmUgMzY4LCBpbiBjYWxsYmFjawogICAgc2VsZi5fc3RhcnRSdW5DYWxsYmFj
a3MocmVzdWx0KQogIEZpbGUgIi9ob21lL3Bva3lidWlsZC95b2N0by1hdXRvYnVpbG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