GNU bug report logs - #50449
[PATCH] Add zig

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: guix-patches; Reported by: Andrew Patterson <andrewpatt7@HIDDEN>; Keywords: patch; merged with #39480, #47006; dated Tue, 7 Sep 2021 07:07:01 UTC; Maintainer for guix-patches is guix-patches@HIDDEN.

Message received at 50449 <at> debbugs.gnu.org:


Received: (at 50449) by debbugs.gnu.org; 9 Sep 2021 18:18:32 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Sep 09 14:18:32 2021
Received: from localhost ([127.0.0.1]:36212 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mOOd5-0008EE-Ip
	for submit <at> debbugs.gnu.org; Thu, 09 Sep 2021 14:18:32 -0400
Received: from mail-wr1-f66.google.com ([209.85.221.66]:46831)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <liliana.prikler@HIDDEN>)
 id 1mOOd2-0008Dv-K1; Thu, 09 Sep 2021 14:18:29 -0400
Received: by mail-wr1-f66.google.com with SMTP id x6so3813152wrv.13;
 Thu, 09 Sep 2021 11:18:28 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
 h=message-id:subject:from:to:cc:date:in-reply-to:references
 :user-agent:mime-version:content-transfer-encoding;
 bh=hj/aNg2ICl+UmCECRdLU6bUL0jZMIeas0ndmLBneWOs=;
 b=RDnYwXKdO76xXajTox9N+9jFJ3+Q9qrUZz80Dgnk1nBrNCAat1W95F3YeS0u82x0dh
 b5VvQY4o0IdQtGWat9L4QEMSv+YDRtvdlZf6fyOjt+ERugp2lwfsOuGLoXPql9XGrurh
 IAKq0rMzKGs5FG38AM1/SakhBiLoFQN3C6+sTdvfPXIG1xQ2I7tbGIA++3d2zmZiajJt
 AfH4U2Q09YwvWNRzS46cPOUPwMwNZlIKNMbmIO3UiLtj7d8cSEmS7P6X8QYAc8WTPHGJ
 5bmnjBrnvY+EIgAfHDo1DnZ9UGNxXInhtCoOA2PbVZbDuMo9of4tdr3x5oSqIrRwG5tl
 FMIg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to
 :references:user-agent:mime-version:content-transfer-encoding;
 bh=hj/aNg2ICl+UmCECRdLU6bUL0jZMIeas0ndmLBneWOs=;
 b=cmYbLkEAYI9hGyWhA9btj6x3ZNxeB9pG0ZZNVMN5LywOTqwiW5F4yA42egLXw7aAaR
 FpgNO4PtoXnYEvfCJXRVOJHipwqsfBvQA016oRMyVPPFHCYoy/uVOCOt9q8bbz5uNRdr
 k5/RH1ULyPQHeqiEnXO9Y4OtEC4HxbqetTORQ8mfTPjaN6DaQg9ynlV7YIZhiYIz4IV7
 tl8I/d26QqfH6kfQDxvQ3UXIGkherPGTpFdOTywcmL2cxnOr3i3RrqG7fwm1NRAl29F4
 fjTkkreQL+mJhT5xZ3c7IHMEaPxVmRuVLDpiKgg91p/9dOeABMqN6QfZdmFI3NH29qwc
 Qm7A==
X-Gm-Message-State: AOAM532uPc/CvBcyi2wSOx2x+NRn57e4nGBXDZbQv5ETsjFhIikmpG64
 5Z0CcyZfiHY8XakWvWI40UA=
X-Google-Smtp-Source: ABdhPJysInJUkHrTvwhpHlrfWAOyvBucgyFFLM2joOVW7u7RmVJoQmB/0LhIPZilaVq66iZ7teVLpA==
X-Received: by 2002:adf:e6c5:: with SMTP id y5mr5297173wrm.198.1631211502629; 
 Thu, 09 Sep 2021 11:18:22 -0700 (PDT)
Received: from nijino.fritz.box (85-127-52-93.dsl.dynamic.surfer.at.
 [85.127.52.93])
 by smtp.gmail.com with ESMTPSA id u26sm2687551wrd.32.2021.09.09.11.18.21
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 09 Sep 2021 11:18:22 -0700 (PDT)
Message-ID: <374c149b13a2c350f35811e6bc29c57cc56829e4.camel@HIDDEN>
Subject: Re: [bug#47006] [PATCH 2/2] gnu: Add zig.
From: Liliana Marie Prikler <liliana.prikler@HIDDEN>
To: Sarah Morgensen <iskarian@HIDDEN>
Date: Thu, 09 Sep 2021 20:18:20 +0200
In-Reply-To: <86tuitn226.fsf@HIDDEN>
References: <a1922b0a2ec237d217af54ed3ff7065e360d994c.camel@HIDDEN>
 <7e0456e51a420958dc9a2809f1e52e2ad444ace6.1631195387.git.liliana.prikler@HIDDEN>
 <86tuitn226.fsf@HIDDEN>
Content-Type: text/plain; charset="UTF-8"
User-Agent: Evolution 3.34.2 
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 50449
Cc: 47006 <at> debbugs.gnu.org, 50449 <at> debbugs.gnu.org, maximedevos@HIDDEN,
 efraim@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Hi Sarah,

Am Donnerstag, den 09.09.2021, 09:31 -0700 schrieb Sarah Morgensen:
> Liliana Prikler <liliana.prikler@HIDDEN> writes:
> 
> > * gnu/packages/zig.scm: New file.
> > * gnu/local.mk (GNU_SYSTEM_MODULES): Add it here.
> > ---
> >  gnu/local.mk         |  1 +
> >  gnu/packages/zig.scm | 83
> > ++++++++++++++++++++++++++++++++++++++++++++
> >  2 files changed, 84 insertions(+)
> >  create mode 100644 gnu/packages/zig.scm
> > 
> > diff --git a/gnu/local.mk b/gnu/local.mk
> > index 2a56c4a9e2..710e5bd9df 100644
> > --- a/gnu/local.mk
> > +++ b/gnu/local.mk
> > @@ -598,6 +598,7 @@ GNU_SYSTEM_MODULES =				
> > \
> >    %D%/packages/xdisorg.scm			\
> >    %D%/packages/xorg.scm				\
> >    %D%/packages/xfce.scm				\
> > +  %D%/packages/zig.scm				\
> >    %D%/packages/zile.scm				\
> >    %D%/packages/zwave.scm			\
> >  						\
> > diff --git a/gnu/packages/zig.scm b/gnu/packages/zig.scm
> > new file mode 100644
> > index 0000000000..8b9a863b4d
> > --- /dev/null
> > +++ b/gnu/packages/zig.scm
> > @@ -0,0 +1,83 @@
> > +;;; GNU Guix --- Functional package management for GNU
> > +;;; Copyright © 2021 Leo Prikler <leo.prikler@HIDDEN>
> > +;;;
> > +;;; This file is part of GNU Guix.
> > +;;;
> > +;;; GNU Guix is free software; you can redistribute it and/or
> > modify it
> > +;;; under the terms of the GNU General Public License as published
> > by
> > +;;; the Free Software Foundation; either version 3 of the License,
> > or (at
> > +;;; your option) any later version.
> > +;;;
> > +;;; GNU Guix is distributed in the hope that it will be useful,
> > but
> > +;;; WITHOUT ANY WARRANTY; without even the implied warranty of
> > +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> > +;;; GNU General Public License for more details.
> > +;;;
> > +;;; You should have received a copy of the GNU General Public
> > License
> > +;;; along with GNU Guix.  If not, see <
> > http://www.gnu.org/licenses/>;.
> > +
> > +(define-module (gnu packages zig)
> > +  #:use-module (guix packages)
> > +  #:use-module (guix git-download)
> > +  #:use-module ((guix licenses) #:prefix license:)
> > +  #:use-module (guix build-system cmake)
> > +  #:use-module (gnu packages)
> > +  #:use-module (gnu packages llvm))
> > +
> > +(define-public zig
> > +  (package
> > +    (name "zig")
> > +    (version "0.8.1")
> > +    (source
> > +     (origin
> > +       (method git-fetch)
> > +       (uri (git-reference
> > +             (url "https://github.com/ziglang/zig.git")
> > +             (commit version)))
> > +       (file-name (git-file-name name version))
> > +       (sha256
> > +        (base32
> > "147qx7xgj0r353wh5ragzn6kmm1vrf31i8038z3zqwjnqqgqxi6c"))))
> > +    (build-system cmake-build-system)
> > +    ;; Zig is based on and builds itself using the Clang
> > toolchain,
> > +    ;; so add it both as inputs and native-inputs.
> > +    (inputs
> > +     `(("clang" ,clang-12)
> > +       ("lld" ,lld-12)
> > +       ("llvm" ,llvm-12)))
> > +    (native-inputs
> > +     `(("clang" ,clang-12)
> > +       ("lld" ,lld-12)
> > +       ("llvm" ,llvm-12)))
> 
> Zig is perfectly happy compiling itself with GCC, and I believe it's
> the default.  I'm pretty sure it either needs no native tools, or
> only llvm, but I wasn't able to test without compiling a whole GCC
> cross-toolchain.
> 
> For cross compiling, you will also need to add "-DZIG_TARGET_TRIPLE=" 
> to configure flags, and you might want to look into adding
> "-DZIG_TARGET_MCPU" (should take the same values as LLVM's -mcpu) to
> change the baseline CPU for ARM systems since we build for ARM7 by
> default.
I don't think we set mcpu for LLVM or Clang, so that one should be
fine.  As for ZIG_TARGET_TRIPLET and the native inputs, do you have an
amended patch already lying around?

> > +    (arguments
> > +     `(#:tests? #f                       ; no check target
> 
> Did you mean to leave this in? ;)
Pretty sure that was a copypaste error at some point, good catch.

> > +       #:phases
> > +       (modify-phases %standard-phases
> > +         (add-after 'unpack 'save-unpack-dir
> > +           (lambda _
> > +             ;; HACK: Passing unpacked source directory to 'check
> > phase.
> > +             (setenv "ZIG_SOURCE_DIR" (getcwd))
> > +             #t))
> > +         (add-after 'configure 'set-home
> > +           (lambda _
> > +             (setenv "HOME" (getcwd))    ; zig writes to
> > $HOME/.cache
> > +             #t))
> > +         (delete 'check)
> > +         (add-after 'install 'check
> > +           (lambda* (#:key outputs tests? #:allow-other-keys)
> > +             (when tests?
> > +               (with-directory-excursion (getenv "ZIG_SOURCE_DIR")
> > +                 (invoke (string-append (assoc-ref outputs) "out")
> > "/bin/zig"
> > +                         "build" "test"))))))))
> 
> Full tests take quite a while, (it's supposed to be "an hour or two")
> so it may eventually be a good idea to limit what we test, such as
> using "-Dskip-release", which tests without optimization.  IMO that
> should be enough for catching any Guix-based issues with Zig.
Is that a configure flag or a test flag?

> > +    (synopsis "General purpose programming language and
> > toolchain")
> > +    (description "Zig is a general-purpose programming language
> > and
> > +toolchain.  Among other features it provides
> > +@itemize
> > +@item an Optional type instead of null pointers,
> > +@item manual memory management,
> > +@item generic data structures and functions,
> > +@item compile-time reflection and compile-time code execution,
> > +@item integration with C using zig as a C compiler, and
> > +@item concurrency via async functions.
> > +@end itemize")
> > +    (home-page "https://github.com/ziglang/zig")
> > +    (license license:expat)))
> 
> I don't know if it affects the license, but Zig bundles the source
> for *many* components, such as glibc, musl, mingw, wasi, and from
> LLVM: libcxx, libcxxabi, libunwind, and tsan.
Good catch, could we unbundle some/all of those?

> Zig doesn't seem to honor LIBRARY_PATH, but oddly enough it honors
> NIX_LDFLAGS and NIX_CFLAGS_COMPILE, so if we want it to see external
> libraries, something like this is needed:
> 
> --8<---------------cut here---------------start------------->8---
>          (add-after 'check 'wrap-binary
>            (lambda* (#:key outputs #:allow-other-keys)
>              ;; TODO: test with 'zig cc'
>              (wrap-program (string-append (assoc-ref outputs "out")
> "/bin/zig")
>                `("NIX_LDFLAGS" prefix
>                  ("${LIBRARY_PATH:+-L${LIBRARY_PATH//:/ -L}}"))
>                `("NIX_CFLAGS_COMPILE" prefix
>                  (,(string-append
>                     "${CPLUS_INCLUDE_PATH:+-isystem "
>                     "${CPLUS_INCLUDE_PATH//:/ -isystem }}"))))))
> --8<---------------cut here---------------end--------------->8---
That is rather inelegant.  I'd prefer we patch zig to honor
LIBRARY_PATH, CPLUS_INCLUDE_FLAGS and what other important environment
variables we find.

Thanks





Information forwarded to guix-patches@HIDDEN:
bug#50449; Package guix-patches. Full text available.

Message received at 50449 <at> debbugs.gnu.org:


Received: (at 50449) by debbugs.gnu.org; 9 Sep 2021 16:31:44 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Sep 09 12:31:44 2021
Received: from localhost ([127.0.0.1]:36083 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mOMxj-0005Gh-Eq
	for submit <at> debbugs.gnu.org; Thu, 09 Sep 2021 12:31:44 -0400
Received: from out2.migadu.com ([188.165.223.204]:16399)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <iskarian@HIDDEN>)
 id 1mOMxR-0005Fv-L0; Thu, 09 Sep 2021 12:31:30 -0400
X-Report-Abuse: Please report any abuse attempt to abuse@HIDDEN and
 include these headers.
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mgsn.dev; s=key1;
 t=1631205082;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
 content-transfer-encoding:content-transfer-encoding:
 in-reply-to:in-reply-to:references:references;
 bh=5s6eo89ClVLVY8grlwiyp7CBX0+U/WcZBA0gUzzkZ1c=;
 b=jlJvxjpMc2xZEemd7BsAxCTtaEjUBQ6y4PJByFR2XiXHtoEK+uDG2+8lgOT5aD6iN3W+Oj
 1xVISX7zmdo1hYJckr6oqsvCrG365C33rXIu7QBJXxt4OdmzjJJ7inr81CLOtY8xiic3BC
 9/2iErtJOoZzBfPWJpfWsYJGs/PaNGo=
From: Sarah Morgensen <iskarian@HIDDEN>
To: Liliana Prikler <liliana.prikler@HIDDEN>
Subject: Re: [bug#47006] [PATCH 2/2] gnu: Add zig.
References: <a1922b0a2ec237d217af54ed3ff7065e360d994c.camel@HIDDEN>
 <7e0456e51a420958dc9a2809f1e52e2ad444ace6.1631195387.git.liliana.prikler@HIDDEN>
Date: Thu, 09 Sep 2021 09:31:13 -0700
In-Reply-To: <7e0456e51a420958dc9a2809f1e52e2ad444ace6.1631195387.git.liliana.prikler@HIDDEN>
 (Liliana Prikler's message of "Thu, 9 Sep 2021 15:32:22 +0200 (2 hours, 26
 minutes, 18 seconds ago)")
Message-ID: <86tuitn226.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Migadu-Flow: FLOW_OUT
X-Migadu-Auth-User: iskarian@HIDDEN
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 50449
Cc: 47006 <at> debbugs.gnu.org, 50449 <at> debbugs.gnu.org, maximedevos@HIDDEN,
 efraim@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Hi Liliana,

Thanks for taking a look at the recent patch and sending an updated
one.  I've been tinkering with the recent zig patch as well, so I have a
few comments.

Liliana Prikler <liliana.prikler@HIDDEN> writes:

> * gnu/packages/zig.scm: New file.
> * gnu/local.mk (GNU_SYSTEM_MODULES): Add it here.
> ---
>  gnu/local.mk         |  1 +
>  gnu/packages/zig.scm | 83 ++++++++++++++++++++++++++++++++++++++++++++
>  2 files changed, 84 insertions(+)
>  create mode 100644 gnu/packages/zig.scm
>
> diff --git a/gnu/local.mk b/gnu/local.mk
> index 2a56c4a9e2..710e5bd9df 100644
> --- a/gnu/local.mk
> +++ b/gnu/local.mk
> @@ -598,6 +598,7 @@ GNU_SYSTEM_MODULES =3D				\
>    %D%/packages/xdisorg.scm			\
>    %D%/packages/xorg.scm				\
>    %D%/packages/xfce.scm				\
> +  %D%/packages/zig.scm				\
>    %D%/packages/zile.scm				\
>    %D%/packages/zwave.scm			\
>  						\
> diff --git a/gnu/packages/zig.scm b/gnu/packages/zig.scm
> new file mode 100644
> index 0000000000..8b9a863b4d
> --- /dev/null
> +++ b/gnu/packages/zig.scm
> @@ -0,0 +1,83 @@
> +;;; GNU Guix --- Functional package management for GNU
> +;;; Copyright =C2=A9 2021 Leo Prikler <leo.prikler@HIDDEN>
> +;;;
> +;;; This file is part of GNU Guix.
> +;;;
> +;;; GNU Guix is free software; you can redistribute it and/or modify it
> +;;; under the terms of the GNU General Public License as published by
> +;;; the Free Software Foundation; either version 3 of the License, or (at
> +;;; your option) any later version.
> +;;;
> +;;; GNU Guix is distributed in the hope that it will be useful, but
> +;;; WITHOUT ANY WARRANTY; without even the implied warranty of
> +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> +;;; GNU General Public License for more details.
> +;;;
> +;;; You should have received a copy of the GNU General Public License
> +;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
> +
> +(define-module (gnu packages zig)
> +  #:use-module (guix packages)
> +  #:use-module (guix git-download)
> +  #:use-module ((guix licenses) #:prefix license:)
> +  #:use-module (guix build-system cmake)
> +  #:use-module (gnu packages)
> +  #:use-module (gnu packages llvm))
> +
> +(define-public zig
> +  (package
> +    (name "zig")
> +    (version "0.8.1")
> +    (source
> +     (origin
> +       (method git-fetch)
> +       (uri (git-reference
> +             (url "https://github.com/ziglang/zig.git")
> +             (commit version)))
> +       (file-name (git-file-name name version))
> +       (sha256
> +        (base32 "147qx7xgj0r353wh5ragzn6kmm1vrf31i8038z3zqwjnqqgqxi6c"))=
))
> +    (build-system cmake-build-system)
> +    ;; Zig is based on and builds itself using the Clang toolchain,
> +    ;; so add it both as inputs and native-inputs.
> +    (inputs
> +     `(("clang" ,clang-12)
> +       ("lld" ,lld-12)
> +       ("llvm" ,llvm-12)))
> +    (native-inputs
> +     `(("clang" ,clang-12)
> +       ("lld" ,lld-12)
> +       ("llvm" ,llvm-12)))

Zig is perfectly happy compiling itself with GCC, and I believe it's the
default.  I'm pretty sure it either needs no native tools, or only llvm,
but I wasn't able to test without compiling a whole GCC cross-toolchain.

For cross compiling, you will also need to add "-DZIG_TARGET_TRIPLE=3D" to
configure flags, and you might want to look into adding
"-DZIG_TARGET_MCPU" (should take the same values as LLVM's -mcpu) to
change the baseline CPU for ARM systems since we build for ARM7 by
default.

> +    (arguments
> +     `(#:tests? #f                       ; no check target

Did you mean to leave this in? ;)

> +       #:phases
> +       (modify-phases %standard-phases
> +         (add-after 'unpack 'save-unpack-dir
> +           (lambda _
> +             ;; HACK: Passing unpacked source directory to 'check phase.
> +             (setenv "ZIG_SOURCE_DIR" (getcwd))
> +             #t))
> +         (add-after 'configure 'set-home
> +           (lambda _
> +             (setenv "HOME" (getcwd))    ; zig writes to $HOME/.cache
> +             #t))
> +         (delete 'check)
> +         (add-after 'install 'check
> +           (lambda* (#:key outputs tests? #:allow-other-keys)
> +             (when tests?
> +               (with-directory-excursion (getenv "ZIG_SOURCE_DIR")
> +                 (invoke (string-append (assoc-ref outputs) "out") "/bin=
/zig"
> +                         "build" "test"))))))))

Full tests take quite a while, (it's supposed to be "an hour or two") so
it may eventually be a good idea to limit what we test, such as using
"-Dskip-release", which tests without optimization.  IMO that should be
enough for catching any Guix-based issues with Zig.

> +    (synopsis "General purpose programming language and toolchain")
> +    (description "Zig is a general-purpose programming language and
> +toolchain.  Among other features it provides
> +@itemize
> +@item an Optional type instead of null pointers,
> +@item manual memory management,
> +@item generic data structures and functions,
> +@item compile-time reflection and compile-time code execution,
> +@item integration with C using zig as a C compiler, and
> +@item concurrency via async functions.
> +@end itemize")
> +    (home-page "https://github.com/ziglang/zig")
> +    (license license:expat)))

I don't know if it affects the license, but Zig bundles the source for
*many* components, such as glibc, musl, mingw, wasi, and from LLVM:
libcxx, libcxxabi, libunwind, and tsan.

Zig doesn't seem to honor LIBRARY_PATH, but oddly enough it honors
NIX_LDFLAGS and NIX_CFLAGS_COMPILE, so if we want it to see external
libraries, something like this is needed:

--8<---------------cut here---------------start------------->8---
         (add-after 'check 'wrap-binary
           (lambda* (#:key outputs #:allow-other-keys)
             ;; TODO: test with 'zig cc'
             (wrap-program (string-append (assoc-ref outputs "out") "/bin/z=
ig")
               `("NIX_LDFLAGS" prefix
                 ("${LIBRARY_PATH:+-L${LIBRARY_PATH//:/ -L}}"))
               `("NIX_CFLAGS_COMPILE" prefix
                 (,(string-append
                    "${CPLUS_INCLUDE_PATH:+-isystem "
                    "${CPLUS_INCLUDE_PATH//:/ -isystem }}"))))))
--8<---------------cut here---------------end--------------->8---

I haven't tested this with 'zig cc', but this worked for compiling [0].

[0] https://github.com/andrewrk/tetris

Hope that helps,

--
Sarah




Information forwarded to guix-patches@HIDDEN:
bug#50449; Package guix-patches. Full text available.

Message received at 50449 <at> debbugs.gnu.org:


Received: (at 50449) by debbugs.gnu.org; 9 Sep 2021 01:53:19 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Sep 08 21:53:19 2021
Received: from localhost ([127.0.0.1]:33800 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mO9Fe-0002XK-Tv
	for submit <at> debbugs.gnu.org; Wed, 08 Sep 2021 21:53:19 -0400
Received: from mail-qk1-f176.google.com ([209.85.222.176]:43605)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <andrewpatt7@HIDDEN>) id 1mO9Fc-0002Wj-Bv
 for 50449 <at> debbugs.gnu.org; Wed, 08 Sep 2021 21:53:18 -0400
Received: by mail-qk1-f176.google.com with SMTP id ay33so203711qkb.10
 for <50449 <at> debbugs.gnu.org>; Wed, 08 Sep 2021 18:53:16 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
 h=references:user-agent:from:to:cc:subject:date:in-reply-to
 :message-id:mime-version;
 bh=QmfEXa/HJrL/gJ8K+S/DowkFRxMzLQSN745vAZljDdc=;
 b=e2eHCGsV61Z54Hqdnb7tHJBDFNq4vYIKrShJQI8b3Oed4Ct+EdLQh+xmLXsPNCAQBs
 L2nNLHwEQOpzu6fM1FZZF+ueagkw7nN5zWlnVPUJUyMvGtCoAvejywAtAIHOklakpplk
 L69va6S2SB3Bcu6HNZU72KlT23QrnDOHtN7m2ephOpRpbr2tCX2klh8G6nqGVRqrqyWA
 9VIdUphnxkRJPxgalviaXYlLEdZ5+urniqSj5Ydp0DjirAvysyC9HmiKPNsTefF5RLJZ
 GRyTfsAJ6Se2rJuHcxmrXi9d7B/FbckBDaCkzbQpNAdgiOREma3yvO7PJpd9MiQ5oaZm
 nu9w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=x-gm-message-state:references:user-agent:from:to:cc:subject:date
 :in-reply-to:message-id:mime-version;
 bh=QmfEXa/HJrL/gJ8K+S/DowkFRxMzLQSN745vAZljDdc=;
 b=Ja7FSye3HpFQ41gBIxu5n96TRp3Yp3sJEtyAy2nLgHzK7Pshvj0YqQH1rD6ghZNg2O
 +GmWLefMQTVuC3m5Rw8ieQMqToFGmXIIGb9UVSAKSIjD6Cf4owmMqSxz+tBY3kXB7EeY
 mu7BCsf/FmTQNn/TsM3eWtdpKbDoqqmThbnWFbIVXwq4K9MLy+YyOjSmsRV5t+HwwENI
 JMUSa44yBNQMCbPuhWj/4R1G0aTiG4vAIIXagJv0BrjqTm3LMAq2fhoHGSizI2v+Qepw
 O9xjGXfWoflu65UcYMqL3q9Xf5F6qRG4k66lJp09z2o7E4XREydpsuLg7+eF0BTmOZoo
 3+6A==
X-Gm-Message-State: AOAM530nekqObp1zOv8uUq4RYNjUbSSrJHXdiBKaprvkMHiUc+Wdv4hH
 q3CCpI9mfmV8vr0UMrzb9ok=
X-Google-Smtp-Source: ABdhPJwnoO80qlsGK9Eb0ZN2awo71vaSsBOjsRguivtsgi+6P9jmgLboqS6YVE2P3TL2YMxMUkI38w==
X-Received: by 2002:a37:e307:: with SMTP id y7mr592970qki.211.1631152390766;
 Wed, 08 Sep 2021 18:53:10 -0700 (PDT)
Received: from kalantha ([2601:5c6:8000:98:4364:bb79:1fd4:2c19])
 by smtp.gmail.com with ESMTPSA id d68sm333353qke.19.2021.09.08.18.53.09
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 08 Sep 2021 18:53:10 -0700 (PDT)
References: <a1922b0a2ec237d217af54ed3ff7065e360d994c.camel@HIDDEN>
User-agent: mu4e 1.6.5; emacs 27.2
From: Andrew Patterson <andrewpatt7@HIDDEN>
To: 50449 <at> debbugs.gnu.org
Subject: Re: [PATCH] Add zig
Date: Wed, 08 Sep 2021 21:43:01 -0400
In-reply-to: <a1922b0a2ec237d217af54ed3ff7065e360d994c.camel@HIDDEN>
Message-ID: <878s06y0oq.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; format=flowed
X-Spam-Score: 0.2 (/)
X-Debbugs-Envelope-To: 50449
Cc: Liliana Marie Prikler <liliana.prikler@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.8 (/)

Thanks for the input, and sorry for not looking through the 
existing
bugs first.  I'll look at the merged issues(?), and I'll watch for 
the
lld version bump, but I probably won't add much to this in the 
foreseeable
future.

-- 
Andrew Patterson




Information forwarded to guix-patches@HIDDEN:
bug#50449; Package guix-patches. Full text available.
Merged 39480 47006 50449. Request was from Liliana Marie Prikler <liliana.prikler@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at 50449 <at> debbugs.gnu.org:


Received: (at 50449) by debbugs.gnu.org; 8 Sep 2021 10:11:58 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Sep 08 06:11:57 2021
Received: from localhost ([127.0.0.1]:58723 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mNuYf-0001jM-G0
	for submit <at> debbugs.gnu.org; Wed, 08 Sep 2021 06:11:57 -0400
Received: from mail-qt1-f170.google.com ([209.85.160.170]:44616)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <andrewpatt7@HIDDEN>) id 1mNuYd-0001j9-HX
 for 50449 <at> debbugs.gnu.org; Wed, 08 Sep 2021 06:11:56 -0400
Received: by mail-qt1-f170.google.com with SMTP id r21so1323275qtw.11
 for <50449 <at> debbugs.gnu.org>; Wed, 08 Sep 2021 03:11:55 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
 h=from:to:cc:subject:date:message-id:in-reply-to:references
 :mime-version:content-transfer-encoding;
 bh=3w3pXynqyMpK+dZuCGGAxLDLrI75vLHna6aKcVw2CJM=;
 b=hHZDi8qLNHZ86gOBypo9JDUu5m3tJ8MSbA3RjRqPFe3oM4H0QRQYjerSLN8stJ4Hwx
 VbWxFIfH8dC4HbjS+2kaOAJoVj9DkVFjXwXFAdCgP31zvp7G4BrQ/F60BaOB6e+8duuK
 lxD8OKYXg7J8zRWU36Ik+ohr4VynDvr7rdSo5xmCgs9C7Xx0HeNBVcviqm6sNAeNn1CX
 LCtW3Cr3tlu1iLWeK4ErbxQVF0y+J6AZTqXfdAPq+WSNaruiWkm3NRo+IZzpXP6u4JFq
 gs7JR4hPOsRKKZbISV4ci/y4tyzJwbUquqO2FD0R7TIPk9LiWsACi9+llnVUWsjO+HPN
 wXDg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to
 :references:mime-version:content-transfer-encoding;
 bh=3w3pXynqyMpK+dZuCGGAxLDLrI75vLHna6aKcVw2CJM=;
 b=NXNBcx2d9hiQvdDzXrdo2yM1N0873uyMK9wsNaOyn7RHOhukC7RTQI9/Ua1XvVy3xB
 5cKI19tFqzpR37HiLyvxG1U9nPwdLoreE9f4cxIDl6F3rBLGOqCJebAzgwY6Zd8NWITe
 N+6O3+QlBN1XexG+FWJzu4+JXcq3g3TKYe8QZN/RfIOMhCGRNNz1qrnUuX9TDOOMqv2b
 cbP4UhMW6OfVSvstUs87HBuQ5WnNQ+gvftj+mphibJ3W0EyOGmb8hK8m2Q38OpoIhTlc
 ZUT2D5aKT22/B5LnX1x2oNPObFhLtH6nKaqA1AeM9GskjAQPowaQPInvlFR2g4YntLL1
 r7qA==
X-Gm-Message-State: AOAM531SQnxTEyMDUGgg8xeP/0MTm9usRi/IrOFYnInSlgFGbDLHH1g4
 VuO3pPupPxEQrDYzJsU2eSxq/T0ZGdNSWg==
X-Google-Smtp-Source: ABdhPJwXMd9pN4UEXcPCxPYwHiIcrjrRgioa6fUvlPSjNgHmZQ6jVG6tPlKJaDkqUU1teE51SP1oxA==
X-Received: by 2002:ac8:4818:: with SMTP id g24mr2779563qtq.328.1631095909803; 
 Wed, 08 Sep 2021 03:11:49 -0700 (PDT)
Received: from localhost.localdomain ([2601:5c6:8000:98:4364:bb79:1fd4:2c19])
 by smtp.gmail.com with ESMTPSA id
 o4sm1187269qti.24.2021.09.08.03.11.48
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 08 Sep 2021 03:11:48 -0700 (PDT)
From: Andrew Patterson <andrewpatt7@HIDDEN>
To: 50449 <at> debbugs.gnu.org
Subject: [PATCH] Add zig
Date: Wed,  8 Sep 2021 06:11:24 -0400
Message-Id: <20210908101125.31895-1-andrewpatt7@HIDDEN>
X-Mailer: git-send-email 2.33.0
In-Reply-To: <20210907172105.8681-1-andrewpatt7@HIDDEN>
References: <20210907172105.8681-1-andrewpatt7@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: 0.2 (/)
X-Debbugs-Envelope-To: 50449
Cc: Andrew Patterson <andrewpatt7@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.8 (/)

---
Confusion between my main guix install and what I'm working on led to
issues.

Current status as to the Submitting Paches checklist in the info page:
1. That's the hash for 0.7.1
2. I've added a synopsis and description
3. I don't know what ~guix lint~'s complaint that "the source file name
should contain the package name" means; otherwise, it's fine
4. It builds on x64 linux.
5. I haven't tried to build it on other platforms; the inputs might need
to be native-inputs, but I'm not sure
6. It has a bundled libc, but that's because zig has a c compiler built
in for some reason.
7. The ~guix size~ output seems reasonable.
8. There shouldn't be any dependent packages, since it's new.
9. ~guix build --rounds=2 zig~ worked fine.
10. Not relevant.
11. The patch is all adding zig.
12. I wrote the patch in emacs, so the indentation should be fine.
13. I don't think there are mirror urls for github?

 gnu/packages/zig.scm | 91 ++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 91 insertions(+)
 create mode 100644 gnu/packages/zig.scm

diff --git a/gnu/packages/zig.scm b/gnu/packages/zig.scm
new file mode 100644
index 0000000000..ba48fcf51f
--- /dev/null
+++ b/gnu/packages/zig.scm
@@ -0,0 +1,91 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2021 Andrew Patterson <andrewpatt7@HIDDEN>
+;;;
+;;; This file is part of GNU Guix.
+;;;
+;;; GNU Guix is free software; you can redistribute it and/or modify it
+;;; under the terms of the GNU General Public License as published by
+;;; the Free Software Foundation; either version 3 of the License, or (at
+;;; your option) any later version.
+;;;
+;;; GNU Guix is distributed in the hope that it will be useful, but
+;;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;;; GNU General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License
+;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
+
+(define-module (gnu packages zig)
+  #:use-module (guix packages)
+  #:use-module (guix git-download)
+  #:use-module (guix build-system cmake)
+  #:use-module ((guix licenses) #:prefix l:)
+  #:use-module (guix build utils)
+  #:use-module (gnu packages)
+  #:use-module (gnu packages llvm)
+  #:use-module (guix utils))
+
+;; Zig versions depend on specific LLVM major versions; should be able to update
+;; to 0.8.x with lld@12
+(define-public zig
+  (package
+    (name "zig")
+    (version "0.7.1")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/ziglang/zig")
+             (commit version)))
+       (sha256
+        (base32
+         "1z6c4ym9jmga46cw2arn7zv2drcpmrf3vw139gscxp27n7q2z5md"))))
+    (build-system cmake-build-system)
+    (inputs
+     `(("llvm" ,llvm-11)
+       ("clang-toolchain" ,clang-toolchain-11)
+       ("lld" ,lld))) ; is currently version 11
+    (arguments
+     `(#:tests? #f
+       #:phases (modify-phases %standard-phases
+                  (add-before 'install 'set-cachedir
+                    (lambda* _ ;; See [[https://github.com/ziglang/zig/issues/6810]]
+                      (setenv "XDG_CACHE_HOME" "/tmp/"))))))
+    (home-page "https://ziglang.org/")
+    (synopsis
+     "Programming language for maintaining robust, optimal, and reusable software")
+    (description
+     "Zig is a general-purpose programming language and toolchain for
+maintaining robust, optimal, and reusable software.
+
+⚡ A Simple Language
+
+Focus on debugging your application rather than debugging your programming
+language knowledge.
+@itemize @bullet
+@item No hidden control flow.
+@item No hidden memory allocations.
+@item No preprocessor, no macros.
+@end itemize
+
+⚡ Comptime
+
+A fresh approach to metaprogramming based on compile-time code execution and
+lazy evaluation.
+@itemize @bullet
+@item Call any function at compile-time.
+@item Manipulate types as values without runtime overhead.
+@item Comptime emulates the target architecture.
+@end itemize
+
+⚡ Performance Meets Safety
+
+Write fast, clear code capable of handling all error conditions.
+@itemize @bullet
+@item The language gracefully guides your error handling logic.
+@item Configurable runtime checks help you strike a balance between performance
+and safety guarantees.
+@item Take advantage of vector types to express SIMD instructions portably.
+@end itemize")
+    (license l:expat)))
-- 
2.33.0





Information forwarded to guix-patches@HIDDEN:
bug#50449; Package guix-patches. Full text available.

Message received at 50449 <at> debbugs.gnu.org:


Received: (at 50449) by debbugs.gnu.org; 7 Sep 2021 17:21:33 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Sep 07 13:21:33 2021
Received: from localhost ([127.0.0.1]:57539 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mNemq-0001sA-Q4
	for submit <at> debbugs.gnu.org; Tue, 07 Sep 2021 13:21:33 -0400
Received: from mail-qt1-f180.google.com ([209.85.160.180]:45761)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <andrewpatt7@HIDDEN>) id 1mNemo-0001rq-UO
 for 50449 <at> debbugs.gnu.org; Tue, 07 Sep 2021 13:21:31 -0400
Received: by mail-qt1-f180.google.com with SMTP id s32so8552189qtc.12
 for <50449 <at> debbugs.gnu.org>; Tue, 07 Sep 2021 10:21:30 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
 h=from:to:cc:subject:date:message-id:in-reply-to:references
 :mime-version:content-transfer-encoding;
 bh=3ERwgVvWoxHjO9SWbghbc6mhdzkgGIom1gL9E0GO3qc=;
 b=KgI/dnbVUfNem0FFLGUii2frKlzG9pVDxI6RomxcoCHdAuHMuDrscoe50aRpa+JbYe
 9tgEiVTFb6QQH50VTY8C6pmD+9jK2Q9/33tMbbEj8FHDxBxaTrNueDjm7pJb1z3psYMf
 hLbnMUUOJn+68Y2Rcs1ZkORYBnq8p11MmITaSyQSept9oHCTJnrWR3zLTr6I727/gQ4I
 3XmzckPqXJlNYl282JwJH/8xiz5TNCYtPDKT4EJjF4xJozVlA4xtPIx8+KWY+JG18/vN
 siDImqhy5RFTV8Ha6e4X3dxGK93dMPxilBzF5RbEz+J4rkSHxyU08FoI9xMICSbMLrRN
 O2MQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to
 :references:mime-version:content-transfer-encoding;
 bh=3ERwgVvWoxHjO9SWbghbc6mhdzkgGIom1gL9E0GO3qc=;
 b=MQwfQugLuAhdSKvotxJI9IBARqNf6rr3gHZsRU4kWoSc8m/Y2zkpFVjzM8Kz0XZsVO
 Wvq1PB/8wb/WVN/jnOLzS3crD5aU1VlDriXUrCdOIJseYHlZKCTuYDQnIODTBuyEEpkI
 1UGemP0oQcxS6golGYlbvkXdQzT2eWWO6gf9l4EWUO5dDniveGOrKKwnhZhNr3XEQcSP
 sh86ACk/TIlwWiTAVYWZwI/mt3G0xlp+GubW4r4PRwS2eUpK2TomJ1fznkVWpc5uyHgk
 6tP8JWkzzZ5Mt4vhvu/cevqzJeMbYMd/w5yAVyUzMVy5abfD0I3YZ3NO8/NQrivB2jbS
 8w0g==
X-Gm-Message-State: AOAM530Dlsb4d0mijwWkIrVFp3kgvhUlM9awyEi7O7AFTlQC/fYrGUic
 y9Uv6k+F3jds76zbOsP3SI3CP91JfAg=
X-Google-Smtp-Source: ABdhPJx1uU5HV3GCem7hyfYJWOYB6/VYUOXsWnSMufdXIqTNOG5XH3q3//W8u8L/jb0B13uQHBnJlg==
X-Received: by 2002:ac8:5981:: with SMTP id e1mr16194699qte.358.1631035285140; 
 Tue, 07 Sep 2021 10:21:25 -0700 (PDT)
Received: from kalantha.lynchburg.edu ([161.115.86.198])
 by smtp.gmail.com with ESMTPSA id h70sm9450075qke.54.2021.09.07.10.21.24
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Tue, 07 Sep 2021 10:21:24 -0700 (PDT)
From: Andrew Patterson <andrewpatt7@HIDDEN>
To: 50449 <at> debbugs.gnu.org
Subject: [PATCH] Add zig
Date: Tue,  7 Sep 2021 13:21:05 -0400
Message-Id: <20210907172105.8681-1-andrewpatt7@HIDDEN>
X-Mailer: git-send-email 2.33.0
In-Reply-To: <handler.50449.B.163099841130426.ack <at> debbugs.gnu.org>
References: <handler.50449.B.163099841130426.ack <at> debbugs.gnu.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: 0.2 (/)
X-Debbugs-Envelope-To: 50449
Cc: Andrew Patterson <andrewpatt7@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.8 (/)

---
I forgot the copyright header last time; here it is with it.

 gnu/packages/zig.scm | 91 ++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 91 insertions(+)
 create mode 100644 gnu/packages/zig.scm

diff --git a/gnu/packages/zig.scm b/gnu/packages/zig.scm
new file mode 100644
index 0000000000..59056a1f88
--- /dev/null
+++ b/gnu/packages/zig.scm
@@ -0,0 +1,91 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2021 Andrew Patterson <andrewpatt7@HIDDEN>
+;;;
+;;; This file is part of GNU Guix.
+;;;
+;;; GNU Guix is free software; you can redistribute it and/or modify it
+;;; under the terms of the GNU General Public License as published by
+;;; the Free Software Foundation; either version 3 of the License, or (at
+;;; your option) any later version.
+;;;
+;;; GNU Guix is distributed in the hope that it will be useful, but
+;;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;;; GNU General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License
+;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
+
+(define-module (gnu packages zig)
+  #:use-module (guix packages)
+  #:use-module (guix git-download)
+  #:use-module (guix build-system cmake)
+  #:use-module ((guix licenses) #:prefix l:)
+  #:use-module (guix build utils)
+  #:use-module (gnu packages)
+  #:use-module (gnu packages llvm)
+  #:use-module (guix utils))
+
+;; Zig versions depend on specific LLVM major versions; should be able to update
+;; to 0.8.x with lld@12
+(define-public zig
+  (package
+    (name "zig")
+    (version "0.7.1")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/ziglang/zig")
+             (commit version)))
+       (sha256
+        (base32
+         "0gq8xjqr3n38i2adkv9vf936frac80wh72dvhh4m5s66yafmhphg"))))
+    (build-system cmake-build-system)
+    (inputs
+     `(("llvm" ,llvm-11)
+       ("clang-toolchain" ,clang-toolchain-11)
+       ("lld" ,lld))) ; is currently version 11
+    (arguments
+     `(#:tests? #f
+       #:phases (modify-phases %standard-phases
+                  (add-before 'install 'set-cachedir
+                    (lambda* _ ;; See [[https://github.com/ziglang/zig/issues/6810]]
+                      (setenv "XDG_CACHE_HOME" "/tmp/"))))))
+    (home-page "https://ziglang.org/")
+    (synopsis
+     "Programming language for maintaining robust, optimal, and reusable software")
+    (description
+     "Zig is a general-purpose programming language and toolchain for
+maintaining robust, optimal, and reusable software.
+
+⚡ A Simple Language
+
+Focus on debugging your application rather than debugging your programming
+language knowledge.
+@itemize @bullet
+@item No hidden control flow.
+@item No hidden memory allocations.
+@item No preprocessor, no macros.
+@end itemize
+
+⚡ Comptime
+
+A fresh approach to metaprogramming based on compile-time code execution and
+lazy evaluation.
+@itemize @bullet
+@item Call any function at compile-time.
+@item Manipulate types as values without runtime overhead.
+@item Comptime emulates the target architecture.
+@end itemize
+
+⚡ Performance Meets Safety
+
+Write fast, clear code capable of handling all error conditions.
+@itemize @bullet
+@item The language gracefully guides your error handling logic.
+@item Configurable runtime checks help you strike a balance between performance
+and safety guarantees.
+@item Take advantage of vector types to express SIMD instructions portably.
+@end itemize")
+    (license l:expat)))
-- 
2.33.0





Information forwarded to guix-patches@HIDDEN:
bug#50449; Package guix-patches. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 7 Sep 2021 07:06:51 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Sep 07 03:06:51 2021
Received: from localhost ([127.0.0.1]:55327 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mNVBy-0007uf-W0
	for submit <at> debbugs.gnu.org; Tue, 07 Sep 2021 03:06:51 -0400
Received: from lists.gnu.org ([209.51.188.17]:55278)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <andrewpatt7@HIDDEN>) id 1mNTZY-0002vz-L5
 for submit <at> debbugs.gnu.org; Tue, 07 Sep 2021 01:23:05 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:42564)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <andrewpatt7@HIDDEN>)
 id 1mNTZY-0008VC-FJ
 for guix-patches@HIDDEN; Tue, 07 Sep 2021 01:23:04 -0400
Received: from mail-qt1-x82d.google.com ([2607:f8b0:4864:20::82d]:44563)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <andrewpatt7@HIDDEN>)
 id 1mNTZU-0004HJ-0z
 for guix-patches@HIDDEN; Tue, 07 Sep 2021 01:23:01 -0400
Received: by mail-qt1-x82d.google.com with SMTP id r21so6995086qtw.11
 for <guix-patches@HIDDEN>; Mon, 06 Sep 2021 22:22:59 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
 h=from:to:cc:subject:date:message-id:mime-version
 :content-transfer-encoding;
 bh=M+rA8+3Q2/reHSlhbHhBlqj72CCeyLhcHpj9j7Qi7kw=;
 b=SwCI4aN1EUHaIe7x3WjxQCJlqZ9d9yyj+f7hzCEgqJI9ZbxxNqDnURLhJbfACxl2Ym
 z8Za7i4IB33cGmp9WCJ9V2nuflpAzgpSKflBNyD+Tx2dBcEFEHf1X89Aig9VzuxmH36W
 OmkZ3NWkUCs2qnCJIniTFIsjWnQADlc3rCDl7E1TqxEXc8ZYq0U+UrU+RmOXrctQ5Ann
 R6tL1tt0GIgm1vX7qw/bnQf+b4t6diqG5o6azRzK0asLLBkFFr6kxIimz7NKPzXxQCBQ
 EojknJFBgGUzovfofxuGezU8kC3UBmcyQHXzvkc3QFS3Gqp8dr1AMYDZ0bi3qrxmDQCA
 ipBA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version
 :content-transfer-encoding;
 bh=M+rA8+3Q2/reHSlhbHhBlqj72CCeyLhcHpj9j7Qi7kw=;
 b=Hrzn7SieRsUPHLa55VFLUhNN4T2E10GUPF3eXWHF1NXaKdlBgTUtaVNWzKzinmDgHW
 8kMfpV7lJ3IqpHO9DYffXXvLFGCMZRrTspsUr+qlCP53A9YEyZIBpBoxxYwPB1xje4C9
 VGnJ1gRatRVP6tFkRH2/53IChK4L0jAonqQDJ4RJ1eiqfByEyl8r9urkzDxYUYPmq3Qu
 qs+TVGCJTp1L4qyihe9F+KyBNZ3C2mwKVCkh8gQ16RbJFOKyozLG3WbLdDK4L/PdIWHU
 z/CCjQVtNRxRcv7XfWJQsnaEuMrDe2isHXxOqEvdQDoKJILODqjFp7l7G06sLBCP0M/r
 4ucQ==
X-Gm-Message-State: AOAM53113Px++iK2T4pNH9RCDKJxl6+QlUWlethGMKwhFmWvSzu6PaN0
 TyLr9cC68kOeV0Pt2JZaPs+16R8q2Yk31Q==
X-Google-Smtp-Source: ABdhPJwrRFsMQSc1brvQZr8zHh/67SmU77+iUvCbNh/tAo240vGFOtUhlRoeIjhyKsEMzJrvl5aq3w==
X-Received: by 2002:ac8:24e:: with SMTP id o14mr13972082qtg.42.1630992178103; 
 Mon, 06 Sep 2021 22:22:58 -0700 (PDT)
Received: from localhost.localdomain ([2601:5c6:8000:98:4364:bb79:1fd4:2c19])
 by smtp.gmail.com with ESMTPSA id
 s16sm6630184qtq.31.2021.09.06.22.22.56
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 06 Sep 2021 22:22:57 -0700 (PDT)
From: Andrew Patterson <andrewpatt7@HIDDEN>
To: guix-patches@HIDDEN
Subject: [PATCH] Add zig
Date: Tue,  7 Sep 2021 01:22:28 -0400
Message-Id: <20210907052228.20761-1-andrewpatt7@HIDDEN>
X-Mailer: git-send-email 2.33.0
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Received-SPF: pass client-ip=2607:f8b0:4864:20::82d;
 envelope-from=andrewpatt7@HIDDEN; helo=mail-qt1-x82d.google.com
X-Spam_score_int: -17
X-Spam_score: -1.8
X-Spam_bar: -
X-Spam_report: (-1.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,
 FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001,
 RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001,
 SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -1.1 (-)
X-Debbugs-Envelope-To: submit
X-Mailman-Approved-At: Tue, 07 Sep 2021 03:06:50 -0400
Cc: Andrew Patterson <andrewpatt7@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.1 (--)

---
Note that this is a minor version behind; zig 0.8.0 depends on all the
clang headers version 12.x, and the current version of lld is 11.x.

 gnu/packages/zig.scm | 73 ++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 73 insertions(+)
 create mode 100644 gnu/packages/zig.scm

diff --git a/gnu/packages/zig.scm b/gnu/packages/zig.scm
new file mode 100644
index 0000000000..bb8af0c98d
--- /dev/null
+++ b/gnu/packages/zig.scm
@@ -0,0 +1,73 @@
+(define-module (gnu packages zig)
+  #:use-module (guix packages)
+  #:use-module (guix git-download)
+  #:use-module (guix build-system cmake)
+  #:use-module ((guix licenses) #:prefix l:)
+  #:use-module (guix build utils)
+  #:use-module (gnu packages)
+  #:use-module (gnu packages llvm)
+  #:use-module (guix utils))
+
+;; Zig versions depend on specific LLVM major versions; should be able to update
+;; to 0.8.x with lld@12
+(define-public zig
+  (package
+    (name "zig")
+    (version "0.7.1")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/ziglang/zig")
+             (commit version)))
+       (sha256
+        (base32
+         "0gq8xjqr3n38i2adkv9vf936frac80wh72dvhh4m5s66yafmhphg"))))
+    (build-system cmake-build-system)
+    (inputs
+     `(("llvm" ,llvm-11)
+       ("clang-toolchain" ,clang-toolchain-11)
+       ("lld" ,lld))) ; is currently version 11
+    (arguments
+     `(#:tests? #f
+       #:phases (modify-phases %standard-phases
+                  (add-before 'install 'set-cachedir
+                    (lambda* _ ;; See [[https://github.com/ziglang/zig/issues/6810]]
+                      (setenv "XDG_CACHE_HOME" "/tmp/"))))))
+    (home-page "https://ziglang.org/")
+    (synopsis
+     "Programming language for maintaining robust, optimal, and reusable software")
+    (description
+     "Zig is a general-purpose programming language and toolchain for
+maintaining robust, optimal, and reusable software.
+
+⚡ A Simple Language
+
+Focus on debugging your application rather than debugging your programming
+language knowledge.
+@itemize @bullet
+@item No hidden control flow.
+@item No hidden memory allocations.
+@item No preprocessor, no macros.
+@end itemize
+
+⚡ Comptime
+
+A fresh approach to metaprogramming based on compile-time code execution and
+lazy evaluation.
+@itemize @bullet
+@item Call any function at compile-time.
+@item Manipulate types as values without runtime overhead.
+@item Comptime emulates the target architecture.
+@end itemize
+
+⚡ Performance Meets Safety
+
+Write fast, clear code capable of handling all error conditions.
+@itemize @bullet
+@item The language gracefully guides your error handling logic.
+@item Configurable runtime checks help you strike a balance between performance
+and safety guarantees.
+@item Take advantage of vector types to express SIMD instructions portably.
+@end itemize")
+    (license l:expat)))
-- 
2.33.0





Acknowledgement sent to Andrew Patterson <andrewpatt7@HIDDEN>:
New bug report received and forwarded. Copy sent to guix-patches@HIDDEN. Full text available.
Report forwarded to guix-patches@HIDDEN:
bug#50449; Package guix-patches. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Thu, 9 Sep 2021 18:30:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.