Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 808462 - media-libs/x265-9999 arm-r1.patch and x265-3.3-ppc64.patch fail to apply
Summary: media-libs/x265-9999 arm-r1.patch and x265-3.3-ppc64.patch fail to apply
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo Media-video project
URL:
Whiteboard:
Keywords:
: 810640 (view as bug list)
Depends on:
Blocks:
 
Reported: 2021-08-15 14:41 UTC by jospezial
Modified: 2021-12-01 15:46 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
x265-3.5-ppc64.patch (x265-3.5-ppc64.patch,523 bytes, patch)
2021-12-01 15:17 UTC, soundbastlerlive
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description jospezial 2021-08-15 14:41:58 UTC
* Package:    media-libs/x265-9999
 * Repository: gentoo
 * Maintainer: media-video@gentoo.org
 * USE:        10bit 12bit abi_x86_32 abi_x86_64 amd64 elibc_glibc kernel_linux userland_GNU
 * FEATURES:   ccache network-sandbox preserve-libs sandbox userpriv usersandbox
>>> Unpacking source...
 * Repository id: multicoreware_x265_git.git
 * To override fetched repository properties, use:
 *   EGIT_OVERRIDE_REPO_MULTICOREWARE_X265_GIT
 *   EGIT_OVERRIDE_BRANCH_MULTICOREWARE_X265_GIT
 *   EGIT_OVERRIDE_COMMIT_MULTICOREWARE_X265_GIT
 *   EGIT_OVERRIDE_COMMIT_DATE_MULTICOREWARE_X265_GIT
 * 
 * Fetching https://bitbucket.org/multicoreware/x265_git/ ...
git fetch https://bitbucket.org/multicoreware/x265_git/ +HEAD:refs/git-r3/HEAD
Unpacking objects: 100% (15/15), 1.92 KiB | 38.00 KiB/s, done.
From https://bitbucket.org/multicoreware/x265_git
   c8905a745..0983cffc5             -> refs/git-r3/HEAD
git symbolic-ref refs/git-r3/media-libs/x265/0/__main__ refs/git-r3/HEAD
 * Checking out https://bitbucket.org/multicoreware/x265_git/ to /var/tmp/portage/media-libs/x265-9999/work/x265-9999 ...
git checkout --quiet refs/git-r3/HEAD
GIT update -->
   repository:               https://bitbucket.org/multicoreware/x265_git/
   updating from commit:     c8905a745633543a1a0df6044a09386057a95be2
   to commit:                0983cffc501e5279e7d9e9b2241b506cb332efcb
 source/CMakeLists.txt              |  7 +++++--
 source/cmake/FindNeon.cmake        | 17 +++++++++++++----
 source/common/aarch64/asm.S        | 28 ++++++++++++++++++++++++++--
 source/common/aarch64/ipfilter8.S  | 66 +++++++++++++++++++++++++++++++++++-------------------------------
 source/common/aarch64/mc-a.S       |  4 ++++
 source/common/aarch64/pixel-util.S |  4 ++++
 source/common/aarch64/sad-a.S      | 20 ++++++++++++--------
 source/test/testharness.h          |  2 +-
 8 files changed, 100 insertions(+), 48 deletions(-)
>>> Source unpacked in /var/tmp/portage/media-libs/x265-9999/work
>>> Preparing source in /var/tmp/portage/media-libs/x265-9999/work/x265-9999/source ...
 * Applying arm-r1.patch ...
patching file CMakeLists.txt
Hunk #1 FAILED at 40.
Hunk #3 succeeded at 251 (offset 3 lines).
1 out of 3 hunks FAILED -- saving rejects to file CMakeLists.txt.rej
 [ !! ]
 * ERROR: media-libs/x265-9999::gentoo failed (prepare phase):
 *   patch -p1  failed with /var/tmp/portage/media-libs/x265-9999/files/arm-r1.patch
 * 
 * Call stack:
 *               ebuild.sh, line  127:  Called src_prepare
 *             environment, line 3059:  Called cmake_src_prepare
 *             environment, line 1121:  Called default_src_prepare
 *      phase-functions.sh, line  923:  Called __eapi6_src_prepare
 *             environment, line  212:  Called eapply '/var/tmp/portage/media-libs/x265-9999/files/arm-r1.patch' '/var/tmp/portage/media-libs/x265-9999/files/neon.patch' '/var/tmp/portage/media-libs/x265-9999/files/x265-3.3-ppc64.patch' '/var/tmp/portage/media-libs/x265-9999/files/tests.patch' '/var/tmp/portage/media-libs/x265-9999/files/test-ns.patch'
 *             environment, line 1272:  Called _eapply_patch '/var/tmp/portage/media-libs/x265-9999/files/arm-r1.patch'
 *             environment, line 1210:  Called __helpers_die 'patch -p1  failed with /var/tmp/portage/media-libs/x265-9999/files/arm-r1.patch'
 *   isolated-functions.sh, line  112:  Called die
 * The specific snippet of code:
 *              die "$@"
Comment 1 Ionen Wolkens gentoo-dev 2021-08-27 11:31:34 UTC
*** Bug 810640 has been marked as a duplicate of this bug. ***
Comment 2 jospezial 2021-09-04 13:20:26 UTC
ping!
Comment 3 jospezial 2021-09-30 16:15:44 UTC
After I removed arm-r1.patch from the ebuild:

>>> Creating Manifest for /usr/portage/media-libs/x265
>>> Unpacking source...
 * Repository id: multicoreware_x265_git.git
 * To override fetched repository properties, use:
 *   EGIT_OVERRIDE_REPO_MULTICOREWARE_X265_GIT
 *   EGIT_OVERRIDE_BRANCH_MULTICOREWARE_X265_GIT
 *   EGIT_OVERRIDE_COMMIT_MULTICOREWARE_X265_GIT
 *   EGIT_OVERRIDE_COMMIT_DATE_MULTICOREWARE_X265_GIT
 * 
 * Fetching https://bitbucket.org/multicoreware/x265_git/ ...
git fetch https://bitbucket.org/multicoreware/x265_git/ +HEAD:refs/git-r3/HEAD
git symbolic-ref refs/git-r3/media-libs/x265/0/__main__ refs/git-r3/HEAD
 * Checking out https://bitbucket.org/multicoreware/x265_git/ to /var/tmp/portage/media-libs/x265-9999/work/x265-9999 ...
git checkout --quiet refs/git-r3/HEAD
GIT update -->
   repository:               https://bitbucket.org/multicoreware/x265_git/
   at the commit:            4bf31dc15fb6d1f93d12ecf21fad5e695f0db5c0
>>> Source unpacked in /var/tmp/portage/media-libs/x265-9999/work
>>> Preparing source in /var/tmp/portage/media-libs/x265-9999/work/x265-9999/source ...
 * Source directory (CMAKE_USE_DIR): "/var/tmp/portage/media-libs/x265-9999/work/x265-9999/source"
 * Build directory  (BUILD_DIR):     "/var/tmp/portage/media-libs/x265-9999/work/x265-9999_build"
 * Applying neon.patch ...                                                                                                                                                                                                                                                                                                                         [ ok ]
 * Applying x265-3.3-ppc64.patch ...
patching file CMakeLists.txt
Hunk #1 FAILED at 44.
1 out of 1 hunk FAILED -- saving rejects to file CMakeLists.txt.rej
Comment 4 jospezial 2021-10-25 17:02:06 UTC
ping!
Comment 5 jospezial 2021-11-25 06:02:28 UTC
Both patches still fail to apply.

>>> Preparing source in /var/tmp/portage/media-libs/x265-9999/work/x265-9999/source ...
 * Source directory (CMAKE_USE_DIR): "/var/tmp/portage/media-libs/x265-9999/work/x265-9999/source"
 * Build directory  (BUILD_DIR):     "/var/tmp/portage/media-libs/x265-9999/work/x265-9999_build"
 * Applying arm-r1.patch ...
patching file CMakeLists.txt
Hunk #1 FAILED at 40.
Hunk #2 FAILED at 239.
Hunk #3 FAILED at 252.
3 out of 3 hunks FAILED -- saving rejects to file CMakeLists.txt.rej
patching file dynamicHDR10/CMakeLists.txt

and

>>> Preparing source in /var/tmp/portage/media-libs/x265-9999/work/x265-9999/source ...
 * Source directory (CMAKE_USE_DIR): "/var/tmp/portage/media-libs/x265-9999/work/x265-9999/source"
 * Build directory  (BUILD_DIR):     "/var/tmp/portage/media-libs/x265-9999/work/x265-9999_build"
 * Applying neon.patch ...                                                                                                                                                                                                                                                                                                                         [ ok ]
 * Applying x265-3.3-ppc64.patch ...
patching file CMakeLists.txt
Hunk #1 FAILED at 44.
1 out of 1 hunk FAILED -- saving rejects to file CMakeLists.txt.rej
Comment 6 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-11-25 06:06:38 UTC
(In reply to jospezial from comment #4)
> ping!

I think it would be best if you tried to rebase them. Pinging repeatedly for a live ebuild which clearly few others are using isn't going to help. Especially for an upstream which seems to have a lot of churn between releases (you end up filing these for x265 quite often IIRC).

Or we can just remove the live ebuild given it clearly rots pretty quickly after a release.
Comment 7 soundbastlerlive 2021-12-01 14:23:34 UTC
IMHO the 9999 build does not rot quickly at all, I've built it 350 times on multiple systems over the last years according to genlop (so thousands of builds) and I can't remember I ever had to change the ebuild.
Why not simply remove the 2 patches that cause it to fail? They are not necessary for x86/amd64 and might not be anymore for arm/ppc64 and in any case if it doesn't build, they are also useless.
Comment 8 jospezial 2021-12-01 14:28:11 UTC
(In reply to soundbastlerlive from comment #7)
> IMHO the 9999 build does not rot quickly at all, I've built it 350 times on
> multiple systems over the last years according to genlop (so thousands of
> builds) and I can't remember I ever had to change the ebuild.
> Why not simply remove the 2 patches that cause it to fail? They are not
> necessary for x86/amd64 and might not be anymore for arm/ppc64 and in any
> case if it doesn't build, they are also useless.

+1
Comment 9 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-12-01 14:29:25 UTC
(In reply to soundbastlerlive from comment #7)
> IMHO the 9999 build does not rot quickly at all, I've built it 350 times on
> multiple systems over the last years according to genlop (so thousands of
> builds) and I can't remember I ever had to change the ebuild.
> Why not simply remove the 2 patches that cause it to fail? They are not
> necessary for x86/amd64 and might not be anymore for arm/ppc64 and in any
> case if it doesn't build, they are also useless.

because it involves time to assess if they're still needed and rebase them if so.
Comment 10 soundbastlerlive 2021-12-01 15:17:28 UTC
Created attachment 757130 [details, diff]
x265-3.5-ppc64.patch

rebased x265-3.3-ppc64.patch
Comment 11 soundbastlerlive 2021-12-01 15:19:01 UTC
so I took the time to assess the two patches.

x265-3.3-ppc64.patch
is just
-set(POWER_ALIASES ppc64 ppc64le)
+set(POWER_ALIASES ppc64 ppc64le powerpc64 powerpc64le)
so I rebased it

arm-r1.patch
does not seem necessary anymore, CMakeLists.txt already sets the CFLAGS

can you remove the arm patch and commit the new ppc64 patch now?

can portage/ebuilds support per-arch patches? it's a shame that the (probably) largest, most used arch (x86/amd64) is broken for half a year because of unrelated patches.
Comment 12 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-12-01 15:32:02 UTC
(In reply to soundbastlerlive from comment #11)
> so I took the time to assess the two patches.
> 
> x265-3.3-ppc64.patch
> is just
> -set(POWER_ALIASES ppc64 ppc64le)
> +set(POWER_ALIASES ppc64 ppc64le powerpc64 powerpc64le)
> so I rebased it
> 
> arm-r1.patch
> does not seem necessary anymore, CMakeLists.txt already sets the CFLAGS
> 
> can you remove the arm patch and commit the new ppc64 patch now?
> 
> can portage/ebuilds support per-arch patches? it's a shame that the
> (probably) largest, most used arch (x86/amd64) is broken for half a year
> because of unrelated patches.

I think an adapted version of arm-r1.patch is still needed: https://bitbucket.org/multicoreware/x265_git/commits/0983cffc501e5279e7d9e9b2241b506cb332efcb still forces -march and such which we don't want.

Thanks for rebasing the ppc64 one, I'll add it.

Yes, portage can support it, although conditional patching is usually avoided because it tends to mean a patch is broken for some niche platforms and nobody even realises.
Comment 13 soundbastlerlive 2021-12-01 15:42:44 UTC
well, "breaking niche platforms" doesn't really apply when x86/amd64 gets broken because of unnecessary arm/ppc64 patches, now does it?
so maybe make those arch specific patches arch specific?
Comment 14 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-12-01 15:45:15 UTC
(In reply to soundbastlerlive from comment #13)
> well, "breaking niche platforms" doesn't really apply when x86/amd64 gets
> broken because of unnecessary arm/ppc64 patches, now does it?

The issue being "when the patches need rebasing, somebody notices" rather than a user of arm having to given the person updating the ebuild probably isn't using it and therefore won't notice.

I don't see the 9999 ebuild not working at a given point in time particularly surprising.

> so maybe make those arch specific patches arch specific?

This is avoided for the reason above.

Really, somebody using the live ebuild(s) needs to maintain them and update their patches. I appreciate you doing that with the ppc64 patch.
Comment 15 Larry the Git Cow gentoo-dev 2021-12-01 15:46:27 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9591e8238da4f5ddab702a01f93fba05943f2a0d

commit 9591e8238da4f5ddab702a01f93fba05943f2a0d
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2021-12-01 15:45:57 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2021-12-01 15:45:57 +0000

    media-libs/x265: rebase 9999 patches
    
    Closes: https://bugs.gentoo.org/808462
    Thanks-to: soundbastlerlive@gmx.at (rebasing ppc64)
    Signed-off-by: Sam James <sam@gentoo.org>

 media-libs/x265/files/x265-9999-arm.patch   | 64 +++++++++++++++++++++++++++++
 media-libs/x265/files/x265-9999-ppc64.patch | 11 +++++
 media-libs/x265/x265-9999.ebuild            |  6 +--
 3 files changed, 78 insertions(+), 3 deletions(-)