indygreg / indygreg/PyOxidizer

Frida module not found error in build

Open
#43 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
6.2k
Forks
256
PR merge metrics
No merged PRs in 30d

Description

I got the error in build process
```
Finished dev [unoptimized + debuginfo] target(s) in 17m 08s
packaging application into /usr/src/myapp/pyapp/build/apps/pyapp
copying /usr/src/myapp/pyapp/build/target/x86_64-unknown-linux-gnu/debug/pyapp to /usr/src/myapp/pyapp/build/apps/pyapp/pyapp
resolving packaging state...
writing license for _bz2 to /usr/src/myapp/pyapp/build/apps/pyapp/LICENSE.bzip2.txt
writing license for _ctypes to /usr/src/myapp/pyapp/build/apps/pyapp/LICENSE.libffi.txt
writing license for _curses to /usr/src/myapp/pyapp/build/apps/pyapp/LICENSE.ncurses.txt
writing license for _curses_panel to /usr/src/myapp/pyapp/build/apps/pyapp/LICENSE.ncurses.txt
writing license for _dbm to /usr/src/myapp/pyapp/build/apps/pyapp/LICENSE.bdb.txt
writing license for _hashlib to /usr/src/myapp/pyapp/build/apps/pyapp/LICENSE.openssl.txt
writing license for _lzma to /usr/src/myapp/pyapp/build/apps/pyapp/LICENSE.liblzma.txt
writing license for _sqlite3 to /usr/src/myapp/pyapp/build/apps/pyapp/LICENSE.sqlite.txt
writing license for _ssl to /usr/src/myapp/pyapp/build/apps/pyapp/LICENSE.openssl.txt
writing license for _uuid to /usr/src/myapp/pyapp/build/apps/pyapp/LICENSE.libuuid.txt
writing license for python to /usr/src/myapp/pyapp/build/apps/pyapp/LICENSE.python.txt
writing license for readline to /usr/src/myapp/pyapp/build/apps/pyapp/LICENSE.libedit.txt
writing license for readline to /usr/src/myapp/pyapp/build/apps/pyapp/LICENSE.ncurses.txt
writing license for zlib to /usr/src/myapp/pyapp/build/apps/pyapp/LICENSE.zlib.txt
pyapp packaged into /usr/src/myapp/pyapp/build/apps/pyapp

\***
Frida native extension not found
Please check your PYTHONPATH.
\***

Traceback (most recent call last):
File "importlib.util", line 94, in find_spec
File "ZenTracer", line 7, in
File "frida", line 24, in
File "frida", line 7, in
ModuleNotFoundError: No module named '_frida'
error: cargo run failed
```
```
### pyoxidizer.toml file

[[python_distribution]]
build_target = "x86_64-apple-darwin"
url = "https://github.com/indygreg/python-build-standalone/releases/download/20190617/cpython-3.7.3-macos-20190618T0523.tar.zst"
sha256 = "6668202a3225892ce252eff4bb53a58ac058b6a413ab9d37c026a500c2a561ee"

[[python_distribution]]
build_target = "x86_64-pc-windows-msvc"
url = "https://github.com/indygreg/python-build-standalone/releases/download/20190617/cpython-3.7.3-windows-amd64-20190618T0516.tar.zst"
sha256 = "fd43554b5654a914846cf1c251d1ad366f46c7c4d20b7c44572251b533351221"

[[python_distribution]]
build_target = "x86_64-unknown-linux-gnu"
url = "https://github.com/indygreg/python-build-standalone/releases/download/20190617/cpython-3.7.3-linux64-20190618T0324.tar.zst"
sha256 = "d6b80a9723c124d6d193f8816fdb874ba6d56abfb35cbfcc2b27de53176d0620"

[[python_distribution]]
build_target = "x86_64-unknown-linux-musl"
url = "https://github.com/indygreg/python-build-standalone/releases/download/20190617/cpython-3.7.3-linux64-musl-20190618T0400.tar.zst"
sha256 = "2be2d109b82634b36685b89800887501b619ef946dda182e5a8ab5c7029a8136"

[[build]]
application_name = "pyapp"

[[embedded_python_config]]
raw_allocator = "jemalloc"

[[embedded_python_config]]
build_target = "x86_64-pc-windows-msvc"
raw_allocator = "system"

[[packaging_rule]]
type = "stdlib-extensions-policy"
policy = "all"

[[packaging_rule]]
type = "stdlib"
include_source = false

[[packaging_rule]]
type = "write-license-files"
path = ""

### package pyqt5
[[packaging_rule]]
type = "pip-install-simple"
package = "PyQt5"
### package frida
[[packaging_rule]]
type = "pip-install-simple"
package = "frida-tools"

[[packaging_rule]]
type = "package-root"
path = "src/mypackage"
packages = ["ZenTracer","layout","ListDialog"]

# Import a Python module and run it.
mode = "module"
module = "ZenTracer.__main__"

[[pyoxidizer]]
version = "0.1.2"
commit = ""
```
#project structure
![image](https://user-images.githubusercontent.com/19252045/60326283-eddb0a00-99bb-11e9-958e-cef66c20d469.png)

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the build described in pyoxidizer.toml and inspect how the pip-install-simple rule packages frida-tools and its native _frida module. Done means the packaged pyapp can import frida without the reported ModuleNotFoundError.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, rust
Domain
build-system, devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.