From patchwork Fri Dec 20 05:12:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: unmush X-Patchwork-Id: 35090 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id CE29427BBE9; Fri, 20 Dec 2024 07:57:39 +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=-6.4 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE, SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham 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 57DE027BBE2 for ; Fri, 20 Dec 2024 07:57:34 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tOXsg-0006TZ-8Z; Fri, 20 Dec 2024 02:57:06 -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 ) id 1tOXsc-0006T9-9l for guix-patches@gnu.org; Fri, 20 Dec 2024 02:57:04 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tOXsc-0002oc-0x for guix-patches@gnu.org; Fri, 20 Dec 2024 02:57:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:From:Date:To:In-Reply-To:References:Subject; bh=p0EERgoZvihfU+43ktPHBOioGhmGOfniqgNNzku7r78=; b=l4AJ2+xZ7zCLJcV4hnPmcrMNxEDwqCEsOuZ6oB0qRdy68KznDT1dLABJ3h0vzeFB9DCbizClWAI0gZrVo9jUwB/1gzv568ZmP9Mcn4qOVhNa7kVv8pNeHcHZVNU5cmcJi9YJucETKEAtEqmC1O9b05W7PBfV3ieC27t/AdLB0w0pZ4UrxlnNHzUzdOsHp4BzTaf/BJIr2CPYj21RH7+/QCeHGB0oDSeEbI4Jiw1U2QkUEfuj71rWe1vXfPSTh5+Vq/YKpi/idHien+NbH4madweJRznqmRyt/aTYg5c6rHvqC9OkpDOEw105rhx+CQm/9KvstJ9HX1umMV8uoxeA6g==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tOXsb-0001YY-Od for guix-patches@gnu.org; Fri, 20 Dec 2024 02:57:01 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#74609] V2 series References: In-Reply-To: Resent-From: unmush Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 20 Dec 2024 07:57:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74609 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: "74609@debbugs.gnu.org" <74609@debbugs.gnu.org> Received: via spool by 74609-submit@debbugs.gnu.org id=B74609.17346813625878 (code B ref 74609); Fri, 20 Dec 2024 07:57:01 +0000 Received: (at 74609) by debbugs.gnu.org; 20 Dec 2024 07:56:02 +0000 Received: from localhost ([127.0.0.1]:41508 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tOXre-0001Wj-8n for submit@debbugs.gnu.org; Fri, 20 Dec 2024 02:56:02 -0500 Received: from mail-43166.protonmail.ch ([185.70.43.166]:51901) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tOVJb-00023d-43 for 74609@debbugs.gnu.org; Fri, 20 Dec 2024 00:12:44 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=proton.me; s=qsx45qqp4nblrfbshgwlk6lsoy.protonmail; t=1734671553; x=1734930753; bh=p0EERgoZvihfU+43ktPHBOioGhmGOfniqgNNzku7r78=; h=Date:To:From:Subject:Message-ID:Feedback-ID:From:To:Cc:Date: Subject:Reply-To:Feedback-ID:Message-ID:BIMI-Selector: List-Unsubscribe:List-Unsubscribe-Post; b=IEi6/UJ5D89rBdCS7TV04fT6wfGSMfJ6/eOxPCLI8xpO6yuvK1tQaGYW1s0SZCakq mvUxcOGR4tCfBVqGLFg+LX/zCu6RMskSjCPtO1bUVUWjpNyJkNvTHKnB1BVlTIgpPv XxZS4smQHEirHCqwfneLJ0LVcnieXmglRUAUannjfNb5glQ8HiKxPqG54jOa8lqANc Q5gWHlINHtJIlY2SaXGp4PoyQv8W5oBvWLEuKb6sLyBPWz31HaHz+sCZZmhwydveBJ Kk1LymQBKtbA9U4oHoNVQtHqPAErnlH29CRCn64eGkMpXbhPeFdkzSs2XeE+jxraKg pxCw1P6FdgEbQ== Date: Fri, 20 Dec 2024 05:12:29 +0000 Message-ID: <2Zx39DgdkCBWdzQR1QSV4eAxPs98sBBj43GTHCUKL3lvKNunS5hQwqkEpvrKSg1W-hlzxdx5RNwlrn5_ILHPHYidzwx_8oCkmzzXxyk6y8M=@proton.me> Feedback-ID: 126986417:user:proton X-Pm-Message-ID: e1ff180d8310700c169dcbfe21e7967019bbe4b9 MIME-Version: 1.0 X-Mailman-Approved-At: Fri, 20 Dec 2024 02:56:01 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-to: unmush X-ACL-Warn: , unmush via Guix-patches X-Patchwork-Original-From: unmush via Guix-patches via From: unmush Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches Efraim writes: > It turns out the first 2 patches didn't apply cleanly, so I fixed that > up and I'm sending them back to the list. It turns out that git wants to do a full 3-way merge when applying patches, and I formatted the patches from my local repository which has a bunch of extra commits in it that touch gnu/local.mk, so the generated patch referenced a file hash that didn't exist upstream. > A couple of things that I noticed: > > * mono-5.something doesn't have its patches apply cleanly mono-5.10's patches didn't apply cleanly because some of the mono sources being patched used CRLF line endings, and git normalized those in the patch-containing-the-patch. This time around I've tried first running "git config core.autocrlf false", hopefully that fixes it. Note that you'll need to pass '--keep-cr' to 'git am'. > * I was only able to build to mono-3.12 before I got a build failure on > x86_64 After some discussion in #guix we discovered that the cause for this was that parallel builds weren't properly supported. I didn't encounter these failures very much on my own system because I used --keep-failed, which disabled offloading so that they were built on my rather weak 4-core system. I have since tested without --keep-failed and found consistent built failures with '#:parallel-build? #t' all the way up to and including mono-5.10.0, so I've passed '#:parallel-build? #f' to all of those. I have, however, added `"-j" (number->string (parallel-job-count))' to the build-reference-assemblies phase, since that phase takes quite a long time and doesn't seem to have any trouble with parallel builds. > * mono-1.2.6 doesn't have support for aarch64 or riscv64, and will > probably need some patches (later) to add support. Old versions of mono do technically have an interpreter, but by mono-1.2.6 it's already bitrotted to the point of not working (it's not only missing several includes, it also refers to nonexistent fields and procedures that seem to have been since renamed). They eventually fully deleted the interpreter in 2014 in commit 6bee6a7b18978aa6ce977b8b0f9ce19cf962f36b, only to later revive it in 2017 (https://www.mono-project.com/news/2017/11/13/mono-interpreter/). So even if we fixed up mono 1.2.6's interpreter, we'd need to also get it working for each version up to 2017 in order to achieve a fully portable bootstrap path. One alternative option could be some variety of frankenmono: either trying to backport 2017's interpreter to older versions of mono, or trying to run an old mono compiler / class library with a newer mono runtime. Mono's class library depends on runtime-specific icalls, which may have changed over time in a non-backwards-compatible way, which could hinder the latter attempt. The implementation of those icalls, additionally, is probably going to depend on code that is also depended on by the interpreter, so replacing runtime internals to more easily suit the backported interpreter may also require updating those, which could hinder the former attempt. Another possibility would be trying to use pnet's ilrun for mono versions up to 2017, but this would run in to the same issues with runtime-specific icalls, so either mono's class library would need to be adjusted to be able to use pnet's icalls, or mono's icalls would have to be ported to pnet's ilrun, or mcs would have to be adjusted to not depend on anything mono-specific (if it doesn't already). That last possibility may be one of the most interesting, as compilers usually don't need many fancy runtime features (they are after all a very basic batch input-output process that usually solely touches files), and this would effectively strip every intermediate mono build down to just building mcs. Additionally, if the build could be stripped down to just building mcs, we wouldn't need to support the new features used by the class library, which would allow us to make much bigger jumps between versions. The sheer amount of work saved may end up more than making up for ilrun's lower performance. > * libjit FTBFS on powerpc64le. I tried working around it but wasn't > successful in when it came to using libjit. > * The assembly included in libjit targets a too-early version of arm, so > it is just broken completely on armhf and would probably do best with it > being ripped out. libjit is the one component of Portable.NET that outlived its parent project, and it's been updated as recently as 2020. It's supposed to fall back to interpreting on architectures it doesn't support, so it could be that the only changes that need to be made are to refine its detection process. In the meantime, I've adjusted pnet-git to not use libjit on all non-x86 platforms, instead using pnet's own Converted Virtual Machine (CVM) interpreter. This was buggy when using its "unroller" functionality, which requires a small amount of platform-specific code anyway, so I disabled that. This also caused a subtle change in pnetlib-git's test suite, so that a test that previously failed is now properly reported as failing, so I disabled that (it failed due to requiring libx11 and an X server, and due to no provision being made for it to find a .so produced by pnetlib that interfaces with libx11). A V2 series is attached. Note: the full series in one message was rejected by debbugs moderators, but presumably made it through to the other CC'ed recipients. I'm splitting it across some more messages in the hope that it will go through that way. There should be 21 patches in total. From 47964f7d6d1ac45fc301b15b7eebfd338196a3fa Mon Sep 17 00:00:00 2001 From: unmush Date: Tue, 26 Nov 2024 13:12:11 Subject: [PATCH v2 08/21] gnu: Add mono-2.11.4. * gnu/packages/dotnet.scm (mono-2.11.4-external-repo-specs, mono-2.11.4): New variables. (add-external-repos): New procedure. * gnu/packages/patches/mono-2.11.4-fixes.patch: New patch. * gnu/local.mk (dist_patch_DATA): Register it. --- gnu/local.mk | 1 + gnu/packages/dotnet.scm | 95 ++++++++++++++++++++ gnu/packages/patches/mono-2.11.4-fixes.patch | 36 ++++++++ 3 files changed, 132 insertions(+) create mode 100644 gnu/packages/patches/mono-2.11.4-fixes.patch diff --git a/gnu/local.mk b/gnu/local.mk index 99e106df8fc..8aeb4536f51 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1828,6 +1828,7 @@ dist_patch_DATA = \ %D%/packages/patches/mono-1.9.1-fixes.patch \ %D%/packages/patches/mono-2.4.2.3-fixes.patch \ %D%/packages/patches/mono-2.6.4-fixes.patch \ + %D%/packages/patches/mono-2.11.4-fixes.patch \ %D%/packages/patches/mosaicatcher-unbundle-htslib.patch \ %D%/packages/patches/mrrescue-support-love-11.patch \ %D%/packages/patches/mtools-mformat-uninitialized.patch \ diff --git a/gnu/packages/dotnet.scm b/gnu/packages/dotnet.scm index 82bee55aa90..f97567dc29f 100644 --- a/gnu/packages/dotnet.scm +++ b/gnu/packages/dotnet.scm @@ -545,3 +545,98 @@ (define-public mono-2.6.4 (search-patches "mono-2.6.4-fixes.patch")))) (native-inputs (modify-inputs (package-native-inputs mono-2.4.2) (replace "mono" mono-2.4.2))))) + +;; submodule checkouts use git://, which isn't supported by github anymore, so +;; we need to manually provide them instead of being able to use (recursive? +;; #t). Also try not to think too hard about the fact that some of these +;; submodules in later versions contain binary compiler blobs which mono +;; maintainers presumably used when creating the bootstrap binaries they +;; published. All fetched and updated over unauthenticated git://. + +(define mono-2.11.4-external-repo-specs + ;; format: ({reponame OR (reponame dir-name)} commit-hash origin-sha256) ... + ;; if reponame starts with https:// it is treated as the repository url, + ;; otherwise the name of a repository under https://github.com/mono/ + '(("aspnetwebstack" "1836deff6a2683b8a5b7dd78f2b591a10b47573e" + "0vqq45i8k6jylljarr09hqqiwjs8wn0lgjrl6bz72vxqpp0j344k") + ("cecil" "54e0a50464edbc254b39ea3c885ee91ada730705" + "007szbf5a14q838695lwdp7ap6rwzz3kzllgjfnibzlqipw3x2yk") + ("entityframework" "9baca562ee3a747a41870f45e749e4436b6aca26" + "0l8k04bykbrbk5q2pz8hzh8xy8y4ayz7j97fw0kyk3lrai89v5da") + ("Newtonsoft.Json" "471c3e0803a9f40a0acc8aeceb31de6ff93a52c4" + "0dgngd5hqk6yhlg40kabn6qdnknm32zcx9q6bm2w31csnsk5978s"))) + +(define (add-external-repos specs) + (define (reponame->url reponame) + (if (string-prefix? "https://" reponame) + reponame + (string-append "https://github.com/mono/" reponame))) + + (define* (external-repo-gexp reponame commit hash + #:key recursive? (patches '())) + (let ((short-commit (string-take commit 6)) + (reponame (if (pair? reponame) (car reponame) + reponame)) + (dir-name (if (pair? reponame) (cadr reponame) + reponame))) + #~(copy-recursively #+(origin + (method git-fetch) + (uri (git-reference + (url (reponame->url reponame)) + (commit commit) + (recursive? recursive?))) + (file-name + (git-file-name dir-name + short-commit)) + (sha256 (base32 hash)) + (patches (map search-patch patches))) + #$(string-append "./external/" dir-name)))) + + (define (spec->gexp spec) + (apply external-repo-gexp spec)) + + #~(begin + #+@(map spec->gexp specs))) + +(define-public mono-2.11.4 + (package + (inherit mono-2.6.4) + (version "2.11.4") + (name "mono") + (source (origin + (method git-fetch) + (uri + (git-reference + (url "https://gitlab.winehq.org/mono/mono.git") + (commit (string-append "mono-" "2.11.4")))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "0y2bifi2avbjmfp80hjga2dyqip4b46zkvx6yfr9pa2hhm940rpx")) + (modules '((guix build utils) + (ice-9 string-fun))) + (snippet #~(begin + #$(add-external-repos + mono-2.11.4-external-repo-specs) + #$prepare-mono-source)) + (patches + (search-patches "mono-2.11.4-fixes.patch")))) + (build-system gnu-build-system) + (native-inputs (modify-inputs (package-native-inputs mono-2.6.4) + (replace "mono" mono-2.6.4))) + (license (list + ;; most of mcs/tools, mono/man, most of mcs/class, tests by + ;; default, mono/eglib, mono/metadata/sgen*, + ;; mono/arch/*/XXX-codegen.h + ;; mcs/mcs, mcs/gmcs (dual-licensed GPL) + ;; samples + license:x11 + ;; mcs/mcs, mcs/gmcs (dual-licensed X11) + ;; some of mcs/tools + license:gpl1+ ;; note: ./mcs/LICENSE.GPL specifies no version + ;; mono/mono (the mono VM, I think they meant mono/mini) + license:lgpl2.0+ ;; note: ./mcs/LICENSE.LGPL specifies no version + ;; mcs/jay + license:bsd-4 + ;; mcs/class/System.Core/System/TimeZoneInfo.Android.cs + license:asl2.0)))) diff --git a/gnu/packages/patches/mono-2.11.4-fixes.patch b/gnu/packages/patches/mono-2.11.4-fixes.patch new file mode 100644 index 00000000000..02a05f7977a --- /dev/null +++ b/gnu/packages/patches/mono-2.11.4-fixes.patch @@ -0,0 +1,36 @@ +diff --git a/configure.in b/configure.in +index 38cc6dc2925..4c608eb150f 100644 +--- a/configure.in ++++ b/configure.in +@@ -470,7 +470,7 @@ AC_CHECK_HEADERS(wchar.h) + AC_CHECK_HEADERS(ieeefp.h) + AC_MSG_CHECKING(for isinf) + AC_TRY_LINK([#include ], [ +- int f = isinf (1); ++ int f = isinf (1.0); + ], [ + AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_ISINF, 1, [isinf available]) +diff --git a/mono/io-layer/processes.c b/mono/io-layer/processes.c +index 586b54715db..d27857aa092 100644 +--- a/mono/io-layer/processes.c ++++ b/mono/io-layer/processes.c +@@ -18,6 +18,7 @@ + #include + #include + #include ++#include + #include + #include + #include +diff --git a/runtime/Makefile.am b/runtime/Makefile.am +index 6957a287d38..2d071230a84 100644 +--- a/runtime/Makefile.am ++++ b/runtime/Makefile.am +@@ -1,6 +1,3 @@ +-# hack to prevent 'check' from depending on 'all' +-AUTOMAKE_OPTIONS = cygnus +- + tmpinst = _tmpinst + + noinst_SCRIPTS = mono-wrapper monodis-wrapper -- 2.45.2