コグノスケ


link 未来から過去へ表示(*)  link 過去から未来へ表示

link もっと前
2024年6月13日 >>> 2024年5月31日
link もっと後

2024年5月31日

Bitbakeのクラス

目次: Yocto

Yocto Scarthgap(5.0.1)のメモです。前回同様、コードを読んで依存関係を調べるのは大変時間が掛かるので、簡易的な調査手法として全ファイルを消してエラーを観察し、エラーの原因となるファイルを復活させて次ステップに進める手段を用います。

引き続きBitbakeを実行してエラーを見て、足りないファイルを元に戻していくという方法で各パーツや設定の動作を見ます。

クラスが見つからないエラー
$ bitbake core-image-sato

ERROR: Unable to parse /home/katsuhiro/share/projects/oss/poky/bitbake/lib/bb/parse/parse_py/BBHandler.py
Traceback (most recent call last):
  File "/home/katsuhiro/share/projects/oss/poky/bitbake/lib/bb/parse/parse_py/BBHandler.py", line 71, in inherit(files=['base'], fn='configuration INHERITs', lineno=0, d=<bb.data_smart.DataSmart object at 0x7f7a85863c50>, deferred=False):
             if not os.path.exists(file):
    >            raise ParseError("Could not inherit file %s" % (file), fn, lineno)

bb.parse.ParseError: ParseError in configuration INHERITs: Could not inherit file classes/base.bbclass

なにやらclassesというディレクトリと、*.bbclassというファイル名が出てきました。これはクラス(Classes - The Yoct Project)といってレシピ間で処理を共有するための仕組みです。ドキュメントによると3種類あるそうです。

  • classes-recipe/ - レシピに個別に継承されることを意図したクラス
  • classes-global/ - グローバルに継承されることを意図したクラス
  • classes/ - 使用コンテキストが明確に定義されていないクラス

Yoctoのクラス(*.bbclassファイル)は全部meta/classes-globalかと思ったらそうでもなく、一部のクラスはmeta/classesディレクトリに配置されています。

エラーメッセージはmeta/classes/base.bbclassがないと言っていますが、ファイルの実際の在処はmeta/classes-global/base.bbclassです。どういうことでしょう?Bitbakeのソースコードを見ると、

Bitbakeのクラスの検索処理

# bitbake/lib/bb/parse/parse_py/BBHandler.py

def inherit(files, fn, lineno, d, deferred=False):
    __inherit_cache = d.getVar('__inherit_cache', False) or []
    #if "${" in files and not deferred:
    #    bb.warn("%s:%s has non deferred conditional inherit" % (fn, lineno))
    files = d.expand(files).split()

    #★★files配列には'base'だけが入っている★★
    for file in files:
        classtype = d.getVar("__bbclasstype", False)    #★★classtype = global★★
        origfile = file

        #★★classes-global/base.bbclassがなければ、classes/base.bbclassを探す★★
        for t in ["classes-" + classtype, "classes"]:
            file = origfile
            #★★パスと拡張子を連結★★
            if not os.path.isabs(file) and not file.endswith(".bbclass"):
                file = os.path.join(t, '%s.bbclass' % file)

            if not os.path.isabs(file):
                bbpath = d.getVar("BBPATH")
                abs_fn, attempts = bb.utils.which(bbpath, file, history=True)
                for af in attempts:
                    if af != abs_fn:
                        bb.parse.mark_dependency(d, af)
                if abs_fn:
                    file = abs_fn

            if os.path.exists(file):
                break

        #★★どちらもないと最後に探したパス名でエラーメッセージを出してくる★★
        if not os.path.exists(file):
            raise ParseError("Could not inherit file %s" % (file), fn, lineno)  #★★エラーメッセージを発生させる行★★

Bitbakeはclasses-globalとclassesの両方を探し、どちらにも目当てのクラスがない場合は最後に探したパス名でエラーメッセージを出力します。従ってエラーメッセージのパスは必ずmeta/classesになります。

今回登場したファイル、ディレクトリは、

  • poky/meta/classes-global/base.bbclass
  • poky/meta/classes-global/*.bbclass
  • poky/meta/classes/*.bbclass

こんなとこ。次回はディストリビューションを見ます。

編集者:すずき(2024/06/04 00:43)

コメント一覧

  • コメントはありません。
open/close この記事にコメントする



link もっと前
2024年6月13日 >>> 2024年5月31日
link もっと後

管理用メニュー

link 記事を新規作成

<2024>
<<<06>>>
------1
2345678
9101112131415
16171819202122
23242526272829
30------

最近のコメント5件

  • link 24年5月16日
    すずきさん (05/21 11:41)
    「あー、確かにdpkg-reconfigu...」
  • link 24年5月16日
    hdkさん (05/21 08:55)
    「システム全体のlocale設定はDebi...」
  • link 24年5月17日
    すずきさん (05/20 13:16)
    「そうですねえ、普通はStandardなの...」
  • link 24年5月17日
    hdkさん (05/19 07:45)
    「なるほど、そういうことなんですね。Exc...」
  • link 24年5月17日
    すずきさん (05/19 03:41)
    「Standardだと下記の設定になってい...」

最近の記事20件

  • link 22年12月22日
    すずき (06/18 19:38)
    「[x86とARMとRISC-VでCoreMark対決] 目次: RISC-VCoreMarkを以前(2019年7月5日の日記参...」
  • link 24年5月3日
    すずき (06/17 02:42)
    「[ROCK 3Cの青色LED点滅を止める] 目次: Arduinoゲーミングマシンの流行により、最近のコンピュータは意味もなく...」
  • link 24年5月19日
    すずき (06/04 00:44)
    「[Yocto - まとめリンク] 目次: YoctoHello YoctoYoctoのセットアップスクリプトとビルドディレクト...」
  • link 24年5月31日
    すずき (06/04 00:43)
    「[Bitbakeのクラス] 目次: YoctoYocto Scarthgap(5.0.1)のメモです。前回同様、コードを読んで...」
  • link 24年5月30日
    すずき (06/04 00:35)
    「[Bitbakeのレイヤー] 目次: YoctoYocto Scarthgap(5.0.1)のメモです。Yoctoの使い方は以...」
  • link 24年5月29日
    すずき (06/04 00:09)
    「[Yoctoのビルドディレクトリとテンプレートディレクトリ] 目次: YoctoYocto Scarthgap(5.0.1)の...」
  • link 24年5月28日
    すずき (06/04 00:02)
    「[Yoctoのセットアップスクリプトとビルドディレクトリ] 目次: YoctoYocto Scarthgap(5.0.1)のメ...」
  • link 20年7月11日
    すずき (06/03 23:59)
    「[STATIONflow実績コンプリート] 目次: ゲームSTATIONflowの実績をコンプリートしました。「ラッキーセブン...」
  • link 20年7月1日
    すずき (06/03 23:59)
    「[STATIONflowランク100] 目次: ゲームSTATIONflowのランクが100になりました。何か実績と紐づいてい...」
  • link 20年6月30日
    すずき (06/03 23:59)
    「[STATIONflowの駅の評価] 目次: ゲーム以前(2020年5月28日の日記参照)STATIONflowで速度3にする...」
  • link 20年6月28日
    すずき (06/03 23:59)
    「[STATIONflowまさかの実績解除方法] 目次: ゲームSTATIONflowのしょうもない小技 その2です。実績の解除...」
  • link 20年6月27日
    すずき (06/03 23:59)
    「[STATIONflowプレイ日記] 目次: ゲームSTATIONflowの基本は理解したつもりなので、実績解除に挑んでますが...」
  • link 20年6月26日
    すずき (06/03 23:58)
    「[STATIONflow小技] 目次: ゲームSTATIONflowのしょうもない小技。将来的に、どこに駅の入り口と電車の乗り...」
  • link 20年5月28日
    すずき (06/03 23:58)
    「[STATIONflowのバグ] 目次: ゲームSTATIONflowバグってますね……。ゲーム進...」
  • link 20年5月27日
    すずき (06/03 23:58)
    「[STATIONflowランク20] 目次: ゲームゲーム進行的に1つの区切りと思われる、ランク20を超えました。駅が広くなる...」
  • link 20年5月19日
    すずき (06/03 23:58)
    「[STATIONflow始めました、超えろ、新宿駅] 目次: ゲームSteamで新たなゲームを買いました。2020年4月ローン...」
  • link 21年12月28日
    すずき (06/03 23:58)
    「[ゲーム - まとめリンク] 目次: ゲーム一覧が欲しくなったので作りました。Wizardry(囚われし亡霊の街)敵が強すぎる...」
  • link 20年7月13日
    すずき (06/03 23:57)
    「[STATIONflow - まとめリンク] 目次: ゲームに統合。...」
  • link 23年9月18日
    すずき (06/03 23:49)
    「[一覧の一覧 - まとめリンク] 一覧の一覧、まとめのまとめが欲しくなったので作りました。OS、アーキテクチャ系。目次: An...」
  • link 24年5月27日
    すずき (06/03 23:46)
    「[Hello Yocto] 目次: YoctoYoctoのメモです。なおYoctoのバージョンはScarthgap(5.0.1...」
link もっとみる

こんてんつ

open/close wiki
open/close Linux JM
open/close Java API

過去の日記

open/close 2002年
open/close 2003年
open/close 2004年
open/close 2005年
open/close 2006年
open/close 2007年
open/close 2008年
open/close 2009年
open/close 2010年
open/close 2011年
open/close 2012年
open/close 2013年
open/close 2014年
open/close 2015年
open/close 2016年
open/close 2017年
open/close 2018年
open/close 2019年
open/close 2020年
open/close 2021年
open/close 2022年
open/close 2023年
open/close 2024年
open/close 過去日記について

その他の情報

open/close アクセス統計
open/close サーバ一覧
open/close サイトの情報

合計:  counter total
本日:  counter today

link About www.katsuster.net
RDFファイル RSS 1.0

最終更新: 06/18 19:38