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

Bug 719736

Summary: dev-lang/zig-0.6.0 version bump
Product: Gentoo Linux Reporter: Anton Kochkov <anton.kochkov>
Component: Current packagesAssignee: Aisha Tammy <gentoo>
Status: RESOLVED FIXED    
Severity: normal CC: bugs.gentoo.org, marduk, mgorny, proxy-maint, sam
Priority: Normal Keywords: PullRequest
Version: unspecified   
Hardware: All   
OS: Linux   
See Also: https://github.com/gentoo/gentoo/pull/19007
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: zig 0.7.0 version bump
build and install lld-11 shared libraries
add missing lld-11 dependency

Description Anton Kochkov 2020-04-27 06:00:15 UTC
Zig 0.6.0 was released at April 14, 2020:

https://github.com/ziglang/zig/releases/tag/0.6.0

This release of Zig upgrades to LLVM 10. Zig operates in lockstep with LLVM; Zig 0.6.0 is not compatible with LLVM 9. 

Amount of changes is tremendous, see full release notes at https://ziglang.org/download/0.6.0/release-notes.html

Many distributions already did an upgrade: https://repology.org/project/zig/versions
Comment 1 Michel Ganguin 2020-05-08 17:46:02 UTC
I tried to version bump, but I get multiple errors:

* linker issues lar to https://github.com/ziglang/zig/issues/4799, I added -DZIG_PREFER_CLANG_CPP_DYLIB=ON to the cmake args
* zig used to embed lld, it does not anymore. Therefore it depends on system lld. However, gentoo's lld does not include static libraries needed by zig. I tweaked the lld ebuild to install them.
* zig0 now compile, but fails at runtime "CommandLine Error: Option 'mc-relax-all' registered more than once", according to upstream, it's due to a double import of functions, dynlib conflicting with static lib (also in https://github.com/ziglang/zig/issues/4799). I did not find a fix/workaround for that.

I tried both with gcc and clang 10, same results.
Comment 2 Anton Kochkov 2020-08-07 06:17:23 UTC
Looks like it have to wait for LLVM 11 and Zig 0.7.0 https://github.com/ziglang/zig/milestone/9 - the planned release date is September 28, 2020.
Comment 3 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2020-10-10 14:53:41 UTC
@Nick, ping.
Comment 4 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2020-11-03 02:53:44 UTC
(In reply to Sam James from comment #3)
> @Nick, ping.

ping
Comment 5 Michel Ganguin 2020-11-12 21:12:12 UTC
Created attachment 671164 [details]
zig 0.7.0 version bump

newly released 0.7.0 version, targetting llvm11.

builds using -DZIG_PREFER_CLANG_CPP_DYLIB=ON

requires sys-devel/lld/lld-11.0.0.ebuild to be patched to build shared libraries. see provided patch.

The build requires quite some RAM about 6GB during my tests.
Comment 6 Michel Ganguin 2020-11-12 21:14:32 UTC
Created attachment 671167 [details, diff]
build and install lld-11 shared libraries

patch sys-devel/lld/lld-11.0.0.ebuild to build and install shared libraries required by >=dev-lang/zig-0.7.0
Comment 7 Michel Ganguin 2020-11-12 22:35:04 UTC
Created attachment 671182 [details]
add missing lld-11 dependency
Comment 8 Jan Ziak (atomsymbol) 2021-01-08 01:47:38 UTC
Hi. I would like to proxy-maintain this package. The most recent release is Zig 0.7.1, which builds OK using the ebuilds attached to this bug.
Comment 9 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-01-08 01:55:30 UTC
(In reply to Jan Ziak (atomsymbol) from comment #8)
> Hi. I would like to proxy-maintain this package. The most recent release is
> Zig 0.7.1, which builds OK using the ebuilds attached to this bug.

It's probably worth speaking to Miguel too, as he wrote these ebuilds

(In reply to Michel Ganguin from comment #5)
> Created attachment 671164 [details]
> zig 0.7.0 version bump
> 
> newly released 0.7.0 version, targetting llvm11.
> 
> builds using -DZIG_PREFER_CLANG_CPP_DYLIB=ON
> 
> requires sys-devel/lld/lld-11.0.0.ebuild to be patched to build shared
> libraries. see provided patch.
> 
> The build requires quite some RAM about 6GB during my tests.

Could you supply a git am-able patch with GCO sign off, but ideally a GitHub PR?

I think we may need to speak to mgorny about whether he's happy with the LLD patch. IIRC upstream were unsure about it.
Comment 10 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-01-08 01:55:49 UTC
(In reply to Sam James from comment #9)
> (In reply to Jan Ziak (atomsymbol) from comment #8)
> > Hi. I would like to proxy-maintain this package. The most recent release is
> > Zig 0.7.1, which builds OK using the ebuilds attached to this bug.
> 
> It's probably worth speaking to Miguel too, as he wrote these ebuilds
> 

Sorry, Michel *.
Comment 11 Jan Ziak (atomsymbol) 2021-01-08 02:01:12 UTC
(In reply to Sam James from comment #9)
> Could you supply a git am-able patch with GCO sign off, but ideally a GitHub
> PR?
> 
> I think we may need to speak to mgorny about whether he's happy with the LLD
> patch. IIRC upstream were unsure about it.

I will try to submit a GitHub PR, with a modified LLD ebuild that adds a "shared" USE flag (unless somebody has a better suggestion).
Comment 12 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2021-01-08 09:22:38 UTC
Don't waste your time.  I'm not going to accept any LLD patch that hasn't been accepted upstream.
Comment 13 Jan Ziak (atomsymbol) 2021-01-08 11:43:48 UTC
(In reply to Michał Górny from comment #12)
> Don't waste your time.  I'm not going to accept any LLD patch that hasn't
> been accepted upstream.

I meant lld.ebuild patch - not lld source code patch. Are you going to accept such a patch?
Comment 14 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2021-01-08 12:30:26 UTC
Does it actually resolve the problem?  Last I've tried, it failed hard due to double initialization or sth like that.
Comment 15 Jan Ziak (atomsymbol) 2021-01-08 13:05:40 UTC
(In reply to Michał Górny from comment #14)
> Does it actually resolve the problem?  Last I've tried, it failed hard due
> to double initialization or sth like that.

It (== https://bugs.gentoo.org/attachment.cgi?id=671167&action=diff) resolves the problem of /usr/lib64/liblld*.so and /usr/include/lld/*/*.h files not being installed, if that is what you mean.

As I mentioned earlier, we can either introduce a "shared" USE flag to lld.ebuild or make lld.ebuild install the libs+includes by default - whichever option you prefer.
Comment 16 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2021-01-08 13:17:26 UTC
Sure but last time I've tried, I wasn't able to start zig with this.
Comment 17 Aisha Tammy 2021-04-22 15:01:04 UTC
fixed

author	Aisha Tammy <gentoo@aisha.cc>	2021-02-22 22:54:50 +0000
committer	Joonas Niilola <juippis@gentoo.org>	2021-03-04 19:42:33 +0200
commit	41ff4d6bedc52f042d13e3e4ab34ee519f2a1baf (patch)
tree	53073e0ac7ea57be690fe523fd9fc9964796e022 /dev-lang/zig
parent	sys-devel/lld: enable shared libraries on lld (diff)
download	gentoo-41ff4d6bedc52f042d13e3e4ab34ee519f2a1baf.tar.gz
gentoo-41ff4d6bedc52f042d13e3e4ab34ee519f2a1baf.tar.bz2
gentoo-41ff4d6bedc52f042d13e3e4ab34ee519f2a1baf.zip

dev-lang/zig: version bump to 0.7.1
Package-Manager: Portage-3.0.14, Repoman-3.0.2
Signed-off-by: Aisha Tammy <gentoo@aisha.cc>
Closes: https://github.com/gentoo/gentoo/pull/19606
Signed-off-by: Joonas Niilola <juippis@gentoo.org>