Bug 1756977

Summary: Zig language package request
Product: [Fedora] Fedora Reporter: Anton Kochkov <anton.kochkov>
Component: distributionAssignee: Josh Boyer <jwboyer>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 32CC: bluebat, dmalcolm, extras-orphan, jakub, jistone, kevin, scottt.tw, sean, sguelton, siddharth.kde, tstellar
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-10-31 19:24:40 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Anton Kochkov 2019-09-30 11:13:20 UTC
Zig is a general-purpose programming language designed for robustness, optimality, and maintainability. Zig is statically typed language, compiled into the native code using LLVM backend.

There is upcoming 0.5 release, should be ready today https://github.com/ziglang/zig/milestone/7

Older releases are available here https://github.com/ziglang/zig/releases

Other distributions already packaged it: https://repology.org/project/zig/versions

https://ziglang.org/

https://github.com/ziglang/zig

This is how Zig code looks like:

var y: i32 = add(10, x);
const x: i32 = add(12, 34);

test "global variables" {
    assert(x == 46);
    assert(y == 56);
}

fn add(a: i32, b: i32) i32 {
    return a + b;
}

const std = @import("std");
const assert = std.debug.assert;

Comment 1 Tom Stellard 2019-10-01 14:09:12 UTC
For new package requests, you will need to provide a spec file and follow the process defined here: https://fedoraproject.org/wiki/Package_Review_Process.

Comment 2 Josh Stone 2019-10-01 18:00:09 UTC
I haven't reviewed it, but RPM Sphere has a ziglang package:
https://github.com/rpmsphere/source/tree/master/z
https://rpmsphere.github.io/

Comment 3 Wei-Lun Chao 2020-01-09 02:29:27 UTC
(In reply to Josh Stone from comment #2)
> I haven't reviewed it, but RPM Sphere has a ziglang package:
> https://github.com/rpmsphere/source/tree/master/z
> https://rpmsphere.github.io/

Thank you. Sadly build failed on aarch64.

Comment 4 Ben Cotton 2020-02-11 17:36:44 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 32 development cycle.
Changing version to 32.

Comment 5 serge_sans_paille 2020-03-03 07:34:30 UTC
I've been trying to port Wei-Lun Chao spec file to rawhide, and we have an issue (upstream).

zig depends on both clang and lld libs, and as of llvm-10, clang ships only libclang-cpp. For some reasons, this library uses codegen options, so it registers them upon linking. This is also the case for liblldCommon, so we end up with the same option being registered twice.

Note that zig explicitly doesn't support using libclang-cpp (see https://github.com/ziglang/zig/pull/3149) so we'd need to maintain patch.

Comment 6 serge_sans_paille 2020-03-03 10:06:44 UTC
Current spec file (fails on running, due to the double registration issue) https://sergesanspaille.fedorapeople.org/ziglang-0.4.0git-1.src.rpm

Comment 7 serge_sans_paille 2020-03-05 10:34:46 UTC
I've proposed a patch at LLVM level to fix the issue: https://reviews.llvm.org/D75579

Comment 8 Anton Kochkov 2020-04-10 04:41:43 UTC
New Zig 0.6.0 release is upcoming with the support of the newer LLVM 10 - it maybe worth trying to build it for Fedora 32-based tree?

It is scheduled to April 13:

https://github.com/ziglang/zig/milestone/8

Comment 9 Anton Kochkov 2020-04-14 04:55:42 UTC
And it was released, see the full changes here: https://ziglang.org/download/0.6.0/release-notes.html

It now relies on LLVM 10 and dropped the support of lesser versions.

Comment 10 Kevin Fenzi 2020-10-31 19:24:40 UTC
This isn't really the place to discuss packaging of something not in Fedora. Good luck packaging it up and if you need assistance, check with the devel list or packaging lists. 

Thanks.

Comment 11 serge_sans_paille 2021-01-05 10:05:01 UTC
Review Request: https://bugzilla.redhat.com/show_bug.cgi?id=1912706