bbclient package

Submodules

bbclient.bbclient module

This file provides client class for bitbake server.

class bbclient.bbclient.BBClient(project_abs_path: str, init_script_path: str = ':', logging_level: int = 50)[source]

Bases: object

Client for bitbake Server

project_path

poky directory path

Type

str

__is_server_running

server is running or not

Type

bool

__server_connection

touch point to server

Type

bb.server.xmlrpcclient.BitBakeXMLRPCServerConnection

__logger

Logger instance for debugging. Default is None.

Type

Optional[Logger]

all_providers(multi_config: str = '') List[bbclient.bbcommon.AllProvidersResult][source]

Get all providers versions and recipe file path

Parameters
  • self (BBClient) – none

  • multi_config (str, optional) – Defaults to “”. See here

Returns

See AllProvidersResult

Return type

List[AllProvidersResult]

Note

Return value is like below.
[
[‘nativesdk-go’, [[[‘’, ‘1.17.10’, ‘r0’], ‘/PATH/TO/RECIPE/go_1.17.10.bb’]]], # PN, [PE, PV, PR], recipe file path
[‘go’, [[[‘’, ‘1.17.10’, ‘r0’], ‘/PATH/TO/RECIPE/go_1.17.10.bb’]]],
]
build_file(file_path: str, task_name: str, internal: bool = False) None[source]

Build recipe file

Note

This function will block until complete to build_file_async is complete. For more details, see build_file_async.

build_file_async(file_path: str, task_name: str, internal: bool = False) None[source]

Build recipe file

This command doen’t resolve any dependencies. If you also want to buid dependencies, please use build_targets command. This command will send following events. If you want to wait done, please use wait_done_async.

  • bb.event.BuildInit

  • bb.event.RecipePreFinalise

  • bb.event.RecipePostKeyExpansion

  • bb.event.RecipeTaskPreProcess

  • bb.event.RecipeParsed

  • bb.event.BuildStarted

  • bb.event.ProcessStarted

  • bb.event.ProcessProgress

  • bb.event.ProcessFinished

  • bb.runqueue.runQueueTaskStarted

  • bb.runqueue.runQueueTaskCompleted

  • bb.event.BuildCompleted

  • bb.command.CommandCompleted

  • bb.command.CommandFailed

  • bb.command.CommandExit

Parameters
  • self (BBClient) – none

  • file_path (str) – target recipe file path

  • task_name (str) – task name which will run

  • internal (bool, optional) – If True, bitbake will fire events that notify BuildStarted and BuildCompleted. Defaults to False.

Note

If you want to monitor BuildStarted and BuildCompleted event, use register_callback.
build_targets(targets: List[str], task_name: str) None[source]

Build package

Note

This function will block until complete to build_targets_async is complete. For more details, see build_targets_async.

build_targets_async(targets: List[str], task_name: str) None[source]

Build package

This command will send following events. If you want to wait done, please use wait_done_async.

  • bb.runqueue.runQueueTaskStarted

  • bb.build.TaskStarted

  • bb.build.TaskProgress

  • bb.build.TaskSucceeded

  • bb.event.ProcessStarted

  • bb.event.ProcessProgress

  • bb.event.ProcessFinished

  • bb.command.CommandCompleted

  • bb.command.CommandFailed

  • bb.command.CommandExit

Parameters
  • self (BBClient) – none

  • targets (List[str]) – see Note section

  • task_name (str) – task name which will run

Note

User can input targets as follows. Please note that if you want to specify task by targets, you have to write do_xxx, not only xxx.
[
“gcc”, # only package name
“mc:xxx_config:alsa”, # multiconfig and package name
“multiconfig:yyy_config:vim”, # multiconfig and package name
“mc:*:clang” # all multiconfig and package name
“mc:yyy_config:python:do_patch”, # multiconfig, package name and task name
]
client_complete() None[source]

xxxxx

Note

This function will block until complete to xxxxx is complete. For more details, see xxxxx.

client_complete_async() None[source]

Notify client will be close

This command will send following events. If you want to wait done, please use wait_done_async.

  • bb.command.CommandCompleted

  • bb.command.CommandFailed

  • bb.command.CommandExit

Parameters

self (BBClient) – none

compare_revisions() None[source]

xxxxx

Note

This function will block until complete to xxxxx is complete. For more details, see xxxxx.

compare_revisions_async() None[source]

Exit async command

This command will send following events. If you want to wait done, please use wait_done_async.

  • bb.command.CommandCompleted

  • bb.command.CommandFailed

  • bb.command.CommandExit

Parameters

self (BBClient) – none

Note

TODO: investigate the detail.
This determines if the cache is out of date, and if so, this terminates asynchronous processing.
data_store_connector_cmd(datastore_index: int, command: str, *args, **kwargs) Any[source]

Data store management function

Parameters
  • self (BBClient) – none

  • datastore_index (int) – specify datastore_index. user can get this value by parse_recipe_file command.

  • command (str) – the method name of bb.data_smart.DataSmart

  • args (Any) – depends on command

  • kwargs (Any) – depends on command

Returns

command return

Return type

Any

Note

User can input following commands. If you want to know detail of these, please see bb.data_smart.DataSmart.
  • createCopy

  • createCopy

  • delVar

  • delVarFlag

  • delVarFlags

  • disableTracking

  • enableTracking

  • expand

  • expandVarref

  • expandWithRefs

  • finalize

  • get

  • getVar

  • getVarFlag

  • getVarFlags

  • get_hash

  • hasOverrides

  • initVar

  • internal_finalize

  • items

  • keys

  • localkeys

  • need_overrides

  • pop

  • popitem

  • prependVar

  • prependVarFlag

  • renameVar

  • setVar

  • setVarFlag

  • setVarFlags

  • setdefault

  • update

  • values

data_store_connector_inc_hist_cmd(datastore_index: int, command: str, *args, **kwargs) Any[source]

Data store include history function

Parameters
  • self (BBClient) – none

  • datastore_index (int) – specify datastore_index. user can get this value by parse_recipe_file command.

  • command (str) – the method name of bb.data_smart.IncludeHistory

  • args (Any) – depends on command

  • kwargs (Any) – depends on command

Returns

command return

Return type

Any

Note

User can input following commands. If you want to know detail of these, please see bb.data_smart.IncludeHistory.
  • copy

  • include

  • emit

data_store_connector_release(datastore_index: int) None[source]

Discard data store

Parameters
  • self (BBClient) – none

  • datastore_index (int) – specify datastore_index. user can get this value by parse_recipe_file command.

data_store_connector_var_hist_cmd_emit(datastore_index: int, variable: str, comment: str, val: str, override_datastore_index: int) str[source]

Update variable in datastore by variable inoverride datastore

Parameters
  • self (BBClient) – none

  • datastore_index (int) – specify datastore_index. user can get this value by parse_recipe_file command.

  • variable (str) – varibale name

  • comment (str) – comment for update log()

  • override_datastore_index (int) – specify datastore_index. user can get this value by parse_recipe_file command.

Returns

update log

Return type

str

Note

To be investigate.

data_store_connector_varhist_cmd(datastore_index: int, command: str, *args, **kwargs) Any[source]

Data store variable history function

Parameters
  • self (BBClient) – none

  • datastore_index (int) – specify datastore_index. user can get this value by parse_recipe_file command.

  • command (str) – the method name of bb.data_smart.VariableHistory

  • args (Any) – depends on command

  • kwargs (Any) – depends on command

Returns

command return

Return type

Any

Note

User can input following commands. If you want to know detail of these, please see bb.data_smart.VariableHistory.
  • copy

  • del_var_history

  • emit

  • get_variable_files

  • get_variable_items_files

  • get_variable_lines

  • get_variable_refs

  • record

  • rename_variable_hist

  • variable

disable_data_tracking() None[source]

Disable data tracking

Parameters

self (BBClient) – none

Note

Please see enable_data_tracking command

enable_data_tracking() None[source]

Enable data tracking

Parameters

self (BBClient) – none

Note

If enable, cooker cacheata(VariableHistory class) logs the history of changin value. You can see the log by dataStoreConnectorVarHistCmdEmit command.
find_best_provider(package_name: str, multi_config: str = '') List[str][source]

Get best provider infos

Parameters
  • self (BBClient) – none

  • package_name (str) – a package name you want to know the detail of best provider

  • multi_config (str, optional) –

    Defaults to “”. See here

Returns

Now under investigation.

Return type

List[str]

Note

Return value is like [None, None, None, ‘/PATH/TO/RECIPE/gcc_11.3.bb’]. Now under investigation.
find_config_file_path(config_file_name: str) None[source]

xxxxx

Note

This function will block until complete to xxxxx is complete. For more details, see xxxxx.

find_config_file_path_async(config_file_name: str) None[source]

Find config file path

This command will send following events. If you want to wait done, please use wait_done_async.

  • bb.event.ConfigFilePathFound

  • bb.command.CommandCompleted

  • bb.command.CommandFailed

  • bb.command.CommandExit

Parameters
  • self (BBClient) – none

  • config_file_name (str) – target config file name

Note

Use can receive result by bb.event.ConfigFilePathFound event.
find_config_files(variable_name: str) None[source]

xxxxx

Note

This function will block until complete to xxxxx is complete. For more details, see xxxxx.

find_config_files_async(variable_name: str) None[source]

Find Config files that define specified variable.

This command will send following events. If you want to wait done, please use wait_done_async.

  • bb.event.ConfigFilesFound

  • bb.command.CommandCompleted

  • bb.command.CommandFailed

  • bb.command.CommandExit

Parameters
  • self (BBClient) – none

  • variable_name (str) – _description_

Note

User can receive result by bb.event.ConfigFilesFound event.
find_files_matching_in_dir(target_file_name_substring: str, directory: str) None[source]

xxxxx

Note

This function will block until complete to xxxxx is complete. For more details, see xxxxx.

find_files_matching_in_dir_async(target_file_name_substring: str, directory: str) None[source]

Find files that matches the regex_pattern from the directory.

This command will send following events. If you want to wait done, please use wait_done_async.

  • bb.event.FilesMatchingFound

  • bb.command.CommandCompleted

  • bb.command.CommandFailed

  • bb.command.CommandExit

Parameters
  • self (BBClient) – none

  • target_file_name_substring (str) – Substrings of target file name. e.g.) “.conf”, “xxx.bbappe”, etc…

  • directory (str) – Target directory. Base directory is ${BBPATH}.

Note

Use can receive result by bb.event.FilesMatchingFound event.
find_providers(multi_config: str = '') List[bbclient.bbcommon.FindProvidersResult][source]

Get latest packages versions, prefered package versions, and whether there is an REQUIRED_VERSION

Parameters
  • self (BBClient) – none

  • multi_config (str, optional) –

    Defaults to “”. See here

Returns

See FindProvidersResult

Return type

List[FindProvidersResult]

find_sigInfo(package_name_with_multi_config: str, task_name: str, sigs: List[str]) None[source]

xxxxx

Note

This function will block until complete to xxxxx is complete. For more details, see xxxxx.

find_sigInfo_async(package_name_with_multi_config: str, task_name: str, sigs: List[str]) None[source]

Find signature info files via the signature generator(?)

Parameters
  • self (BBClient) – none

  • package_name_with_multi_config (str) – TODO

  • task_name (str) – TODO

  • sigs (List[str]) – TODO

Note

Use can receive result by bb.event.FindSigInfoResult event.
generate_dep_tree_event(targets: List[str], task_name: str) None[source]

xxxxx

Note

This function will block until complete to xxxxx is complete. For more details, see xxxxx.

generate_dep_tree_event_async(targets: List[str], task_name: str) None[source]

Request dependency tree information

This command will send following events. If you want to wait done, please use wait_done_async.

  • bb.event.TreeDataPreparationStarted

  • bb.event.TreeDataPreparationProgress

  • bb.event.TreeDataPreparationCompleted

  • bb.event.DepTreeGenerated

  • bb.command.CommandCompleted

  • bb.command.CommandFailed

  • bb.command.CommandExit

Parameters
  • self (BBClient) – none

  • targets (List[str]) – targets info. see Note section.

  • task_name (str) – task name. e.g.) do_build, do_fetch, etc…

Note

User can input targets as follows.
[
“gcc”, # only package name
“mc:xxx_config:alsa”, # multiconfig and package name
“multiconfig:yyy_config:vim”, # multiconfig and package name
“mc:*:clang” # all multiconfig and package name
“mc:yyy_config:python:do_patch”, # multiconfig, package name and task name
]
generate_dot_graph(targets: List[str], task_name: str) None[source]

xxxxx

Note

This function will block until complete to xxxxx is complete. For more details, see xxxxx.

generate_dot_graph_async(targets: List[str], task_name: str) None[source]

Generate task dependency graph(task-depends.dot)

This command will send following events. If you want to wait done, please use wait_done_async.

  • bb.event.TreeDataPreparationStarted

  • bb.event.TreeDataPreparationProgress

  • bb.event.TreeDataPreparationCompleted

  • bb.command.CommandCompleted

  • bb.command.CommandFailed

  • bb.command.CommandExit

Parameters
  • self (BBClient) – none

  • targets (List[str]) – targets info. see Note section.

  • task_name (str) – task name. e.g.) do_build, do_fetch, etc…

Note

User can input targets as follows.
[
“gcc”, # only package name
“mc:xxx_config:alsa”, # multiconfig and package name
“multiconfig:yyy_config:vim”, # multiconfig and package name
“mc:*:clang” # all multiconfig and package name
“mc:yyy_config:python:do_patch”, # multiconfig, package name and task name
]
generate_targets_tree(bb_klass_file_path: str, package_names: List[str]) None[source]

xxxxx

Note

This function will block until complete to xxxxx is complete. For more details, see xxxxx.

generate_targets_tree_async(bb_klass_file_path: str, package_names: List[str]) None[source]

Generate target tree

This command will send following events. If you want to wait done, please use wait_done_async.

  • bb.event.TreeDataPreparationStarted

  • bb.event.TreeDataPreparationProgress

  • bb.event.TreeDataPreparationCompleted

  • bb.event.TargetsTreeGenerated

  • bb.command.CommandCompleted

  • bb.command.CommandFailed

  • bb.command.CommandExit

Parameters
  • self (BBClient) – none

  • bb_klass_file_path (str) – bbclass file path

  • package_names (List[str]) – target package names

Note

Use can receive result by bb.event.TargetsTreeGenerated event.
If you specify bb_klass_file_path, bitbake will add the packages that inherits bb_klass_file_path to package_names. If you don’t want to do it, please input None to bb_klass_file_path.
get_all_appends(multi_config: str = '') List[bbclient.bbcommon.GetAllAppendsResult][source]

Get all append recipes

Parameters
  • self (BBClient) – none

  • multi_config (str, optional) –

    Defaults to “”. See here

Returns

See GetAllAppendsResult

Return type

List[GetAllAppendsResult]

get_all_keys_with_flags(flag_list: List[str]) List[bbclient.bbcommon.getAllKeysWithFlagsResult][source]

Get value, history and specified flags of all global variables.

Parameters
  • self (BBClient) – none

  • flag_list (List[str]) – Target flags. If flags are unnecessary, please set [].

Returns

See getAllKeysWithFlagsResult.

Return type

List[getAllKeysWithFlagsResult]

Note

If you want to get variables defined at any recipes, please use parse_recipe_file and data_store_connector_cmd.

get_bb_file_priority(multi_config: str = '') List[bbclient.bbcommon.GetBbFilePriorityResult][source]

Get recipe files and its priority.

Parameters
  • self (BBClient) – none

  • multi_config (str, optional) –

    Defaults to “”. See here

Returns

See GetBbFilePriorityResult

Return type

List[GetBbFilePriorityResult]

get_default_preference(multi_config: str = '') List[bbclient.bbcommon.GetDefaultPreferenceResult][source]

Get recipes and default preference.

Parameters
  • self (BBClient) – none

  • multi_config (str, optional) –

    Defaults to “”. See here

Returns

See GetDefaultPreference

Return type

List[GetDefaultPreference]

get_file_appends(file_path: str, multi_config: str = '') List[str][source]

Get append files

Parameters
  • self (BBClient) – none

  • file_path (str) – recipe file path

  • multi_config (str, optional) –

    Defaults to “”. See here

Returns

append files

Return type

List[str]

get_layer_priorities() List[bbclient.bbcommon.GetLayerPrioritiesResult][source]

Get name, path, priority of all layers

Parameters

self (BBClient) – none

Returns

See GetLayerPrioritiesResult.

Return type

List[GetLayerPrioritiesResult]

Warning

This command deletes caches(bug?).

get_overlayed_recipes(multi_config: str = '')[source]
get_r_providers(multi_config: str = '') List[bbclient.bbcommon.GetRProvidersResult][source]

Get alias of PN and its recipe files

Parameters
  • self (BBClient) – none

  • multi_config (str, optional) –

    Defaults to “”. See here

Returns

See GetRProvidersResult

Return type

List[GetRProvidersResult]

Note

If you want to know the detail of alias of PN, See here
get_recipe_depends(multi_config: str = '') List[bbclient.bbcommon.GetRecipeDependsResult][source]

Get recipe depends

Parameters
  • self (BBClient) – none

  • multi_config (str, optional) –

    Defaults to “”. See here

Returns

See GetRecipeDependsResult.

Return type

List[GetRecipeDependsResult]

get_recipe_inherits(multi_config: str = '') List[bbclient.bbcommon.GetRecipeInheritsResult][source]

Get recipes and its inherit recipes

Parameters
  • self (BBClient) – none

  • multi_config (str, optional) –

    Defaults to “”. See here

Returns

See GetRecipeInheritsResult

Return type

List[GetRecipeInheritsResult]

get_recipe_packages(multi_config: str = '') List[bbclient.bbcommon.GetRecipePackagesResult][source]

Get all recipe files and its recipe files

Parameters
  • self (BBClient) – none

  • multi_config (str, optional) –

    Defaults to “”. See here

Returns

See GetRecipePackagesResult.

Return type

List[GetRecipePackagesResult]

get_recipe_packages_dynamic(multi_config: str = '') List[bbclient.bbcommon.GetRecipePackagesDynamicResult][source]

Get all recipe files that provides PACKAGE_DYNAMIC and its PACKAGE_DYNAMIC

Parameters
  • self (BBClient) – none

  • multi_config (str, optional) –

    Defaults to “”. See here

Returns

See GetRecipePackagesDynamicResult

Return type

List[GetRecipePackagesDynamicResult]

get_recipe_provides(multi_config: str = '') List[bbclient.bbcommon.GetRecipeProvidesResult][source]

Get all recipe files and its packages

Parameters
  • self (BBClient) – none

  • multi_config (str, optional) –

    Defaults to “”. See here

Returns

See GetRecipeProvidesResult

Return type

List[GetRecipeProvidesResult]

get_recipe_versions(multi_config: str = '') List[bbclient.bbcommon.GetRecipeVersionsResult][source]

Get all recipe versions

Parameters
  • self (BBClient) – none

  • multi_config (str, optional) –

    Defaults to “”. See here

Returns

See GetRecipeVersions.

Return type

List[GetRecipeVersions]

get_recipes(multi_config: str = '') List[bbclient.bbcommon.GetRecipesResult][source]

Get all package name from cache

Parameters
  • self (BBClient) – none

  • multi_config (str, optional) –

    Defaults to “”. See here

Returns

See GetRecipesResult.

Return type

List[GetRecipesResult]

get_runtime_depends(multi_config: str = '') List[bbclient.bbcommon.GetRuntimeDependsResult][source]

Get all runtime dependency by all recipe files

Parameters
  • self (BBClient) – none

  • multi_config (str, optional) –

    Defaults to “”. See here

Returns

See GetRuntimeDependsResult

Return type

List[GetRuntimeDependsResult]

get_runtime_providers(runtime_providers: List[str], multi_config: str = '')[source]
get_runtime_recommends(multi_config: str = '') List[bbclient.bbcommon.GetRuntimeDependsResult][source]

Get all runtime recoomends(=weak depends) by all recipe files

Parameters
  • self (BBClient) – none

  • multi_config (str, optional) –

    Defaults to “”. See here

Returns

See GetRuntimeRecommendsResult

Return type

List[GetRuntimeRecommendsResult]

get_set_variable(name: str, expand: bool = True) str[source]

Get variable from cache and set it into cache

Parameters
  • self (BBClient) – none

  • name (str) – variable name

  • expand (bool, optional) – Whether to expand references to other variables. Defaults to True.

Returns

variable value

Return type

str

Note

This is maybe for expand variable value in cache.

get_skipped_recipes() List[bbclient.bbcommon.GetSkippedRecipesResult][source]

Get skipped recipes and its reasons, provides, alias

Parameters

self (BBClient) – none

Returns

See GetSkippedRecipesResult

Return type

List[GetSkippedRecipesResult]

get_uihandler_num() int[source]

Get ui handler num.

Parameters

self (BBClient) – none

Returns

ui hanlder num

Return type

int

get_variable(name: str, expand: bool = True) str[source]

Get variable value

Parameters
  • self (BBClient) – none

  • name (str) – variable name

  • expand (bool, optional) – Whether to expand references to other variables. Defaults to True.

Returns

variable value

Return type

str

logger_decorator()[source]

Decorator for logging

Parameters

func (Callable) – target function

Note

This is just for logging.

match_file(file_path_regex: str, mutli_conf_name: str = '') str[source]

Search file by regex

Parameters
  • self (BBClient) – none

  • file_path_regex (str) – search regex pattern

  • mutli_conf_name (str) – target multi-config. Defaults to ‘’.

Returns

matched file path

Return type

str

Warning

This command will fail because the second parameter and the first one mixed up in the command.

Note

This command can extract only one file. If you input the regex matching to many file, this command will fail.
parse_configuration() None[source]

Parse configuration

Note

This command clears caches and re-builds them.

parse_files() None[source]

xxxxx

Note

This function will block until complete to xxxxx is complete. For more details, see xxxxx.

parse_files_async() None[source]

Parse all bb files.

This command will send following events. If you want to wait done, please use wait_done_async.

  • bb.event.ReachableStamps

  • bb.command.CommandCompleted

  • bb.command.CommandFailed

  • bb.command.CommandExit

Parameters

self (BBClient) – none

parse_recipe_file(file_path: str, append: bool = True, append_list: Optional[str] = None, datastore_index: Optional[int] = None) Optional[int][source]

Parse recipe file

Parameters
  • self (BBClient) – none

  • file_path (str) – recipe file path

  • append (bool, optional) – whether to append. Defaults to True.

  • append_list (Optional[str], optional) – Append file list. Defaults to None. If None, bitbake loads append files automatically.

  • datastore_index (int) – specify datastore_index. user can get this value by parse_recipe_file command.

Returns

data store index

Return type

Optional[int]

Note

This commands parses recipe file and store result into datastore. User can access the result by data store index. It’s not clear how the fifth parameter(datastore_index) works.
register_callback(target: Type[bbclient.bbevent.BBEventBase], callback: Callable[[bbclient.bbclient.BBClient, bbclient.bbevent.BBEventBase], None]) uuid.UUID[source]

Register callback functions for events

Parameters
Returns

Callback id. The user can use this to unregister.

Return type

uuid.UUID

reset_cooker() None[source]

xxxxx

Note

This function will block until complete to xxxxx is complete. For more details, see xxxxx.

reset_cooker_async() None[source]

Reset cooker state and caches.

This command will send following events. If you want to wait done, please use wait_done_async.

  • bb.event.ConfigParsed

  • bb.command.CommandCompleted

  • bb.command.CommandFailed

  • bb.command.CommandExit

Parameters

self (BBClient) – none

Note

TODO: investigate the detail.
set_config(name: str, value: str) None[source]

Set CookerConfigcation properties

Parameters
  • self (BBClient) – none

  • name (str) – property name

  • value (str) – property value

Note

If you want to know all CookerConfigcation properties, see poky/bitbake/lib/bb/cookerdata.py. But I don’t know the detail and how to use it…
set_event_mask(handler_num: int, log_level: int, debug_domains: Mapping[str, int], mask: List[str]) bool[source]

Set log filter for specified ui handler

Parameters
  • self (BBClient) – none

  • handler_num (int) – target ui handler

  • log_level (int) – logging.DEBUG, logging.INFO, etc…

  • debug_domains (Mapping[str, int]) – logger name.

  • mask (List[str]) – target event name. If you don’t want to filter by event name, put [ “*” ].

Returns

if handler_num is invalid, return False, otherwise True.

Return type

bool

Note

debug_domains is a little bit complex. If you want to extract logging.getLogger(“NAME”), put { “NAME”: logging.INFO }.
debug_domains value filters log level like log_level arg. log_level arg and debug_domains value are or conditoin.

mask is also a little bit difficult. This args filters log by event class name like bb.event.BuildStarted, bb.command.CommandCompleted, etc..
It is unclear what type of logs are available.
set_features(features: List[bbclient.bbcommon.BBFeature]) None[source]

Set feature(Enable feature)

Parameters
  • self (BBClient) – none

  • features (List[BBFeature]) – list of HOB_EXTRA_CACHES, BASEDATASTORE_TRACKING and SEND_SANITYEVENTS.

Note

if enable HOB_EXTRA_CACHES, recipecheces has extra-info like SUMMARY, LICENSE, DESCRIPTION, etc…
if enable BASEDATASTORE_TRACKING, enable_data_tracking. See enable_data_tracking command.
if enable SEND_SANITYEVENTS, this feature has not been implemented and is currently meaningless.
set_pre_post_conf_files(pre_files: str, post_files: str) None[source]

Set pre-load files and post-load files of bitbake.conf at parse_configuration_files command

Parameters
  • self (BBClient) – none

  • pre_files (str) – files loaded before bitbake.conf

  • post_files (str) – files loaded after bitbake.conf

Note

When parse_configuration_files command, pre_files will load before bitbake.conf and post_files will load after bitbake.conf.

set_variable(name: str, value: str) None[source]

Set vaiable value

Parameters
  • self (BBClient) – none

  • name (str) – variable name

  • value (str) – variable value you want to set

show_environment(bb_file_path: str) None[source]

xxxxx

Note

This function will block until complete to xxxxx is complete. For more details, see xxxxx.

show_environment_async(bb_file_path: str) None[source]

Show variables for specified recipe

This command will send following events. If you want to wait done, please use wait_done_async.

  • bb.event.ConfigParsed

  • bb.event.CacheLoadStarted

  • bb.event.CacheLoadProgress

  • bb.event.CacheLoadCompleted

  • bb.event.RecipePreFinalise

  • bb.event.RecipePostKeyExpansion

  • bb.event.RecipeTaskPreProcess

  • bb.event.RecipeParsed

  • bb.event.ConfigParsed

  • bb.command.CommandCompleted

  • bb.command.CommandFailed

  • bb.command.CommandExit

Parameters
  • self (BBClient) – none

  • bb_file_path (str) – target recipe path

Note

bbclient doesn’t display any information. If you want to use this feature, please use bitbake-gervar or bitbake -e.
show_environment_target(package_name: str = '') None[source]

xxxxx

Note

This function will block until complete to xxxxx is complete. For more details, see xxxxx.

show_environment_target_async(package_name: str = '') None[source]

Show variables for specified package

This command will send following events. If you want to wait done, please use wait_done_async.

  • bb.event.ConfigParsed

  • bb.command.CommandCompleted

  • bb.command.CommandFailed

  • bb.command.CommandExit

Parameters
  • self (BBClient) – none

  • package_name (str) – target package name

Note

bbclient doesn’t display any information. If you want to use this feature, please use bitbake-gervar or bitbake -e.
show_versions() None[source]

xxxxx

Note

This function will block until complete to xxxxx is complete. For more details, see xxxxx.

show_versions_async() None[source]

Show all packages versions

This command will send following events. If you want to wait done, please use wait_done_async.

  • bb.command.CommandCompleted

  • bb.command.CommandFailed

  • bb.command.CommandExit

Parameters

self (BBClient) – none

Note

bbclient doesn’t display any information. If you want to use this feature, please use bitbake-layers.
start_server() bool[source]

Start bitbake server

Parameters

self (BBClient) – none

Returns

start_server result

Return type

bool

Note

Remote server support deprecated becuase bitbake has some minor software bug when using remote server.

state_force_shutdown() None[source]

Terminate tasks

Parameters

self (BBClient) – none

Note

Terminate tasks defined in recipes. If there are running tasks, terminate them.

state_shutdown() None[source]

Terminate tasks

Parameters

self (BBClient) – none

Note

Terminate tasks defined in recipes. If there are running tasks, wait for them to exit.

stop_server() None[source]

Stop bitbake server

Parameters

self (BBClient) – none

syncronize_decorator() None[source]

Decorator for syncronize

Parameters

func (Callable) – target function

Note

This decorator automatically waits for async

test_cooker_command_event(pattern: str) None[source]

xxxxx

Note

This function will block until complete to xxxxx is complete. For more details, see xxxxx.

test_cooker_command_event_async(pattern: str) None[source]

Dummy command

This command will send following events. If you want to wait done, please use wait_done_async.

  • bb.event.FilesMatchingFound

  • bb.command.CommandCompleted

  • bb.command.CommandFailed

  • bb.command.CommandExit

Parameters
  • self (BBClient) – none

  • pattern (str) – dummy param

trigger_event(evene_name: str) None[source]

xxxxx

Note

This function will block until complete to xxxxx is complete. For more details, see xxxxx.

trigger_event_async(evene_name: str) None[source]

Send event

Parameters
  • self (BBClient) – none

  • evene_name (str) – event class name.

Note

Send evene_name event. User can receive this event by register_callback.
unregister_callback(unique_id: uuid.UUID) None[source]

Unregister callback functions for events

Parameters
  • self (BBClient) – none

  • unique_id (uuid.UUID) – Callback id. The user can get this when registering.

update_config(options: Mapping[str, Any], environment: Mapping[str, str], command_line: str) None[source]

Update config

Parameters
  • self (BBClient) – none

  • options (Mapping[str, Any]) – dict of prefile and postfile

  • environment (Mapping[str, str]) – environment variables

  • command_line (str) – will set to BB_CMDLINE

Note

options will set like {“prefile”: [“FILE_NAME”, “FILE_NAME”], “postfile”: [“FILE_NAME”, “FILE_NAME”]}
They are prefiles and postfiles settings. See set_pre_post_conf_files command. if you change prefiles or postfiles, bitbake will reset their cache.
environment is environment variables, like {“KEY”: “VALUE”, “KEY”: “VALUE”}. if you add/change/delete any environemt variable, bitbake will reset their cache.
command_line will set to BB_CMDLINE variable. BB_CMDLINE seems not to be used at all.
wait_done_async(timeout: Optional[float] = None) Optional[bbclient.bbevent.BBEventBase][source]

Wait CommandCompletedEvent, CommandExitEvent, CommandFailedEvent event

Parameters
  • self (BBClient) – none

  • timeout (Optional[float], optional) – timeout. (seconds)

Returns

target event or None

Return type

Optional[BBEventBase]

class bbclient.bbclient.CallBack(target_event_type: Optional[bbclient.bbevent.BBEventBase], callback: Callable[[bbclient.bbclient.BBClient, bbclient.bbevent.BBEventBase], None])[source]

Bases: object

CallBack for bitbake events

target_event_type

trigger event type for callback function

Type

Optional[BBEventBase]

callback

callback function

Type

Callable[[“BBClient”, BBEventBase], None]

bbclient.bbcommon module

This file provides common definition for ease of understanding in/out of commands

class bbclient.bbcommon.AllProvidersResult(package_name: str, recipe_file: List[Any])[source]

Bases: object

allProviders result

package_name

package name

Type

str

recipes

recipe file path and its pe, pv, pr

Type

List[GetRecipeVersionsResult]

class bbclient.bbcommon.BBFeature(value)[source]

Bases: enum.Enum

An enumeration.

BASEDATASTORE_TRACKING = 1
HOB_EXTRA_CACHES = 0
SEND_SANITYEVENTS = 2
exception bbclient.bbcommon.BBProjectNotFoundError(project_path: str)[source]

Bases: Exception

__project_path

project path provided by user

Type

str

class bbclient.bbcommon.FindProvidersResult(package_name: str, latest_version: List[Any], perffered_version: List[Any], required_version: Optional[bool])[source]

Bases: object

findProviders result

package_name

recipe file name

Type

str

latest_pe

latest package epoch

Type

List[Any]

latest_pv

latest package version

Type

List[Any]

latest_pr

latest package revision

Type

List[Any]

latest_recipe_file_path

latest package recipe file path

Type

List[Any]

preffered_pe

preffered package epoch

Type

List[Any]

preffered_pv

preffered package version

Type

List[Any]

preffered_pr

preffered package revision

Type

List[Any]

preffered_recipe_file_path

preffered package recipe file path

Type

List[Any]

required_version

whether required version exists or not. If the yocto version is old, it does not support this and will be None.

Type

Optional[bool]

class bbclient.bbcommon.GetAllAppendsResult(target_recipe_name: str, append_file_path: str)[source]

Bases: object

getAllAppends result

target_recipe_name

recipe file name

Type

str

append_file_path

append recipe file path for the recipe file name

Type

str

class bbclient.bbcommon.GetBbFilePriorityResult(recipe_file_path: str, priority: int)[source]

Bases: object

getBbFilePriority result

recipe_file_path

recipe file path

Type

str

priority

priority of the recipe file

Type

int

class bbclient.bbcommon.GetDefaultPreferenceResult(recipe_file_path: str, default_preference_version: int)[source]

Bases: object

getDefaultPreference result

recipe_file_path

recipe file path

Type

str

default_preference_version

DEFAULT_PRERENCE for the recipe file.

Type

int

class bbclient.bbcommon.GetLayerPrioritiesResult(data: List[Any])[source]

Bases: object

getLayerPriorities Result

name

variable name

Type

str

path

variable value

Type

str

path2

variable value

Type

str

priority

see VariableHistory.

Type

int

class bbclient.bbcommon.GetRProvidersResult(package_alias_name: str, recipe_file_paths: List[str])[source]

Bases: object

getRProviders result

package_alias_name

package alias name

Type

str

recipe_file_paths

recipe file paths that provides the alias package

Type

List[str]

class bbclient.bbcommon.GetRecipeDependsResult(data: List[Any])[source]

Bases: object

getRecipeDepends result

recipe_file_path

recipe file path

Type

str

depend_package_names

package names that the recipe file depends on

Type

List[str]

class bbclient.bbcommon.GetRecipeInheritsResult(recipe_file_path: str, inherit_file_paths: List[str])[source]

Bases: object

getRecipeInherits result

recipe_file_path

recipe file path

Type

str

inherit_file_paths

inherit recipe file paths that the recipe file inherits

Type

List[str]

class bbclient.bbcommon.GetRecipePackagesDynamicResult(dynamic_package_name: str, recipe_file_paths: List[str])[source]

Bases: object

getRecipePackagesDynamic result

dynamic_package_name

dynamic package name

Type

str

recipe_file_paths

recipe file paths that provides the dynamic package

Type

List[str]

class bbclient.bbcommon.GetRecipePackagesResult(package_name: str, recipe_file_paths: List[str])[source]

Bases: object

getRecipePackages result

package_name

package name

Type

str

recipe_file_paths

recipe file paths that provides the package

Type

List[str]

class bbclient.bbcommon.GetRecipeProvidesResult(recipe_file_path: str, packages: List[str])[source]

Bases: object

getRecipeProvides result

recipe_file_path

recipe file path

Type

str

packages

package names that the recipe file provides

Type

List[str]

class bbclient.bbcommon.GetRecipeVersionsResult(version: List[str], recipe_file_path: str)[source]

Bases: object

getRecipeVersions result

recipe_file_path

recipe file path

Type

str

pe

package epoch

Type

str

pv

package version

Type

str

pr

package revision

Type

str

class bbclient.bbcommon.GetRecipesResult(data: List[Any])[source]

Bases: object

getRecipes result

package_name

package name

Type

str

recipe_files

recipe file paths

Type

List[str]

class bbclient.bbcommon.GetRuntimeDependsResult(recipe_file_path: str, package_depenedncy: Mapping[str, List[str]])[source]

Bases: object

getRProviders result

recipe_file_path

recipe file path

Type

str

package_depenedncy

package names that the recipe file depends on

Type

Mapping[str, List[str]]

bbclient.bbcommon.GetRuntimeRecommendsResult

alias of bbclient.bbcommon.GetRuntimeDependsResult

class bbclient.bbcommon.GetSkippedRecipesResult(recipe_file_path: str, data: Union[Mapping[str, Any], SkippedPackage])[source]

Bases: object

getSkippedRecipes result

recipe_file_path

recipe file path

Type

str

pn

packages name

Type

str

skipreason

skipreason for the recipe file.

Type

str

provides

package names provided by the recipe file

Type

List[str]

rprovides

package alias names provided by the recipe file

Type

List[str]

class bbclient.bbcommon.JsonEncoder(*, skipkeys=False, ensure_ascii=True, check_circular=True, allow_nan=True, sort_keys=False, indent=None, separators=None, default=None)[source]

Bases: json.encoder.JSONEncoder

default(obj)[source]

Implement this method in a subclass such that it returns a serializable object for o, or calls the base implementation (to raise a TypeError).

For example, to support arbitrary iterators, you could implement default like this:

def default(self, o):
    try:
        iterable = iter(o)
    except TypeError:
        pass
    else:
        return list(iterable)
    # Let the base class default method raise the TypeError
    return JSONEncoder.default(self, o)
class bbclient.bbcommon.VariableHistory(parsing, variable, file, line, op, detail, flag, func)

Bases: tuple

detail

Alias for field number 5

file

Alias for field number 2

flag

Alias for field number 6

func

Alias for field number 7

line

Alias for field number 3

op

Alias for field number 4

parsing

Alias for field number 0

variable

Alias for field number 1

class bbclient.bbcommon.getAllKeysWithFlagsResult(name: str, data: Mapping[str, Any])[source]

Bases: object

name

variable name

Type

str

value

variable value

Type

str

histories

see VariableHistory.

Type

List[VariableHistory]

flags

flag and value map

Type

Mapping[str, str]

bbclient.bbevent module

This file provides definition for events from bitbake server

class bbclient.bbevent.BBEventBase(event_name: str, data: Mapping[str, Any])[source]

Bases: object

Base class for all the events

event_name

event name like “bb.build.TaskProgress”

Type

str

EVENT_NAME: str = 'bb.build.TaskFailed'
classmethod is_target(event_name: str) bool[source]

Determine if the event is a target event.

Parameters

event_name (str) – event name like “bb.build.TaskProgress”

Returns

whether the event is a target or not

Return type

bool

class bbclient.bbevent.BuildBaseEvent(event_name: str, data: Mapping[str, Any])[source]

Bases: bbclient.bbevent.BBEventBase

EVENT_NAME: str = 'bb.event.BuildBase'
class bbclient.bbevent.BuildInitEvent(data: Mapping[str, Any])[source]

Bases: bbclient.bbevent.BuildBaseEvent

EVENT_NAME: str = 'bb.event.BuildInit'
class bbclient.bbevent.BuildStartedEvent(data: Mapping[str, Any])[source]

Bases: bbclient.bbevent.BuildBaseEvent, bbclient.bbevent.OperationStarted

EVENT_NAME: str = 'bb.event.BuildStarted'
class bbclient.bbevent.CacheLoadCompletedEvent(data: Mapping[str, Any])[source]

Bases: bbclient.bbevent.OperationCompletedEvent

EVENT_NAME: str = 'bb.event.CacheLoadCompleted'
class bbclient.bbevent.CacheLoadProgressEvent(data: Mapping[str, Any])[source]

Bases: bbclient.bbevent.OperationProgress

EVENT_NAME: str = 'bb.event.CacheLoadProgress'
class bbclient.bbevent.CacheLoadStartedEvent(data: Mapping[str, Any])[source]

Bases: bbclient.bbevent.OperationStarted

EVENT_NAME: str = 'bb.event.CacheLoadStarted'
class bbclient.bbevent.CommandCompletedEvent(data: Mapping[str, Any])[source]

Bases: bbclient.bbevent.BBEventBase

EVENT_NAME: str = 'bb.command.CommandCompleted'
class bbclient.bbevent.CommandExitEvent(data: Mapping[str, Any], event_name: str = 'bb.command.CommandExit')[source]

Bases: bbclient.bbevent.BBEventBase

EVENT_NAME: str = 'bb.command.CommandExit'
class bbclient.bbevent.CommandFailedEvent(data: Mapping[str, Any])[source]

Bases: bbclient.bbevent.CommandExitEvent

EVENT_NAME: str = 'bb.command.CommandFailed'
class bbclient.bbevent.ConfigFilePathFoundEvent(data: Mapping[str, Any])[source]

Bases: bbclient.bbevent.BBEventBase

EVENT_NAME: str = 'bb.event.ConfigFilePathFound'
class bbclient.bbevent.ConfigFilesFoundEvent(data: Mapping[str, Any])[source]

Bases: bbclient.bbevent.BBEventBase

EVENT_NAME: str = 'bb.event.ConfigFilesFound'
class bbclient.bbevent.ConfigParsedEvent(data: Mapping[str, Any])[source]

Bases: bbclient.bbevent.BBEventBase

EVENT_NAME: str = 'bb.event.ConfigParsed'
class bbclient.bbevent.DepTreeGeneratedEvent(data: Mapping[str, Any])[source]

Bases: bbclient.bbevent.BBEventBase

EVENT_NAME: str = 'bb.event.DepTreeGenerated'
class bbclient.bbevent.FilesMatchingFoundEvent(data: Mapping[str, Any])[source]

Bases: bbclient.bbevent.BBEventBase

EVENT_NAME: str = 'bb.event.FilesMatchingFound'
class bbclient.bbevent.HeartbeatEvent(data: Mapping[str, Any])[source]

Bases: bbclient.bbevent.BBEventBase

EVENT_NAME: str = 'bb.event.HeartbeatEvent'
class bbclient.bbevent.LogRecord(data: Mapping[str, Any])[source]

Bases: bbclient.bbevent.BBEventBase

EVENT_NAME: str = 'logging.LogRecord'
class bbclient.bbevent.MonitorDiskEventEvent(data: Mapping[str, Any])[source]

Bases: bbclient.bbevent.BBEventBase

EVENT_NAME: str = 'bb.event.MonitorDiskEvent'
class bbclient.bbevent.NoProviderEvent(data: Mapping[str, Any])[source]

Bases: bbclient.bbevent.BBEventBase

EVENT_NAME: str = 'bb.event.NoProvider'
class bbclient.bbevent.OperationCompletedEvent(event_name: str, data: Mapping[str, Any])[source]

Bases: bbclient.bbevent.BBEventBase

EVENT_NAME: str = 'bb.event.OperationCompletedEvent'
class bbclient.bbevent.OperationProgress(event_name: str, data: Mapping[str, Any])[source]

Bases: bbclient.bbevent.BBEventBase

EVENT_NAME: str = 'bb.event.OperationProgress'
class bbclient.bbevent.OperationStarted(event_name: str, data: Mapping[str, Any])[source]

Bases: bbclient.bbevent.BBEventBase

EVENT_NAME: str = 'bb.event.OperationStarted'
class bbclient.bbevent.ProcessFinishedEvent(data: Mapping[str, Any])[source]

Bases: bbclient.bbevent.BBEventBase

EVENT_NAME: str = 'bb.event.ProcessFinished'
class bbclient.bbevent.ProcessProgressEvent(data: Mapping[str, Any])[source]

Bases: bbclient.bbevent.BBEventBase

EVENT_NAME: str = 'bb.event.ProcessProgress'
class bbclient.bbevent.ProcessStartedEvent(data: Mapping[str, Any])[source]

Bases: bbclient.bbevent.BBEventBase

EVENT_NAME: str = 'bb.event.ProcessStarted'
class bbclient.bbevent.ReachableStampsEvent(data: Mapping[str, Any])[source]

Bases: bbclient.bbevent.BBEventBase

EVENT_NAME: str = 'bb.event.ReachableStamps'
class bbclient.bbevent.RecipeEvent(event_name: str, data: Mapping[str, Any])[source]

Bases: bbclient.bbevent.BBEventBase

EVENT_NAME: str = 'bb.event.RecipeEvent'
class bbclient.bbevent.RecipeParsedEvent(data: Mapping[str, Any])[source]

Bases: bbclient.bbevent.RecipeEvent

EVENT_NAME: str = 'bb.event.RecipeParsed'
class bbclient.bbevent.RecipePostKeyExpansionEvent(data: Mapping[str, Any])[source]

Bases: bbclient.bbevent.RecipeEvent

EVENT_NAME: str = 'bb.event.RecipePostKeyExpansion'
class bbclient.bbevent.RecipePreFinaliseEvent(data: Mapping[str, Any])[source]

Bases: bbclient.bbevent.RecipeEvent

EVENT_NAME: str = 'bb.event.RecipePreFinalise'
class bbclient.bbevent.RecipeTaskPreProcessEvent(data: Mapping[str, Any])[source]

Bases: bbclient.bbevent.RecipeEvent

EVENT_NAME: str = 'bb.event.RecipeTaskPreProcess'
class bbclient.bbevent.TargetsTreeGeneratedEvent(data: Mapping[str, Any])[source]

Bases: bbclient.bbevent.BBEventBase

EVENT_NAME: str = 'bb.event.TargetsTreeGenerated'
class bbclient.bbevent.TaskBase(event_name: str, data: Mapping[str, Any])[source]

Bases: bbclient.bbevent.BBEventBase

EVENT_NAME: str = 'bb.build.TaskBase'
class bbclient.bbevent.TaskFailedEvent(data: Mapping[str, Any])[source]

Bases: bbclient.bbevent.TaskBase

EVENT_NAME: str = 'bb.build.TaskFailed'
class bbclient.bbevent.TaskProgressEvent(data: Mapping[str, Any])[source]

Bases: bbclient.bbevent.BBEventBase

EVENT_NAME: str = 'bb.build.TaskProgress'
class bbclient.bbevent.TaskStartedEvent(data: Mapping[str, Any])[source]

Bases: bbclient.bbevent.TaskBase

EVENT_NAME: str = 'bb.build.TaskStarted'
class bbclient.bbevent.TaskSucceededEvent(data: Mapping[str, Any])[source]

Bases: bbclient.bbevent.TaskBase

EVENT_NAME: str = 'bb.build.TaskSucceeded'
class bbclient.bbevent.TreeDataPreparationCompletedEvent(data: Mapping[str, Any])[source]

Bases: bbclient.bbevent.OperationCompletedEvent

EVENT_NAME: str = 'bb.event.TreeDataPreparationCompleted'
class bbclient.bbevent.TreeDataPreparationProgressEvent(data: Mapping[str, Any])[source]

Bases: bbclient.bbevent.OperationProgress

EVENT_NAME: str = 'bb.event.TreeDataPreparationProgress'
class bbclient.bbevent.TreeDataPreparationStartedEvent(data: Mapping[str, Any])[source]

Bases: bbclient.bbevent.OperationStarted

EVENT_NAME: str = 'bb.event.TreeDataPreparationStarted'
class bbclient.bbevent.UnknownEvent(event_name: str, data: Mapping[str, Any])[source]

Bases: bbclient.bbevent.BBEventBase

class bbclient.bbevent.runQueueEvent(event_name: str, data: Mapping[str, Any])[source]

Bases: bbclient.bbevent.BBEventBase

EVENT_NAME: str = 'bb.runqueue.runQueueEvent'
class bbclient.bbevent.runQueueTaskCompletedEvent(data: Mapping[str, Any])[source]

Bases: bbclient.bbevent.runQueueEvent

EVENT_NAME: str = 'bb.runqueue.runQueueTaskCompleted'
class bbclient.bbevent.runQueueTaskFailedEvent(data: Mapping[str, Any])[source]

Bases: bbclient.bbevent.runQueueEvent

EVENT_NAME: str = 'bb.runqueue.runQueueTaskFailed'
class bbclient.bbevent.runQueueTaskSkippedEvent(data: Mapping[str, Any])[source]

Bases: bbclient.bbevent.runQueueEvent

EVENT_NAME: str = 'bb.runqueue.runQueueTaskSkipped'
class bbclient.bbevent.runQueueTaskStartedEvent(data: Mapping[str, Any])[source]

Bases: bbclient.bbevent.runQueueEvent

EVENT_NAME: str = 'bb.runqueue.runQueueTaskStarted'
class bbclient.bbevent.sceneQueueCompleteEvent(data: Mapping[str, Any])[source]

Bases: bbclient.bbevent.sceneQueueEvent

EVENT_NAME: str = 'bb.runqueue.sceneQueueComplete'
class bbclient.bbevent.sceneQueueEvent(event_name: str, data: Mapping[str, Any])[source]

Bases: bbclient.bbevent.runQueueEvent

EVENT_NAME: str = 'bb.runqueue.sceneQueueEvent'

Module contents