kivy / kivy/python-for-android

ENHACEMENT: warn about potential patch apply errors when package version requested don't match recipe

オープン
#3,088 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
need-analysis Priority: Low recipe
主要言語
Python
スター
8.9k
フォーク
2k
平均マージ
12時間 20分
マージ済み PR(30日)
9

説明

User can specify package version with --requirements option:
`p4a apk --requirements=python3,pillow==7.1`
Then p4a will download specified version instead of the one defined in the Pillow recipe. This recipe has patches to apply, and p4a will fail trying to do so because patch almost always strictly requires the exact input files of the particular package version - the package version which is specified in the recipe itself:
```
self.handle_command_exit_code(exit_code)
File "/home/u1/.local/share/pipx/venvs/python-for-android/lib64/python3.11/site-packages/sh.py", line 821, in handle_command_exit_code
raise exc
sh.ErrorReturnCode_1:

RAN: /usr/bin/patch -t -d /home/u1/.local/share/python-for-android/build/other_builds/Pillow/armeabi-v7a__ndk_target_24/Pillow -p1 -i /home/u1/.local/share/pipx/venvs/python-for-android/lib/python3.11/site-packages/pythonforandroid/recipes/Pillow/setup.py.patch

STDOUT:
patching file setup.py
Hunk #1 FAILED at 39.
Hunk #2 succeeded at 156 with fuzz 1 (offset 6 lines).
Hunk #3 FAILED at 461.
Hunk #4 succeeded at 400 with fuzz 2 (offset -96 lines).
Hunk #5 FAILED at 507.
Hunk #6 succeeded at 500 (offset -107 lines).
3 out of 6 hunks FAILED -- saving rejects to file setup.py.rej
```

Suggestion: warn user clearly that the package version he requested does not match the recipe version, and the patch is likely to fail.

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

エントリーポイント `p4a apk --requirements` から開始し、`setup.py.patch` が適用される前に、要求されたパッケージバージョンが Pillow recipe のバージョンとどのように比較されるかを追跡します。`pillow==7.1` で不一致を再現し、その後、要求されたバージョンが異なるため recipe patch が失敗する可能性がある場合に、コマンドがユーザーへ明確に警告することを確認します。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
python
領域
build-system, cli
issue の種類
機能追加
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
45/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。