Skip to content

refactor: Separate venvs into subdirectories for Flatpak and host#237

Open
shymega wants to merge 1 commit intodevfrom
shymega/isolate-venvs-flatpak-host
Open

refactor: Separate venvs into subdirectories for Flatpak and host#237
shymega wants to merge 1 commit intodevfrom
shymega/isolate-venvs-flatpak-host

Conversation

@shymega
Copy link
Copy Markdown
Member

@shymega shymega commented Jan 25, 2026

To avoid ELF binary conflicts between Flatpak and host environments, virtual environments are now created in separate subdirectories:

  • wemod_venv/flatpak: For Flatpak sandbox environment
  • wemod_venv/host: For host system environment

This ensures that binaries compiled for one environment don't get executed in the other, preventing "wrong ELF class" errors.

Changes:

  • mk_venv(): Creates venv in appropriate subdirectory based on environment
  • venv_manager(): Checks for existing venv in correct subdirectory
  • check_flatpak(): Creates host venv in wemod_venv/host with dependencies
  • Adds venv detection to prevent infinite rerun loops

@shymega shymega requested a review from marvin1099 January 25, 2026 00:22
@shymega shymega self-assigned this Jan 25, 2026
@shymega shymega force-pushed the shymega/isolate-venvs-flatpak-host branch from 10ea84a to 54398dc Compare February 23, 2026 20:22
@marvin1099
Copy link
Copy Markdown
Collaborator

Seems reasonable, you tried to compile then.
Ok seems, good.
One thing thogh, since we allready have the venv at wemod_venv,
adding 2 subdirs would leave onld installs with a venv at wemod_venv,
and then 2 more in wemod_venv/host and wemod_venv/flatpak
we could just use a other folder like wemod_flat_venv.
Should also work.
What do you think?

@shymega
Copy link
Copy Markdown
Member Author

shymega commented Mar 1, 2026

I can add logic to migrate the 'old' venv to the new structure, yes. But I'd rather not have it in a flat structure. Nested is better, because it means the launcher dir is tidier. I will add logic in a later commit.

@shymega shymega force-pushed the shymega/isolate-venvs-flatpak-host branch 6 times, most recently from bfdaee1 to d01cf67 Compare March 7, 2026 22:18
@shymega
Copy link
Copy Markdown
Member Author

shymega commented Mar 7, 2026

Added a migration function.

@shymega shymega changed the base branch from main to dev March 7, 2026 22:25
@shymega shymega force-pushed the shymega/isolate-venvs-flatpak-host branch from d01cf67 to 59b7263 Compare March 7, 2026 22:29
@marvin1099
Copy link
Copy Markdown
Collaborator

Looks pretty good, how ready is this now.
Seems testing can be done at this point.

@shymega
Copy link
Copy Markdown
Member Author

shymega commented Mar 10, 2026

Looks pretty good, how ready is this now. Seems testing can be done at this point.

Should be fairly ready. I'll test this weekend, as I'm free.

@shymega shymega force-pushed the shymega/isolate-venvs-flatpak-host branch 2 times, most recently from 76e54ef to 2a3d1f5 Compare March 20, 2026 20:37
@marvin1099 marvin1099 added the test me Added to PRs that look merge‑ready, but still clone and test the code to confirm expected behavior. label Apr 30, 2026
To avoid ELF binary conflicts between Flatpak and host environments,
virtual environments are now created in separate subdirectories:
- wemod_venv/flatpak: For Flatpak sandbox environment
- wemod_venv/host: For host system environment

This ensures that binaries compiled for one environment don't get
executed in the other, preventing "wrong ELF class" errors.

Changes:
- mk_venv(): Creates venv in appropriate subdirectory based on environment
- venv_manager(): Checks for existing venv in correct subdirectory
- check_flatpak(): Creates host venv in wemod_venv/host with dependencies
- Adds venv detection to prevent infinite rerun loops
@marvin1099 marvin1099 force-pushed the shymega/isolate-venvs-flatpak-host branch from 2a3d1f5 to 48f72fb Compare May 1, 2026 08:48
@marvin1099
Copy link
Copy Markdown
Collaborator

Should we move a old venv, or just delete it or do nothing, what do you think.

@marvin1099
Copy link
Copy Markdown
Collaborator

Also PR confirmed working on my end.

@marvin1099 marvin1099 removed the test me Added to PRs that look merge‑ready, but still clone and test the code to confirm expected behavior. label May 1, 2026
@shymega
Copy link
Copy Markdown
Member Author

shymega commented May 4, 2026 via email

@shymega
Copy link
Copy Markdown
Member Author

shymega commented May 4, 2026 via email

@marvin1099 marvin1099 added the under development This feature/issue is under development right now label May 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

under development This feature/issue is under development right now

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants