Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 926216 - dev-util/android-tools: python gki module is not installed
Summary: dev-util/android-tools: python gki module is not installed
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Zac Medico
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-03-05 19:53 UTC by qwinci222
Modified: 2024-07-26 10:39 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description qwinci222 2024-03-05 19:53:38 UTC
The python gki module that comes with dev-util/android-tools isn't installed, causing errors like `ModuleNotFoundError: No module named 'gki'` when trying to run mkbootimg and other python tools that come with this package.
Comment 1 qwinci222 2024-06-01 20:21:21 UTC
ping. the gki module is in vendor/mkbootimg (the gki folder).
Comment 2 Zac Medico gentoo-dev 2024-06-01 21:00:47 UTC
Hi, I've looked into it and I found the cmake only installs mkbootimg/gki/generate_gki_certificate.py from the gki directory here:

https://github.com/nmeum/android-tools/blob/master/vendor/CMakeLists.mkbootimg.txt

The cmake build system comes from this project, so could you report the issue there as well?

https://github.com/nmeum/android-tools/issues

Please post the full ModuleNotFoundError traceback so we can see how it's being called.
Comment 3 qwinci222 2024-07-10 20:13:53 UTC
(In reply to Zac Medico from comment #2)
> Hi, I've looked into it and I found the cmake only installs
> mkbootimg/gki/generate_gki_certificate.py from the gki directory here:
> 
> https://github.com/nmeum/android-tools/blob/master/vendor/CMakeLists.
> mkbootimg.txt
> 
> The cmake build system comes from this project, so could you report the
> issue there as well?
> 
> https://github.com/nmeum/android-tools/issues
> 
> Please post the full ModuleNotFoundError traceback so we can see how it's
> being called.

Hi, actually it looks like the file is indeed being installed but because on Gentoo the python script that running mkbootimg from the terminal calls is not /usr/share/android-tools/mkbootimg/mkbootimg.py but rather /usr/lib/python-exec/python3.12/mkbootimg it doesn't find the generate_gki_certificate that is installed at /usr/share/android-tools/mkbootimg/gki/generate_gki_certificate.py. It works fine if I run /usr/share/android-tools/mkbootimg/mkbootimg.py using this absolute path.
```
Traceback (most recent call last):
  File "/usr/lib/python-exec/python3.12/mkbootimg", line 31, in <module>
    from gki.generate_gki_certificate import generate_gki_certificate
ModuleNotFoundError: No module named 'gki'
```
Comment 4 z4 2024-07-26 10:39:57 UTC
I hit this same problem, and it does indeed look like the "gki" module is not installed as per Gentoo python standards, or at least not in the standard location.  However, perhaps a better work-around when trying to run mkbootimg would be:

PYTHONPATH=/usr/share/android-tools/mkbootimg mkbootimg

as I find that works.

But this does seem like a corner-case in how Gentoo installs python scripts, so Gentoo python team should probably comment on this further.