All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Adrian Ambrożewicz" <adrian.ambrozewicz@linux.intel.com>
To: "zhouyuanqing8@outlook.com" <zhouyuanqing8@outlook.com>,
	openbmc <openbmc@lists.ozlabs.org>
Cc: "uperic@163.com" <uperic@163.com>
Subject: Re: about virtual variable
Date: Mon, 22 Jun 2020 15:55:18 +0200	[thread overview]
Message-ID: <18282d9f-9c23-df77-8a11-099abda81b88@linux.intel.com> (raw)
In-Reply-To: <b4aaf649-312c-ebc3-c8eb-e780973e17fc@linux.intel.com>

In other words - virtual/XYZ is exported by recipes delivering the same 
stuff, conflicting with each other . In your system you have to choose 
the compiler, kernel etc. While many recipes might deliver those 
components, recipe creators use the same 'meta-name' (from 'virtual' 
namespace), so then by choosing "PREFERRED_PROVIDER" you can decide 
which of the 'implementations' you would like to actually use.

With 'virtual' variables you can use 'virtual/xyz' as a generic alias. 
You can then introduce BitBake code depending on magic 'virtual/kernel' 
instead of using concrete name of implementations (like linux-aspeed / 
linux-nuvoton / linux-yocto / linux-yocto-rt).

Regards,
Adrian

W dniu 6/22/2020 o 15:43, Adrian Ambrożewicz pisze:
> I feel rude for pointing out link to StackOverflow, but this guy really 
> nailed it when it comes to easy explanation of 'virtual/' variable 
> namespace :)
> 
> https://stackoverflow.com/a/37823742/8226884
> 
> W dniu 6/22/2020 o 14:48, zhouyuanqing8@outlook.com pisze:
>> Hi everyone,
>>
>>       I would like to ask, is virtual a variable defined by bitbake? I 
>> did not find it in the bitbake manual. What is the use of the virtual 
>> variable? What would be the problem without this variable?
>>
>>
>>     2.4. Preferences¶
>>     
>> <https://www.yoctoproject.org/docs/latest/bitbake-user-manual/bitbake-user-manual.html#bb-bitbake-preferences> 
>>
>>
>> The|PROVIDES|list is only part of the solution for figuring out a 
>> target's recipes. Because targets might have multiple providers, 
>> BitBake needs to prioritize providers by determining provider 
>> preferences.
>>
>> A common example in which a target has multiple providers is 
>> "virtual/kernel", which is on the|PROVIDES|list for each kernel 
>> recipe. Each machine often selects the best kernel provider by using a 
>> line similar to the following in the machine configuration file:
>>
>>       PREFERRED_PROVIDER_virtual/kernel = "linux-yocto"
>>
>>

  reply	other threads:[~2020-06-22 13:55 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-22 12:48 about virtual variable zhouyuanqing8
2020-06-22 13:43 ` Adrian Ambrożewicz
2020-06-22 13:55   ` Adrian Ambrożewicz [this message]
2020-07-13  7:50     ` 回复: " 周 远清

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=18282d9f-9c23-df77-8a11-099abda81b88@linux.intel.com \
    --to=adrian.ambrozewicz@linux.intel.com \
    --cc=openbmc@lists.ozlabs.org \
    --cc=uperic@163.com \
    --cc=zhouyuanqing8@outlook.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.