Skip to content

bug: Can't have 2 Obfuscated Packages #2

@cat-loaf

Description

@cat-loaf

🐞 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

  1. Obfuscate & build package A
  2. Obfuscate & build package B
  3. Install both packages (A and B) to an environment
  4. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions