Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

macOS app throws "library load disallowed by system policy" error while loading 3rd-party Python .so modules #4543

Open
1 task done
FeodorFitsner opened this issue Dec 10, 2024 · 3 comments
Assignees

Comments

@FeodorFitsner
Copy link
Contributor

Duplicate Check

Describe the bug

Original report: #4514 (comment)

I got this error when I release it to test flight and test on my mac M4:

  File "/Users/simon/Library/Containers/com.diogenes.ai.chatbot.flet.diogenesaibutlerflet/Data/Library/Application Support/com.diogenes.ai.chatbot.flet.diogenesaibutlerflet/flet/app/__pypackages__/pydantic_core/__init__.py", line 6, in <module>
    from ._pydantic_core import (
ImportError: dlopen(/Users/simon/Library/Containers/com.diogenes.ai.chatbot.flet.diogenesaibutlerflet/Data/Library/Application Support/com.diogenes.ai.chatbot.flet.diogenesaibutlerflet/flet/app/__pypackages__/pydantic_core/_pydantic_core.cpython-312-darwin.so, 0x0002): tried: '/Users/simon/Library/Containers/com.diogenes.ai.chatbot.flet.diogenesaibutlerflet/Data/Library/Application Support/com.diogenes.ai.chatbot.flet.diogenesaibutlerflet/flet/app/__pypackages__/pydantic_core/_pydantic_core.cpython-312-darwin.so' (code signature in <17D6EF5C-4D71-3E06-912D-5464BC98FC00> '/Users/simon/Library/Containers/com.diogenes.ai.chatbot.flet.diogenesaibutlerflet/Data/Library/Application Support/com.diogenes.ai.chatbot.flet.diogenesaibutlerflet/flet/app/__pypackages__/pydantic_core/_pydantic_core.cpython-312-darwin.so' not valid for use in process: library load disallowed by system policy), '/System/Volumes/Preboot/Cryptexes/OS/Users/simon/Library/Containers/com.diogenes.ai.chatbot.flet.diogenesaibutlerflet/Data/Library/Application Support/com.diogenes.ai.chatbot.flet.diogenesaibutlerflet/flet/app/__pypackages__/pydantic_core/_pydantic_core.cpython-312-darwin.so' (no such file), '/Users/simon/Library/Containers/com.diogenes.ai.chatbot.flet.diogenesaibutlerflet/Data/Library/Application Support/com.diogenes.ai.chatbot.flet.diogenesaibutlerflet/flet/app/__pypackages__/pydantic_core/_pydantic_core.cpython-312-darwin.so' (code signature in <17D6EF5C-4D71-3E06-912D-5464BC98FC00> '/Users/simon/Library/Containers/com.diogenes.ai.chatbot.flet.diogenesaibutlerflet/Data/Library/Application Support/com.diogenes.ai.chatbot.flet.diogenesaibutlerflet/flet/app/__pypackages__/pydantic_core/_pydantic_core.cpython-312-darwin.so' not valid for use in process: library load disallowed by system policy)

Code sample

Code
# n/a

To reproduce

n/a

Expected behavior

No response

Screenshots / Videos

Captures

[Upload media here]

Operating System

macOS

Operating system details

Any version

Flet version

0.25.1

Regression

No, it isn't

Suggestions

No response

Logs

Logs
[Paste your logs here]

Additional details

No response

@dsx1986
Copy link

dsx1986 commented Dec 10, 2024

I do build with entitlements: flet build macos --info-plist LSApplicationCategoryType="public.app-category.productivity" --macos-entitlements com.apple.security.app-sandbox=True --build-number $(date +%y%m%d%H%M)

@FeodorFitsner
Copy link
Contributor Author

OK, as it's sandbox my guess would be #2 from here: " it could be a problem with signing 3rd-party python packages (like pydantic) unpacked during the first run."

Will investigate.

@FeodorFitsner
Copy link
Contributor Author

Note to developers: https://docs.flutter.dev/deployment/macos

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

No branches or pull requests

2 participants