<?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>10242</bug_id>
          
          <creation_ts>2016-09-08 10:06:13 +0000</creation_ts>
          <short_desc>Improve the detection of misplaced parameters</short_desc>
          <delta_ts>2016-11-09 13:27:38 +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>BitBake</product>
          <component>bitbake</component>
          <version>unspecified</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>WONTFIX</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium</priority>
          <bug_severity>enhancement</bug_severity>
          <target_milestone>2.3</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Igor Stoppa">igor.stoppa</reporter>
          <assigned_to name="Ross Burton">ross.burton</assigned_to>
          <cc>poky.bs.watcher</cc>
    
    <cc>poky.watcher</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>Yes (doc changes required)</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>65910</commentid>
    <comment_count>0</comment_count>
    <who name="Igor Stoppa">igor.stoppa</who>
    <bug_when>2016-09-08 10:06:13 +0000</bug_when>
    <thetext>Some parameters are meant to be used only when placed inside local.conf or similar configuration file (ex: distro.conf)

However there is no mechanism that can help the person trying to use a recipe, to figure out that the parameter was misplaced (ex: inside a .bb .bbclass or .bbappend file).

Worse, things can change over time, because a recipe is modified, yet there is no way to detect that was previously ok is now a bug.

As example, here&apos;s an excerpt from [1]

-----8&lt;-----8&lt;-----8&lt;-----8&lt;-----8&lt;-----8&lt;-----8&lt;-----8&lt;-----
&gt; In such below sentence from local.conf.sample is wrong or I missing
&gt; something here?
&gt; 
&gt; *# NOTE: You can set INITRAMFS_IMAGE in an image recipe, but*
&gt; *#       INITRAMFS_IMAGE_BUNDLE can only be set in a conf file.*

It would seem that this is no longer correct - perhaps it was true in an older 
version. kernel.bbclass (which is inherited by all kernel recipes) reads both 
of these variables, so they do both need to be set at the configuration level. 
We should update the comment.
-----8&lt;-----8&lt;-----8&lt;-----8&lt;-----8&lt;-----8&lt;-----8&lt;-----8&lt;-----

If there was some way to either explicitly or implicitly declare where a parameter should be configured (recipe vs conf), that would allow bitbake to generate at lest a warning ,if not an error.

Ex:
- explicit: let the recipe using a parameter declare where it should come from
- implicit: use a prefix (CONF_xxxxx) for parameters that belong to conf files


[1]: https://lists.yoctoproject.org/pipermail/yocto/2015-April/024610.html</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>68163</commentid>
    <comment_count>1</comment_count>
    <who name="Ross Burton">ross.burton</who>
    <bug_when>2016-11-09 01:36:08 +0000</bug_when>
    <thetext>There&apos;s very few variables that *need* to be set in local.conf vs distro conf vs recipe (I can&apos;t think of anything apart from the obviously recipe-specific instances such as FILES), and in fact a large number of variables are explicitly available to be set in all three (user customisations, distro defaults, recipe overrides).

Personally I feel that context is sufficient: don&apos;t set FILES in local.conf, don&apos;t set DISTRO_NAME in a recipe, etc; and where it isn&apos;t then the documentation should clarify.

From an implementation point of view, there&apos;s no difference between distro/local/recipe beyond filename, whether a copy has been made, and parse order, so I think this would be distinctly non-trivial to implement.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>68178</commentid>
    <comment_count>2</comment_count>
    <who name="Igor Stoppa">igor.stoppa</who>
    <bug_when>2016-11-09 12:08:16 +0000</bug_when>
    <thetext>I obviously disagree with the statement that the context is sufficient, otherwise I would have not created the issue report :-)

Improving the fine manual is ok, but it is not particularly developer friendly, after having done so, to just reply RTFM.

I can understand if the answer is: &quot;improving this has a low ROI&quot;

However I do not understand why this would be a non-trivial change.
Wouldn&apos;t it be sufficient to search for the fingerprint part of he string ()in the example, CONF_ and compare it against the type of file where th CONF_xxx entry is used?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>68179</commentid>
    <comment_count>3</comment_count>
    <who name="Ross Burton">ross.burton</who>
    <bug_when>2016-11-09 12:20:35 +0000</bug_when>
    <thetext>(In reply to comment #2)
&gt; However I do not understand why this would be a non-trivial change.
&gt; Wouldn&apos;t it be sufficient to search for the fingerprint part of he string
&gt; ()in the example, CONF_ and compare it against the type of file where th
&gt; CONF_xxx entry is used?

If we&apos;re happy to accept a complete API break as large numbers of variables change their name, sure.   Not sure that&apos;s a good tradeoff though.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>68180</commentid>
    <comment_count>4</comment_count>
    <who name="Igor Stoppa">igor.stoppa</who>
    <bug_when>2016-11-09 12:32:38 +0000</bug_when>
    <thetext>It depends on how the change is introduced. What you describe is a hard change.

If it was made available as opt-in feature, new/converted recipes could use it, while others wouldn&apos;t be affected.

All I can say as a user, is that it feels unnatural to have 3 different types of file where to put basically the same type of assignment, without (afaik) a simple way to figure out what is set where.

The example I gave in the issue report seems to agree with my feelings.

I do not particularly care that it is done in the way I proposed, if the change I proposed is unfeasible/hard to implement and the same improvement can be achieved better/more easily through automated means.

Adding more documentation will eventually turn the mega manual into a giga manual, but I doubt it&apos;s reasonable to expect the user to remember it all.

Not if the goal is to provide a pleasant experience.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>68181</commentid>
    <comment_count>5</comment_count>
    <who name="Ross Burton">ross.burton</who>
    <bug_when>2016-11-09 13:09:27 +0000</bug_when>
    <thetext>If a variable can go in multiple places then there tends to be a good reason for that: is it distro policy, recipe configuration, or user overriding.  Other variables have clear scope: RDEPENDS for example is recipe-specific.

I don&apos;t see adding a naming convention or metadata being sufficiently useful to warrant the impact.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>68184</commentid>
    <comment_count>6</comment_count>
    <who name="Igor Stoppa">igor.stoppa</who>
    <bug_when>2016-11-09 13:27:38 +0000</bug_when>
    <thetext>(In reply to comment #5)
&gt; If a variable can go in multiple places

I do not know how it has come to this, when the request was about the opposite:

(In reply to comment #0)
&gt; Some parameters are meant to be used only when placed inside local.conf or
&gt; similar configuration file (ex: distro.conf)
&gt; 
&gt; However there is no mechanism that can help the person trying to use a
&gt; recipe, to figure out that the parameter was misplaced (ex: inside a .bb
&gt; .bbclass or .bbappend file).</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>