Bug 1756977 - Zig language package request
Summary: Zig language package request
Status: NEW
Alias: None
Product: Fedora
Classification: Fedora
Component: distribution
Version: 32
Hardware: Unspecified
OS: Unspecified
Target Milestone: ---
Assignee: Josh Boyer
QA Contact: Fedora Extras Quality Assurance
Depends On:
TreeView+ depends on / blocked
Reported: 2019-09-30 11:13 UTC by Anton Kochkov
Modified: 2020-04-14 04:55 UTC (History)
11 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Last Closed:
Type: Bug

Attachments (Terms of Use)

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



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:

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:


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.

Note You need to log in before you can comment on or make changes to this bug.