Message ID | 20220207011332.27844-1-jgart@dismail.de |
---|---|
State | New |
Headers |
Return-Path: <guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org> X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 2E09D27BBEA; Mon, 7 Feb 2022 01:21:30 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id EC38327BBE9 for <patchwork@mira.cbaines.net>; Mon, 7 Feb 2022 01:21:29 +0000 (GMT) Received: from localhost ([::1]:51182 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from <guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org>) id 1nGsie-0001OK-PS for patchwork@mira.cbaines.net; Sun, 06 Feb 2022 20:21:28 -0500 Received: from eggs.gnu.org ([209.51.188.92]:57158) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <Debian-debbugs@debbugs.gnu.org>) id 1nGsiH-0001Ll-4k for guix-patches@gnu.org; Sun, 06 Feb 2022 20:21:05 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:46556) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from <Debian-debbugs@debbugs.gnu.org>) id 1nGsiE-000271-9S for guix-patches@gnu.org; Sun, 06 Feb 2022 20:21:04 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from <Debian-debbugs@debbugs.gnu.org>) id 1nGsiD-0004sW-UJ for guix-patches@gnu.org; Sun, 06 Feb 2022 20:21:01 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#53833] [PATCH] gnu: Add qbe. Resent-From: jgart <jgart@dismail.de> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces@debbugs.gnu.org> Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 07 Feb 2022 01:21:01 +0000 Resent-Message-ID: <handler.53833.B.164419684818717@debbugs.gnu.org> Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 53833 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 53833@debbugs.gnu.org Cc: jgart <jgart@dismail.de> X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.164419684818717 (code B ref -1); Mon, 07 Feb 2022 01:21:01 +0000 Received: (at submit) by debbugs.gnu.org; 7 Feb 2022 01:20:48 +0000 Received: from localhost ([127.0.0.1]:40453 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces@debbugs.gnu.org>) id 1nGshz-0004rp-OL for submit@debbugs.gnu.org; Sun, 06 Feb 2022 20:20:47 -0500 Received: from lists.gnu.org ([209.51.188.17]:52964) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <jgart@dismail.de>) id 1nGshx-0004rg-RI for submit@debbugs.gnu.org; Sun, 06 Feb 2022 20:20:46 -0500 Received: from eggs.gnu.org ([209.51.188.92]:57090) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <jgart@dismail.de>) id 1nGshv-0001Ap-PC for guix-patches@gnu.org; Sun, 06 Feb 2022 20:20:45 -0500 Received: from [2a01:4f8:c17:e5e::2] (port=38915 helo=mx1.dismail.de) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <jgart@dismail.de>) id 1nGshm-0001yx-Sm for guix-patches@gnu.org; Sun, 06 Feb 2022 20:20:43 -0500 Received: from mx1.dismail.de (localhost [127.0.0.1]) by mx1.dismail.de (OpenSMTPD) with ESMTP id c8be7182 for <guix-patches@gnu.org>; Mon, 7 Feb 2022 02:13:47 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=dismail.de; h=from:to:cc :subject:date:message-id:mime-version:content-transfer-encoding; s=20190914; bh=0MIm/QImGPAircRSBP67WMkXcVGAFcImVBsULlrS0ZA=; b= HZs4hkVhoBa9Soc0Nn04nNpLkea883p+MddMZtPTCuo/WcCLgf7UD4BKFm8ZEnyM bmi2i3QM2slxtyohpc4iJ2iWTF/Dzz4byrzUxuej69bwWpsYkoFkVJo29g8+XFeB OqpkTHBSI4bqTK5qssDEFkQeNfoAtiDszBSV5ezGrJD4t3Ni32BSXclOlWvR/in+ SZUBocRBVrYklcws77zY8C+gzpoq9HMKyGWclB+NfyJyh3Wq7PuYNS0Tc8ppPSrT O81PEgGrxgNtomyn5/brHl+1IFwDHGKMiYM4RWg3RobSzJhz9n48qOEt/X3uTjea jSPQH8q/STE2FmJkpFhXxw== Received: from smtp1.dismail.de (<unknown> [10.240.26.11]) by mx1.dismail.de (OpenSMTPD) with ESMTP id ab16b334 for <guix-patches@gnu.org>; Mon, 7 Feb 2022 02:13:47 +0100 (CET) Received: from smtp1.dismail.de (localhost [127.0.0.1]) by smtp1.dismail.de (OpenSMTPD) with ESMTP id 91ff3752 for <guix-patches@gnu.org>; Mon, 7 Feb 2022 02:13:47 +0100 (CET) Received: by dismail.de (OpenSMTPD) with ESMTPSA id e11b45e5 (TLSv1.3:AEAD-AES256-GCM-SHA384:256:NO); Mon, 7 Feb 2022 02:13:41 +0100 (CET) Date: Sun, 6 Feb 2022 20:13:32 -0500 Message-Id: <20220207011332.27844-1-jgart@dismail.de> X-Mailer: git-send-email 2.35.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a01:4f8:c17:e5e::2 (failed) Received-SPF: pass client-ip=2a01:4f8:c17:e5e::2; envelope-from=jgart@dismail.de; helo=mx1.dismail.de X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 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, RCVD_IN_DNSWL_MED=-2.3, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: <guix-patches.gnu.org> List-Unsubscribe: <https://lists.gnu.org/mailman/options/guix-patches>, <mailto:guix-patches-request@gnu.org?subject=unsubscribe> List-Archive: <https://lists.gnu.org/archive/html/guix-patches> List-Post: <mailto:guix-patches@gnu.org> List-Help: <mailto:guix-patches-request@gnu.org?subject=help> List-Subscribe: <https://lists.gnu.org/mailman/listinfo/guix-patches>, <mailto:guix-patches-request@gnu.org?subject=subscribe> Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" <guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org> Reply-to: jgart <jgart@dismail.de> X-ACL-Warn: , jgart via Guix-patches <guix-patches@gnu.org> From: jgart via Guix-patches via <guix-patches@gnu.org> X-getmail-retrieved-from-mailbox: Patches |
Series |
[bug#53833] gnu: Add qbe.
|
|
Commit Message
jgart
Feb. 7, 2022, 1:13 a.m. UTC
* gnu/packages/c.scm (qbe): New variable. --- gnu/packages/c.scm | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+)
Comments
Am Sonntag, dem 06.02.2022 um 20:13 -0500 schrieb jgart: > * gnu/packages/c.scm (qbe): New variable. > --- > gnu/packages/c.scm | 30 ++++++++++++++++++++++++++++++ > 1 file changed, 30 insertions(+) > > diff --git a/gnu/packages/c.scm b/gnu/packages/c.scm > index 459d996fa2..8966b7b8d0 100644 > --- a/gnu/packages/c.scm > +++ b/gnu/packages/c.scm > @@ -142,6 +142,36 @@ (define-public pcc > ;; preferred. See http://pcc.ludd.ltu.se/licenses/ for more > details. > (license (list license:bsd-2 license:bsd-3)))) > > +(define-public qbe > + (let ((commit "2ca6fb25a238842418019a3f9ee8d1beb1327f7e") > + (revision "0")) > + (package > + (name "qbe") > + (version (git-version "0.0" revision commit)) From the homepage: "QBE is in constant change. It is a young project and I still have many ideas to try." As always, I don't think it's too good of an idea to package projects that tell you "this edge will make you bleed". Or in the words of the manual > Occasionally, we package snapshots of upstream’s version control > system (VCS) instead of formal releases. This should remain > exceptional, because it is up to upstream developers to clarify what > the stable release is. I think upstream is very clear here that QBE is not yet stable and therefore not something you'd want in a distro. Of course, since the recipe is a rather simple one, you can easily maintain it in your own channel -- or not package it at all and use it from source with just a C compiler. > + (source > + (origin > + (method git-fetch) > + (uri > + (git-reference > + (url "git://c9x.me/qbe") > + (commit commit))) > + (file-name (git-file-name name version)) > + (sha256 > + (base32 > + > "0qbnsrwk10v0s42vzxy2wvksd8xl8bmxfzqv2a4j4zjaklqgfd6j")))) > + (build-system gnu-build-system) > + (arguments > + `(#:tests? #f ; Tests require a running qemu? You should be able to add qemu to native-inputs if that's all it takes. > + #:make-flags (list (string-append "CC=" ,(cc-for-target)) > + (string-append "PREFIX=" %output)) > + #:phases > + (modify-phases %standard-phases > + (delete 'configure)))) > + (synopsis "Backend compiler") > + (description "@code{qbe} is a compiler backend.") It'd be nice if the description was more descriptive :) Also the synopsis should probably not invert the ordering of "compiler" and "backend". > + (home-page "https://c9x.me/compile/") > + (license license:expat)))) > + > (define-public libbytesize > (package > (name "libbytesize") Cheers
On Mon, 07 Feb 2022 10:47:08 +0100 Liliana Marie Prikler <liliana.prikler@ist.tugraz.at> wrote: > Am Sonntag, dem 06.02.2022 um 20:13 -0500 schrieb jgart: > > * gnu/packages/c.scm (qbe): New variable. > > --- > > gnu/packages/c.scm | 30 ++++++++++++++++++++++++++++++ > > 1 file changed, 30 insertions(+) > > > > diff --git a/gnu/packages/c.scm b/gnu/packages/c.scm > > index 459d996fa2..8966b7b8d0 100644 > > --- a/gnu/packages/c.scm > > +++ b/gnu/packages/c.scm > > @@ -142,6 +142,36 @@ (define-public pcc > > ;; preferred. See http://pcc.ludd.ltu.se/licenses/ for more > > details. > > (license (list license:bsd-2 license:bsd-3)))) > > > > +(define-public qbe > > + (let ((commit "2ca6fb25a238842418019a3f9ee8d1beb1327f7e") > > + (revision "0")) > > + (package > > + (name "qbe") > > + (version (git-version "0.0" revision commit)) > From the homepage: "QBE is in constant change. It is a young project > and I still have many ideas to try." As always, I don't think it's too > good of an idea to package projects that tell you "this edge will make > you bleed". Or in the words of the manual > > > Occasionally, we package snapshots of upstream’s version control > > system (VCS) instead of formal releases. This should remain > > exceptional, because it is up to upstream developers to clarify what > > the stable release is. > I think upstream is very clear here that QBE is not yet stable and > therefore not something you'd want in a distro. Of course, since the > recipe is a rather simple one, you can easily maintain it in your own > channel -- or not package it at all and use it from source with just a > C compiler. Hi lilyp, Thanks for the review. It's much appreciated. Here's a recent talk from FOSDEM 2022 on qbe by Drew Devault in case you're interested in finding out more about it: https://fosdem.org/2022/schedule/event/lg_qbe/ I already have qbe in Guix 'R Us along with cproc: https://git.sr.ht/~whereiseveryone/guixrus/tree/master/item/guixrus/packages/qbe.scm#L43 If maintainers think it will be ready for Guix in the future ping me or feel free to send an update as you see fit. all best, jgart https://whereiseveryone.srht.site/ gemini://whereiseveryone.srht.site/ https://sr.ht/~mcf/cproc
Hi jgart, jgart <jgart@dismail.de> skribis: > I already have qbe in Guix 'R Us along with cproc: > > https://git.sr.ht/~whereiseveryone/guixrus/tree/master/item/guixrus/packages/qbe.scm#L43 > > If maintainers think it will be ready for Guix in the future ping me or > feel free to send an update as you see fit. I’m not opposed to including it if it’s useful but like you write, since you have it in a channel, maybe we can wait until it’s mature enough before getting it in Guix proper. I’m closing this issue but feel free to ping us when you think it should get in. Thanks, Ludo’.
QBE is now being used in one reasonably mature project: https://harelang.org https://harelang.org/ While it's not at 1.0 yet, it's been in development for ~2 (i think) years now.
> I'm not asking for a 1.0, I'd be fine with a 0.1 or even a 0.0.1. As > it stands, every place I look at says "this is experimental" rather > than "you can use this and it ought to work as intended at least for > these sample programs". Ah, I think you misunderstood slightly: I was saying that Hare was not yet at 1.0 yet (although QBE isn't either.) Regardless, I think it is mature enough for Guix, especially as a stable programming language uses it now. By the way, https://c9x.me/compile is really outdated, so its estimate on QBE's stability is probably inaccurate by now.
Hi Liliana, > IMHO, paren's initial patch is slightly better in quality than 55151, > but there are two (three) things lacking. First, the synopsis and > description are subpar. 55151 has a slightly better synopsis, don't > feel too sure about the description though. Second, the "fix-cc" phase > from 55151 should be added after unpack ("patch-test-script" sounds > like a better phase name). It might be better to use (cc-for-target) > in the substitution rather than gcc, but note that this substitution > only applies for native compilation anyway. I have made your suggested improvements, plus substantial changes to the build recipe that allows you to cross-compile both QBE and cproc. I have confirmed that cross-compilation works for aarch64 and riscv64. Here is the updated code: <https://git.sr.ht/~whereiseveryone/guixrus/tree/master/guixrus/packages/qbe.scm>. The changes are as follows for qbe: * Patch the makefile to support cross-building with a TARGET variable. This is done with a standalone patch. * Set "TARGET" to the appropriate target system. * Set the correct supported systems. (It supports x86_64, aarch64, and riscv64 currently.) * Improve the synopsis and description. * Update to the latest commit. Note that tests still aren't provided because they use QEMU. And cproc: * Reenable tests. Not sure why they were disabled in the first place... * Instead of skipping the configuration phase, replace it with an invocation of cproc's hand-written ./configure. Pass the correct arguments to it to allow cross-compilation to aarch64. * Use gcc:lib as an input to support cross-compilation. * Set the correct supported systems. (It supports riscv64 only under musl libc right now.) * Improve the synopsis and description. * Update to the latest commit. I think they are ready for upstreaming now. I will send improved patches to the appropriate issue threads.
I just noticed that the QBE makefile patch contains a mistake in the description: > This patch modifies the QBE makefile to add a TARGET variable that allows us to support > cross-compiling it. We modify the case...esac in the config.h target to use this variable > instead of TARGET. "instead of TARGET" should be "instead of uname". I can't really see much point in submitting a whole v2 patch for that, especially since i've already made further adjustments to the c.scm file for cproc, so could whoever merges this change that please? Thanks!
diff --git a/gnu/packages/c.scm b/gnu/packages/c.scm index 459d996fa2..8966b7b8d0 100644 --- a/gnu/packages/c.scm +++ b/gnu/packages/c.scm @@ -142,6 +142,36 @@ (define-public pcc ;; preferred. See http://pcc.ludd.ltu.se/licenses/ for more details. (license (list license:bsd-2 license:bsd-3)))) +(define-public qbe + (let ((commit "2ca6fb25a238842418019a3f9ee8d1beb1327f7e") + (revision "0")) + (package + (name "qbe") + (version (git-version "0.0" revision commit)) + (source + (origin + (method git-fetch) + (uri + (git-reference + (url "git://c9x.me/qbe") + (commit commit))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "0qbnsrwk10v0s42vzxy2wvksd8xl8bmxfzqv2a4j4zjaklqgfd6j")))) + (build-system gnu-build-system) + (arguments + `(#:tests? #f ; Tests require a running qemu? + #:make-flags (list (string-append "CC=" ,(cc-for-target)) + (string-append "PREFIX=" %output)) + #:phases + (modify-phases %standard-phases + (delete 'configure)))) + (synopsis "Backend compiler") + (description "@code{qbe} is a compiler backend.") + (home-page "https://c9x.me/compile/") + (license license:expat)))) + (define-public libbytesize (package (name "libbytesize")