beeware / cpython-android-source-deps

Libraries that are needed to compile CPython for Android
MIT License
5 stars 2 forks source link

bzip2 release has broken links in `bin` directory #2

Open FeodorFitsner opened 6 months ago

FeodorFitsner commented 6 months ago

Describe the bug

bzip2 1.0.8-1 release has broken links in bin directory which causes problems while assembling a Python package with it.

$ ls -al bzip2-1.0.8-1-aarch64-linux-android/bin
total 632
drwxr-xr-x@ 13 feodor  staff    416 14 Feb 14:06 .
drwx------@  6 feodor  staff    192 26 Apr 14:18 ..
-rwxr-xr-x@  1 feodor  staff  98160 14 Feb 14:06 bunzip2
-rwxr-xr-x@  1 feodor  staff  98160 14 Feb 14:06 bzcat
lrwxrwxrwx@  1 feodor  staff    131 14 Feb 14:06 bzcmp -> /home/runner/work/cpython-android-source-deps/cpython-android-source-deps/bzip2/build/1.0.8/aarch64-linux-android/prefix/bin/bzdiff
-rwxr-xr-x@  1 feodor  staff   2140 14 Feb 14:06 bzdiff
lrwxrwxrwx@  1 feodor  staff    131 14 Feb 14:06 bzegrep -> /home/runner/work/cpython-android-source-deps/cpython-android-source-deps/bzip2/build/1.0.8/aarch64-linux-android/prefix/bin/bzgrep
lrwxrwxrwx@  1 feodor  staff    131 14 Feb 14:06 bzfgrep -> /home/runner/work/cpython-android-source-deps/cpython-android-source-deps/bzip2/build/1.0.8/aarch64-linux-android/prefix/bin/bzgrep
-rwxr-xr-x@  1 feodor  staff   2054 14 Feb 14:06 bzgrep
-rwxr-xr-x@  1 feodor  staff  98160 14 Feb 14:06 bzip2
-rwxr-xr-x@  1 feodor  staff  13984 14 Feb 14:06 bzip2recover
lrwxrwxrwx@  1 feodor  staff    131 14 Feb 14:06 bzless -> /home/runner/work/cpython-android-source-deps/cpython-android-source-deps/bzip2/build/1.0.8/aarch64-linux-android/prefix/bin/bzmore
-rwxr-xr-x@  1 feodor  staff   1259 14 Feb 14:06 bzmore

Other distros seem to be fine, for example xz-5.4.6-0 has relative links:

drwxr-xr-x  25 feodor  staff     800 14 Feb 14:10 .
drwxr-xr-x   6 feodor  staff     192 26 Apr 14:01 ..
lrwxr-xr-x   1 feodor  staff       2 14 Feb 14:10 lzcat -> xz
lrwxr-xr-x   1 feodor  staff       6 14 Feb 14:10 lzcmp -> xzdiff
lrwxr-xr-x   1 feodor  staff       6 14 Feb 14:10 lzdiff -> xzdiff
lrwxr-xr-x   1 feodor  staff       6 14 Feb 14:10 lzegrep -> xzgrep
lrwxr-xr-x   1 feodor  staff       6 14 Feb 14:10 lzfgrep -> xzgrep
lrwxr-xr-x   1 feodor  staff       6 14 Feb 14:10 lzgrep -> xzgrep
lrwxr-xr-x   1 feodor  staff       6 14 Feb 14:10 lzless -> xzless
lrwxr-xr-x   1 feodor  staff       2 14 Feb 14:10 lzma -> xz
-rwxr-xr-x   1 feodor  staff   63552 14 Feb 14:10 lzmadec
-rwxr-xr-x   1 feodor  staff   84472 14 Feb 14:10 lzmainfo
lrwxr-xr-x   1 feodor  staff       6 14 Feb 14:10 lzmore -> xzmore
lrwxr-xr-x   1 feodor  staff       2 14 Feb 14:10 unlzma -> xz
lrwxr-xr-x   1 feodor  staff       2 14 Feb 14:10 unxz -> xz
-rwxr-xr-x   1 feodor  staff  404096 14 Feb 14:10 xz
lrwxr-xr-x   1 feodor  staff       2 14 Feb 14:10 xzcat -> xz
lrwxr-xr-x   1 feodor  staff       6 14 Feb 14:10 xzcmp -> xzdiff
-rwxr-xr-x   1 feodor  staff  135976 14 Feb 14:10 xzdec
-rwxr-xr-x   1 feodor  staff    7424 14 Feb 14:10 xzdiff
lrwxr-xr-x   1 feodor  staff       6 14 Feb 14:10 xzegrep -> xzgrep
lrwxr-xr-x   1 feodor  staff       6 14 Feb 14:10 xzfgrep -> xzgrep
-rwxr-xr-x   1 feodor  staff   10335 14 Feb 14:10 xzgrep
-rwxr-xr-x   1 feodor  staff    1815 14 Feb 14:10 xzless
-rwxr-xr-x   1 feodor  staff    2192 14 Feb 14:10 xzmore

Steps to reproduce

List detailed contents of any archive from this release: https://github.com/beeware/cpython-android-source-deps/releases/tag/bzip2-1.0.8-1

Expected behavior

Relative links.

Screenshots

No response

Environment

Logs

No response

Additional context

No response

mhsmith commented 6 months ago

Thanks for the report; I would accept a pull request that fixes this. But what problems does it cause when building Python? That should only need the include and lib directories.

FeodorFitsner commented 6 months ago

It's shutil.copytree() that failing while trying to copy those links, but it could be fixed by adding ignore_dangling_symlinks=True.

So, what would be the fix: 1) fixing links; 2) removing links or bin directory all together?

mhsmith commented 6 months ago

Is this error coming from Python's own build system, or one of your own scripts?

The proper fix would be to make the bzip2 build script produce relative links. For example, the last line of the script is currently:

make install PREFIX=$prefix

Maybe this could be changed to:

cd $prefix
make install PREFIX=.
FeodorFitsner commented 6 months ago

That's my own script to build Python with the structure to work with mobile-forge. Mobile forge doesn't need bin though.

mhsmith commented 6 months ago

Mobile-forge doesn't really have Android support yet. You should use Chaquopy's build-wheel tool instead.

FeodorFitsner commented 6 months ago

I'm working on a proof-of-concept of Android support in mobile-forge and it looks promising so far.