GNU bug report logs - #75778
[PATCH] gnu: Add microhs.

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: Homo <gay@HIDDEN>; Keywords: patch; dated Thu, 23 Jan 2025 07:38:02 UTC; Maintainer for guix-patches is guix-patches@HIDDEN.

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


Received: (at 75778) by debbugs.gnu.org; 26 Jan 2025 14:51:30 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Jan 26 09:51:30 2025
Received: from localhost ([127.0.0.1]:55533 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tc3z0-0001gY-0c
	for submit <at> debbugs.gnu.org; Sun, 26 Jan 2025 09:51:30 -0500
Received: from layka.disroot.org ([178.21.23.139]:50390)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.84_2) (envelope-from <gay@HIDDEN>) id 1tc3yx-0001gI-R2
 for 75778 <at> debbugs.gnu.org; Sun, 26 Jan 2025 09:51:28 -0500
Received: from mail01.disroot.lan (localhost [127.0.0.1])
 by disroot.org (Postfix) with ESMTP id 3BD21259FE;
 Sun, 26 Jan 2025 15:51:26 +0100 (CET)
X-Virus-Scanned: SPAM Filter at disroot.org
Received: from layka.disroot.org ([127.0.0.1])
 by localhost (disroot.org [127.0.0.1]) (amavis, port 10024) with ESMTP
 id SRGk4XLPsiPT; Sun, 26 Jan 2025 15:51:25 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail;
 t=1737903085; bh=CykBKMTXYogyQ0mni0kp9k4Y+ELxQ5OmsMnJEFziL7Y=;
 h=Date:From:To:Subject:In-Reply-To:References;
 b=Hj1ni82P7FuErXBwpVWhAEJFcpekZq0U37nqtQUvlIOCXXtGu4Y106XKF3A8sTcC+
 KvPTB+620tHmJIQmNsLpfXn0veWgMs8VKxRXg+YcGECAR5sgCt8SYLGVX4xmDpEv5t
 nU9EhoTLx6FVBYg15skAZSEOIxTqZa94szUdJlSDv7GSOdzlwMeG5gUi4wnoh7vEgW
 J4RlOe+GgR0tP9mYuHKfAap/p8kpQq/MQ0BDK0Twu/IhWEliFTvm2k6kA425yb6nNT
 ivFINGpppCIy0MdZ1E18kh1NiwLweUuGRLg/N8ZR8IQIjRm8Ig+dcdnhJGzDbclxYn
 IHf8zEU5eqjLw==
MIME-Version: 1.0
Date: Sun, 26 Jan 2025 16:51:25 +0200
From: gay@HIDDEN
To: Lars-Dominik Braun <lars@HIDDEN>, 75778 <75778 <at> debbugs.gnu.org>
Subject: Re: [PATCH] gnu: Add microhs.
In-Reply-To: <Z5XfSL_LdHBMaID3@HIDDEN>
References: <25ce8eba9245ce9ea517a9b33e811d2e@HIDDEN>
 <Z5XfSL_LdHBMaID3@HIDDEN>
Message-ID: <046ba89455944db143aa84f1e3062443@HIDDEN>
X-Sender: gay@HIDDEN
Content-Type: text/plain; charset=US-ASCII;
 format=flowed
Content-Transfer-Encoding: 7bit
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 75778
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 (-)

Nice, thank you :)

To anyone having non-x86 hardware: testing would be helpful, especially 
considering there is bug in Hugs that triggers randomly depending on 
hardware and/or OS.




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

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


Received: (at 75778) by debbugs.gnu.org; 26 Jan 2025 07:08:10 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Jan 26 02:08:09 2025
Received: from localhost ([127.0.0.1]:54049 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tbwkb-0004op-46
	for submit <at> debbugs.gnu.org; Sun, 26 Jan 2025 02:08:09 -0500
Received: from mout-p-201.mailbox.org ([80.241.56.171]:46108)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <lars@HIDDEN>) id 1tbwkX-0004ny-IX
 for 75778 <at> debbugs.gnu.org; Sun, 26 Jan 2025 02:08:07 -0500
Received: from smtp202.mailbox.org (smtp202.mailbox.org [10.196.197.202])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256)
 (No client certificate requested)
 by mout-p-201.mailbox.org (Postfix) with ESMTPS id 4YgjLL6jrYz9sJ2;
 Sun, 26 Jan 2025 08:07:54 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6xq.net; s=MBO0001;
 t=1737875275;
 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=EkharMGZzbXLUKEkhVAAR/xtPpq9gmnYP7rvzZqnCu0=;
 b=Vp2grb3Q3osT2WSHQc59WcflDVfG3tFDlGBVejNDibyw6pil5Ctw0zGdLbcoduDJqeHCGr
 ZuttTWTMzl8l8I/iurLy4gJQJObV38V9Yw3r3fQh2WO1j1gAh0RnxUG3WmS5xFCVyzRt6u
 4KzrmSTg0/j0PSVPfnkMf0dS7uorZVTO2gDqsxxrO5BcXLQKLltkhzmCrwVOWCw7zvCm6X
 lI5G6eikQn2ukNZ+OkzJG1cNEwOdcdRCyUpl4Xe0x4aaMgFEGqFBCUBBH1Ptuu4Jhs3HhE
 FrDrN/Weog3XhKP4bnHoncnJkz41SgqmmetfacG6gUNX2o9SkB4WKPu0zyeI8g==
Date: Sun, 26 Jan 2025 08:07:52 +0100
From: Lars-Dominik Braun <lars@HIDDEN>
To: gay@HIDDEN
Subject: Re: [PATCH] gnu: Add microhs.
Message-ID: <Z5XfSL_LdHBMaID3@HIDDEN>
References: <25ce8eba9245ce9ea517a9b33e811d2e@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="zJSeZZzBM0S66QEs"
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <25ce8eba9245ce9ea517a9b33e811d2e@HIDDEN>
X-Spam-Score: 1.9 (+)
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, > Need help to change CONF=unix-64 to CONF=unix-32 on
 all 32-bit > architectures, MicroHs should work on every architecture without
 any > other modifications, provided Hugs itself is available for boo [...]
 Content analysis details:   (1.9 points, 10.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 0.0 RCVD_IN_VALIDITY_RPBL_BLOCKED RBL: ADMINISTRATOR NOTICE: The
 query to Validity was blocked.  See
 https://knowledge.validity.com/hc/en-us/articles/20961730681243
 for more information.
 [80.241.56.171 listed in bl.score.senderscore.com]
 -0.0 SPF_PASS               SPF: sender matches SPF record
 0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 0.7 PDS_OTHER_BAD_TLD      Untrustworthy TLDs
 [URI: yoctocell.xyz (xyz)]
 -0.7 RCVD_IN_DNSWL_LOW      RBL: Sender listed at https://www.dnswl.org/,
 low trust [80.241.56.171 listed in list.dnswl.org]
 0.0 RCVD_IN_VALIDITY_CERTIFIED_BLOCKED RBL: ADMINISTRATOR NOTICE:
 The query to Validity was blocked.  See
 https://knowledge.validity.com/hc/en-us/articles/20961730681243
 for more information.
 [80.241.56.171 listed in sa-trusted.bondedsender.org]
 1.8 LONGWORDS              Long string of long words
 -0.0 T_SCC_BODY_TEXT_LINE   No description available.
X-Debbugs-Envelope-To: 75778
Cc: 75778 <at> debbugs.gnu.org, divya@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.9 (/)


--zJSeZZzBM0S66QEs
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

Hi,

> Need help to change CONF=unix-64 to CONF=unix-32 on all 32-bit 
> architectures, MicroHs should work on every architecture without any 
> other modifications, provided Hugs itself is available for bootstrap.

the attached patch should work and also enables tests.

Lars


--zJSeZZzBM0S66QEs
Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: attachment; filename="0001-gnu-Add-microhs.patch"
Content-Transfer-Encoding: 8bit

From 30612fd4a49d73a9c9747b68d98ce94c1993ee08 Mon Sep 17 00:00:00 2001
Message-ID: <30612fd4a49d73a9c9747b68d98ce94c1993ee08.1737875219.git.lars@HIDDEN>
From: Homo <gay@HIDDEN>
Date: Thu, 23 Jan 2025 09:36:26 +0200
Subject: [PATCH] gnu: Add microhs.

Thanks to cooperative work with Lennart Augustsson, MicroHs is now bootstrappable with Hugs.

Skipping build of CPPHS because it depends on CPPHS, as well as skipping build of MicroCabal because its source lives in <https://github.com/augustss/MicroCabal>, so need to package it separately.

* gnu/packages/patches/microhs-Makefile.patch: New file.
* gnu/local.mk (dist_patch_DATA): Register it.
* gnu/packages/haskell.scm (microhs): New variable.

Change-Id: Iedbec3fef125044a36f7beed0d5db0d7ad123d5d
Signed-off-by: Lars-Dominik Braun <lars@HIDDEN>
---
 gnu/local.mk                                |  1 +
 gnu/packages/haskell.scm                    | 43 ++++++++++++
 gnu/packages/patches/microhs-Makefile.patch | 76 +++++++++++++++++++++
 3 files changed, 120 insertions(+)
 create mode 100644 gnu/packages/patches/microhs-Makefile.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 5091f93eb8..9a44bdfc02 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1835,6 +1835,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/mia-vtk9.patch				\
   %D%/packages/patches/mia-vtk92.patch				\
   %D%/packages/patches/mia-vtk-version.patch			\
+  %D%/packages/patches/microhs-Makefile.patch			\
   %D%/packages/patches/minisat-friend-declaration.patch		\
   %D%/packages/patches/minisat-install.patch			\
   %D%/packages/patches/miniz-for-pytorch.patch			\
diff --git a/gnu/packages/haskell.scm b/gnu/packages/haskell.scm
index 10803f5afe..05d2de878a 100644
--- a/gnu/packages/haskell.scm
+++ b/gnu/packages/haskell.scm
@@ -24,6 +24,7 @@
 ;;; Copyright © 2021 Xinglu Chen <public@HIDDEN>
 ;;; Copyright © 2021 Simon Tournier <zimon.toutoune@HIDDEN>
 ;;; Copyright © 2023 Maxim Cournoyer <maxim.cournoyer@HIDDEN>
+;;; Copyright © 2025 Homo <gay@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -54,6 +55,7 @@ (define-module (gnu packages haskell)
   #:use-module (gnu packages gawk)
   #:use-module (gnu packages gcc)
   #:use-module (gnu packages ghostscript)
+  #:use-module (gnu packages hugs)
   #:use-module (gnu packages libffi)
   #:use-module (gnu packages linux)
   #:use-module (gnu packages lisp)
@@ -113,6 +115,47 @@ (define-public cl-yale-haskell
 top of CLISP.")
       (license license:bsd-4))))
 
+(define-public microhs
+  ;; There are no tags, using latest commit from branch "hugs".
+  (let ((commit "c478ae10b84b722dc41b58d016fd28c8f7e97695")
+        (revision "0"))
+    (package
+      (name "microhs")
+      (version (git-version "0.11.2.4" revision commit))
+      (source (origin
+        (method git-fetch)
+        (uri (git-reference
+          (url "https://github.com/augustss/MicroHs")
+          (commit commit)))
+        (file-name (git-file-name name version))
+        (sha256
+          (base32 "09rx5zaygc0f3wx4pjxk58q7cfh9ac06194ha2gbqjdis71llfs4"))
+        (patches (search-patches "microhs-Makefile.patch"))
+        (modules '((guix build utils)))
+        ;; Remove pre-build binaries.
+        (snippet '(delete-file-recursively "generated"))))
+      (build-system gnu-build-system)
+      (arguments
+        (list
+          #:make-flags #~(list "CC=gcc"
+                               (string-append "PREFIX=" #$output)
+                               (string-append "CONF=unix-"
+                                 #$(if (target-64bit?) "64" "32")))
+          #:test-target "runtestmhs"
+          #:phases
+          #~(modify-phases %standard-phases
+            (delete 'configure))))
+      (inputs (list hugs))
+      (native-search-paths
+        (list (search-path-specification
+          (variable "MHSDIR")
+          (files '("lib/mhs")))))
+      (home-page "https://github.com/augustss/MicroHs")
+      (synopsis "A small compiler for Haskell")
+      (description "A compiler for an extended subset of Haskell-2010.
+The compiler translates to combinators and can compile itself.")
+      (license license:asl2.0))))
+
 ;; This package contains lots of generated .hc files containing C code to
 ;; bootstrap the compiler without a Haskell compiler.  The included .hc files
 ;; cover not just the compiler sources but also all Haskell libraries.
diff --git a/gnu/packages/patches/microhs-Makefile.patch b/gnu/packages/patches/microhs-Makefile.patch
new file mode 100644
index 0000000000..1f407a860d
--- /dev/null
+++ b/gnu/packages/patches/microhs-Makefile.patch
@@ -0,0 +1,76 @@
+Avoid verbosity in (arguments) in Guile code.
+
+diff --git a/Makefile b/Makefile
+index 2b98363b..86d2260e 100644
+--- a/Makefile
++++ b/Makefile
+@@ -34,7 +34,7 @@ MAINMODULE=src/MicroHs/Main.hs
+ #
+ .PHONY:	clean bootstrap install ghcgen newmhs newmhsz cachelib timecompile exampletest cachetest runtest runtestmhs everytest everytestmhs nfibtest info
+ 
+-all:	bin/mhs bin/cpphs bin/mcabal
++all:	bin/mhs
+ 
+ targets.conf:
+ 	echo [default]           > targets.conf
+@@ -56,11 +56,6 @@ newmhsz:	newmhs
+ sanitizemhs:	ghcgen targets.conf
+ 	$(CCEVAL) -fsanitize=undefined -fsanitize=address -fsanitize=pointer-compare -fsanitize=pointer-subtract generated/mhs.c -o bin/mhssane
+ 
+-# Compile mhs from distribution, with C compiler
+-bin/mhs:	src/runtime/*.c src/runtime/*.h targets.conf #generated/mhs.c
+-	@mkdir -p bin
+-	$(CCEVAL) generated/mhs.c -o bin/mhs
+-
+ # Compile cpphs from distribution, with C compiler
+ bin/cpphs:	src/runtime/*.c src/runtime/config*.h generated/cpphs.c
+ 	@mkdir -p bin
+@@ -108,16 +103,16 @@ mhs.js:	src/*/*.hs src/runtime/*.[ch] targets.conf
+ 	bin/mhs $(MHSINC) -temscripten $(MAINMODULE) -o mhs.js
+ 
+ # Make sure boottrapping works
+-bootstrap:	bin/mhs-stage2
++bin/mhs:	bin/mhs-stage2
+ 	@echo "*** copy stage2 to bin/mhs"
+ 	cp bin/mhs-stage2 bin/mhs
+ 	cp generated/mhs-stage2.c generated/mhs.c 
+ 
+ # Build stage1 compiler with existing compiler
+-bin/mhs-stage1:	bin/mhs src/*/*.hs
++bin/mhs-stage1:	bin/hmhs src/*/*.hs
+ 	@mkdir -p generated
+ 	@echo "*** Build stage1 compiler, using bin/mhs"
+-	bin/mhs -z $(MHSINC) $(MAINMODULE) -ogenerated/mhs-stage1.c
++	bin/hmhs -z $(MHSINC) $(MAINMODULE) -ogenerated/mhs-stage1.c
+ 	$(CCEVAL) generated/mhs-stage1.c -o bin/mhs-stage1
+ 
+ # Build stage2 compiler with stage1 compiler, and compare
+@@ -178,10 +173,9 @@ clean:
+ 	cd tests; make clean
+ 	-cabal clean
+ 
+-oldinstall:
++install:
+ 	mkdir -p $(PREFIX)/bin
+ 	cp bin/mhs $(PREFIX)/bin
+-	-cp bin/cpphs $(PREFIX)/bin
+ 	mkdir -p $(PREFIX)/lib/mhs/src/runtime
+ 	cp -r lib $(PREFIX)/lib/mhs
+ 	cp src/runtime/* $(PREFIX)/lib/mhs/src/runtime
+@@ -253,7 +247,7 @@ $(MCABALMHS)/packages/$(BASE).pkg: bin/mhs lib/*.hs lib/*/*.hs lib/*/*/*.hs
+ 	bin/mhs -Q $(BASE).pkg $(MCABALMHS)
+ 	@rm $(BASE).pkg
+ 
+-install: $(MCABALBIN)/mhs $(MCABALBIN)/cpphs $(MCABALBIN)/mcabal $(MCABALMHS)/packages/$(BASE).pkg
++newinstall: $(MCABALBIN)/mhs $(MCABALBIN)/cpphs $(MCABALBIN)/mcabal $(MCABALMHS)/packages/$(BASE).pkg
+ 	@echo $$PATH | tr ':' '\012' | grep -q $(MCABALBIN) || echo '***' Add $(MCABALBIN) to the PATH
+ 
+ # mkdir ~/.mcabal/packages/array-0.5.6.0
+@@ -277,6 +271,6 @@ generated/hmhs.c:
+ 	@mkdir -p generated
+ 	$(HUGS) $(HUGSINCS) $(MAINMODULE) $(MHSINC) $(MAINMODULE) -ogenerated/hmhs.c
+ 
+-bin/hmhs: generated/hmhs.c
++bin/hmhs: generated/hmhs.c src/runtime/*.c src/runtime/*.h targets.conf
+ 	@mkdir -p bin
+ 	$(CCEVAL) generated/hmhs.c -o bin/hmhs

base-commit: b226a1007a9111adacb05984b8d74def24257dce
-- 
2.45.3


--zJSeZZzBM0S66QEs--




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

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


Received: (at 75778) by debbugs.gnu.org; 25 Jan 2025 18:16:36 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Jan 25 13:16:36 2025
Received: from localhost ([127.0.0.1]:52499 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tbkhw-0006IY-3z
	for submit <at> debbugs.gnu.org; Sat, 25 Jan 2025 13:16:36 -0500
Received: from layka.disroot.org ([178.21.23.139]:57218)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.84_2) (envelope-from <gay@HIDDEN>) id 1tbkht-0006IH-PN
 for 75778 <at> debbugs.gnu.org; Sat, 25 Jan 2025 13:16:34 -0500
Received: from mail01.disroot.lan (localhost [127.0.0.1])
 by disroot.org (Postfix) with ESMTP id 0045525BD7;
 Sat, 25 Jan 2025 19:16:32 +0100 (CET)
X-Virus-Scanned: SPAM Filter at disroot.org
Received: from layka.disroot.org ([127.0.0.1])
 by localhost (disroot.org [127.0.0.1]) (amavis, port 10024) with ESMTP
 id vusit1LdjRNO; Sat, 25 Jan 2025 19:16:31 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail;
 t=1737828991; bh=44oal0RNAXt9V8T3VzniSqfz3L5NOUInjyi3tA8OA9Y=;
 h=Date:From:To:Subject;
 b=VbauA1L0KSPKEgErWLy03dyGDUFTQ0+h2kRKQ+mNXTEkN4FfXaAKAfQ1ujLjegtt7
 h3/AqXo4P1kMUCsA9tCip899wINdlDybhjeY+YexpRKlVOFssKVPaaONawzy+rcm//
 Zf0Ns84xQLpaFr/P7nNKPn4LXUVrp/VkU0izylyEesoLXftc1L/6ckh6exCTK9i4al
 hxgMsf4gvsQIILBU2d+xYeEvApt7PGCZGMIb9Jhnq9vZV6Or6j5ovj1nn31bBPG1KC
 hrJE0SwkAfT9+McEPzUiqDJhj//0lU7BmdEHHZgfr2VWY1eEwucE7SLWF8NDPBol8S
 TKlta2/sRJR7w==
MIME-Version: 1.0
Date: Sat, 25 Jan 2025 20:16:31 +0200
From: gay@HIDDEN
To: 75778 <at> debbugs.gnu.org, Lars-Dominik Braun <lars@HIDDEN>,
 divya@HIDDEN
Subject: Re: [PATCH] gnu: Add microhs.
Message-ID: <25ce8eba9245ce9ea517a9b33e811d2e@HIDDEN>
X-Sender: gay@HIDDEN
Content-Type: text/plain; charset=US-ASCII;
 format=flowed
Content-Transfer-Encoding: 7bit
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 75778
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 (-)

Need help to change CONF=unix-64 to CONF=unix-32 on all 32-bit 
architectures, MicroHs should work on every architecture without any 
other modifications, provided Hugs itself is available for bootstrap.




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

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


Received: (at submit) by debbugs.gnu.org; 23 Jan 2025 07:37:16 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Jan 23 02:37:16 2025
Received: from localhost ([127.0.0.1]:38930 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tarm7-0002he-Ej
	for submit <at> debbugs.gnu.org; Thu, 23 Jan 2025 02:37:16 -0500
Received: from lists.gnu.org ([2001:470:142::17]:38412)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <gay@HIDDEN>) id 1tarm5-0002hO-Hf
 for submit <at> debbugs.gnu.org; Thu, 23 Jan 2025 02:37:14 -0500
Received: from eggs.gnu.org ([2001:470:142:3::10])
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <gay@HIDDEN>) id 1tarlw-0005cl-Ta
 for guix-patches@HIDDEN; Thu, 23 Jan 2025 02:37:06 -0500
Received: from layka.disroot.org ([178.21.23.139])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <gay@HIDDEN>) id 1tarlp-0000dc-Lh
 for guix-patches@HIDDEN; Thu, 23 Jan 2025 02:37:03 -0500
Received: from mail01.disroot.lan (localhost [127.0.0.1])
 by disroot.org (Postfix) with ESMTP id 98ADC25C79;
 Thu, 23 Jan 2025 08:36:54 +0100 (CET)
X-Virus-Scanned: SPAM Filter at disroot.org
Received: from layka.disroot.org ([127.0.0.1])
 by localhost (disroot.org [127.0.0.1]) (amavis, port 10024) with ESMTP
 id cMK3kk7Ft-kc; Thu, 23 Jan 2025 08:36:50 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail;
 t=1737617810; bh=CX6oHJ+pRfcLeq2dMU5DPTnAGFEvdjcDzjKWiw3scJI=;
 h=From:To:Cc:Subject:Date;
 b=S1i1KIby2YpKhXSP3zG2e1R0rDn5TjDFOVn5JG6kUVDSXtzjNxvUZchiVMQJSH8NX
 AupTkVG111Lh56/ttSwdEwQel5fg1GF165GcsvIaqNxrTxgsLaQHvygUES/2sgL8Qm
 NMHFi0nwOVj0asXJ//hPLcUVoEOGAuIgIHSxrlK12uUAII9v3zC/570P+LZckr/D2t
 hbhJK7ccBK1t6CFf8LJVpYaUvcqnpNbD0i3bM5AwyTlte5NvDd7+oLmhg5WCscJkg1
 1wmA/a1R2GmQgFh1VY4VR6xTo23Gudf6MFROU4g2foV0RjPaXSennXEArOCortCYZv
 eZi9PeHN2fQ4Q==
From: Homo <gay@HIDDEN>
To: guix-patches@HIDDEN,
	lars@HIDDEN,
	divya@HIDDEN
Subject: [PATCH] gnu: Add microhs.
Date: Thu, 23 Jan 2025 09:36:26 +0200
Message-ID: <20250123073630.11285-1-gay@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Received-SPF: pass client-ip=178.21.23.139; envelope-from=gay@HIDDEN;
 helo=layka.disroot.org
X-Spam_score_int: 0
X-Spam_score: -0.1
X-Spam_bar: /
X-Spam_report: (-0.1 / 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, LONGWORDS=2.035,
 RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001,
 SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no
X-Spam_action: no action
X-Spam-Score: 3.5 (+++)
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:  Thanks to cooperative work with Lennart Augustsson, MicroHs
 is now bootstrappable with Hugs. Skipping build of CPPHS because it depends
 on CPPHS, as well as skipping build of MicroCabal because its source lives
 in <https://github.com/augustss/MicroCabal>, so need to package it separately.
 Content analysis details:   (3.5 points, 10.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 0.9 SPF_FAIL               SPF: sender does not match SPF record (fail)
 [SPF failed: Please see http://www.openspf.org/Why?s=mfrom;
 id=gay%40disroot.org; ip=2001%3A470%3A142%3A%3A17; r=debbugs.gnu.org]
 -0.0 RCVD_IN_DNSWL_NONE     RBL: Sender listed at https://www.dnswl.org/,
 no trust [2001:470:142:0:0:0:0:17 listed in] [list.dnswl.org]
 0.8 PDS_OTHER_BAD_TLD      Untrustworthy TLDs
 [URI: yoctocell.xyz (xyz)]
 -0.0 SPF_HELO_PASS          SPF: HELO matches SPF record
 1.8 LONGWORDS              Long string of long words
X-Debbugs-Envelope-To: submit
Cc: Homo <gay@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 2.5 (++)
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:  Thanks to cooperative work with Lennart Augustsson, MicroHs
    is now bootstrappable with Hugs. Skipping build of CPPHS because it depends
    on CPPHS, as well as skipping build of MicroCabal because its source lives
    in <https://github.com/augustss/MicroCabal>, so need to package it separately.
    
 
 Content analysis details:   (2.5 points, 10.0 required)
 
  pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -0.0 RCVD_IN_DNSWL_NONE     RBL: Sender listed at https://www.dnswl.org/,
                              no trust
                             [2001:470:142:0:0:0:0:17 listed in]
                             [list.dnswl.org]
  0.9 SPF_FAIL               SPF: sender does not match SPF record (fail)
 [SPF failed: Please see http://www.openspf.org/Why?s=mfrom;id=gay%40disroot.org;ip=2001%3A470%3A142%3A%3A17;r=debbugs.gnu.org]
  0.8 PDS_OTHER_BAD_TLD      Untrustworthy TLDs
                             [URI: yoctocell.xyz (xyz)]
 -0.0 SPF_HELO_PASS          SPF: HELO matches SPF record
  1.8 LONGWORDS              Long string of long words
 -1.0 MAILING_LIST_MULTI     Multiple indicators imply a widely-seen list
                             manager

Thanks to cooperative work with Lennart Augustsson, MicroHs is now bootstrappable with Hugs.

Skipping build of CPPHS because it depends on CPPHS, as well as skipping build of MicroCabal because its source lives in <https://github.com/augustss/MicroCabal>, so need to package it separately.

Depends on <https://issues.guix.gnu.org/75745>.

* gnu/packages/patches/microhs-Makefile.patch: New file.
* gnu/local.mk (dist_patch_DATA): Register it.
* gnu/packages/haskell.scm (microhs): New variable.

Change-Id: Iedbec3fef125044a36f7beed0d5db0d7ad123d5d
---
 gnu/local.mk                                |  1 +
 gnu/packages/haskell.scm                    | 42 ++++++++++++
 gnu/packages/patches/microhs-Makefile.patch | 76 +++++++++++++++++++++
 3 files changed, 119 insertions(+)
 create mode 100644 gnu/packages/patches/microhs-Makefile.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index ecea6ae9c7..0a56634eb5 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1824,6 +1824,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/mia-vtk9.patch				\
   %D%/packages/patches/mia-vtk92.patch				\
   %D%/packages/patches/mia-vtk-version.patch			\
+  %D%/packages/patches/microhs-Makefile.patch			\
   %D%/packages/patches/minisat-friend-declaration.patch		\
   %D%/packages/patches/minisat-install.patch			\
   %D%/packages/patches/miniz-for-pytorch.patch			\
diff --git a/gnu/packages/haskell.scm b/gnu/packages/haskell.scm
index 10803f5afe..43774dbc54 100644
--- a/gnu/packages/haskell.scm
+++ b/gnu/packages/haskell.scm
@@ -24,6 +24,7 @@
 ;;; Copyright © 2021 Xinglu Chen <public@HIDDEN>
 ;;; Copyright © 2021 Simon Tournier <zimon.toutoune@HIDDEN>
 ;;; Copyright © 2023 Maxim Cournoyer <maxim.cournoyer@HIDDEN>
+;;; Copyright © 2025 Homo <gay@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -54,6 +55,7 @@ (define-module (gnu packages haskell)
   #:use-module (gnu packages gawk)
   #:use-module (gnu packages gcc)
   #:use-module (gnu packages ghostscript)
+  #:use-module (gnu packages hugs)
   #:use-module (gnu packages libffi)
   #:use-module (gnu packages linux)
   #:use-module (gnu packages lisp)
@@ -113,6 +115,46 @@ (define-public cl-yale-haskell
 top of CLISP.")
       (license license:bsd-4))))
 
+(define-public microhs
+  ;; There are no tags, using latest commit from branch "hugs".
+  (let ((commit "c478ae10b84b722dc41b58d016fd28c8f7e97695")
+        (revision "0"))
+    (package
+      (name "microhs")
+      (version (git-version "0.11.2.4" revision commit))
+      (source (origin
+        (method git-fetch)
+        (uri (git-reference
+          (url "https://github.com/augustss/MicroHs")
+          (commit commit)))
+        (file-name (git-file-name name version))
+        (sha256
+          (base32 "09rx5zaygc0f3wx4pjxk58q7cfh9ac06194ha2gbqjdis71llfs4"))
+        (patches (search-patches "microhs-Makefile.patch"))
+        (modules '((guix build utils)))
+        ;; Remove pre-build binaries.
+        (snippet '(delete-file-recursively "generated"))))
+      (build-system gnu-build-system)
+      (arguments
+        (list
+          ;; TODO: CONF=unix-32 if CPU is 32-bit.
+          #:make-flags #~(list "CC=gcc" (string-append "PREFIX=" #$output))
+          ;; Some tests require GHC and CPPHS.
+          #:tests? #f
+          #:phases
+          #~(modify-phases %standard-phases
+            (delete 'configure))))
+      (inputs (list hugs))
+      (native-search-paths
+        (list (search-path-specification
+          (variable "MHSDIR")
+          (files '("lib/mhs")))))
+      (home-page "https://github.com/augustss/MicroHs")
+      (synopsis "A small compiler for Haskell")
+      (description "A compiler for an extended subset of Haskell-2010.
+The compiler translates to combinators and can compile itself.")
+      (license license:asl2.0))))
+
 ;; This package contains lots of generated .hc files containing C code to
 ;; bootstrap the compiler without a Haskell compiler.  The included .hc files
 ;; cover not just the compiler sources but also all Haskell libraries.
diff --git a/gnu/packages/patches/microhs-Makefile.patch b/gnu/packages/patches/microhs-Makefile.patch
new file mode 100644
index 0000000000..1f407a860d
--- /dev/null
+++ b/gnu/packages/patches/microhs-Makefile.patch
@@ -0,0 +1,76 @@
+Avoid verbosity in (arguments) in Guile code.
+
+diff --git a/Makefile b/Makefile
+index 2b98363b..86d2260e 100644
+--- a/Makefile
++++ b/Makefile
+@@ -34,7 +34,7 @@ MAINMODULE=src/MicroHs/Main.hs
+ #
+ .PHONY:	clean bootstrap install ghcgen newmhs newmhsz cachelib timecompile exampletest cachetest runtest runtestmhs everytest everytestmhs nfibtest info
+ 
+-all:	bin/mhs bin/cpphs bin/mcabal
++all:	bin/mhs
+ 
+ targets.conf:
+ 	echo [default]           > targets.conf
+@@ -56,11 +56,6 @@ newmhsz:	newmhs
+ sanitizemhs:	ghcgen targets.conf
+ 	$(CCEVAL) -fsanitize=undefined -fsanitize=address -fsanitize=pointer-compare -fsanitize=pointer-subtract generated/mhs.c -o bin/mhssane
+ 
+-# Compile mhs from distribution, with C compiler
+-bin/mhs:	src/runtime/*.c src/runtime/*.h targets.conf #generated/mhs.c
+-	@mkdir -p bin
+-	$(CCEVAL) generated/mhs.c -o bin/mhs
+-
+ # Compile cpphs from distribution, with C compiler
+ bin/cpphs:	src/runtime/*.c src/runtime/config*.h generated/cpphs.c
+ 	@mkdir -p bin
+@@ -108,16 +103,16 @@ mhs.js:	src/*/*.hs src/runtime/*.[ch] targets.conf
+ 	bin/mhs $(MHSINC) -temscripten $(MAINMODULE) -o mhs.js
+ 
+ # Make sure boottrapping works
+-bootstrap:	bin/mhs-stage2
++bin/mhs:	bin/mhs-stage2
+ 	@echo "*** copy stage2 to bin/mhs"
+ 	cp bin/mhs-stage2 bin/mhs
+ 	cp generated/mhs-stage2.c generated/mhs.c 
+ 
+ # Build stage1 compiler with existing compiler
+-bin/mhs-stage1:	bin/mhs src/*/*.hs
++bin/mhs-stage1:	bin/hmhs src/*/*.hs
+ 	@mkdir -p generated
+ 	@echo "*** Build stage1 compiler, using bin/mhs"
+-	bin/mhs -z $(MHSINC) $(MAINMODULE) -ogenerated/mhs-stage1.c
++	bin/hmhs -z $(MHSINC) $(MAINMODULE) -ogenerated/mhs-stage1.c
+ 	$(CCEVAL) generated/mhs-stage1.c -o bin/mhs-stage1
+ 
+ # Build stage2 compiler with stage1 compiler, and compare
+@@ -178,10 +173,9 @@ clean:
+ 	cd tests; make clean
+ 	-cabal clean
+ 
+-oldinstall:
++install:
+ 	mkdir -p $(PREFIX)/bin
+ 	cp bin/mhs $(PREFIX)/bin
+-	-cp bin/cpphs $(PREFIX)/bin
+ 	mkdir -p $(PREFIX)/lib/mhs/src/runtime
+ 	cp -r lib $(PREFIX)/lib/mhs
+ 	cp src/runtime/* $(PREFIX)/lib/mhs/src/runtime
+@@ -253,7 +247,7 @@ $(MCABALMHS)/packages/$(BASE).pkg: bin/mhs lib/*.hs lib/*/*.hs lib/*/*/*.hs
+ 	bin/mhs -Q $(BASE).pkg $(MCABALMHS)
+ 	@rm $(BASE).pkg
+ 
+-install: $(MCABALBIN)/mhs $(MCABALBIN)/cpphs $(MCABALBIN)/mcabal $(MCABALMHS)/packages/$(BASE).pkg
++newinstall: $(MCABALBIN)/mhs $(MCABALBIN)/cpphs $(MCABALBIN)/mcabal $(MCABALMHS)/packages/$(BASE).pkg
+ 	@echo $$PATH | tr ':' '\012' | grep -q $(MCABALBIN) || echo '***' Add $(MCABALBIN) to the PATH
+ 
+ # mkdir ~/.mcabal/packages/array-0.5.6.0
+@@ -277,6 +271,6 @@ generated/hmhs.c:
+ 	@mkdir -p generated
+ 	$(HUGS) $(HUGSINCS) $(MAINMODULE) $(MHSINC) $(MAINMODULE) -ogenerated/hmhs.c
+ 
+-bin/hmhs: generated/hmhs.c
++bin/hmhs: generated/hmhs.c src/runtime/*.c src/runtime/*.h targets.conf
+ 	@mkdir -p bin
+ 	$(CCEVAL) generated/hmhs.c -o bin/hmhs
-- 
2.47.1





Acknowledgement sent to Homo <gay@HIDDEN>:
New bug report received and forwarded. Copy sent to guix-patches@HIDDEN. Full text available.
Report forwarded to guix-patches@HIDDEN:
bug#75778; 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: Sun, 26 Jan 2025 15:00:02 UTC

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