dev-util/android-ndk: Manifest checksum invalid – maybe?
leycec opened this issue · comments
The checksum for the Android NDK Level 21 zipfile recorded by dev-util/android-ndk/Manifest
seems to have become mysteriously desynchronized from the actual file distributed by Google:
$ em -1 android-ndk
These are the packages that would be merged:
Calculating dependencies ... done!
[ebuild N ~] dev-util/android-ndk-21::mva 1,064,672 KiB
Total: 1 package (1 new), Size of downloads: 1,064,672 KiB
Would you like to merge these packages? [Yes/No] Y
>>> Verifying ebuild manifests
>>> Running pre-merge checks for dev-util/android-ndk-21
* Checking for at least 6 GiB disk space at "/var/tmp/portage/dev-util/android-ndk-21/temp" ... [ ok ]
>>> Emerging (1 of 1) dev-util/android-ndk-21::mva
>>> Downloading 'https://dl.google.com/android/repository/android-ndk-r21-linux-x86_64.zip'
--2022-04-06 00:50:27-- https://dl.google.com/android/repository/android-ndk-r21-linux-x86_64.zip
Resolving dl.google.com (dl.google.com)... 142.251.33.174, 2607:f8b0:400b:80c::200e
Connecting to dl.google.com (dl.google.com)|142.251.33.174|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1043332542 (995M) [application/zip]
Saving to: ‘/usr/portage/distfiles/android-ndk-r21-linux-x86_64.zip.__download__’
/usr/portage/distfi 100%[===================>] 995.00M 498KB/s in 45m 35s
2022-04-06 01:36:03 (372 KB/s) - ‘/usr/portage/distfiles/android-ndk-r21-linux-x86_64.zip.__download__’ saved [1043332542/1043332542]
!!! Fetched file: android-ndk-r21-linux-x86_64.zip VERIFY FAILED!
!!! Reason: Filesize does not match recorded size
!!! Got: 1043332542
!!! Expected: 1090223430
Refetching... File renamed to '/usr/portage/distfiles/android-ndk-r21-linux-x86_64.zip._checksum_failure_.1yjo024h'
!!! Couldn't download 'android-ndk-r21-linux-x86_64.zip'. Aborting.
* Fetch failed for 'dev-util/android-ndk-21', Log file:
* '/var/tmp/portage/dev-util/android-ndk-21/temp/build.log.gz'
>>> Failed to emerge dev-util/android-ndk-21, Log file:
>>> '/var/tmp/portage/dev-util/android-ndk-21/temp/build.log.gz'
* Messages for package dev-util/android-ndk-21:
* Fetch failed for 'dev-util/android-ndk-21', Log file:
* '/var/tmp/portage/dev-util/android-ndk-21/temp/build.log.gz'
*
* The following package has failed to build, install, or execute postinst:
*
* (dev-util/android-ndk-21:0/0::mva, ebuild scheduled for merge), Log file:
* '/var/tmp/portage/dev-util/android-ndk-21/temp/build.log.gz'
*
The ebuild expects a zipfile ~47MB larger than the actual downloaded zipfile. Admittedly, this might be entirely on my end. Connection stability is out the window when you live in the Canadian wilderness beset by ravenous snow lynxes. For sanity, I've tried:
- Repeatedly fetching the same zipfile, which is no small task when you live in the Canadian wilderness beset by ravenous snow lynxes. The final download size and resulting checksum failure remains the same.
- Manually extracted the same zipfile (e.g., with
unzip /usr/portage/distfiles/android-ndk-r21-linux-x86_64.zip._checksum_failure_.1yjo024h -d /tmp
), which succeeds without corruption errors.
Baseless conjecture: Google modified their Android NDK Level 21 zipfile after its initial release without releasing a new zipfile. They just overwrote the existing zipfile, which is pure perfidious evil. They shouldn't do that, but... that's Google. They do what they want. Then Gentoo picks up the pieces. 😱
Thanks so much for the non-stop high-quality packaging, @msva. As a fellow overlay maintainer, I can only genuflect in humility before your jaw-dropping volunteer effort. You the Big Boss.
Alternately, would bumping to the newest Long-term Support (LTS) Android NDK release (i.e., r23b) be feasible? Android NDK r21 is officially obsolete. It's probably not worth quibbling about checksums when we could just bump instead, but...
You the Big Boss. I defer to your all-seeing wisdom, @msva.
Update: I kinda needed this now. So, I just went ahead and added an ebuild for Android NDK Level 24 (i.e., the most recent stable release) to my companion overlay. Everything went berry smoothie except for:
- The download URL, which now omits the trailing
-x86_64
(because, of course, Google no longer publishes 32-bit variants):
SRC_URI="https://dl.google.com/android/repository/${PN}-r${PV}-linux.zip"
- Runtime dependencies, which now require
virtual/libcrypt
to accommodate changes in upstream's linkage:
RDEPEND="
...
virtual/libcrypt
...
"
- The
src_install()
phase, which requires a minor two-line modification to accommodate changes in upstream's directory tree:
# Just change this...
fperms 0775 "/${ANDROID_NDK_DIR}/"{,build,platforms,prebuilt}
fperms 0775 "/${ANDROID_NDK_DIR}/"{python-packages,sources,toolchains}
# ...to this! *BOOM.*
chmod 0775 "${ED}${ANDROID_NDK_DIR}/"{,*/} || die
Since I trust you to maintain this much better than I ever could, I'll promptly drop my ebuild when you find the scarce dev time to bump yours. Thanks again, @msva. Viva la mva-overlay
!