Skip to content
New issue

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

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

Already on GitHub? # to your account

Add support for OpenSuSE #1416

Closed
Cimbali opened this issue Aug 25, 2023 · 2 comments · Fixed by #1417
Closed

Add support for OpenSuSE #1416

Cimbali opened this issue Aug 25, 2023 · 2 comments · Fixed by #1417
Labels
enhancement New features, or improvements to existing features. linux The issue relates Linux support.

Comments

@Cimbali
Copy link
Contributor

Cimbali commented Aug 25, 2023

If you run Briefcase on OpenSuSE, you currently get an error:

Describe the bug

Running a built app fails with:

Fatal Python error: init_fs_encoding: failed to get the Python codec of the filesystem encoding
Python runtime state: core initialized
Install path: <a project specific path>
Pre-initializing Python runtime...
PYTHONPATH:
- /usr/lib/python3.11
- /usr/lib/python3.11/lib-dynload
- <some project specific paths>
Configure argc/argv...
Initializing Python runtime...
ModuleNotFoundError: No module named 'encodings'

And we have:

> python3.11 -c 'import encodings; print(encodings.__file__)'
/usr/lib64/python3.11/encodings/__init__.py

Note the path /usr/lib64/python3.11 is not in PYTHONPATH (lib64 instead of lib).

Steps to reproduce

  1. Get the basic template
  2. Run briefcase run

Expected behavior

Building picks up the paths required for python to run.

Screenshots

No response

Environment

  • Operating System: OpenSUSE
  • Python version: 3.11
  • Software versions:
    • Briefcase: 0.3.15
    • Toga: 0.3.1

Logs

No response

Additional context

No response

@Cimbali Cimbali added the bug A crash or error in behavior. label Aug 25, 2023
@Cimbali
Copy link
Contributor Author

Cimbali commented Aug 25, 2023

Obviously I’ve tried setting PYTHONPATH in the environment but to no avail. I should also mention the python install is absolutely fine, and the app runs with briefcase dev

@freakboy3742
Copy link
Member

Thanks for the report - this appears to be an OpenSuSE specific detail. Unfortunately, we don't currently advertise support for OpenSuSE.

That said - adding support shouldn't be that difficult.

The immediate cause of the problem you're seeing is that OpenSuSE isn't identifying a vendor base; and as a result, it's not working out that OpenSuSE is using the /usr/lib64 folder.

I think this will stem from This line in the briefcase template, and/or this section of platform identification code. There will be a related issue when you get to packaging because briefcase won't know what packaging format to use.

The changes needed are:

  1. Adding an extra block to identify SuSE as a vendor base,
  2. Include SuSE in the list of RPM-alike platforms,
  3. Modify the template so that it identifies SuSE as needing the lib64 folder
  4. Adding OpenSuSE to the list of Linux distros that are known to support RPM.

I'm modifying the ticket to be a feature request for OpenSUSE support; if you want to try your hand at a fix, you're more than welcome to take a swing - we're here to provide help if you need it.

@freakboy3742 freakboy3742 added enhancement New features, or improvements to existing features. linux The issue relates Linux support. and removed bug A crash or error in behavior. labels Aug 25, 2023
@freakboy3742 freakboy3742 changed the title How can I get the correct PYTHONPATH when building a toga app? Add support for OpenSuSE Aug 25, 2023
@Cimbali Cimbali mentioned this issue Aug 26, 2023
4 tasks
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
enhancement New features, or improvements to existing features. linux The issue relates Linux support.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants