From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id KK9HE4ZjYGdfZQAAqHPOHw:P1 (envelope-from ) for ; Mon, 16 Dec 2024 17:29:42 +0000 Received: from aspmx1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id KK9HE4ZjYGdfZQAAqHPOHw (envelope-from ) for ; Mon, 16 Dec 2024 18:29:42 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=debbugs.gnu.org header.s=debbugs-gnu-org header.b=MctYPzRk; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20230601 header.b=bXYxmh6g; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" ARC-Seal: i=1; s=key1; d=yhetil.org; t=1734370182; a=rsa-sha256; cv=none; b=sIlsPhXmgKNqmqXpkmM8J5CpPWqyg6SUyOEUo191gqfr4me0Z7/UICjD+6VBF1PoLRUAOS gKIsFxVE8HKrD5cT6ZlYA8Lq6AhRhdzqYg+iMEvzRyoQxTdFpdIKKTMg9li/ljP/1NLGO4 d4PK6i8MjOLlKxvg2CT0s1OksJmo+dBzfB+/8kENnmp2cLMzdvpukZ+rg8xRJJ+1/f7E1x KI7X9LYjIhvPf6dwO9WbvGzPWAyBgWyCG6UdQDN6FwlfCvR8rteOuT/vgqkWAcFoxrBiyQ iogx3tCF6RRxy+guNRF6u2GbIGcQQXjJ5MOOz3nX+xOT77E6WMloGZMrcmuByQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=debbugs.gnu.org header.s=debbugs-gnu-org header.b=MctYPzRk; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20230601 header.b=bXYxmh6g; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1734370182; h=from:from:sender:sender: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:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=KNZ8scw786ESgmoMjsnQZxE98UPRcCPXMtTGJNsxfBY=; b=tFY8olKdPr9xfteRSKaV3pUxSaB0lZbHpHONOgi3EP0YsLYvVqoKQNBqoXOLZHtZ5dz58L b5HnhUb0orXvdOKnMWofwQBzdwUI4f5gq20H5Ovoz4LaBE9e2Iu8cBtTCP+6KzzQdfYqsB wHeJLgIBzn79VSsRts5PzD5+ug9coHMz+rYhQbQ/v26JrEM8W8V7eXUZoBTDVftsmfcO3m 3Q0EWQhKFtp7nLtVq3JNZ+8R2ISNTYwkemxivB36LUk7f23+Tjg8hhytdnNaXMHlQ3Ii3J dV9aILuy23Ozu4DA4DJHBkMd9lzw6QYpUgLeSPBm/Y4oZP55+YRqb2PCnV2Hig== Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 69F97B96 for ; Mon, 16 Dec 2024 18:29:41 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tNEuN-0000TU-51; Mon, 16 Dec 2024 12:29:28 -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 1tNEu5-0000IG-Fc for guix-patches@gnu.org; Mon, 16 Dec 2024 12:29:11 -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 1tNEu4-0001vt-LW for guix-patches@gnu.org; Mon, 16 Dec 2024 12:29:09 -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:References:In-Reply-To:Date:From:To:Subject; bh=KNZ8scw786ESgmoMjsnQZxE98UPRcCPXMtTGJNsxfBY=; b=MctYPzRkyhoLmMBV+QkERwNljbbw8kwBDivM3xrfQYoJL4MFRZi7Tp0fqs7Ao8gWA08nNqmxl+v8doNZpfkBxo9K1Piz/N2sSjLjaLSywmtt39WIBVq1Q7gS19SanVhTKGOFx/9/zMHbe+M+QmumO/U1u5uYzNyDezr9NQrG2sNrJ0k12kGiwmOYL+df4RK4OxXvTV67/VJnPr87ABqPonuvhyFau6XFLfj00uvzkPp4Qvb/myHdvNv2e2RF5ButoMKsq/xJ0ngXGnzwQQeZxIwYONzBQJ8wiUYUoD+e1Se/tvqCPF5UY1kax7EjhX/UKvsIM1KIsZVqVroMaShxTQ==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tNEu4-0006Kp-Bq for guix-patches@gnu.org; Mon, 16 Dec 2024 12:29:08 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#74609] [PATCH 04/21] gnu: Add mono-1.2.6. Resent-From: Efraim Flashner Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 16 Dec 2024 17:29:08 +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 Cc: aaron.covrig.us@ieee.org, ludo@gnu.org, unmush , richard@freakingpenguin.com, unmush@proton.me, janneke@gnu.org Received: via spool by 74609-submit@debbugs.gnu.org id=B74609.173437011324065 (code B ref 74609); Mon, 16 Dec 2024 17:29:08 +0000 Received: (at 74609) by debbugs.gnu.org; 16 Dec 2024 17:28:33 +0000 Received: from localhost ([127.0.0.1]:55844 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tNEtS-0006Fo-Gf for submit@debbugs.gnu.org; Mon, 16 Dec 2024 12:28:32 -0500 Received: from mail-wm1-f43.google.com ([209.85.128.43]:59519) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tNEtK-0006EU-Q0 for 74609@debbugs.gnu.org; Mon, 16 Dec 2024 12:28:25 -0500 Received: by mail-wm1-f43.google.com with SMTP id 5b1f17b1804b1-436202dd730so31549225e9.2 for <74609@debbugs.gnu.org>; Mon, 16 Dec 2024 09:28:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1734370037; x=1734974837; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:from:to:cc:subject:date :message-id:reply-to; bh=KNZ8scw786ESgmoMjsnQZxE98UPRcCPXMtTGJNsxfBY=; b=bXYxmh6gPcqsjLWScwD6XOlknDNlcSFoSvFt+4zrvbSdUcWBJPax2B9gXFOX2llF2W X1sOGneSso7UEENKyI0te51vSLLH5iPWu9bGPjrgMq9JWpsQnxocu4w3D96ECLjSNfrb 3qnbvnj1N/2FNaBOO652obfjTNtA/++h32dzykfEbQ3jniVVxvGCNsKnhXLgT70wPpJj Rxlf2N9Y8HIywNKzD7440kXJZOyL2SLxjeHZVXtn8Wssa0XGdNMTYQx2fy/xZNB25dm5 ccX8cNFJD0S9LpKyQbdkF0mHbwO3mTbY+QyCWfRE8s+l37EQ/MHGsq5wkPyakewqUjEy WSqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734370037; x=1734974837; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=KNZ8scw786ESgmoMjsnQZxE98UPRcCPXMtTGJNsxfBY=; b=gl1vui4067e5x/VnZStGkuT/BaRXmEupWQ1EUQvsjGSsgqza7YHNt/AQ0yFr/XO5Ol d0XzbO6hr8SNyecxv4zwGuPi1fEUoB/Yj0YciIWbnf9msY6LaSuKle8vm++oajfKH8lV x6tskcqAnJd46eYdcEhysucWfvowi6/hszEW27UHS4+n3MmNZe5YACTjdbWcVjiuCFLp fUckDF1aWB6XfdVacaSMgdPWlzm6spu3K97obfxZef0gMTKOOVL9RypU31kasy88dcNB MULnoMw+Rz3X5PgmHP8/FuyfeITlYFsmy7B34YSVtRlM44vKQ+fuy+fqAFqQZIa3XLiN J6kA== X-Gm-Message-State: AOJu0YwNNijeFqZiSs45V3jLkmZraMvqbEaO1ZF3WkIiyt66xEBdLsbM mEF5TrHUOTv9H27eLWGSgVtYzoKRyrt7iegV1fEYjYHA3ct4imwfyRSBB5ul X-Gm-Gg: ASbGncusH8NrruJj7s76rd1t2VOXPrYulI3tgi3P/m1qWnbmKWJOdqOsgxiSCtn/Da6 4uOdc5wUEbhbV5BuJhBjhd714lx9EPJ682K6MAwbkxsPvO7//pXa2LHkhsukIgS82V1W32rTLnd scSaWGQ6WRhCFw6Jnj7zUYiBXivVfC13MVkKFwvB+/QhwZC+pSBQMD+tuE69hREX6nYQmBiYqFT u5Rcy+srCvIDygjrjj0iqBjenm9rudKLihlx/0D0a61RUP8JGu/kW/rLuuM6g== X-Google-Smtp-Source: AGHT+IFOa8lTolzDX4FMS6D0Qn+z5mm2KHgykXgtG2jCz1PsnvpBgbJcKZqXQ3GkCMcyi7/Uv4Rbcg== X-Received: by 2002:a05:6000:1ac8:b0:386:3e48:f732 with SMTP id ffacd0b85a97d-38880acd52fmr11019926f8f.16.1734370036647; Mon, 16 Dec 2024 09:27:16 -0800 (PST) Received: from localhost ([31.210.180.118]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-388c8016275sm8618959f8f.24.2024.12.16.09.27.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Dec 2024 09:27:16 -0800 (PST) From: Efraim Flashner Date: Mon, 16 Dec 2024 19:26:27 +0200 Message-ID: <6a867624b7826756425f2fce8b8d77628b3d9fd4.1734369314.git.efraim@flashner.co.il> X-Mailer: git-send-email 2.46.0 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -8.65 X-Spam-Score: -8.65 X-Migadu-Queue-Id: 69F97B96 X-Migadu-Scanner: mx12.migadu.com X-TUID: zwJS7O8zfNrW From: unmush * gnu/packages/dotnet.scm (mono-1.2.6): New variable. * gnu/packages/patches/mono-1.2.6-bootstrap.patch: New patch. * gnu/local.mk (dist_patch_DATA): register it. Change-Id: I73765d921c28c473271a2038dfaa53cc7fdad3c5 --- gnu/local.mk | 1 + gnu/packages/dotnet.scm | 145 +++++ .../patches/mono-1.2.6-bootstrap.patch | 585 ++++++++++++++++++ 3 files changed, 731 insertions(+) create mode 100644 gnu/packages/patches/mono-1.2.6-bootstrap.patch diff --git a/gnu/local.mk b/gnu/local.mk index 8fc98c8fd22..bd2d3e61df4 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1818,6 +1818,7 @@ dist_patch_DATA = \ %D%/packages/patches/mpg321-gcc-10.patch \ %D%/packages/patches/module-init-tools-moduledir.patch \ %D%/packages/patches/monero-use-system-miniupnpc.patch \ + %D%/packages/patches/mono-1.2.6-bootstrap.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 1a027854ced..2f93d4bbd00 100644 --- a/gnu/packages/dotnet.scm +++ b/gnu/packages/dotnet.scm @@ -216,3 +216,148 @@ (define-public pnetlib-git "DotGNU Portable.NET Library contains an implementation of the C# library, for use with .NET-capable runtime engines and applications.") (license license:gpl2+)))) + +(define prepare-mono-source-0 + #~((false-if-exception + (delete-file "./configure")) + (false-if-exception + (delete-file-recursively "./libgc")) + ;; just to be sure + (for-each delete-file + (find-files "." + "\\.(dll|exe|DLL|EXE|so)$")) + ;; We deleted docs/AgilityPack.dll earlier (if it existed), and it's + ;; required for building the documentation, so skip building the + ;; documentation. According to docs/README, "the sources to this DLL + ;; live in GNOME CVS module beagle/Filters/AgilityPack". + (substitute* "./Makefile.am" + (("^(|DIST_|MOONLIGHT_|MONOTOUCH_)SUBDIRS =.*" all) + (string-replace-substring + (string-replace-substring + (string-replace-substring all " docs" "") + " $(libgc_dir)" "") + " libgc" ""))))) + +;; A lot of the fixes are shared between many versions, and it doesn't hurt to +;; apply them to versions before or after they are necessary, so just include +;; them all. +(define prepare-mono-source + #~(begin + #$@prepare-mono-source-0 + (substitute* (filter file-exists? + '("./configure.in" + "./configure.ac")) + (("int f = isinf \\(1\\);") + "int f = isinf (1.0);")) + ;; makedev is in now. Include + ;; it. + (substitute* "mono/io-layer/processes.c" + (("#ifdef HAVE_SYS_MKDEV_H") "#if 1") + (("sys/mkdev.h") "sys/sysmacros.h")) + (substitute* (filter file-exists? '("./mono/metadata/boehm-gc.c")) + (("GC_set_finalizer_notify_proc") + "GC_set_await_finalize_proc") + (("GC_toggleref_register_callback") + "GC_set_toggleref_func")) + (substitute* (filter file-exists? '("./mono/utils/mono-compiler.h")) + (("static __thread gpointer x MONO_TLS_FAST") + (string-append + "static __thread gpointer x" + " __attribute__((used))"))) + ;; Since the time the old mono versions were written at, gcc has started + ;; removing more things it thinks are unused (for example because they + ;; are only referenced in inline assembly of some sort). + (substitute* (filter file-exists? '("./mono/metadata/sgen-alloc.c")) + (("static __thread char \\*\\*tlab_next_addr") + (string-append + "static __thread char **tlab_next_addr" + " __attribute__((used))"))) + (substitute* (filter file-exists? '("mono/utils/mono-compiler.h")) + (("#define MONO_TLS_FAST ") + "#define MONO_TLS_FAST __attribute__((used)) ")))) + +(define-public mono-1.2.6 + (package + (version "1.2.6") + (name "mono") + (source (origin + (method url-fetch) + (uri (string-append + "http://download.mono-project.com/sources/mono/" + "mono" "-" version ".tar.bz2")) + (sha256 + (base32 "03sn7wyvrjkkkbrqajpmqifxfn83p30qprizpb3m6c5cdhwlzk14")) + (modules '((guix build utils) + (ice-9 string-fun))) + (snippet #~(begin + #$prepare-mono-source + (delete-file + "./mcs/class/System/System.Text.RegularExpressions/BaseMachine.cs") + ;; Can't patch a file with different line endings, + ;; so the patch creates a new one, and we overwrite + ;; the old one here. + (rename-file + "./mcs/class/System/System.Text.RegularExpressions/BaseMachine.cs-2" + "./mcs/class/System/System.Text.RegularExpressions/BaseMachine.cs"))) + (patches + (search-patches "mono-1.2.6-bootstrap.patch")))) + (build-system gnu-build-system) + (native-inputs + (list autoconf + automake + bison + libtool + pnet-git + pnetlib-git + pkg-config)) + (inputs + (list glib + libgc + libx11 + zlib)) + (arguments + (list + #:configure-flags #~(list "--with-gc=boehm") + #:make-flags #~(list (string-append "EXTERNAL_MCS=" + #+(this-package-native-input "pnet-git") + "/bin/cscc") + (string-append "EXTERNAL_RUNTIME=" + #+(this-package-native-input "pnet-git") + "/bin/ilrun") + "CFLAGS+=-DARG_MAX=500" + "CC=gcc" + "V=1") + ;; build fails nondeterministically without this + #:parallel-build? #f + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'set-env + (lambda _ ;;* (#:key inputs #:allow-other-keys) + ;; all tests under mcs/class fail trying to access $HOME + (setenv "HOME" "/tmp") + ;; ZIP files have "DOS time" which starts in Jan 1980. + (setenv "SOURCE_DATE_EPOCH" "315532800")))) + ;; System.Object isn't marked as serializable because it causes issues + ;; with compiling with pnet (circular class reference between Object and + ;; SerializableAttribute), and this causes tests to fail + #:tests? #f)) + (native-search-paths + (list (search-path-specification + (variable "MONO_PATH") + (files (list "lib/mono"))))) + (synopsis "Compiler and libraries for the C# programming language") + (description "Mono is a compiler, vm, debugger and set of libraries for +C#, a C-style programming language from Microsoft that is very similar to +Java.") + (home-page "https://www.mono-project.com/") + ;; See ./LICENSE + (license (list + ;; most of mcs/tools, mono/man, most of mcs/class, tests by + ;; default, mono/eglib + license:x11 + ;; mcs/mcs, mcs/gmcs, 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)))) diff --git a/gnu/packages/patches/mono-1.2.6-bootstrap.patch b/gnu/packages/patches/mono-1.2.6-bootstrap.patch new file mode 100644 index 00000000000..0f6efd4a034 --- /dev/null +++ b/gnu/packages/patches/mono-1.2.6-bootstrap.patch @@ -0,0 +1,585 @@ +diff --git a/mcs/class/System/System.Diagnostics/ICollectData.cs b/mcs/class/System/System.Diagnostics/ICollectData.cs +index c52f9871589..c66c1936d3d 100644 +--- a/mcs/class/System/System.Diagnostics/ICollectData.cs ++++ b/mcs/class/System/System.Diagnostics/ICollectData.cs +@@ -41,7 +41,7 @@ namespace System.Diagnostics + #endif + public interface ICollectData { + void CloseData (); +- [return: MarshalAs(UnmanagedType.I4)] ++ //[return: MarshalAs(UnmanagedType.I4)] + void CollectData ( + [In] [MarshalAs(UnmanagedType.I4)] int id, + [In] [MarshalAs(UnmanagedType.SysInt)] IntPtr valueName, +diff --git a/mcs/class/System/System.Diagnostics/LocalFileEventLog.cs b/mcs/class/System/System.Diagnostics/LocalFileEventLog.cs +index 280e6a97227..c41816dca24 100644 +--- a/mcs/class/System/System.Diagnostics/LocalFileEventLog.cs ++++ b/mcs/class/System/System.Diagnostics/LocalFileEventLog.cs +@@ -140,6 +140,30 @@ namespace System.Diagnostics + file_watcher.EnableRaisingEvents = false; + } + ++ void FileCreationWatcher(object o, FileSystemEventArgs e) ++ { ++ lock (this) { ++ if (_notifying) ++ return; ++ _notifying = true; ++ } ++ ++ // Process every new entry in one notification event. ++ try { ++ while (GetLatestIndex () > last_notification_index) { ++ try { ++ CoreEventLog.OnEntryWritten (GetEntry (last_notification_index++)); ++ } catch (Exception ex) { ++ // FIXME: find some proper way to output this error ++ Debug.WriteLine (ex); ++ } ++ } ++ } finally { ++ lock (this) ++ _notifying = false; ++ } ++ } ++ + public override void EnableNotification () + { + if (file_watcher == null) { +@@ -149,28 +173,7 @@ namespace System.Diagnostics + + file_watcher = new FileSystemWatcher (); + file_watcher.Path = logDir; +- file_watcher.Created += delegate (object o, FileSystemEventArgs e) { +- lock (this) { +- if (_notifying) +- return; +- _notifying = true; +- } +- +- // Process every new entry in one notification event. +- try { +- while (GetLatestIndex () > last_notification_index) { +- try { +- CoreEventLog.OnEntryWritten (GetEntry (last_notification_index++)); +- } catch (Exception ex) { +- // FIXME: find some proper way to output this error +- Debug.WriteLine (ex); +- } +- } +- } finally { +- lock (this) +- _notifying = false; +- } +- }; ++ file_watcher.Created += new FileSystemEventHandler(FileCreationWatcher); + } + last_notification_index = GetLatestIndex (); + file_watcher.EnableRaisingEvents = true; +diff --git a/mcs/class/System/System.IO/InotifyWatcher.cs b/mcs/class/System/System.IO/InotifyWatcher.cs +index d8e7acce3a7..7b0907eebc1 100644 +--- a/mcs/class/System/System.IO/InotifyWatcher.cs ++++ b/mcs/class/System/System.IO/InotifyWatcher.cs +@@ -423,19 +423,36 @@ namespace System.IO { + return 16 + len; + } + ++ class ThingEnumerator : IEnumerator, IEnumerable ++ { ++ object thing; ++ int j; ++ public ThingEnumerator(object thing) ++ { this.thing = thing; j = -1; } ++ ++ public IEnumerator GetEnumerator() { return this; } ++ public bool MoveNext() ++ { ++ if(thing == null) { return false; } ++ if(thing is ArrayList) ++ { ++ ArrayList list = (ArrayList) thing; ++ if(j+1 >= list.Count) { return false; } ++ j++; ++ return true; ++ } ++ if(j == -1) { j = 0; return true; } ++ return false; ++ } ++ public void Reset() { j = -1; } ++ public object Current ++ { get { if(thing is ArrayList) return ((ArrayList)thing)[j]; ++ return thing; }} ++ } ++ + static IEnumerable GetEnumerator (object source) + { +- if (source == null) +- yield break; +- +- if (source is InotifyData) +- yield return source; +- +- if (source is ArrayList) { +- ArrayList list = (ArrayList) source; +- for (int i = 0; i < list.Count; i++) +- yield return list [i]; +- } ++ return new ThingEnumerator(source); + } + + /* Interesting events: +diff --git a/mcs/class/System/System.Net/ServicePoint.cs b/mcs/class/System/System.Net/ServicePoint.cs +index a884d90f507..e1c73b098c2 100644 +--- a/mcs/class/System/System.Net/ServicePoint.cs ++++ b/mcs/class/System/System.Net/ServicePoint.cs +@@ -137,7 +137,7 @@ namespace System.Net + get { + return idleSince; + } +- internal set { ++ set { + lock (locker) + idleSince = value; + } +diff --git a/mcs/class/System/System.Text.RegularExpressions/BaseMachine.cs-2 b/mcs/class/System/System.Text.RegularExpressions/BaseMachine.cs-2 +new file mode 100644 +index 00000000000..a685e2679b7 +--- /dev/null ++++ b/mcs/class/System/System.Text.RegularExpressions/BaseMachine.cs-2 +@@ -0,0 +1,168 @@ ++// ++// BaseMachine.jvm.cs ++// ++// Author: ++// author: Dan Lewis (dlewis@gmx.co.uk) ++// (c) 2002 ++// Copyright (C) 2005 Novell, Inc (http://www.novell.com) ++// ++ ++// ++// Permission is hereby granted, free of charge, to any person obtaining ++// a copy of this software and associated documentation files (the ++// "Software"), to deal in the Software without restriction, including ++// without limitation the rights to use, copy, modify, merge, publish, ++// distribute, sublicense, and/or sell copies of the Software, and to ++// permit persons to whom the Software is furnished to do so, subject to ++// the following conditions: ++// ++// The above copyright notice and this permission notice shall be ++// included in all copies or substantial portions of the Software. ++// ++// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, ++// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF ++// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND ++// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE ++// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION ++// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION ++// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ++// ++ ++using System; ++using System.Collections; ++using System.Collections.Specialized; ++ ++namespace System.Text.RegularExpressions ++{ ++ abstract class BaseMachine : IMachine ++ { ++ internal delegate void MatchAppendEvaluator (Match match, StringBuilder sb); ++ ++ public virtual string Replace (Regex regex, string input, string replacement, int count, int startat) ++ { ++ ReplacementEvaluator ev = new ReplacementEvaluator (regex, replacement); ++ if (regex.RightToLeft) ++ return RTLReplace (regex, input, new MatchEvaluator (ev.Evaluate), count, startat); ++ else ++ return LTRReplace (regex, input, new MatchAppendEvaluator (ev.EvaluateAppend), count, startat); ++ } ++ ++ virtual public string [] Split (Regex regex, string input, int count, int startat) ++ { ++ ArrayList splits = new ArrayList (); ++ if (count == 0) ++ count = Int32.MaxValue; ++ ++ int ptr = startat; ++ Match m = null; ++ while (--count > 0) { ++ if (m != null) ++ m = m.NextMatch (); ++ else ++ m = regex.Match (input, ptr); ++ ++ if (!m.Success) ++ break; ++ ++ if (regex.RightToLeft) ++ splits.Add (input.Substring (m.Index + m.Length, ptr - m.Index - m.Length)); ++ else ++ splits.Add (input.Substring (ptr, m.Index - ptr)); ++ ++ int gcount = m.Groups.Count; ++ for (int gindex = 1; gindex < gcount; gindex++) { ++ Group grp = m.Groups [gindex]; ++ splits.Add (input.Substring (grp.Index, grp.Length)); ++ } ++ ++ if (regex.RightToLeft) ++ ptr = m.Index; ++ else ++ ptr = m.Index + m.Length; ++ ++ } ++ ++ if (regex.RightToLeft && ptr >= 0) ++ splits.Add (input.Substring (0, ptr)); ++ if (!regex.RightToLeft && ptr <= input.Length) ++ splits.Add (input.Substring (ptr)); ++ ++ return (string []) splits.ToArray (typeof (string)); ++ } ++ ++ virtual public Match Scan (Regex regex, string text, int start, int end) ++ { ++ throw new NotImplementedException ("Scan method must be implemented in derived classes"); ++ } ++ ++ virtual public string Result (string replacement, Match match) ++ { ++ return ReplacementEvaluator.Evaluate (replacement, match); ++ } ++ ++ internal static string LTRReplace (Regex regex, string input, MatchAppendEvaluator evaluator, int count, int startat) ++ { ++ Match m = regex.Match (input, startat); ++ if (!m.Success) ++ return input; ++ ++ StringBuilder result = new StringBuilder (); ++ int ptr = startat; ++ int counter = count; ++ ++ result.Append (input, 0, ptr); ++ ++ do { ++ if (count != -1) ++ if (counter-- <= 0) ++ break; ++ if (m.Index < ptr) ++ throw new SystemException ("how"); ++ result.Append (input, ptr, m.Index - ptr); ++ evaluator (m, result); ++ ++ ptr = m.Index + m.Length; ++ m = m.NextMatch (); ++ } while (m.Success); ++ ++ result.Append (input, ptr, input.Length - ptr); ++ ++ return result.ToString (); ++ } ++ ++ internal static string RTLReplace (Regex regex, string input, MatchEvaluator evaluator, int count, int startat) ++ { ++ Match m = regex.Match (input, startat); ++ if (!m.Success) ++ return input; ++ ++ int ptr = startat; ++ int counter = count; ++ StringCollection pieces = new StringCollection (); ++ pieces.Add (input.Substring (ptr)); ++ ++ do { ++ if (count != -1) ++ if (counter-- <= 0) ++ break; ++ if (m.Index + m.Length > ptr) ++ throw new SystemException ("how"); ++ pieces.Add (input.Substring (m.Index + m.Length, ptr - m.Index - m.Length)); ++ pieces.Add (evaluator (m)); ++ ++ ptr = m.Index; ++ m = m.NextMatch (); ++ } while (m.Success); ++ ++ StringBuilder result = new StringBuilder (); ++ ++ result.Append (input, 0, ptr); ++ for (int i = pieces.Count; i > 0; ) ++ result.Append (pieces [--i]); ++ ++ pieces.Clear (); ++ ++ return result.ToString (); ++ } ++ } ++} +diff --git a/mcs/class/corlib/System.Runtime.Remoting.Messaging/MethodCall.cs b/mcs/class/corlib/System.Runtime.Remoting.Messaging/MethodCall.cs +index 94069d1727e..042574178fa 100644 +--- a/mcs/class/corlib/System.Runtime.Remoting.Messaging/MethodCall.cs ++++ b/mcs/class/corlib/System.Runtime.Remoting.Messaging/MethodCall.cs +@@ -272,6 +272,10 @@ namespace System.Runtime.Remoting.Messaging { + set { _uri = value; } + } + ++ string IMethodMessage.Uri { ++ get { return Uri; } ++ } ++ + string IInternalMessage.Uri { + get { return Uri; } + set { Uri = value; } +diff --git a/mcs/class/corlib/System.Runtime.Remoting.Messaging/MethodResponse.cs b/mcs/class/corlib/System.Runtime.Remoting.Messaging/MethodResponse.cs +index 1b1eab014b3..575e7e37dee 100644 +--- a/mcs/class/corlib/System.Runtime.Remoting.Messaging/MethodResponse.cs ++++ b/mcs/class/corlib/System.Runtime.Remoting.Messaging/MethodResponse.cs +@@ -272,6 +272,10 @@ namespace System.Runtime.Remoting.Messaging { + } + } + ++ string IMethodMessage.Uri { ++ get { return Uri; } ++ } ++ + string IInternalMessage.Uri { + get { return Uri; } + set { Uri = value; } +diff --git a/mcs/class/corlib/System.Runtime.Remoting.Messaging/ReturnMessage.cs b/mcs/class/corlib/System.Runtime.Remoting.Messaging/ReturnMessage.cs +index aee39f5bb81..ec09b73c15d 100644 +--- a/mcs/class/corlib/System.Runtime.Remoting.Messaging/ReturnMessage.cs ++++ b/mcs/class/corlib/System.Runtime.Remoting.Messaging/ReturnMessage.cs +@@ -166,6 +166,10 @@ namespace System.Runtime.Remoting.Messaging + } + } + ++ string IMethodMessage.Uri { ++ get { return Uri; } ++ } ++ + string IInternalMessage.Uri { + get { return Uri; } + set { Uri = value; } +diff --git a/mcs/class/corlib/System/MulticastDelegate.cs b/mcs/class/corlib/System/MulticastDelegate.cs +index b36aff33492..cf9134a33b3 100644 +--- a/mcs/class/corlib/System/MulticastDelegate.cs ++++ b/mcs/class/corlib/System/MulticastDelegate.cs +@@ -262,16 +262,16 @@ namespace System + + public static bool operator == (MulticastDelegate a, MulticastDelegate b) + { +- if (a == null) +- return b == null; ++ if ((object)a == null) ++ return (object)b == null; + + return a.Equals (b); + } + + public static bool operator != (MulticastDelegate a, MulticastDelegate b) + { +- if (a == null) +- return b != null; ++ if ((object)a == null) ++ return (object)b != null; + + return !a.Equals (b); + } +diff --git a/mcs/class/corlib/System/Object.cs b/mcs/class/corlib/System/Object.cs +index 6b0a03d2a31..694cbd454e1 100644 +--- a/mcs/class/corlib/System/Object.cs ++++ b/mcs/class/corlib/System/Object.cs +@@ -40,7 +40,7 @@ using System.Runtime.ConstrainedExecution; + + namespace System { + +- [Serializable] ++ //[Serializable] + [ClassInterface (ClassInterfaceType.AutoDual)] + #if NET_2_0 + [ComVisible (true)] +@@ -47,6 +47,12 @@ + #endif + public class Object { + ++ // Default definition of the object finalizer. ++ #if NET_2_0 ++ [ReliabilityContractAttribute (Consistency.WillNotCorruptState, Cer.Success)] ++ #endif ++ protected virtual void Finalize() {} ++ + // + // Compares this object to the specified object. + // Returns true if they are equal, false otherwise. +@@ -80,16 +86,6 @@ namespace System { + { + } + +- // +- // Object destructor. +- // +-#if NET_2_0 +- [ReliabilityContractAttribute (Consistency.WillNotCorruptState, Cer.Success)] +-#endif +- ~Object () +- { +- } +- + // + // Returns a hashcode for this object. Each derived + // class should return a hash code that makes sense +diff --git a/mcs/mcs/codegen.cs b/mcs/mcs/codegen.cs +index c94a61772f4..8546d671ec6 100644 +--- a/mcs/mcs/codegen.cs ++++ b/mcs/mcs/codegen.cs +@@ -498,7 +498,7 @@ namespace Mono.CSharp { + + // utility helper for CheckExpr, UnCheckExpr, Checked and Unchecked statements + // it's public so that we can use a struct at the callsite +- public struct FlagsHandle : IDisposable ++ public class FlagsHandle : IDisposable + { + EmitContext ec; + readonly Flags invmask, oldval; +diff --git a/mcs/mcs/typemanager.cs b/mcs/mcs/typemanager.cs +index 1e173de89d2..58477af41a3 100644 +--- a/mcs/mcs/typemanager.cs ++++ b/mcs/mcs/typemanager.cs +@@ -629,18 +629,42 @@ namespace Mono.CSharp { + return CSharpName (GetFullName (t)); + } + ++ static bool StartsWithWord(string haystack, string check) ++ { ++ if(String.Compare(haystack, 0, check, 0, check.Length, false) != 0) ++ { return false; } ++ if(check.Length == haystack.Length) { return true; } ++ char c = haystack[check.Length]; ++ return !(Char.IsLetter(c) || Char.IsDigit(c)); ++ } ++ + public static string CSharpName (string name) + { + if (name.StartsWith (AnonymousTypeClass.ClassNamePrefix)) + return AnonymousTypeClass.SignatureForError; +- +- return Regex.Replace (name, +- @"^System\." + +- @"(Int32|UInt32|Int16|UInt16|Int64|UInt64|" + +- @"Single|Double|Char|Decimal|Byte|SByte|Object|" + +- @"Boolean|String|Void|Null)" + +- @"(\W+|\b)", +- new MatchEvaluator (CSharpNameMatch)).Replace ('+', '.'); ++ ++ int l = "System.".Length; ++ if(name.StartsWith("System.") && name.Length > l) ++ { ++ string s2 = name.Substring(l).ToLower(); ++ if(StartsWithWord(s2, "int32")) ++ return "int"; ++ if(StartsWithWord(s2, "uint32")) ++ return "uint"; ++ if(StartsWithWord(s2, "int16")) ++ return "short"; ++ if(StartsWithWord(s2, "uint16")) ++ return "ushort"; ++ if(StartsWithWord(s2, "int64")) ++ return "long"; ++ if(StartsWithWord(s2, "uint64")) ++ return "ulong"; ++ if(StartsWithWord(s2, "single")) ++ return "float"; ++ if(StartsWithWord(s2, "boolean")) ++ return "bool"; ++ } ++ return name; + } + + static public string CSharpName (Type[] types) +@@ -654,21 +678,6 @@ namespace Mono.CSharp { + return sb.ToString (); + } + +- static String CSharpNameMatch (Match match) +- { +- string s = match.Groups [1].Captures [0].Value; +- return s.ToLower (). +- Replace ("int32", "int"). +- Replace ("uint32", "uint"). +- Replace ("int16", "short"). +- Replace ("uint16", "ushort"). +- Replace ("int64", "long"). +- Replace ("uint64", "ulong"). +- Replace ("single", "float"). +- Replace ("boolean", "bool") +- + match.Groups [2].Captures [0].Value; +- } +- + // Used for error reporting to show symbolic name instead of underlying value + public static string CSharpEnumValue (Type t, object value) + { +diff --git a/mono/io-layer/processes.c b/mono/io-layer/processes.c +index cd6176cdda2..486087d3a1b 100644 +--- a/mono/io-layer/processes.c ++++ b/mono/io-layer/processes.c +@@ -15,6 +15,7 @@ + #include + #include + #include ++#include + #include + #include + #include +diff --git a/mono/metadata/Makefile.am b/mono/metadata/Makefile.am +index 6ff2368895b..b8ba66e8756 100644 +--- a/mono/metadata/Makefile.am ++++ b/mono/metadata/Makefile.am +@@ -154,7 +154,6 @@ libmonoruntimeinclude_HEADERS = \ + object.h \ + exception.h \ + profiler.h \ +- appdomain.h \ + mono-config.h \ + debug-helpers.h \ + mempool.h +diff --git a/mono/metadata/class.c b/mono/metadata/class.c +index f13f37632fe..128710337f4 100644 +--- a/mono/metadata/class.c ++++ b/mono/metadata/class.c +@@ -2695,10 +2695,10 @@ initialize_object_slots (MonoClass *class) + finalize_slot = i; + } + +- g_assert (ghc_slot > 0); ++ g_assert (ghc_slot >= 0); + default_ghc = class->vtable [ghc_slot]; + +- g_assert (finalize_slot > 0); ++ g_assert (finalize_slot >= 0); + default_finalize = class->vtable [finalize_slot]; + } + } +diff --git a/mono/metadata/object.c b/mono/metadata/object.c +index 2b6f4909b34..ef4c8fd8b44 100644 +--- a/mono/metadata/object.c ++++ b/mono/metadata/object.c +@@ -861,7 +861,7 @@ mono_class_compute_gc_descriptor (MonoClass *class) + mono_register_jit_icall (GC_local_gcj_fast_malloc, "GC_local_gcj_fast_malloc", mono_create_icall_signature ("object int ptr"), FALSE); + #endif + mono_register_jit_icall (GC_gcj_malloc, "GC_gcj_malloc", mono_create_icall_signature ("object int ptr"), FALSE); +- mono_register_jit_icall (GC_gcj_fast_malloc, "GC_gcj_fast_malloc", mono_create_icall_signature ("object int ptr"), FALSE); ++ mono_register_jit_icall (GC_gcj_malloc, "GC_gcj_fast_malloc", mono_create_icall_signature ("object int ptr"), FALSE); + #endif + gcj_inited = TRUE; + mono_loader_unlock (); +diff --git a/runtime/Makefile.am b/runtime/Makefile.am +index 779787b3ce3..b67957dcf16 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 semdel-wrapper -- Efraim Flashner אפרים פלשנר GPG key = A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351 Confidentiality cannot be guaranteed on emails sent or received unencrypted