Skip to content

fix: export pyinstaller binary in linux x86-64 and add missing rfc3987 dependencies - #235

Open
sanjay7178 wants to merge 42 commits into
sciops-org:mainfrom
sanjay7178:fix/pyinstaller
Open

sanjay7178 wants to merge 42 commits into
sciops-org:mainfrom
sanjay7178:fix/pyinstaller

Conversation

@sanjay7178

Copy link
Copy Markdown
Collaborator

Pull Request description

This PR fixes an issue where the pre-compiled makim binaries shipped to GitHub Releases crash during runtime with a ModuleNotFoundError for rfc3987 and missing rfc3987_syntax data files when used by Homebrew or natively.

The root cause was that Python's jsonschema relies on implicit, data-heavy dependencies (rfc3987 and rfc3987_syntax/*.lark) that PyInstaller's basic collection options failed to trace and bundle deeply enough into the dist/ tarballs.

How to test these changes

How to Test

  1. Compile the binary locally using poetry build && pyinstaller --onefile -n makim-linux-x86-64 --add-data 'src/makim/schema.json:.' src/makim/__main__.py.
  2. Run ./dist/makim-linux-x86-64.
  3. Try standard commands (makim --version, makim --help) to verify no module exceptions are unhandled.

Before the fix (pre-compiled binary)

(makim) ➜  makim git:(fix/pyinstaller) ✗ ./makim-linux-x86-64
Traceback (most recent call last):
  File "jsonschema/_format.py", line 304, in <module>
ModuleNotFoundError: No module named 'rfc3987'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "__main__.py", line 3, in <module>
  File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
  File "pyimod02_importers.py", line 457, in exec_module
  File "makim/__init__.py", line 8, in <module>
  File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
  File "pyimod02_importers.py", line 457, in exec_module
  File "makim/core.py", line 25, in <module>
  File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
  File "pyimod02_importers.py", line 457, in exec_module
  File "jsonschema/__init__.py", line 13, in <module>
  File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
  File "pyimod02_importers.py", line 457, in exec_module
  File "jsonschema/_format.py", line 328, in <module>
  File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
  File "pyimod02_importers.py", line 457, in exec_module
  File "rfc3987_syntax/__init__.py", line 1, in <module>
  File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
  File "pyimod02_importers.py", line 457, in exec_module
  File "rfc3987_syntax/syntax_helpers.py", line 48, in <module>
  File "rfc3987_syntax/utils.py", line 5, in load_grammar
FileNotFoundError: [Errno 2] No such file or directory: '/tmp/_MEIsN0Ugz/rfc3987_syntax/syntax_rfc3987.lark'
[PYI-152827:ERROR] Failed to execute script '__main__' due to unhandled exception!
(makim) ➜  makim git:(fix/pyinstaller) ✗ 

Pull Request checklists

This PR is a:

  • bug-fix
  • new feature
  • maintenance

About this PR:

  • it includes tests.
  • the tests are executed on CI.
  • the tests generate log file(s) (path).
  • pre-commit hooks were executed locally.
  • this PR requires a project documentation update.

Author's checklist:

  • I have reviewed the changes and it contains no misspelling.
  • The code is well commented, especially in the parts that contain more
    complexity.
  • New and old tests passed locally.

Additional information

Reviewer's checklist

Copy and paste this template for your review's note:

## Reviewer's Checklist

- [ ] I managed to reproduce the problem locally from the `main` branch
- [ ] I managed to test the new changes locally
- [ ] I confirm that the issues mentioned were fixed/resolved .

sanjay7178 and others added 30 commits June 17, 2025 22:18
@sanjay7178 sanjay7178 changed the title fix: PyInstaller exported binary in linux x86-64 and missing rfc3987 dependencies fix: export pyinstaller binary in linux x86-64 and add missing rfc3987 dependencies Apr 14, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants