-
Notifications
You must be signed in to change notification settings - Fork 7
Description
🐞 Bug Description
When you obfuscate two packages, and try to import both packages, one of the packages fails as codeenimga generates a .so file (Shared Object), and this .so file is generated per obfuscation.
The codeenigma runtime is different per package, and causes one of the packages to fail on import.
🔍 Steps to Reproduce
- Obfuscate & build package
A - Obfuscate & build package
B - Install both packages (
AandB) to an environment - Attempt to import both packages
import A
import B📝 Additional Context
Currently, the work around is that I package A & B together, and obfuscate them together.
This won't work if someone wants to import multiple obfuscated packages.
✅ Proposed Solution
Generate a unique runtime module name for each obfuscation build (e.g. codeenigma_runtime_<uid>)
Embed that name into the obfuscated package, and build the C-extension with that name.
This ensures each obfuscated package installs and imports a differently-named .so/.pyd, and therefore exports a unique PyInit_<name> symbol, meaning no shared object collisions.