Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 579578 - eapply doesn't use GNU/patch on FreeBSD/etc... systems
Summary: eapply doesn't use GNU/patch on FreeBSD/etc... systems
Status: RESOLVED DUPLICATE of bug 574626
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core - Ebuild Support (show other bugs)
Hardware: All FreeBSD
: Normal normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-04-11 08:59 UTC by Joshua Kinard
Modified: 2016-04-11 15:29 UTC (History)
1 user (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Joshua Kinard gentoo-dev 2016-04-11 08:59:02 UTC
For Gentoo/FreeBSD (and probably the other *BSD's that use non-GNU patch), the default options in EPATCH_COMMON_OPTS won't work with FreeBSD's copy of 'patch'.  Specifically, the -g option:

>>> Emerging (1 of 2) sys-devel/llvm-3.7.1-r1::gentoo
 * Fetching files in the background.
 * To view fetch progress, run in another terminal:
 * tail -f /var/log/emerge-fetch.log
 * llvm-3.7.1.src.tar.xz SHA256 SHA512 WHIRLPOOL size ;-) ...                                                                                        [ ok ]
 * compiler-rt-3.7.1.src.tar.xz SHA256 SHA512 WHIRLPOOL size ;-) ...                                                                                 [ ok ]
 * cfe-3.7.1.src.tar.xz SHA256 SHA512 WHIRLPOOL size ;-) ...                                                                                         [ ok ]
 * clang-tools-extra-3.7.1.src.tar.xz SHA256 SHA512 WHIRLPOOL size ;-) ...                                                                           [ ok ]
 * llvm-3.7.0-manpages.tar.bz2 SHA256 SHA512 WHIRLPOOL size ;-) ...                                                                                  [ ok ]
 * Checking for at least 1200 MiB disk space at "/ramfs/portage/sys-devel/llvm-3.7.1-r1/temp" ...                                                    [ ok ]
>>> Unpacking source...
>>> Unpacking llvm-3.7.1.src.tar.xz to /ramfs/portage/sys-devel/llvm-3.7.1-r1/work
>>> Unpacking compiler-rt-3.7.1.src.tar.xz to /ramfs/portage/sys-devel/llvm-3.7.1-r1/work
>>> Unpacking cfe-3.7.1.src.tar.xz to /ramfs/portage/sys-devel/llvm-3.7.1-r1/work
>>> Unpacking clang-tools-extra-3.7.1.src.tar.xz to /ramfs/portage/sys-devel/llvm-3.7.1-r1/work
>>> Unpacking llvm-3.7.0-manpages.tar.bz2 to /ramfs/portage/sys-devel/llvm-3.7.1-r1/work
>>> Source unpacked in /ramfs/portage/sys-devel/llvm-3.7.1-r1/work
>>> Preparing source in /ramfs/portage/sys-devel/llvm-3.7.1-r1/work/llvm-3.7.1.src ...
 * Applying llvm-3.7.0-ocaml-multilib.patch ...
patch: invalid option -- g
usage: patch [-bCcEeflNnRstuv] [-B backup-prefix] [-D symbol] [-d directory]
             [-F max-fuzz] [-i patchfile] [-o out-file] [-p strip-count]
             [-r rej-name] [-V t | nil | never] [-x number] [-z backup-ext]
             [--posix] [origfile [patchfile]]
       patch <patchfile                                                                                                                              [ !! ]
 * ERROR: sys-devel/llvm-3.7.1-r1::gentoo failed (prepare phase):
 *   patch -p1  failed with /usr/portage/sys-devel/llvm/files/cmake/llvm-3.7.0-ocaml-multilib.patch
 *
 * Call stack:
 *               ebuild.sh, line  133:  Called src_prepare
 *             environment, line 4914:  Called eapply '/usr/portage/sys-devel/llvm/files/cmake/llvm-3.7.0-ocaml-multilib.patch'
 *             environment, line 1363:  Called _eapply_patch '/usr/portage/sys-devel/llvm/files/cmake/llvm-3.7.0-ocaml-multilib.patch'
 *             environment, line 1301:  Called __helpers_die 'patch -p1  failed with /usr/portage/sys-devel/llvm/files/cmake/llvm-3.7.0-ocaml-multilib.patch'
 *   isolated-functions.sh, line  117:  Called die


AFAICT, the fix is to either not use options that aren't available or are incompatible with FreeBSD's patch, or get epatch to call 'gpatch' instead when on non-GNU systems, which is the GNU patch on those platforms, and should work with the arguments provided in EPATCH_COMMON_OPTS.

Unless there's some magic widget I'm missing?
Comment 1 Arfrever Frehtes Taifersar Arahesis 2016-04-11 09:51:25 UTC
https://gitweb.gentoo.org/repo/gentoo.git/tree/profiles/default/bsd/fbsd/profile.bashrc#n6

Has alias stopped working?

What profile is used?
Show: python -c 'import portage; print("\n".join(portage.settings.profiles))'
Comment 2 Joshua Kinard gentoo-dev 2016-04-11 14:53:20 UTC
(In reply to Arfrever Frehtes Taifersar Arahesis from comment #1)
> https://gitweb.gentoo.org/repo/gentoo.git/tree/profiles/default/bsd/fbsd/
> profile.bashrc#n6
> 
> Has alias stopped working?
> 
> What profile is used?
> Show: python -c 'import portage; print("\n".join(portage.settings.profiles))'

Running the 10.2 profile at the moment:
# python -c 'import portage; print("\n".join(portage.settings.profiles))'
/usr/portage/profiles/base
/usr/portage/profiles/default/bsd
/usr/portage/profiles/default/bsd/fbsd
/usr/portage/profiles/arch/base
/usr/portage/profiles/features/multilib
/usr/portage/profiles/features/multilib/lib32
/usr/portage/profiles/arch/amd64-fbsd/todo
/usr/portage/profiles/arch/amd64-fbsd
/usr/portage/profiles/default/bsd/fbsd/amd64
/usr/portage/profiles/releases
/usr/portage/profiles/releases/freebsd-10.2
/usr/portage/profiles/default/bsd/fbsd/amd64/10.2

I saw that 10.3 was out, so I figured to give it a go and was updating the 10.2 VM, then ran into llvm and (I think) cmake bailing out because of epatch/eapply sending -g0 and --no-backup-if-mismatch to the BSD patch, which doesn't accept them.

And what alias?
Comment 3 Arfrever Frehtes Taifersar Arahesis 2016-04-11 15:29:07 UTC
Alias is defined in place referenced by URL in comment #1:

type -P gpatch > /dev/null && alias patch=gpatch

But it is not working for previously defined _eapply_patch() function.

*** This bug has been marked as a duplicate of bug 574626 ***