GNU bug report logs - #47006
[PATCH] gnu: 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: Leo Prikler <leo.prikler@HIDDEN>; Keywords: patch; merged with #39480, #50449; dated Mon, 8 Mar 2021 13:15:02 UTC; Maintainer for guix-patches is guix-patches@HIDDEN.

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


Received: (at 47006) by debbugs.gnu.org; 9 Sep 2021 18:18:31 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Sep 09 14:18:31 2021
Received: from localhost ([127.0.0.1]:36210 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-0008EB-2N
	for submit <at> debbugs.gnu.org; Thu, 09 Sep 2021 14:18:31 -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: 47006
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#47006; Package guix-patches. Full text available.

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


Received: (at 47006) by debbugs.gnu.org; 9 Sep 2021 16:31:42 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Sep 09 12:31:42 2021
Received: from localhost ([127.0.0.1]:36081 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mOMxY-0005GI-2x
	for submit <at> debbugs.gnu.org; Thu, 09 Sep 2021 12:31:42 -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: 47006
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#47006; Package guix-patches. Full text available.

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


Received: (at 47006) by debbugs.gnu.org; 9 Sep 2021 13:50:09 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Sep 09 09:50:09 2021
Received: from localhost ([127.0.0.1]:34490 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mOKRM-0004Xn-Ha
	for submit <at> debbugs.gnu.org; Thu, 09 Sep 2021 09:50:09 -0400
Received: from mail-wm1-f65.google.com ([209.85.128.65]:45757)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <liliana.prikler@HIDDEN>) id 1mOKRG-0004We-8i
 for 47006 <at> debbugs.gnu.org; Thu, 09 Sep 2021 09:50:05 -0400
Received: by mail-wm1-f65.google.com with SMTP id
 j17-20020a05600c1c1100b002e754875260so1454254wms.4
 for <47006 <at> debbugs.gnu.org>; Thu, 09 Sep 2021 06:50:02 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
 h=message-id:in-reply-to:references:from:date:subject:to:cc
 :content-transfer-encoding:mime-version;
 bh=FBu1ieizj5eSnFR3fkeHb5whX2ottbKvQbbz5tfb/mY=;
 b=KdFYvzWfKdsECIB57fT4w0hdhTEnXVcqQIkWkBCIeEmR5lcYd/CPQ9cvqfYo8zp+Py
 jVfctm10QRjVZ7uMHbZxtgifz6PSQJU1JYG6I0PXoWhBuSxH7NZLSbyz3JJ2NeBUP3PX
 aUGbBgCSSdhaP/VEAO/7neJWB1VKzLWr9Pk4Dsk1oJjNB9xPf6NhXSGUVGhtI5keywj2
 UrEhZtxj0zGCOU35KgIdbrLj97YsjEf8IfnRiQux3uc8r+BxCENHv4MsngP/mbvnR+fv
 9TU+xJa0Av9Y109qRtCceVKPpRc4h9d/WNH8ZZOC3ZO0FiBxTUulp98iCNC2Dn3vIm1Y
 m5zw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=x-gm-message-state:message-id:in-reply-to:references:from:date
 :subject:to:cc:content-transfer-encoding:mime-version;
 bh=FBu1ieizj5eSnFR3fkeHb5whX2ottbKvQbbz5tfb/mY=;
 b=24mF+sHF1uTZA1s/AK6DpeKwa0mlachTTTcIrhnIIVvMfSWsIZFPqRFe5Px8xqj7XZ
 jty89MCvWrC9dUiE0QM8WAl2k1cuLOgpexk5rUIeS4Pf0tZ1UD7QfBgXSk/S0wiZb/2/
 x7KBkucwJJHZians7eTn9CXgMJxFmT0hNtS+PpR+qXwV8gIWhzm/RwlZOGi95APyf/wy
 VQMzx+9r/qXIyjq5B7/1qI674QHCYYpUSm8b0udL8CT9opkWrS2CgReuPkb+Cc+xmQD1
 jxXcE+c/QeCOaHKT+gRSGRjEvxZsZMbu7urWY4owlYTXjiUJo8lhZtvYJj5gRNXhfOpa
 n/0Q==
X-Gm-Message-State: AOAM533FJo7U0P1qBgsd3g8VSd6SspgOTXM6fUuwO6cQJgWqgjHVjTJl
 MIOMy0WFVA5uG1do/zKFBYi+NgeDdqw=
X-Google-Smtp-Source: ABdhPJyIP+raPA9uow/TZ9fqEjnQ9RW/RIHAQi6Y0HsYlx5LQDhOgG9/z8ncf1V2Uw6liM82BTCGJA==
X-Received: by 2002:a1c:7f84:: with SMTP id a126mr3074393wmd.33.1631195396168; 
 Thu, 09 Sep 2021 06:49:56 -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 j18sm1927967wrd.56.2021.09.09.06.49.54
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 09 Sep 2021 06:49:55 -0700 (PDT)
Message-Id: <0f6c5b692df8d06a0d7adddc9e5abf93894a366f.1631195387.git.liliana.prikler@HIDDEN>
In-Reply-To: <a1922b0a2ec237d217af54ed3ff7065e360d994c.camel@HIDDEN>
References: <a1922b0a2ec237d217af54ed3ff7065e360d994c.camel@HIDDEN>
From: Liliana Prikler <liliana.prikler@HIDDEN>
Date: Thu, 9 Sep 2021 15:32:20 +0200
Subject: [PATCH 1/2] gnu: lld: Update to 12.0.0.
to: 47006 <at> debbugs.gnu.org
Content-Transfer-Encoding: 7bit
MIME-Version: 1.0
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 47006
Cc: 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 (-)

* gnu/packages/llvm.scm (llvm-subprojects-origin, %llvm-project-12.0.0-hash):
New variables.
(lld-11, lld-12): New variables.
(lld): Point to lld-11.
---
 gnu/packages/llvm.scm | 44 ++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 43 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/llvm.scm b/gnu/packages/llvm.scm
index 4394194939..220116cbfb 100644
--- a/gnu/packages/llvm.scm
+++ b/gnu/packages/llvm.scm
@@ -92,6 +92,22 @@ as \"x86_64-linux\"."
   (string-append "https://github.com/llvm/llvm-project/releases/download"
                  "/llvmorg-" version "/" component "-" version ".src.tar.xz"))
 
+(define* (llvm-subprojects-origin components version base32-hash
+                                  #:optional (patches '()))
+  (origin
+    (method url-fetch)
+    (uri (llvm-uri "llvm-project" version))
+    (sha256 base32-hash)
+    (patches (map search-patch patches))
+    (modules '((guix build utils)
+               (ice-9 ftw)))
+    (snippet
+     `(for-each
+       (lambda (file)
+         (unless (member file '("." ".." ,@components))
+           (delete-file-recursively file)))
+       (scandir ".")))))
+
 (define* (clang-runtime-from-llvm llvm hash
                                   #:optional (patches '()))
   (package
@@ -882,7 +898,7 @@ of programming tools as well as libraries with equivalent functionality.")
 (define-public clang clang-9)
 (define-public clang-toolchain clang-toolchain-9)
 
-(define-public lld
+(define-public lld-11
   (package
     (name "lld")
     (version "11.0.0")
@@ -906,6 +922,32 @@ of programming tools as well as libraries with equivalent functionality.")
 components which highly leverage existing libraries in the larger LLVM Project.")
     (license license:asl2.0))) ; With LLVM exception
 
+(define %llvm-project-12.0.0-hash
+  (base32 "0a1n88dmbwp1ww7h3ykf0s001cndk1bm3i2cj1y2sh548f4nilcy"))
+
+(define-public lld-12
+  (package
+    (inherit lld-11)
+    (version "12.0.0")
+    (source (llvm-subprojects-origin '("lld" "libunwind") version
+                                     %llvm-project-12.0.0-hash))
+    (arguments
+     `(,@(package-arguments lld-11)
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'dissect
+           (lambda _
+             ;; Find libunwind in unpacked sources
+             (substitute* "lld/MachO/CMakeLists.txt"
+               (("\\$\\{LLVM_MAIN_SRC_DIR\\}/\\.\\./libunwind")
+                (string-append (getcwd) "/libunwind")))
+             ;; chdir to actual source folder
+             (chdir "lld"))))))
+    (inputs
+     `(("llvm" ,llvm-12)))))
+
+(define-public lld lld-11)
+
 (define-public lldb
   (package
     (name "lldb")
-- 
2.33.0






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

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


Received: (at 47006) by debbugs.gnu.org; 9 Sep 2021 13:50:06 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Sep 09 09:50:06 2021
Received: from localhost ([127.0.0.1]:34488 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mOKRJ-0004XQ-GH
	for submit <at> debbugs.gnu.org; Thu, 09 Sep 2021 09:50:06 -0400
Received: from mail-wr1-f67.google.com ([209.85.221.67]:43993)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <liliana.prikler@HIDDEN>) id 1mOKRG-0004Wg-T2
 for 47006 <at> debbugs.gnu.org; Thu, 09 Sep 2021 09:50:04 -0400
Received: by mail-wr1-f67.google.com with SMTP id b6so2654996wrh.10
 for <47006 <at> debbugs.gnu.org>; Thu, 09 Sep 2021 06:50:02 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
 h=message-id:in-reply-to:references:from:date:subject:to:cc
 :content-transfer-encoding:mime-version;
 bh=sBoiWQhi56Tn6F30u9LWk0Z40dlMnHKKJTK+Lfnpa5w=;
 b=AoLvgHuo7MW7nc+/b/UY5DFRBjN+Gsap4ALwL9kyQVXsALQ5ERt5oPJm0IxDARGCo9
 rb+ckb0bc/xGgieFb5GPlBKLGjc0p3g/FFLY3TxF7vEz3UEjMexuSohlomkJlCm6Eael
 9eM2i/GF2bnuzjXxmCSqATp1wo/Mw/HOV5trMFuMjnPV7Jk7j20TTj3EEkqf/HGe8htb
 mKjbXg+X3pNLGFY7sVN4VkPZqSHxXpRA+8rzbn7Wu8Twm+AgbHYHsrjACHuVSyZ12d7t
 C4ma9pOt8I24+ayMmoM0ooH5x5xHrRfCcQx1ClQlqBB1+SiXHFWY/I1VPWQ/aPBO3QFT
 AQjA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=x-gm-message-state:message-id:in-reply-to:references:from:date
 :subject:to:cc:content-transfer-encoding:mime-version;
 bh=sBoiWQhi56Tn6F30u9LWk0Z40dlMnHKKJTK+Lfnpa5w=;
 b=rCHwCg3Er7nxvplWfFwJW1XiUA6GES0TJlhExJDLMVVBT63dKWDGrYtk59716bUWmK
 g7r11ya4wCBAX3LBi6ckwNrw1VEwec+xz+RpN4QlFcS+6W1rmwzqCzChLYvtkwTa7PSe
 GEOXoH2MwRQ75PEdFaF+XCn3qaFvUvbLyR0J4ktH2miRyNwBSI87OG/pcGr+TIj1BQBy
 aNF31zC+xoQ1vKFRhOatsWwAkT6ZdrRk20gfiWvbVkxaF12jn+s7Y56A+SbAtiOGJ/Yw
 BEims1W30i11hBge7XnZfAfDq4/HXBc1kwEusOEzRvHEIQ1OQXd6aEebhbBVP7CD/noq
 UVgg==
X-Gm-Message-State: AOAM531ApO72jIndMl7lB8CWKWJrXmirlLJsQwyNuaAMLpcN6fS0rDmr
 CwUheZw0y7adYBdLQY37I1Ol+6yxOxo=
X-Google-Smtp-Source: ABdhPJzV5X7PPfwIwln70fXldrETGklUSQFRPDVF9XOEso3ucvlI8ykXhkPArFyva9Itqv/NQmmxeQ==
X-Received: by 2002:adf:916f:: with SMTP id j102mr3671247wrj.422.1631195397055; 
 Thu, 09 Sep 2021 06:49:57 -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 j18sm1927967wrd.56.2021.09.09.06.49.56
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 09 Sep 2021 06:49:56 -0700 (PDT)
Message-Id: <7e0456e51a420958dc9a2809f1e52e2ad444ace6.1631195387.git.liliana.prikler@HIDDEN>
In-Reply-To: <a1922b0a2ec237d217af54ed3ff7065e360d994c.camel@HIDDEN>
References: <a1922b0a2ec237d217af54ed3ff7065e360d994c.camel@HIDDEN>
From: Liliana Prikler <liliana.prikler@HIDDEN>
Date: Thu, 9 Sep 2021 15:32:22 +0200
Subject: [PATCH 2/2] gnu: Add zig.
to: 47006 <at> debbugs.gnu.org
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
X-Spam-Score: 1.0 (+)
X-Debbugs-Envelope-To: 47006
Cc: 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: -0.0 (/)

* 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)))
+    (arguments
+     `(#:tests? #f                       ; no check target
+       #: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"))))))))
+    (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)))
-- 
2.33.0






Information forwarded to guix-patches@HIDDEN:
bug#47006; 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.
Merged 39480 47006. Request was from Leo Prikler <leo.prikler@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

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


Received: (at 47006) by debbugs.gnu.org; 30 May 2021 09:32:51 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun May 30 05:32:51 2021
Received: from localhost ([127.0.0.1]:58411 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1lnHoR-0004FP-0e
	for submit <at> debbugs.gnu.org; Sun, 30 May 2021 05:32:51 -0400
Received: from mail-wr1-f43.google.com ([209.85.221.43]:43664)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <sharlatanus@HIDDEN>) id 1lnHoP-0004FA-1F
 for 47006 <at> debbugs.gnu.org; Sun, 30 May 2021 05:32:49 -0400
Received: by mail-wr1-f43.google.com with SMTP id v23so5366078wrd.10
 for <47006 <at> debbugs.gnu.org>; Sun, 30 May 2021 02:32:48 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=mime-version:from:date:message-id:subject:to;
 bh=MvsTN9H1/5RghS8L9dSGayDKL0iQtk84COy+zUWv43U=;
 b=dqDCuPwcX668PkR1V78r59lvmMckv1l110yBxRTNKji/ZZg3yiqHRRCRd6IWh0seGA
 TbeJ/Zx/PdEkxWvSL3TsRiisVCtggF5hs84JdYJiQqDIHDg0L5bOHmi4RxkpWc7+KFD/
 07rY7ox5Z0ariKS3t4rei+Um1hw1DFcWsx4d6J/KPzcdkeomZ45iYJkl6FmrYz2LSkIF
 1R4CMq+SLvifT3EGzkX69KAQ6oqqrELmQo2LAsM6Wb8D+k+nJoL+wOv6ZOplDqJAZ96a
 mCilqxlX7wsHb1knzkRxW9bs8UkQ2PXp+aWqZVpdSSJbDUjReCgy1WNqdIVO3+oCY17L
 xnmw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:mime-version:from:date:message-id:subject:to;
 bh=MvsTN9H1/5RghS8L9dSGayDKL0iQtk84COy+zUWv43U=;
 b=sRr/D8QUFkJVy086H+7S0WsqlX87G+miforRWGdqTXXXtTo6dRg81LfRJy+vRD6xL5
 izjaCOMoQVnrushHCTwJzlWyHxhLdwfJBGNkawcjzCHB67UfpglomAaMbvrGvhWV30yR
 XRL0adhKr0TLgbhAA0xmiaJeddJ4VCHoR5V3PLAEuJwxc5clQACltQloSfYzVaItiANH
 AI2pKWOc8llXgtUdeWM2aoW8+g9GpwMJx3c337U6OdFoiKuXZ0WaihXuzJc9GebzaYdY
 iicZBC1nJ5iXtEqs/meJ4Y+JbIBiKai0dX4LXM/ukU5MeX8jogFRG4oBI/P+5ApMejE1
 UcmQ==
X-Gm-Message-State: AOAM532k7uZy4tFXlrxkTSHAaJzY9pgbzIGHOwXcgLq4lD934QVivv0b
 ZDEMv79DPbLZ92ipkwLb68KKwws5f7pHzJFop+a/R+Y1
X-Google-Smtp-Source: ABdhPJwvxQaSiKWcHDhbKDG/zHGhI+bG8TwMCMR/z2NafR0O7HLs2K5i1bAqKEwv9LDStAYk8nC1CdVu6JFKwLs67DM=
X-Received: by 2002:adf:e48b:: with SMTP id i11mr17187865wrm.228.1622367163176; 
 Sun, 30 May 2021 02:32:43 -0700 (PDT)
MIME-Version: 1.0
From: Sharlatan Hellseher <sharlatanus@HIDDEN>
Date: Sun, 30 May 2021 10:32:33 +0100
Message-ID: <CAO+9K5rVT+2JZT==XcqNe0s-TJkAboC9Re3pQ4t-wWGM53ByNQ@HIDDEN>
Subject: Zig question
To: 47006 <at> debbugs.gnu.org
Content-Type: multipart/alternative; boundary="00000000000074d84605c388ca8c"
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 47006
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 (-)

--00000000000074d84605c388ca8c
Content-Type: text/plain; charset="UTF-8"

Hi Guix team.


There is an open issue from 2020 adding zig

 https://issues.guix.gnu.org/39480

it probably could be linked to this one #47006

Zig has it's own build system:

 zig build

it will be usefully to have a guix native build system as well when
compiler is merged.

https://ziglang.org/learn/overview/#zig-build-system

It also has a language server https://github.com/zigtools/zls

--00000000000074d84605c388ca8c
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"auto"><div style=3D"font-family:sans-serif;font-size:12.8px" di=
r=3D"auto"><div style=3D"width:455.378px;margin:15px 0px"><div><div dir=3D"=
auto">Hi Guix team.<div dir=3D"auto"><br></div><div dir=3D"auto"><br></div>=
<div dir=3D"auto">There is an open issue from 2020 adding zig</div><div dir=
=3D"auto"><br></div><div dir=3D"auto">=C2=A0<a href=3D"https://issues.guix.=
gnu.org/39480" style=3D"text-decoration-line:none;color:rgb(66,133,244)">ht=
tps://issues.guix.gnu.org/39480</a>=C2=A0</div><div dir=3D"auto"><br></div>=
<div dir=3D"auto">it probably could be linked to this one #47006</div><div =
dir=3D"auto"><br></div><div dir=3D"auto">Zig has it&#39;s own build system:=
</div><div dir=3D"auto"><br></div><div dir=3D"auto">=C2=A0zig build</div><d=
iv dir=3D"auto"><br></div><div dir=3D"auto">it will be usefully to have a g=
uix native build system as well when compiler is merged.=C2=A0=C2=A0</div><=
div dir=3D"auto"><br></div><div dir=3D"auto"><a href=3D"https://ziglang.org=
/learn/overview/#zig-build-system" style=3D"text-decoration-line:none;color=
:rgb(66,133,244)">https://ziglang.org/learn/overview/#zig-build-system</a><=
br></div><div dir=3D"auto"><br></div><div dir=3D"auto">It also has a langua=
ge server=C2=A0<a href=3D"https://github.com/zigtools/zls" style=3D"text-de=
coration-line:none;color:rgb(66,133,244)">https://github.com/zigtools/zls</=
a></div></div></div></div><div style=3D"height:0px"></div></div><div style=
=3D"font-family:sans-serif;font-size:12.8px" dir=3D"auto"><br></div></div>

--00000000000074d84605c388ca8c--




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

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


Received: (at 47006) by debbugs.gnu.org; 11 Apr 2021 21:04:23 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Apr 11 17:04:23 2021
Received: from localhost ([127.0.0.1]:55942 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1lVhFn-00015w-1Y
	for submit <at> debbugs.gnu.org; Sun, 11 Apr 2021 17:04:23 -0400
Received: from michel.telenet-ops.be ([195.130.137.88]:33398)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <maximedevos@HIDDEN>) id 1lVhFl-00015n-8Q
 for 47006 <at> debbugs.gnu.org; Sun, 11 Apr 2021 17:04:22 -0400
Received: from ptr-bvsjgyjmffd7q9timvx.18120a2.ip6.access.telenet.be
 ([IPv6:2a02:1811:8c09:9d00:aaf1:9810:a0b8:a55d])
 by michel.telenet-ops.be with bizsmtp
 id rZ4K2400A0mfAB406Z4KXT; Sun, 11 Apr 2021 23:04:19 +0200
Message-ID: <8937efa5c022c9791a0402cf561384057b29bc77.camel@HIDDEN>
Subject: Re: [PATCH] gnu: Add zig.
From: Maxime Devos <maximedevos@HIDDEN>
To: 47006 <at> debbugs.gnu.org
Date: Sun, 11 Apr 2021 23:04:15 +0200
Content-Type: multipart/signed; micalg="pgp-sha512";
 protocol="application/pgp-signature"; boundary="=-kmhHoyzuIB5nzwlzP0xq"
User-Agent: Evolution 3.34.2 
MIME-Version: 1.0
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r21;
 t=1618175059; bh=EltjjgW36T5IbxSLHs3r58GyCyD5cJnGe1chRk2PhLQ=;
 h=Subject:From:To:Date;
 b=PyVRgul/p0o14bpEAajxJoA3jQYoHNUbVsx7DX0IYfFhfpMX/DtJvdkkdkbz8c983
 YKNUXZpCsVSJhTmhr61Nc2HSk37e1Kg4PYzw1qC/Heh0Ql00JlrZl76tfXl3QfnYk2
 i0iDzN7iZXsptL3ubuotC0gsViu2SQZvXC7Y4VZxuq5dtQQhBgm6X5IbktiXkjPrUP
 9tzL9oQFzaSUl/s2g6Ha+jCArHJp3uN1DjZBuyeT4+v+dBjJsBrQLj4TAe6pzJqiUJ
 Z9Q9TADmMCIB99WU/3jtLU2A8O9p6eRy8t6h5K8pjeUzgdikEUt30iphzhVT7rf5u4
 bpjOZDH7ixlnw==
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 47006
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.7 (-)


--=-kmhHoyzuIB5nzwlzP0xq
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

One comment below.

> +    (native-inputs
> +     `(("clang" ,clang-11)
> +       ("lld" ,lld)
> +       ("llvm" ,llvm-11)))

This looks rather suspicious from a cross-compilation perspective.
IIUC, lld and llvm are used for two purposes:

* for compiling the "zig" compiler  --> native-inputs is ok
  (or is GCC used to compile the zig compiler?)
* as a run-time dependency of "zig" --> should be 'inputs'

Therefore, shouldn't "lld" and "llvm" be added to "inputs" as well?

TODO to self: define a variant of disallowed-references
disallowed-references/native that refers to the package in 'native-inputs'
instead of 'inputs'.

Perhaps explicitely whitelist some inputs (llvm, lld, maybe some implicit
libc inputs?).

Note: according to me, *all* inputs in native-inputs should be added
to disallowed-references *by default* when cross-compiling.

Alternatively, I guess =E2=80=98we=E2=80=99 could simply add a comment
;; Cross-compilation is currently unsupported.
and leave cross-compilation for later.  My comments are mostly about
=E2=80=98giving the good example=E2=80=99 on how to use inputs & native-inp=
uts and avoid
giving =E2=80=98bad examples=E2=80=99 of package definitions without markin=
g them as such.

Greetings,
Maxime.

--=-kmhHoyzuIB5nzwlzP0xq
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: This is a digitally signed message part
Content-Transfer-Encoding: 7bit

-----BEGIN PGP SIGNATURE-----

iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYHNkTxccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7k8tAQDhufNU+AXFtLQEUOWjgqb/7s8O
wb3gzwJ5NbTLpA+n4wEA60aECkxtERa4HaNzl5XDHHRPPXBoL+xG/W2bghBuGw8=
=tY8T
-----END PGP SIGNATURE-----

--=-kmhHoyzuIB5nzwlzP0xq--





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

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


Received: (at 47006) by debbugs.gnu.org; 9 Apr 2021 22:21:43 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Apr 09 18:21:43 2021
Received: from localhost ([127.0.0.1]:51115 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1lUzVX-0005KV-IP
	for submit <at> debbugs.gnu.org; Fri, 09 Apr 2021 18:21:43 -0400
Received: from mail-40132.protonmail.ch ([185.70.40.132]:57546)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <terramorpha@HIDDEN>) id 1lUzRk-0005Dv-G5
 for 47006 <at> debbugs.gnu.org; Fri, 09 Apr 2021 18:17:49 -0400
Date: Fri, 09 Apr 2021 22:17:32 +0000
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com;
 s=protonmail; t=1618006661;
 bh=vILsTXoobF1Y/zjyG/ZC5W90KT7SlwGik6CqVjSp17A=;
 h=Date:To:From:Reply-To:Subject:From;
 b=HR8Vezj1YzglK//XhsfLZ6aiM96l//bvX2lRIWu6tmlaZlQx+XidMBfjTkjteYmib
 jU7anlW5ZEZ9Wn6rMpM48EwZwH3Roxd/6NRQemoTFXujly5HUKvsHTbJZ21bICXAhV
 BuR0Ahs3K6lMgpE0bkjYh1kC8IHoo1zCKWXFwG+s=
To: "47006 <at> debbugs.gnu.org" <47006 <at> debbugs.gnu.org>
From: terramorpha@HIDDEN
Subject: (No Subject)
Message-ID: <FGe2Nnzhpn8bKzjuBI1k4XKd_xFvRa7OzA7t7fRbK-ii4F3m-Kd55HArNciMyqwe2P1u8TKe3v_GfUwR9aL2AReXfMliQxC7Xr8ssWXCII0=@protonmail.com>
MIME-Version: 1.0
Content-Type: multipart/alternative;
 boundary="b1_MV7t6MjTFEs3runDDor3nxq1QDdAJe2nvIq2btNeU"
X-Spam-Status: No, score=-1.2 required=10.0 tests=ALL_TRUSTED,DKIM_SIGNED,
 DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,HTML_MESSAGE
 shortcircuit=no autolearn=disabled version=3.4.4
X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on
 mailout.protonmail.ch
X-Spam-Score: 1.3 (+)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 Content preview:  Hi,
 are there any issues left preventing this patch from being
 merged? If so, I can help. I would love to see Zig packaged in guix. Hi,
 are there any issues left preventing this patch from being merged? If so,
 I can help. I would love to see Zig packaged in guix. 
 Content analysis details:   (1.3 points, 10.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 2.0 SLIGHTLY_BAD_SUBJECT   Subject contains something slightly spammy
 0.0 RCVD_IN_MSPIKE_H3      RBL: Good reputation (+3)
 [185.70.40.132 listed in wl.mailspike.net]
 -0.7 RCVD_IN_DNSWL_LOW      RBL: Sender listed at https://www.dnswl.org/,
 low trust [185.70.40.132 listed in list.dnswl.org]
 -0.0 SPF_PASS               SPF: sender matches SPF record
 0.0 FREEMAIL_FROM          Sender email is commonly abused enduser mail
 provider (terramorpha[at]protonmail.com)
 -0.0 SPF_HELO_PASS          SPF: HELO matches SPF record
 0.0 HTML_MESSAGE           BODY: HTML included in message
 0.0 RCVD_IN_MSPIKE_WL      Mailspike good senders
X-Debbugs-Envelope-To: 47006
X-Mailman-Approved-At: Fri, 09 Apr 2021 18:21:43 -0400
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>
Reply-To: terramorpha@HIDDEN
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 0.3 (/)

This is a multi-part message in MIME format.

--b1_MV7t6MjTFEs3runDDor3nxq1QDdAJe2nvIq2btNeU
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: base64

SGksIGFyZSB0aGVyZSBhbnkgaXNzdWVzIGxlZnQgcHJldmVudGluZyB0aGlzIHBhdGNoIGZyb20g
YmVpbmcgbWVyZ2VkPyBJZiBzbywgSSBjYW4gaGVscC4gSSB3b3VsZCBsb3ZlIHRvIHNlZSBaaWcg
cGFja2FnZWQgaW4gZ3VpeC4=

--b1_MV7t6MjTFEs3runDDor3nxq1QDdAJe2nvIq2btNeU
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: base64

PGRpdj5IaSwgYXJlIHRoZXJlIGFueSBpc3N1ZXMgbGVmdCBwcmV2ZW50aW5nIHRoaXMgcGF0Y2gg
ZnJvbSBiZWluZyBtZXJnZWQ/IElmIHNvLCBJIGNhbiBoZWxwLiBJIHdvdWxkIGxvdmUgdG8gc2Vl
IFppZyBwYWNrYWdlZCBpbiBndWl4LjwvZGl2Pg==


--b1_MV7t6MjTFEs3runDDor3nxq1QDdAJe2nvIq2btNeU--





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

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


Received: (at 47006) by debbugs.gnu.org; 17 Mar 2021 07:05:40 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Mar 17 03:05:40 2021
Received: from localhost ([127.0.0.1]:41754 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1lMQFQ-0001DM-Au
	for submit <at> debbugs.gnu.org; Wed, 17 Mar 2021 03:05:40 -0400
Received: from mail.zaclys.net ([178.33.93.72]:51497)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <lle-bout@HIDDEN>) id 1lMQFO-0001DA-GN
 for 47006 <at> debbugs.gnu.org; Wed, 17 Mar 2021 03:05:38 -0400
Received: from guix-xps.local (82-64-145-38.subs.proxad.net [82.64.145.38])
 (authenticated bits=0)
 by mail.zaclys.net (8.14.7/8.14.7) with ESMTP id 12H75WZc050502
 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO)
 for <47006 <at> debbugs.gnu.org>; Wed, 17 Mar 2021 08:05:33 +0100
DMARC-Filter: OpenDMARC Filter v1.3.2 mail.zaclys.net 12H75WZc050502
Authentication-Results: mail.zaclys.net;
 dmarc=fail (p=reject dis=none) header.from=zaclys.net
Authentication-Results: mail.zaclys.net;
 spf=fail smtp.mailfrom=lle-bout@HIDDEN
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zaclys.net;
 s=default; t=1615964733;
 bh=x6RiyBP5AQ7kljqPObf+v6Me5EvzpLif1X10/ytYTX8=;
 h=Subject:From:To:Date:From;
 b=C1ad17+4JfGFvWVejsimrr/Qt0nVLty2esOItOjyZrB0hHuqRTnPHBTEWBNjNkuxL
 UGXnYvyOPuKsGWuB/jqfL+wzz6jKd5QlNWkjcYeEFSfq/8xwBnTXH5+zkzuTPMr6dD
 T5hrYvCU2iUg+/HecAadszzCt/ikIAxZ0J8YDYEs=
Message-ID: <0c5725ad6fa6154f107c71b18fcaab624f6e75e4.camel@HIDDEN>
Subject: [PATCH] gnu: Add zig.
From: =?ISO-8859-1?Q?L=E9o?= Le Bouter <lle-bout@HIDDEN>
To: 47006 <at> debbugs.gnu.org
Date: Wed, 17 Mar 2021 08:05:32 +0100
Content-Type: multipart/signed; micalg="pgp-sha512";
 protocol="application/pgp-signature"; boundary="=-aNpqnACTwKXFhLMvk6rW"
User-Agent: Evolution 3.34.2 
MIME-Version: 1.0
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 47006
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 (-)


--=-aNpqnACTwKXFhLMvk6rW
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Another patch submission for Zig was sent:=20
https://issues.guix.gnu.org/47206 (I closed and directed them here for
cooperation instead). But still have a look there for any improvements
to the current patch.

--=-aNpqnACTwKXFhLMvk6rW
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: This is a digitally signed message part
Content-Transfer-Encoding: 7bit

-----BEGIN PGP SIGNATURE-----

iQIzBAABCgAdFiEEFIvLi9gL+xax3g6RRaix6GvNEKYFAmBRqjwACgkQRaix6GvN
EKYblhAAoomapMxAv8wc3k1cs+KI5s04ktCKaVdzEBokHc6UB8Ag6b+dJUnqqbD2
pc1QaCQpCBtmAk+r5ehNw/Zs/vsYXf5f7MACOqN673PWFBwZXotl3bL6m7Vehmlm
puboUvsyX162iWuDoqH0OAQ2Ge1GYJ8NSZnNJZQgDJyMqKDJ7NP16RxKUcoC1BED
dF1sVV+8XohaKdnLhQl/pgwmc3yYyYZwb0idoMEvydfnqjWZKYZBSlhXb9xBWEcm
rl5axewIhWa2WZZ1oTcrBV9FO8wgdeffQtvvYSS/ybO+yAuXnmdMDqVTU9wC2qPS
gK3zPKM9hlOR/0JafEXysDKGU5PGXPrbuFn8gS7cNBaKBCjoBTlqT2MjlQX1ZzIR
2DG8eYk3XukrGGEpVA/R62/Ru4PoR+6KC2pidoIFTSMszPZyq2dX79ShI8WlXC/M
4eI/4OSguGgU9pezRWVEl/0dYb+NvAuxJTN8EuFWcJ6xwG+egOfdPQY0AgG+Nn2T
RHZ0rSELmE7oxrLu5mqv6smvKD9Eu7u3DlKL62j0uoaU8Wql14hx4sls8iHRUqYG
suTtnh+0/GNTAzTPNzRZfvqgHme/xqZxNztY9Tajp9/rqYk1rJv3F+L7NtyfV5LX
HXqqtYCOo4nGpiNP6FPgamtliQunk2iAgN5hZcPiVXiIa/cvX9o=
=L7XK
-----END PGP SIGNATURE-----

--=-aNpqnACTwKXFhLMvk6rW--





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

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


Received: (at 47006) by debbugs.gnu.org; 16 Mar 2021 13:09:42 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Mar 16 09:09:42 2021
Received: from localhost ([127.0.0.1]:38484 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1lM9S9-00067k-TB
	for submit <at> debbugs.gnu.org; Tue, 16 Mar 2021 09:09:42 -0400
Received: from mailrelay.tugraz.at ([129.27.2.202]:56094)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <leo.prikler@HIDDEN>) id 1lM9S7-00067a-62
 for 47006 <at> debbugs.gnu.org; Tue, 16 Mar 2021 09:09:39 -0400
Received: from nijino.local (217-149-164-20.nat.highway.telekom.at
 [217.149.164.20])
 by mailrelay.tugraz.at (Postfix) with ESMTPSA id 4F0DCM5fwKz3w9M;
 Tue, 16 Mar 2021 14:09:35 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tugraz.at;
 s=mailrelay; t=1615900175;
 bh=ioNpzdqqOM/zj+0Q5a3p1HQtGAAH0XmikSg1i/7I5GI=;
 h=Subject:From:To:Cc:Date:In-Reply-To:References;
 b=oft8ADha96J+6Ce8I5G8MvQO/QCgKG3YyNN+2UuyZcE/gyk8HDGC4ayY+W5KmqGPv
 v/76gOReEUSkRpT2JNGKHNh9qOf2O3wrJCI6efSmy5KjaumJlWtlyO/MLh9ddDc1Yh
 7eeh+0G6eeSRnfudoiff19qQNdgshKt2UMGQkU68=
Message-ID: <a53079580e424ca83966a2f0796b5f7722d10290.camel@HIDDEN>
Subject: Re: [bug#47006] [PATCH] gnu: Add zig.
From: Leo Prikler <leo.prikler@HIDDEN>
To: Efraim Flashner <efraim@HIDDEN>
Date: Tue, 16 Mar 2021 14:09:34 +0100
In-Reply-To: <YFCrPGrTIm/F5mWi@3900XT>
References: <20210308131155.7441-1-leo.prikler@HIDDEN>
 <YFCrPGrTIm/F5mWi@3900XT>
Content-Type: text/plain; charset="UTF-8"
User-Agent: Evolution 3.34.2 
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
X-TUG-Backscatter-control: bt4lQm5Tva3SBgCuw0EnZw
X-Spam-Scanner: SpamAssassin 3.003001 
X-Spam-Score-relay: -1.9
X-Scanned-By: MIMEDefang 2.74 on 129.27.10.116
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 47006
Cc: 47006 <at> debbugs.gnu.org
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: -3.3 (---)

Am Dienstag, den 16.03.2021, 14:57 +0200 schrieb Efraim Flashner:
> On Mon, Mar 08, 2021 at 02:11:56PM +0100, Leo Prikler wrote:
> > +    (native-inputs
> > +     `(("clang" ,clang-11)
> > +       ("lld" ,lld)
> > +       ("llvm" ,llvm-11)))
> 
> Does it work to replace these three with clang-toolchain-11?
You can replace clang+llvm by clang-toolchain, but IIUC we prefer the
explicit style in Guix.  Correct me if I'm wrong.

Regards,
Leo





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

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


Received: (at 47006) by debbugs.gnu.org; 16 Mar 2021 12:58:20 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Mar 16 08:58:20 2021
Received: from localhost ([127.0.0.1]:38441 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1lM9H9-0005o7-Tf
	for submit <at> debbugs.gnu.org; Tue, 16 Mar 2021 08:58:20 -0400
Received: from flashner.co.il ([178.62.234.194]:54462)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <efraim@HIDDEN>) id 1lM9H7-0005nu-6j
 for 47006 <at> debbugs.gnu.org; Tue, 16 Mar 2021 08:58:18 -0400
Received: from localhost (unknown [31.210.181.184])
 by flashner.co.il (Postfix) with ESMTPSA id 55B2340160;
 Tue, 16 Mar 2021 12:58:10 +0000 (UTC)
Date: Tue, 16 Mar 2021 14:57:32 +0200
From: Efraim Flashner <efraim@HIDDEN>
To: Leo Prikler <leo.prikler@HIDDEN>
Subject: Re: [bug#47006] [PATCH] gnu: Add zig.
Message-ID: <YFCrPGrTIm/F5mWi@3900XT>
References: <20210308131155.7441-1-leo.prikler@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha512;
 protocol="application/pgp-signature"; boundary="ZClCR6dXkjsIUozD"
Content-Disposition: inline
In-Reply-To: <20210308131155.7441-1-leo.prikler@HIDDEN>
X-PGP-Key-ID: 0x41AAE7DCCA3D8351
X-PGP-Key: https://flashner.co.il/~efraim/efraim_flashner.asc
X-PGP-Fingerprint: A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 47006
Cc: 47006 <at> debbugs.gnu.org
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 (-)


--ZClCR6dXkjsIUozD
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Mon, Mar 08, 2021 at 02:11:56PM +0100, Leo Prikler wrote:
> * gnu/packages/zig.scm: New file.
> * gnu/local.mk (GNU_SYSTEM_MODULES): Add it here.
> ---
>  gnu/local.mk         |  1 +
>  gnu/packages/zig.scm | 65 ++++++++++++++++++++++++++++++++++++++++++++
>  2 files changed, 66 insertions(+)
>  create mode 100644 gnu/packages/zig.scm
>=20
> diff --git a/gnu/local.mk b/gnu/local.mk
> index fb3b395852..abcf86fb7e 100644
> --- a/gnu/local.mk
> +++ b/gnu/local.mk
> @@ -586,6 +586,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..caf0a5e21a
> --- /dev/null
> +++ b/gnu/packages/zig.scm
> @@ -0,0 +1,65 @@
> +;;; 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.7.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 "1z6c4ym9jmga46cw2arn7zv2drcpmrf3vw139gscxp27n7q2z5md"))=
))
> +    (build-system cmake-build-system)
> +    (native-inputs
> +     `(("clang" ,clang-11)
> +       ("lld" ,lld)
> +       ("llvm" ,llvm-11)))

Does it work to replace these three with clang-toolchain-11?

> +    (arguments
> +     `(#:tests? #f                       ; no check target
> +       #:phases
> +       (modify-phases %standard-phases
> +         (add-after 'configure 'set-home
> +           (lambda _
> +             (setenv "HOME" (getcwd))    ; zig writes to $HOME/.cache
> +             #t)))))
> +    (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)))
> --=20
> 2.30.1
>=20
>=20
>=20
>=20

--=20
Efraim Flashner   <efraim@HIDDEN>   =D7=90=D7=A4=D7=A8=D7=99=D7=9D =
=D7=A4=D7=9C=D7=A9=D7=A0=D7=A8
GPG key =3D A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted

--ZClCR6dXkjsIUozD
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQIzBAABCgAdFiEEoov0DD5VE3JmLRT3Qarn3Mo9g1EFAmBQqzkACgkQQarn3Mo9
g1HX/w/+OZZFFTqSTVwvL4drj2bu1MYz/cXmE7WXMUn5XJdw+hMZour+DfHk8zrm
kd64lVazm5/mOvpLtw778y4LV/9XNjEO/ix3q4Hh3vtVMcxY0qXQTNIRg1WpXNnm
RjGGHv/ELBUft/27EkWvzcHxcNQSRD784RWhBbRhRTFp4xiktv0tQpuuIYJR23k0
Gi5F2ybYduuZridPe/Xl6JB9A2kB/uCoCp5qNPAiVNfXRQAbtcQ5zrBMq85F9YZh
0V/nY1cubvDrB6sDwQBLyO97frzUIydVw1IlZgGksBjQ7XEeRt1bbMlddyT6DLWm
ywNMn1lN6U11xMyzDs8MWXsllcC+EN06+f8lWZskbRHQF9EFnDUhA7cph6WTOZht
W325w/yloo0u5CtZNig6uDUTGy3ZOwBsapMAxq03YCQO326zNthKzWWuxEAD8rdT
aCX3Kvfl70KJmDdwcJLtxOxipLMZ9TzxIjfUJgcf9X3pVeyypIXgHe1Zt4KHfj1+
oRyt+2Aw+Sc9IPJXk81sbB1gcQs1z2ty79zZdGGfpnNL0ngP43COHbbYrG1NMarQ
o6qPHSPVLgIuAOrSfC8hibxsHEGAmTWiBuRVCeYec2BjRHif0xDCJMKWHG1pLyHt
NV/IUHifg4kBC0WxquTdYuP06qTpX7brYT/+CW7uGzjNygpcY5U=
=gXVo
-----END PGP SIGNATURE-----

--ZClCR6dXkjsIUozD--




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

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


Received: (at 47006) by debbugs.gnu.org; 15 Mar 2021 14:21:25 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Mar 15 10:21:25 2021
Received: from localhost ([127.0.0.1]:36308 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1lLo61-0002PY-AX
	for submit <at> debbugs.gnu.org; Mon, 15 Mar 2021 10:21:25 -0400
Received: from mail.zaclys.net ([178.33.93.72]:54373)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <lle-bout@HIDDEN>) id 1lLo5t-0002P0-KY
 for 47006 <at> debbugs.gnu.org; Mon, 15 Mar 2021 10:21:22 -0400
Received: from localhost.localdomain (82-64-145-38.subs.proxad.net
 [82.64.145.38]) (authenticated bits=0)
 by mail.zaclys.net (8.14.7/8.14.7) with ESMTP id 12FEL8nb026359
 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO);
 Mon, 15 Mar 2021 15:21:10 +0100
DMARC-Filter: OpenDMARC Filter v1.3.2 mail.zaclys.net 12FEL8nb026359
Authentication-Results: mail.zaclys.net;
 dmarc=fail (p=reject dis=none) header.from=zaclys.net
Authentication-Results: mail.zaclys.net;
 spf=fail smtp.mailfrom=lle-bout@HIDDEN
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zaclys.net;
 s=default; t=1615818070;
 bh=yulflcoIPLqBDgqSRfbI7i6i7E+GRbUk/9hnfRHsYNY=;
 h=From:To:Cc:Subject:Date:In-Reply-To:References:From;
 b=ZYg4+FCtKNSLxNfHDDWn+agHJMeikOfaSL4olk5tQrBwMPRKOQ8b3q7Jre2RM6Jl3
 cZ4u3iaZ2alKMQrqk4KrkJLfJIOBAGezcHpS+XYH/YYnfRBsk4Bz7TNv4Dvg34syzi
 3NdDzvj46UgUbEkEkmKg6UilxT4Eyj8I1Fr0HFDY=
From: =?UTF-8?q?L=C3=A9o=20Le=20Bouter?= <lle-bout@HIDDEN>
To: 47006 <at> debbugs.gnu.org
Subject: [PATCH v2 1/1] gnu: Add zig.
Date: Mon, 15 Mar 2021 15:20:45 +0100
Message-Id: <20210315142045.25392-2-lle-bout@HIDDEN>
X-Mailer: git-send-email 2.30.2
In-Reply-To: <20210315142045.25392-1-lle-bout@HIDDEN>
References: <20210315142045.25392-1-lle-bout@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 47006
Cc: =?UTF-8?q?L=C3=A9o=20Le=20Bouter?= <lle-bout@HIDDEN>,
 Leo Prikler <leo.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: -1.0 (-)

From: Leo Prikler <leo.prikler@HIDDEN>

* gnu/packages/zig.scm: New file.
* gnu/local.mk (GNU_SYSTEM_MODULES): Add it here.

Co-authored-by: Léo Le Bouter <lle-bout@HIDDEN>
---
 gnu/local.mk         |  1 +
 gnu/packages/zig.scm | 76 ++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 77 insertions(+)
 create mode 100644 gnu/packages/zig.scm

diff --git a/gnu/local.mk b/gnu/local.mk
index cf8849cf59..ffa8005533 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -586,6 +586,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..adc4c3e1e0
--- /dev/null
+++ b/gnu/packages/zig.scm
@@ -0,0 +1,76 @@
+;;; 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.7.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 "1z6c4ym9jmga46cw2arn7zv2drcpmrf3vw139gscxp27n7q2z5md"))))
+    (build-system cmake-build-system)
+    (native-inputs
+     `(("clang" ,clang-11)
+       ("lld" ,lld)
+       ("llvm" ,llvm-11)))
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'save-unpack-dir
+           (lambda _
+             ;; HACK: Passing unpacked source directory to 'check phase.
+             (setenv "ZIG_UNPACK_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 #:allow-other-keys)
+             (with-directory-excursion (getenv "ZIG_UNPACK_DIR")
+               (invoke (string-append (assoc-ref outputs "out") "/bin/zig")
+                       "build" "test"))
+             #t)))))
+    (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)))
-- 
2.30.2





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

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


Received: (at 47006) by debbugs.gnu.org; 15 Mar 2021 14:21:22 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Mar 15 10:21:22 2021
Received: from localhost ([127.0.0.1]:36306 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1lLo5x-0002PF-QT
	for submit <at> debbugs.gnu.org; Mon, 15 Mar 2021 10:21:22 -0400
Received: from mail.zaclys.net ([178.33.93.72]:50031)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <lle-bout@HIDDEN>) id 1lLo5s-0002Ox-Un
 for 47006 <at> debbugs.gnu.org; Mon, 15 Mar 2021 10:21:20 -0400
Received: from localhost.localdomain (82-64-145-38.subs.proxad.net
 [82.64.145.38]) (authenticated bits=0)
 by mail.zaclys.net (8.14.7/8.14.7) with ESMTP id 12FEL8na026359
 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO);
 Mon, 15 Mar 2021 15:21:09 +0100
DMARC-Filter: OpenDMARC Filter v1.3.2 mail.zaclys.net 12FEL8na026359
Authentication-Results: mail.zaclys.net;
 dmarc=fail (p=reject dis=none) header.from=zaclys.net
Authentication-Results: mail.zaclys.net;
 spf=fail smtp.mailfrom=lle-bout@HIDDEN
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zaclys.net;
 s=default; t=1615818069;
 bh=ZdLEqfxXBSU9Kj6JkCeqSGSy/wjazZbR2O1WQcRGQCM=;
 h=From:To:Cc:Subject:Date:From;
 b=bQokzQ/MSu8BuQGLnTTVtt4EVmWor5LR2tlvr3fxReCjuYXgWaM0pn1wnVorweA9V
 YNQU4ifXlgToVllSUDKWxnGQY+zKsIN6ApQ+iG7iYQzNt0fNFMUvfQBaTI7Izes1TQ
 PqKK+DTVOojiXMsUvCvbXT3om1Jky0kIgktMtKuU=
From: =?UTF-8?q?L=C3=A9o=20Le=20Bouter?= <lle-bout@HIDDEN>
To: 47006 <at> debbugs.gnu.org
Subject: [PATCH v2 0/1] gnu: Add zig.
Date: Mon, 15 Mar 2021 15:20:44 +0100
Message-Id: <20210315142045.25392-1-lle-bout@HIDDEN>
X-Mailer: git-send-email 2.30.2
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 47006
Cc: =?UTF-8?q?L=C3=A9o=20Le=20Bouter?= <lle-bout@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 (-)

I attempted to add tests, Zig has an unconventional way of requiring tests to be
run after installation so I added a 'check phase after the 'install phase which
works but then after lots of tests succeeded there is a FileNotFound error cause
by some 'test' binary failing to run.

I found out by running:

$ ./pre-inst-env guix build --keep-failed zig
$ cd /tmp/guix-build-zig-0.7.1.drv-0/source
$ env -i $(which bash)
$ source ../environment-variables
$ /run/current-system/profile/bin/strace -f -e trace=file /gnu/store/1cmjgdiim452bqkzgp53d0kw4fi4gfar-zig-0.7.1/bin/zig build test
...
[pid 25896] execve("/tmp/guix-build-zig-0.7.1.drv-0/source/zig-cache/o/25718f52ae311b1dafdba7de4a338f12/test", ["/tmp/guix-build-zig-0.7.1.drv-0/"...], 0x4e42bb0 /* 27 vars */) = -1 ENOENT (No such file or directory)
[pid 25896] +++ exited with 1 +++
[pid 25885] --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=25896, si_uid=1000, si_status=1, si_utime=0, si_stime=0} ---
error: FileNotFound
...
$ ldd /tmp/guix-build-zig-0.7.1.drv-0/source/zig-cache/o/25718f52ae311b1dafdba7de4a338f12/test
        linux-vdso.so.1 (0x00007ffd22d1d000)
        libc.so.6 => /gnu/store/fa6wj5bxkj5ll1d7292a70knmyl7a0cr-glibc-2.31/lib/libc.so.6 (0x00007fea82162000)
        libm.so.6 => /gnu/store/fa6wj5bxkj5ll1d7292a70knmyl7a0cr-glibc-2.31/lib/libm.so.6 (0x00007fea82021000)
        libpthread.so.0 => /gnu/store/fa6wj5bxkj5ll1d7292a70knmyl7a0cr-glibc-2.31/lib/libpthread.so.0 (0x00007fea82000000)
        libdl.so.2 => /gnu/store/fa6wj5bxkj5ll1d7292a70knmyl7a0cr-glibc-2.31/lib/libdl.so.2 (0x00007fea81ffb000)
        librt.so.1 => /gnu/store/fa6wj5bxkj5ll1d7292a70knmyl7a0cr-glibc-2.31/lib/librt.so.1 (0x00007fea81ff1000)
        /lib64/ld-linux-x86-64.so.2 => /gnu/store/fa6wj5bxkj5ll1d7292a70knmyl7a0cr-glibc-2.31/lib/ld-linux-x86-64.so.2 (0x00007fea82321000)
        libutil.so.1 => /gnu/store/fa6wj5bxkj5ll1d7292a70knmyl7a0cr-glibc-2.31/lib/libutil.so.1 (0x00007fea81fec000)
$ file /tmp/guix-build-zig-0.7.1.drv-0/source/zig-cache/o/25718f52ae311b1dafdba7de4a338f12/test
/tmp/guix-build-zig-0.7.1.drv-0/source/zig-cache/o/25718f52ae311b1dafdba7de4a338f12/test: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.0.0, with debug_info, not stripped

The issue here is that this binary should work fine already according to the
output of ldd and file. We would need a way to get verbose debugging errors of
execve somehow.

Leo Prikler (1):
  gnu: Add zig.

 gnu/local.mk         |  1 +
 gnu/packages/zig.scm | 76 ++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 77 insertions(+)
 create mode 100644 gnu/packages/zig.scm

-- 
2.30.2





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

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


Received: (at submit) by debbugs.gnu.org; 8 Mar 2021 13:14:04 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Mar 08 08:14:04 2021
Received: from localhost ([127.0.0.1]:42351 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1lJFi0-0001Ec-7e
	for submit <at> debbugs.gnu.org; Mon, 08 Mar 2021 08:14:04 -0500
Received: from lists.gnu.org ([209.51.188.17]:55508)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <leo.prikler@HIDDEN>) id 1lJFhv-0001Dz-Ep
 for submit <at> debbugs.gnu.org; Mon, 08 Mar 2021 08:14:02 -0500
Received: from eggs.gnu.org ([2001:470:142:3::10]:44994)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <leo.prikler@HIDDEN>)
 id 1lJFhv-0000wZ-8Y
 for guix-patches@HIDDEN; Mon, 08 Mar 2021 08:13:59 -0500
Received: from mailrelay.tugraz.at ([129.27.2.202]:46400)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <leo.prikler@HIDDEN>)
 id 1lJFhr-0001ye-Qb
 for guix-patches@HIDDEN; Mon, 08 Mar 2021 08:13:58 -0500
Received: from localhost.localdomain (217-149-164-20.nat.highway.telekom.at
 [217.149.164.20])
 by mailrelay.tugraz.at (Postfix) with ESMTPSA id 4DvJgs48t4z3wFK
 for <guix-patches@HIDDEN>; Mon,  8 Mar 2021 14:13:45 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tugraz.at;
 s=mailrelay; t=1615209225;
 bh=NCb7DsqfunqrWHvrUlTJ4Sh0Snhec4rLl4RVxdBSzyE=;
 h=From:To:Subject:Date;
 b=tqZ0JFbonb1c8Bkhv0IgViOYm0ThcTMInNO6YSUeJsc0iDTqMM87Xjk741kBjjSgO
 Y89nhLzucWwDIaBaM0k2ywb+B0knzlN9ZASAql4h2XWp0f0+rQ6t9cvfuitcDche6N
 loqBiDmWwxPYBxs0bW1HddXq0XJ9vem3c4abHBRI=
From: Leo Prikler <leo.prikler@HIDDEN>
To: guix-patches@HIDDEN
Subject: [PATCH] gnu: Add zig.
Date: Mon,  8 Mar 2021 14:11:56 +0100
Message-Id: <20210308131155.7441-1-leo.prikler@HIDDEN>
X-Mailer: git-send-email 2.30.1
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-TUG-Backscatter-control: bt4lQm5Tva3SBgCuw0EnZw
X-Spam-Scanner: SpamAssassin 3.003001 
X-Spam-Score-relay: -1.9
X-Scanned-By: MIMEDefang 2.74 on 129.27.10.117
Received-SPF: pass client-ip=129.27.2.202;
 envelope-from=leo.prikler@HIDDEN; helo=mailrelay.tugraz.at
X-Spam_score_int: -42
X-Spam_score: -4.3
X-Spam_bar: ----
X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3,
 RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001,
 SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -1.3 (-)
X-Debbugs-Envelope-To: submit
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.3 (--)

* gnu/packages/zig.scm: New file.
* gnu/local.mk (GNU_SYSTEM_MODULES): Add it here.
---
 gnu/local.mk         |  1 +
 gnu/packages/zig.scm | 65 ++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 66 insertions(+)
 create mode 100644 gnu/packages/zig.scm

diff --git a/gnu/local.mk b/gnu/local.mk
index fb3b395852..abcf86fb7e 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -586,6 +586,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..caf0a5e21a
--- /dev/null
+++ b/gnu/packages/zig.scm
@@ -0,0 +1,65 @@
+;;; 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.7.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 "1z6c4ym9jmga46cw2arn7zv2drcpmrf3vw139gscxp27n7q2z5md"))))
+    (build-system cmake-build-system)
+    (native-inputs
+     `(("clang" ,clang-11)
+       ("lld" ,lld)
+       ("llvm" ,llvm-11)))
+    (arguments
+     `(#:tests? #f                       ; no check target
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'configure 'set-home
+           (lambda _
+             (setenv "HOME" (getcwd))    ; zig writes to $HOME/.cache
+             #t)))))
+    (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)))
-- 
2.30.1





Acknowledgement sent to Leo Prikler <leo.prikler@HIDDEN>:
New bug report received and forwarded. Copy sent to guix-patches@HIDDEN. Full text available.
Report forwarded to guix-patches@HIDDEN:
bug#47006; 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.