Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 665192

Summary: sys-devel/llvm: Add Julia patchset to llvm-6
Product: Gentoo Linux Reporter: Matthias Maier <tamiko>
Component: Current packagesAssignee: LLVM support project <llvm>
Status: RESOLVED OBSOLETE    
Severity: normal CC: dschridde+gentoobugs, herrtimson, jeffrey, koz.ross, lssndrbarbieri, mgorny, O01eg
Priority: Normal Keywords: PullRequest
Version: unspecified   
Hardware: All   
OS: Linux   
See Also: https://github.com/gentoo/gentoo/pull/10692
Whiteboard:
Package list:
Runtime testing required: ---

Description Matthias Maier gentoo-dev 2018-09-03 22:32:21 UTC
dev-lang/julia has the unfortunate feature of requiring a patched sys-devel/llvm (or otherwise we would have to install a bundled llvm version for julia).

Would the llvm maintainers be inclined to add the following patches to ebuild in the llvm:6 slot (if necessary toggled by a "juliapatches", or similar, useflag)?

 - https://raw.githubusercontent.com/JuliaLang/julia/master/deps/patches/llvm-D49832-SCEVPred.patch
 - https://raw.githubusercontent.com/JuliaLang/julia/master/deps/patches/llvm-D50010-VNCoercion-ni.patch
 - https://raw.githubusercontent.com/JuliaLang/julia/master/deps/patches/llvm-D50167-scev-umin.patch
 - https://raw.githubusercontent.com/JuliaLang/julia/master/deps/patches/llvm-rL323946-LSRTy.patch
Comment 1 Jeffrey Lin 2018-09-03 22:48:15 UTC
Three of these patches have been merged upstream; one is still being reviewed:

https://reviews.llvm.org/rL338073
https://reviews.llvm.org/rL323946
https://reviews.llvm.org/rL323946

https://reviews.llvm.org/D50010
https://reviews.llvm.org/D50167
Comment 2 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2018-09-04 06:14:28 UTC
Please let us know when they're all merged upstream.  Those are certainly intrusive changes, and I'm not going to potentially break clang for this.
Comment 3 Andrzej Korwin-Mikke 2018-11-15 21:13:45 UTC
If this is likely to be a recurring problem once in a while, please add option to install bundled patched LLVM. I'm probably not the only one that would much rather have to compile LLVM twice (or pull it in binary, don't really care) than have an outdated Julia.
Comment 4 Andrzej Korwin-Mikke 2018-11-17 23:02:55 UTC
Julia's upstream devs even strongly recommend bundling a separate LLVM specifically for Julia as part of its package. Quoting their README.md:

"The most complicated dependency is LLVM, for which we require version 3.9 with some additional patches from upstream (LLVM is not backward compatible). For packaging Julia, we recommend either: - bundling a Julia-only LLVM library inside the Julia package, or - adding the patches to the LLVM 3.9 package of the distribution."

As far as I understand, this is also what their build from source does.
Comment 5 cryptopsy 2018-12-30 05:31:52 UTC
Was the patch we are waiting for merged upstreadm in llvm-8 ?
Comment 6 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2018-12-30 10:05:13 UTC
(In reply to cryptopsy from comment #5)
> Was the patch we are waiting for merged upstreadm in llvm-8 ?

No.  It's the usual case of somebody forking LLVM, making incompatible changes, making a lot of code relying on them, and then being surprised upstream doesn't like them.
Comment 7 Matthias Maier gentoo-dev 2019-01-07 20:22:34 UTC
(In reply to Michał Górny from comment #6)
> 
> No.  It's the usual case of somebody forking LLVM, making incompatible
> changes, making a lot of code relying on them, and then being surprised
> upstream doesn't like them.

No it is not. The fact that most of these patches are merged upstream and every single patch *fixes a regression* contradicts your argument here.
Comment 8 Larry the Git Cow gentoo-dev 2019-01-07 21:38:52 UTC
The bug has been referenced in the following commit(s):

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

commit c545f629a77bf34ddd9f2d357502f88d8064ed9d
Author:     Matthias Maier <tamiko@gentoo.org>
AuthorDate: 2019-01-07 21:04:48 +0000
Commit:     Matthias Maier <tamiko@gentoo.org>
CommitDate: 2019-01-07 21:35:31 +0000

    dev-lang/julia: version bump to 1.1.0-rc1
    
     * give up and bundle llvm-6
    
    Bug: https://bugs.gentoo.org/665192
    Package-Manager: Portage-2.3.54, Repoman-2.3.12
    Signed-off-by: Matthias Maier <tamiko@gentoo.org>

 dev-lang/julia/Manifest                            |   3 +
 .../julia/files/julia-1.1.0-fix_build_system.patch |  53 ++++++
 dev-lang/julia/julia-1.1.0_rc1.ebuild              | 197 +++++++++++++++++++++
 3 files changed, 253 insertions(+)

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

commit b3f5076cbb154f273ea52417f3a6542dc964cf49
Author:     Jeffrey Lin <jeffrey@icurse.nl>
AuthorDate: 2018-12-24 18:05:27 +0000
Commit:     Matthias Maier <tamiko@gentoo.org>
CommitDate: 2019-01-07 21:35:26 +0000

    dev-lang/julia-bin: new package
    
    Bug: https://bugs.gentoo.org/665192
    Closes: https://github.com/gentoo/gentoo/pull/10692
    Package-Manager: Portage-2.3.52, Repoman-2.3.12
    Signed-off-by: Jeffrey Lin <jeffrey@icurse.nl>
    Signed-off-by: Matthias Maier <tamiko@gentoo.org>

 dev-lang/julia-bin/Manifest               |  5 ++++
 dev-lang/julia-bin/julia-bin-1.0.3.ebuild | 43 +++++++++++++++++++++++++++++++
 dev-lang/julia-bin/metadata.xml           | 31 ++++++++++++++++++++++
 3 files changed, 79 insertions(+)
Comment 9 Matthias Maier gentoo-dev 2019-01-07 21:47:12 UTC
Actually, thinking about it - it would still be best if we could just apply the 4 patches in question.

For reference, Debian did the same:

  https://sources.debian.org/patches/llvm-toolchain-6.0/1:6.0.1-6/