Repository: beeware/briefcase
Pull request #1545 (2023-11-19 01:08:46)

Bump Flatpak runtime versions for new projects
## Changes
- Bump Flatpak runtime versions
  - `org.freedesktop.Platform`: `22.08` -> `23.08`
  - `org.kde.Platform`: `6.4` -> `6.6`
  - `org.gnome.Platform`: `44` -> `45`

## Notes
`org.gnome.Platform==45`, `org.kde.Platform==6.6`, and `org.freedesktop.Platform==23.08` do not have `libcrypt.so.1` and Flatpak builds are failing because Standalone Python is still looking for it.... I was under the [impression](https://github.com/beeware/briefcase/issues/1383) that Standalone Python was dropping its dependency on this ancient library....but maybe I misunderstood something....

`libcrypt.so` was dropped for Python 3.10, 3.9, and 3.8 with https://github.com/indygreg/python-build-standalone/commit/80cd87f3401ebe42618d98b23d62f6fc6f5d7f63 and released in [20240107](https://github.com/indygreg/python-build-standalone/releases/tag/20240107).

## Dependencies
- https://github.com/indygreg/python-build-standalone/issues/197
- https://github.com/beeware/briefcase-linux-flatpak-template/pull/32

## PR Checklist:
<!--- Go over all the following points, and put an `x` in all the boxes that apply. -->
- [x] All new features have been tested
- [x] All new features have been documented
- [X] I have read the **CONTRIBUTING.md** file
- [X] I will abide by the code of conduct


rmartin16: I've narrowed this down to being a problem for Python 3.8, 3.9, and 3.10; when using Python 3.11 and 3.12, the dependency on `libcrypt.so.1` is absent. This is true for both releases 20231002 and 20230826.

```console
❯ ldd ./build/flatpaktest/linux/flatpak/support/python/bin/python3.11
	linux-vdso.so.1 (0x00007ffeda74f000)
	/home/user/tmp/beeware/flatpaktest/./build/flatpaktest/linux/flatpak/support/python/bin/../lib/libpython3.11.so.1.0 (0x00007f6859c00000)
	libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f685b42f000)
	libdl.so.2 => /lib64/libdl.so.2 (0x00007f685b42a000)
	libutil.so.1 => /lib64/libutil.so.1 (0x00007f685b425000)
	libm.so.6 => /lib64/libm.so.6 (0x00007f6859b1f000)
	librt.so.1 => /lib64/librt.so.1 (0x00007f685b41e000)
	libc.so.6 => /lib64/libc.so.6 (0x00007f685993d000)
	/lib64/ld-linux-x86-64.so.2 (0x00007f685b44f000)
```
```console
❯ ldd ./build/flatpaktest/linux/flatpak/support/python/bin/python3.10
	linux-vdso.so.1 (0x00007ffe1c6ef000)
	/home/user/tmp/beeware/flatpaktest/./build/flatpaktest/linux/flatpak/support/python/bin/../lib/libpython3.10.so.1.0 (0x00007ffad6800000)
	libcrypt.so.1 => not found
	libpthread.so.0 => /lib64/libpthread.so.0 (0x00007ffad7e9a000)
	libdl.so.2 => /lib64/libdl.so.2 (0x00007ffad7e95000)
	libutil.so.1 => /lib64/libutil.so.1 (0x00007ffad7e90000)
	libm.so.6 => /lib64/libm.so.6 (0x00007ffad7dad000)
	librt.so.1 => /lib64/librt.so.1 (0x00007ffad7da8000)
	libc.so.6 => /lib64/libc.so.6 (0x00007ffad661e000)
	/lib64/ld-linux-x86-64.so.2 (0x00007ffad7eba000)
	libcrypt.so.1 => not found
```
The development in Standalone Python that claimed to remove this dependency didn't make any carve outs for older Python; so, I'm not sure if this in intentional or what yet.
rmartin16: Feedback in https://github.com/indygreg/python-build-standalone/issues/173#issuecomment-1823727953 confirms that Python 3.8, 3.9, and 3.10 should not be linking `libcrypt.so.1` like this. I created https://github.com/indygreg/python-build-standalone/issues/197 to document this. Elsewhere indygreg commented they won't be able to make another release until Christmas or later (not that I consider that a committed timeline or anything).

As a note, `org.kde.Platform==6.4` (the current version used in the template) is EOL; 6.5 doesn't have this issue....but I also can't find the EOL schedule for the KDE runtimes...

Patch:
diff --git a/changes/1545.feature.rst b/changes/1545.feature.rst
new file mode 100644
index 00000000..bba6d6ca
--- /dev/null
+++ b/changes/1545.feature.rst
@@ -0,0 +1,1 @@
+The Flatpak runtimes for new projects were updated. ``org.freedesktop.Platform`` will now default to 23.08; ``org.gnome.Platform`` will now default to 45; and ``org.kde.Platform`` will now default to 6.6.
diff --git a/src/briefcase/bootstraps/pursuedpybear.py b/src/briefcase/bootstraps/pursuedpybear.py
index 18300468..6deabede 100644
--- a/src/briefcase/bootstraps/pursuedpybear.py
+++ b/src/briefcase/bootstraps/pursuedpybear.py
@@ -134,7 +134,7 @@ linuxdeploy_plugins = [
     def pyproject_table_linux_flatpak(self):
         return """
 flatpak_runtime = "org.freedesktop.Platform"
-flatpak_runtime_version = "22.08"
+flatpak_runtime_version = "23.08"
 flatpak_sdk = "org.freedesktop.Sdk"
 """
 
diff --git a/src/briefcase/bootstraps/pygame.py b/src/briefcase/bootstraps/pygame.py
index f009fbea..3e5f87e4 100644
--- a/src/briefcase/bootstraps/pygame.py
+++ b/src/briefcase/bootstraps/pygame.py
@@ -134,7 +134,7 @@ linuxdeploy_plugins = [
     def pyproject_table_linux_flatpak(self):
         return """
 flatpak_runtime = "org.freedesktop.Platform"
-flatpak_runtime_version = "22.08"
+flatpak_runtime_version = "23.08"
 flatpak_sdk = "org.freedesktop.Sdk"
 """
 
diff --git a/src/briefcase/bootstraps/pyside6.py b/src/briefcase/bootstraps/pyside6.py
index 3d2d0c78..7771b0b6 100644
--- a/src/briefcase/bootstraps/pyside6.py
+++ b/src/briefcase/bootstraps/pyside6.py
@@ -156,7 +156,7 @@ linuxdeploy_plugins = [
     def pyproject_table_linux_flatpak(self):
         return """
 flatpak_runtime = "org.kde.Platform"
-flatpak_runtime_version = "6.4"
+flatpak_runtime_version = "6.6"
 flatpak_sdk = "org.kde.Sdk"
 """
 
diff --git a/src/briefcase/bootstraps/toga.py b/src/briefcase/bootstraps/toga.py
index 58e541db..7065f79b 100644
--- a/src/briefcase/bootstraps/toga.py
+++ b/src/briefcase/bootstraps/toga.py
@@ -182,7 +182,7 @@ linuxdeploy_plugins = [
     def pyproject_table_linux_flatpak(self):
         return """
 flatpak_runtime = "org.gnome.Platform"
-flatpak_runtime_version = "44"
+flatpak_runtime_version = "45"
 flatpak_sdk = "org.gnome.Sdk"
 """
 


Test patch:
diff --git a/tests/commands/new/test_build_context.py b/tests/commands/new/test_build_context.py
index 20b51e17..067bfa0e 100644
--- a/tests/commands/new/test_build_context.py
+++ b/tests/commands/new/test_build_context.py
@@ -220,7 +220,7 @@ linuxdeploy_plugins = [
 """,
         pyproject_table_linux_flatpak="""
 flatpak_runtime = "org.gnome.Platform"
-flatpak_runtime_version = "44"
+flatpak_runtime_version = "45"
 flatpak_sdk = "org.gnome.Sdk"
 """,
         pyproject_table_windows="""
@@ -420,7 +420,7 @@ linuxdeploy_plugins = [
 """,
         pyproject_table_linux_flatpak="""
 flatpak_runtime = "org.kde.Platform"
-flatpak_runtime_version = "6.4"
+flatpak_runtime_version = "6.6"
 flatpak_sdk = "org.kde.Sdk"
 """,
         pyproject_table_windows="""
@@ -589,7 +589,7 @@ linuxdeploy_plugins = [
 """,
         pyproject_table_linux_flatpak="""
 flatpak_runtime = "org.freedesktop.Platform"
-flatpak_runtime_version = "22.08"
+flatpak_runtime_version = "23.08"
 flatpak_sdk = "org.freedesktop.Sdk"
 """,
         pyproject_table_windows="""
@@ -758,7 +758,7 @@ linuxdeploy_plugins = [
 """,
         pyproject_table_linux_flatpak="""
 flatpak_runtime = "org.freedesktop.Platform"
-flatpak_runtime_version = "22.08"
+flatpak_runtime_version = "23.08"
 flatpak_sdk = "org.freedesktop.Sdk"
 """,
         pyproject_table_windows="""
@@ -1200,7 +1200,7 @@ linuxdeploy_plugins = [
 """,
         pyproject_table_linux_flatpak="""
 flatpak_runtime = "org.gnome.Platform"
-flatpak_runtime_version = "44"
+flatpak_runtime_version = "45"
 flatpak_sdk = "org.gnome.Sdk"
 """,
         pyproject_table_windows="""