Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6E053C04A68 for ; Wed, 27 Jul 2022 15:49:41 +0000 (UTC) Subject: [REPORT]Some strange behavior with XMLRPC server To: bitbake-devel@lists.openembedded.org From: regulationdango@gmail.com X-Originating-Location: Tokyo, JP (160.237.142.147) X-Originating-Platform: Windows Chrome 103 User-Agent: GROUPS.IO Web Poster MIME-Version: 1.0 Date: Wed, 27 Jul 2022 08:49:35 -0700 Message-ID: Content-Type: multipart/mixed; boundary="JrRAYLabBftJqUlBM3EU" List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Wed, 27 Jul 2022 15:49:41 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/bitbake-devel/message/13859 --JrRAYLabBftJqUlBM3EU Content-Type: multipart/alternative; boundary="y9sKOy4xRMwGOEyrQdYF" --y9sKOy4xRMwGOEyrQdYF Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Hi! I'm a newbie of bitbake community! Recently, I'm trying to implement XMLRPC client for bitbake command(this is= similar to tinfoil). As I do this activity,=C2=A0 I found the following strange behavior. --- # getRecipePackages commands returns collections.defaultdict object, but it= 's not supported by XMLRPCServer This is as the title says.=C2=A0The following two places may help you under= stand.=C2=A0Isn't this a glitch? * getRecipePackages command returns=C2=A0command.cooker.recipecaches[mc].pa= ckages(See https://git.yoctoproject.org/poky/tree/bitbake/lib/bb/command.py= #n343 ) ( https://git.yoctoproject.org/poky/tree/bitbake/lib/bb/command.py#= n343 ) * command.cooker.recipecaches[mc].packages is set as defaultdict(list) (See= https://git.yoctoproject.org/poky/tree/bitbake/lib/bb/cache.py#n153 ) This causes an exception when calling getRecipePackages commands. See the a= ttached log file. We can fix this by returning as a dict object. ``` return dict(command.cooker.recipecaches[mc].packages) ``` #=C2=A0getLayerPriorities command clears recipescache I noticed that `getLayerPriorities` command deletes cache data because `get= LayerPriorities` calls `cooker.parseConfiguration()`, and this deletes cook= er.recipecaches. Is this behavior as intended? 1. getLayerPriorities=C2=A0command calls command.cooker.parseConfiguration(= )(See https://git.yoctoproject.org/poky/tree/bitbake/lib/bb/command.py#n298= ) 2. parseConfiguration deletes recipecaches(See https://git.yoctoproject.org= /poky/tree/bitbake/lib/bb/cooker.py#n467 ) Therefore, If user calls commands by following order, the results of the th= ird and fifth getRecipes are different because the fourth getLayerPrioritie= s clears the cache. 1. parseConfiguration command 2. parseFiles command 3.=C2=A0getRecipes command=C2=A0 =C2=A0<- user can get info normaly 3.=C2=A0getLayerPriorities command 4. getRecipes command=C2=A0 =C2=A0=C2=A0=C2=A0<- user can get empty info! --- This is my first post to this mailing list, so please forgive me if I am ru= de in any way. Thanks for reading! --y9sKOy4xRMwGOEyrQdYF Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: quoted-printable Hi! I'm a newbie of bitbake community! 
Recently, I'm trying to i= mplement XMLRPC client for bitbake command(this is similar to tinfoil).&nbs= p;
As I do this activity,  I found the following strange behavior= .

---

# getRecipePackages commands returns collection= s.defaultdict object, but it's not supported by XMLRPCServer
This is a= s the title says. The following two places may help you understand.&nb= sp;Isn't this a glitch?

* getRecipePackages command returns = ;command.cooker.recipecaches[mc].packages(See https://git.yoctoproject.org/poky/tree/bitbake/lib/bb/com= mand.py#n343 )
* command.cooker.recipecaches[mc].packages is set a= s defaultdict(list) (See https://gi= t.yoctoproject.org/poky/tree/bitbake/lib/bb/cache.py#n153)

T= his causes an exception when calling getRecipePackages commands. See the at= tached log file. 
We can fix this by returning as a dict object.&= nbsp;

```
return dict(command.cooker.recipecaches[mc].packa= ges)
```

# getLayerPriorities command clears recipesca= che
I noticed that `getLayerPriorities` command deletes cache data bec= ause `getLayerPriorities` calls `cooker.parseConfiguration()`, and this del= etes cooker.recipecaches.
Is this behavior as intended?

1. = getLayerPriorities command calls command.cooker.parseConfiguration()(S= ee https://git.yoctoproject.org/p= oky/tree/bitbake/lib/bb/command.py#n298)
2. parseConfiguration del= etes recipecaches(See https:/= /git.yoctoproject.org/poky/tree/bitbake/lib/bb/cooker.py#n467)
Therefore, If user calls commands by following order, the results of the= third and fifth getRecipes are different because the fourth getLayerPriori= ties clears the cache.

1. parseConfiguration command
2. parseFiles command
3. getRecipes command   <= - user can get info normaly
3. getLayerPriorities command
4.= getRecipes command     <- user can get empty info!&= nbsp;

---

This is my first post to this mailing list,= so please forgive me if I am rude in any way. Thanks for reading!
--y9sKOy4xRMwGOEyrQdYF-- --JrRAYLabBftJqUlBM3EU Content-Type: application/octet-stream; name="log" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="log" L3Vzci9saWIvcHl0aG9uMy9kaXN0LXBhY2thZ2VzL2h0bWw1bGliL190cmllL19iYXNlLnB5OjM6 IERlcHJlY2F0aW9uV2FybmluZzogVXNpbmcgb3IgaW1wb3J0aW5nIHRoZSBBQkNzIGZyb20gJ2Nv bGxlY3Rpb25zJyBpbnN0ZWFkIG9mIGZyb20gJ2NvbGxlY3Rpb25zLmFiYycgaXMgZGVwcmVjYXRl ZCBzaW5jZSBQeXRob24gMy4zLCBhbmQgaW4gMy4xMCBpdCB3aWxsIHN0b3Agd29ya2luZwogIGZy b20gY29sbGVjdGlvbnMgaW1wb3J0IE1hcHBpbmcKV0FSTklORzogeWFjYyB0YWJsZSBmaWxlIHZl cnNpb24gaXMgb3V0IG9mIGRhdGUKTG9hZGluZyBjYWNoZTogMTAwJSB8IyMjIyMjIyMjIyMjIyMj IyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMj IyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMj IyM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