kivy / kivy/python-for-android

service_only and empty bootstraps should be fixed/documented or removed

Open
#2,875 1 comment 3 reactions 0 assignees View on GitHub
need-analysis Priority: Medium
Dominant language
Python
Stars
8.9k
Forks
2k
Avg merge
12h 20m
Merged PRs (30d)
9

Description

### Versions

- P4a: 2023.05.21

### Description

The p4a command line lists the valid bootstraps:

```
$ p4a bootstraps
[WARNING]: prerequisites.py is experimental and does not support all prerequisites yet.
[WARNING]: Please report any issues to the python-for-android issue tracker.
sdl2
depends: ['android', 'python3', 'sdl2']
webview
depends: ['genericndkbuild', 'android', 'python3']
service_library
depends: ['genericndkbuild', 'android', 'python3']
service_only
depends: ['genericndkbuild', 'android', 'python3']
empty
depends: []

```

However, `service_only` and `empty` are not mentioned in the [documentation on bootstrap options](https://python-for-android.readthedocs.io/en/latest/buildoptions/#bootstrap-build-options).

Furthermore, the `service_only` value has a show-stopper bug: in `build.py` starting from around line 809, the command-line arguments `orientation` and `manifest-orientation` are ignored if the bootstrap name is `service_only`.

But in line 1016, the code assumes those arguments are defined (even if they have default values).

```
args.manifest_orientation = get_manifest_orientation(
args.orientation, args.manifest_orientation
)
```

This causes p4a to crash.

I don't know enough about the difference between `service_only` and `service_library` to give an opinion, but we should either:

* Properly document `service_only` AND fix the bug stopping it from working and (if we are serious about supporting it) add an integration test to show it works, or
* remove it from the options available.

Likewise, we should either:

* Properly document `empty` and add an integration test to show it works, or
* remove it from the options available.

Contributor guide

Open the contributing guide

Research direction

Start by reading build.py around lines 809 and 1016 to trace how service_only handles orientation and manifest-orientation, then review the bootstrap options documentation. Determine the intended status of service_only and empty, and check the existing integration-test structure. Done means the supported options are documented and tested without the reported service_only crash, or the unsupported options are removed.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, python
Domain
build-system, cli, documentation
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.