diff options
| author | Danny Milosavljevic <dannym@friendly-machines.com> | 2026-04-08 17:07:40 +0200 |
|---|---|---|
| committer | Danny Milosavljevic <dannym@friendly-machines.com> | 2026-07-17 01:41:57 +0200 |
| commit | a883d8d02b76983f15d1a3733b13b46c174bdd03 (patch) | |
| tree | 89ceed10177063d53e90835419366aa9efa5dcb6 /gnu/packages | |
| parent | d71affea0c59266b8fc75377c3e6d32878a29b56 (diff) | |
gnu: Add roslyn@3.2.0.
* gnu/packages/patches/roslyn-3.2.0-bootstrap-with-csc-3.0.patch: New file.
* gnu/local.mk (dist_patch_DATA): Add reference to it.
* gnu/packages/dotnet.scm (roslyn-3.2): New variable.
Change-Id: Icfb46abfe41fdfaa7a5c532911ef2abcac4d416c
Diffstat (limited to 'gnu/packages')
| -rw-r--r-- | gnu/packages/dotnet.scm | 53 | ||||
| -rw-r--r-- | gnu/packages/patches/roslyn-3.2.0-bootstrap-with-csc-3.0.patch | 355 |
2 files changed, 408 insertions, 0 deletions
diff --git a/gnu/packages/dotnet.scm b/gnu/packages/dotnet.scm index b914d29fe60..6f423de54cb 100644 --- a/gnu/packages/dotnet.scm +++ b/gnu/packages/dotnet.scm | |||
| @@ -2957,6 +2957,59 @@ a C# 7.2 compiler."))) | |||
| 2957 | "This package provides the Roslyn C# compiler (@command{csc}), built | 2957 | "This package provides the Roslyn C# compiler (@command{csc}), built |
| 2958 | from source using @code{roslyn-2.8} as the bootstrap compiler. It produces | 2958 | from source using @code{roslyn-2.8} as the bootstrap compiler. It produces |
| 2959 | a C# 8.0 compiler."))) | 2959 | a C# 8.0 compiler."))) |
| 2960 | |||
| 2961 | |||
| 2962 | ;;; | ||
| 2963 | ;;; roslyn-3.2: inherits roslyn-3.0, built with csc 3.0 | ||
| 2964 | ;;; Adds 'notnull' constraint support needed by roslyn 3.8+. | ||
| 2965 | ;;; | ||
| 2966 | |||
| 2967 | (define-public roslyn-3.2 | ||
| 2968 | (package | ||
| 2969 | (inherit roslyn-3.0) | ||
| 2970 | (version "3.2.0") | ||
| 2971 | (source | ||
| 2972 | (origin | ||
| 2973 | (method git-fetch) | ||
| 2974 | (uri (git-reference | ||
| 2975 | (url "https://github.com/dotnet/roslyn") | ||
| 2976 | (commit (string-append "version-" version)))) | ||
| 2977 | (file-name (git-file-name "roslyn" version)) | ||
| 2978 | (sha256 | ||
| 2979 | (base32 | ||
| 2980 | "0brx9i0jrx2j3zircalgyabc24qqy8ghd8hcjazga8w58a0gmvpc")) | ||
| 2981 | (patches | ||
| 2982 | (search-patches "roslyn-3.2.0-bootstrap-with-csc-3.0.patch")))) | ||
| 2983 | (native-inputs (list roslyn-3.0)) | ||
| 2984 | (arguments | ||
| 2985 | (substitute-keyword-arguments (package-arguments roslyn-3.0) | ||
| 2986 | ((#:phases phases '()) | ||
| 2987 | #~(modify-phases #$phases | ||
| 2988 | ;; 3.2 uses static local functions (C# 8 preview in csc 3.0). | ||
| 2989 | (replace 'create-csc-rsp | ||
| 2990 | (lambda _ | ||
| 2991 | (call-with-output-file "csc.rsp" | ||
| 2992 | (lambda (port) | ||
| 2993 | (display "-langversion:preview\n-d:NET472\n" port))))) | ||
| 2994 | ;; Point at roslyn-3.0's csc. | ||
| 2995 | (replace 'create-csc-wrapper | ||
| 2996 | (lambda* (#:key inputs #:allow-other-keys) | ||
| 2997 | (mkdir-p "bootstrap-bin") | ||
| 2998 | (call-with-output-file "bootstrap-bin/csc" | ||
| 2999 | (lambda (port) | ||
| 3000 | (format port "#!~a~%exec mono ~a \"$@\"~%" | ||
| 3001 | (which "bash") | ||
| 3002 | (string-append (assoc-ref inputs "roslyn") "/lib/roslyn/csc.exe")))) | ||
| 3003 | (chmod "bootstrap-bin/csc" #o755) | ||
| 3004 | (setenv "PATH" | ||
| 3005 | (string-append (getcwd) "/bootstrap-bin:" | ||
| 3006 | (getenv "PATH"))))))))) | ||
| 3007 | (synopsis "C# 8.0 compiler with notnull constraint support") | ||
| 3008 | (description | ||
| 3009 | "This package provides the Roslyn C# compiler (@command{csc}), built | ||
| 3010 | from source using @code{roslyn-3.0} as the bootstrap compiler. It adds | ||
| 3011 | support for the @code{notnull} generic constraint, which is needed to build | ||
| 3012 | newer Roslyn versions."))) | ||
| 2960 | ;; too new version: 15.9.21.664 | 3013 | ;; too new version: 15.9.21.664 |
| 2961 | ;; too old (no support for mono) version: 14.0 | 3014 | ;; too old (no support for mono) version: 14.0 |
| 2962 | (define-public msbuild | 3015 | (define-public msbuild |
diff --git a/gnu/packages/patches/roslyn-3.2.0-bootstrap-with-csc-3.0.patch b/gnu/packages/patches/roslyn-3.2.0-bootstrap-with-csc-3.0.patch new file mode 100644 index 00000000000..1c01d077842 --- /dev/null +++ b/gnu/packages/patches/roslyn-3.2.0-bootstrap-with-csc-3.0.patch | |||
| @@ -0,0 +1,355 @@ | |||
| 1 | Author: Danny Milosavljevic <dannym@friendly-machines.com> | ||
| 2 | Date: 2026-04-08 | ||
| 3 | Subject: Avoid ReadOnlySpan since it's unavailable in mono runtime. Avoid CodePagesEncodingProvider. | ||
| 4 | |||
| 5 | diff -ruN '--exclude=*.resx' '--exclude=*.xlf' '--exclude=*.xml' '--exclude=*.rsp' '--exclude=srm-src-patched' '--exclude=*.resources' '--exclude=bootstrap-*' '--exclude=*.dll' '--exclude=*.exe' '--exclude=srm-strings.cs' '--exclude=generated' a/src/Compilers/Core/Portable/Collections/ImmutableArrayExtensions.cs b/src/Compilers/Core/Portable/Collections/ImmutableArrayExtensions.cs | ||
| 6 | --- a/src/Compilers/Core/Portable/Collections/ImmutableArrayExtensions.cs 2019-07-09 03:30:24.000000000 +0000 | ||
| 7 | +++ b/src/Compilers/Core/Portable/Collections/ImmutableArrayExtensions.cs 2026-04-08 05:54:06.286349563 +0000 | ||
| 8 | @@ -536,16 +536,16 @@ | ||
| 9 | // TODO(https://github.com/dotnet/corefx/issues/34126): Remove when System.Collections.Immutable | ||
| 10 | // provides a Span API | ||
| 11 | internal static T[] DangerousGetUnderlyingArray<T>(this ImmutableArray<T> array) | ||
| 12 | - => Unsafe.As<ImmutableArray<T>, ImmutableArrayProxy<T>>(ref array).MutableArray; | ||
| 13 | + => array.ToArray(); | ||
| 14 | |||
| 15 | - internal static ReadOnlySpan<T> AsSpan<T>(this ImmutableArray<T> array) | ||
| 16 | + internal static T[] AsSpan<T>(this ImmutableArray<T> array) | ||
| 17 | => array.DangerousGetUnderlyingArray(); | ||
| 18 | |||
| 19 | internal static ImmutableArray<T> DangerousCreateFromUnderlyingArray<T>(ref T[] array) | ||
| 20 | { | ||
| 21 | var proxy = new ImmutableArrayProxy<T> { MutableArray = array }; | ||
| 22 | array = null; | ||
| 23 | - return Unsafe.As<ImmutableArrayProxy<T>, ImmutableArray<T>>(ref proxy); | ||
| 24 | + return ImmutableArray.CreateRange(array); | ||
| 25 | } | ||
| 26 | |||
| 27 | internal static Dictionary<K, ImmutableArray<T>> ToDictionary<K, T>(this ImmutableArray<T> items, Func<T, K> keySelector, IEqualityComparer<K> comparer = null) | ||
| 28 | diff -ruN '--exclude=*.resx' '--exclude=*.xlf' '--exclude=*.xml' '--exclude=*.rsp' '--exclude=srm-src-patched' '--exclude=*.resources' '--exclude=bootstrap-*' '--exclude=*.dll' '--exclude=*.exe' '--exclude=srm-strings.cs' '--exclude=generated' a/src/Compilers/Core/Portable/DiaSymReader/Writer/SymUnmanagedWriter.cs b/src/Compilers/Core/Portable/DiaSymReader/Writer/SymUnmanagedWriter.cs | ||
| 29 | --- a/src/Compilers/Core/Portable/DiaSymReader/Writer/SymUnmanagedWriter.cs 2019-07-09 03:30:24.000000000 +0000 | ||
| 30 | +++ b/src/Compilers/Core/Portable/DiaSymReader/Writer/SymUnmanagedWriter.cs 2026-04-08 05:53:11.281396854 +0000 | ||
| 31 | @@ -44,7 +44,7 @@ | ||
| 32 | /// <exception cref="ObjectDisposedException">Object has been disposed.</exception> | ||
| 33 | /// <exception cref="InvalidOperationException">Writes are not allowed to the underlying stream.</exception> | ||
| 34 | /// <exception cref="SymUnmanagedWriterException">Error occurred while writing PDB data.</exception> | ||
| 35 | - public abstract int DefineDocument(string name, Guid language, Guid vendor, Guid type, Guid algorithmId, ReadOnlySpan<byte> checksum, ReadOnlySpan<byte> source); | ||
| 36 | + public abstract int DefineDocument(string name, Guid language, Guid vendor, Guid type, Guid algorithmId, byte[] checksum, byte[] source); | ||
| 37 | |||
| 38 | /// <summary> | ||
| 39 | /// Defines sequence points. | ||
| 40 | @@ -127,8 +127,8 @@ | ||
| 41 | int moveNextMethodToken, | ||
| 42 | int kickoffMethodToken, | ||
| 43 | int catchHandlerOffset, | ||
| 44 | - ReadOnlySpan<int> yieldOffsets, | ||
| 45 | - ReadOnlySpan<int> resumeOffsets); | ||
| 46 | + int[] yieldOffsets, | ||
| 47 | + int[] resumeOffsets); | ||
| 48 | |||
| 49 | /// <summary> | ||
| 50 | /// Associates custom debug information blob with the current method. | ||
| 51 | diff -ruN '--exclude=*.resx' '--exclude=*.xlf' '--exclude=*.xml' '--exclude=*.rsp' '--exclude=srm-src-patched' '--exclude=*.resources' '--exclude=bootstrap-*' '--exclude=*.dll' '--exclude=*.exe' '--exclude=srm-strings.cs' '--exclude=generated' a/src/Compilers/Core/Portable/DiaSymReader/Writer/SymUnmanagedWriterImpl.cs b/src/Compilers/Core/Portable/DiaSymReader/Writer/SymUnmanagedWriterImpl.cs | ||
| 52 | --- a/src/Compilers/Core/Portable/DiaSymReader/Writer/SymUnmanagedWriterImpl.cs 2019-07-09 03:30:24.000000000 +0000 | ||
| 53 | +++ b/src/Compilers/Core/Portable/DiaSymReader/Writer/SymUnmanagedWriterImpl.cs 2026-04-08 05:53:11.284206429 +0000 | ||
| 54 | @@ -137,7 +137,7 @@ | ||
| 55 | } | ||
| 56 | } | ||
| 57 | |||
| 58 | - public override int DefineDocument(string name, Guid language, Guid vendor, Guid type, Guid algorithmId, ReadOnlySpan<byte> checksum, ReadOnlySpan<byte> source) | ||
| 59 | + public override int DefineDocument(string name, Guid language, Guid vendor, Guid type, Guid algorithmId, byte[] checksum, byte[] source) | ||
| 60 | { | ||
| 61 | if (name == null) | ||
| 62 | { | ||
| 63 | @@ -468,8 +468,8 @@ | ||
| 64 | int moveNextMethodToken, | ||
| 65 | int kickoffMethodToken, | ||
| 66 | int catchHandlerOffset, | ||
| 67 | - ReadOnlySpan<int> yieldOffsets, | ||
| 68 | - ReadOnlySpan<int> resumeOffsets) | ||
| 69 | + int[] yieldOffsets, | ||
| 70 | + int[] resumeOffsets) | ||
| 71 | { | ||
| 72 | if (yieldOffsets == null) throw new ArgumentNullException(nameof(yieldOffsets)); | ||
| 73 | if (resumeOffsets == null) throw new ArgumentNullException(nameof(resumeOffsets)); | ||
| 74 | diff -ruN '--exclude=*.resx' '--exclude=*.xlf' '--exclude=*.xml' '--exclude=*.rsp' '--exclude=srm-src-patched' '--exclude=*.resources' '--exclude=bootstrap-*' '--exclude=*.dll' '--exclude=*.exe' '--exclude=srm-strings.cs' '--exclude=generated' a/src/Compilers/Core/Portable/InternalUtilities/Hash.cs b/src/Compilers/Core/Portable/InternalUtilities/Hash.cs | ||
| 75 | --- a/src/Compilers/Core/Portable/InternalUtilities/Hash.cs 2019-07-09 03:30:24.000000000 +0000 | ||
| 76 | +++ b/src/Compilers/Core/Portable/InternalUtilities/Hash.cs 2026-04-08 05:53:11.288964327 +0000 | ||
| 77 | @@ -180,7 +180,7 @@ | ||
| 78 | /// <param name="data">The sequence of bytes that are likely to be ASCII text.</param> | ||
| 79 | /// <param name="isAscii">True if the sequence contains only characters in the ASCII range.</param> | ||
| 80 | /// <returns>The FNV-1a hash of <paramref name="data"/></returns> | ||
| 81 | - internal static int GetFNVHashCode(ReadOnlySpan<byte> data, out bool isAscii) | ||
| 82 | + internal static int GetFNVHashCode(byte[] data, out bool isAscii) | ||
| 83 | { | ||
| 84 | int hashCode = Hash.FnvOffsetBias; | ||
| 85 | |||
| 86 | diff -ruN '--exclude=*.resx' '--exclude=*.xlf' '--exclude=*.xml' '--exclude=*.rsp' '--exclude=srm-src-patched' '--exclude=*.resources' '--exclude=bootstrap-*' '--exclude=*.dll' '--exclude=*.exe' '--exclude=srm-strings.cs' '--exclude=generated' a/src/Compilers/Core/Portable/InternalUtilities/LittleEndianReader.cs b/src/Compilers/Core/Portable/InternalUtilities/LittleEndianReader.cs | ||
| 87 | --- a/src/Compilers/Core/Portable/InternalUtilities/LittleEndianReader.cs 2019-07-09 03:30:24.000000000 +0000 | ||
| 88 | +++ b/src/Compilers/Core/Portable/InternalUtilities/LittleEndianReader.cs 2026-04-08 05:53:11.294122253 +0000 | ||
| 89 | @@ -3,60 +3,58 @@ | ||
| 90 | using System; | ||
| 91 | -using Roslyn.Utilities; | ||
| 92 | -using static System.Buffers.Binary.BinaryPrimitives; | ||
| 93 | |||
| 94 | -namespace Microsoft.CodeAnalysis | ||
| 95 | +namespace Roslyn.Utilities | ||
| 96 | { | ||
| 97 | - /// <summary> | ||
| 98 | - /// A Span-compatible version of <see cref="System.IO.BinaryReader"/>. | ||
| 99 | - /// </summary> | ||
| 100 | - internal ref struct LittleEndianReader | ||
| 101 | + internal struct LittleEndianReader | ||
| 102 | { | ||
| 103 | - private ReadOnlySpan<byte> _span; | ||
| 104 | + private readonly byte[] _data; | ||
| 105 | + private int _offset; | ||
| 106 | |||
| 107 | - public LittleEndianReader(ReadOnlySpan<byte> span) | ||
| 108 | + public LittleEndianReader(byte[] data) | ||
| 109 | { | ||
| 110 | - _span = span; | ||
| 111 | + _data = data; | ||
| 112 | + _offset = 0; | ||
| 113 | } | ||
| 114 | |||
| 115 | internal uint ReadUInt32() | ||
| 116 | { | ||
| 117 | - var result = ReadUInt32LittleEndian(_span); | ||
| 118 | - _span = _span.Slice(sizeof(uint)); | ||
| 119 | + var result = (uint)(_data[_offset] | _data[_offset+1] << 8 | | ||
| 120 | + _data[_offset+2] << 16 | _data[_offset+3] << 24); | ||
| 121 | + _offset += sizeof(uint); | ||
| 122 | return result; | ||
| 123 | } | ||
| 124 | |||
| 125 | internal byte ReadByte() | ||
| 126 | { | ||
| 127 | - var result = _span[0]; | ||
| 128 | - _span = _span.Slice(sizeof(byte)); | ||
| 129 | - return result; | ||
| 130 | + return _data[_offset++]; | ||
| 131 | } | ||
| 132 | |||
| 133 | internal ushort ReadUInt16() | ||
| 134 | { | ||
| 135 | - var result = ReadUInt16LittleEndian(_span); | ||
| 136 | - _span = _span.Slice(sizeof(ushort)); | ||
| 137 | + var result = (ushort)(_data[_offset] | _data[_offset+1] << 8); | ||
| 138 | + _offset += sizeof(ushort); | ||
| 139 | return result; | ||
| 140 | } | ||
| 141 | |||
| 142 | - internal ReadOnlySpan<byte> ReadBytes(int byteCount) | ||
| 143 | + internal byte[] ReadBytes(int byteCount) | ||
| 144 | { | ||
| 145 | - var result = _span.Slice(0, byteCount); | ||
| 146 | - _span = _span.Slice(byteCount); | ||
| 147 | + var result = new byte[byteCount]; | ||
| 148 | + Array.Copy(_data, _offset, result, 0, byteCount); | ||
| 149 | + _offset += byteCount; | ||
| 150 | return result; | ||
| 151 | } | ||
| 152 | |||
| 153 | internal int ReadInt32() | ||
| 154 | { | ||
| 155 | - var result = ReadInt32LittleEndian(_span); | ||
| 156 | - _span = _span.Slice(sizeof(int)); | ||
| 157 | + var result = _data[_offset] | _data[_offset+1] << 8 | | ||
| 158 | + _data[_offset+2] << 16 | _data[_offset+3] << 24; | ||
| 159 | + _offset += sizeof(int); | ||
| 160 | return result; | ||
| 161 | } | ||
| 162 | |||
| 163 | - internal byte[] ReadReversed(int byteCount) | ||
| 164 | + internal byte[] ReadReversed(int count) | ||
| 165 | { | ||
| 166 | - var result = ReadBytes(byteCount).ToArray(); | ||
| 167 | - result.ReverseContents(); | ||
| 168 | + var result = ReadBytes(count); | ||
| 169 | + Array.Reverse(result); | ||
| 170 | return result; | ||
| 171 | } | ||
| 172 | } | ||
| 173 | diff -ruN '--exclude=*.resx' '--exclude=*.xlf' '--exclude=*.xml' '--exclude=*.rsp' '--exclude=srm-src-patched' '--exclude=*.resources' '--exclude=bootstrap-*' '--exclude=*.dll' '--exclude=*.exe' '--exclude=srm-strings.cs' '--exclude=generated' a/src/Compilers/Core/Portable/InternalUtilities/StringTable.cs b/src/Compilers/Core/Portable/InternalUtilities/StringTable.cs | ||
| 174 | --- a/src/Compilers/Core/Portable/InternalUtilities/StringTable.cs 2019-07-09 03:30:24.000000000 +0000 | ||
| 175 | +++ b/src/Compilers/Core/Portable/InternalUtilities/StringTable.cs 2026-04-08 05:53:11.304611873 +0000 | ||
| 176 | @@ -109,7 +109,7 @@ | ||
| 177 | |||
| 178 | internal string Add(char[] chars, int start, int len) | ||
| 179 | { | ||
| 180 | - var span = chars.AsSpan(start, len); | ||
| 181 | + var span = new string(chars, start, len).ToCharArray(); | ||
| 182 | var hashCode = Hash.GetFNVHashCode(chars, start, len); | ||
| 183 | |||
| 184 | // capture array to avoid extra range checks | ||
| 185 | @@ -295,7 +295,7 @@ | ||
| 186 | |||
| 187 | if (e != null) | ||
| 188 | { | ||
| 189 | - if (hash == hashCode && TextEquals(e, chars.AsSpan(start, len))) | ||
| 190 | + if (hash == hashCode && TextEquals(e, new string(chars, start, len).ToCharArray())) | ||
| 191 | { | ||
| 192 | break; | ||
| 193 | } | ||
| 194 | @@ -350,7 +350,7 @@ | ||
| 195 | return e; | ||
| 196 | } | ||
| 197 | |||
| 198 | - private static string FindSharedEntryASCII(int hashCode, ReadOnlySpan<byte> asciiChars) | ||
| 199 | + private static string FindSharedEntryASCII(int hashCode, byte[] asciiChars) | ||
| 200 | { | ||
| 201 | var arr = s_sharedTable; | ||
| 202 | int idx = SharedIdxFromHash(hashCode); | ||
| 203 | @@ -581,7 +581,7 @@ | ||
| 204 | return text; | ||
| 205 | } | ||
| 206 | |||
| 207 | - internal static string AddSharedUTF8(ReadOnlySpan<byte> bytes) | ||
| 208 | + internal static string AddSharedUTF8(byte[] bytes) | ||
| 209 | { | ||
| 210 | bool isAscii; | ||
| 211 | int hashCode = Hash.GetFNVHashCode(bytes, out isAscii); | ||
| 212 | @@ -598,13 +598,13 @@ | ||
| 213 | return AddSharedSlow(hashCode, bytes, isAscii); | ||
| 214 | } | ||
| 215 | |||
| 216 | - private static string AddSharedSlow(int hashCode, ReadOnlySpan<byte> utf8Bytes, bool isAscii) | ||
| 217 | + private static string AddSharedSlow(int hashCode, byte[] utf8Bytes, bool isAscii) | ||
| 218 | { | ||
| 219 | string text; | ||
| 220 | |||
| 221 | unsafe | ||
| 222 | { | ||
| 223 | - fixed (byte* bytes = &utf8Bytes.GetPinnableReference()) | ||
| 224 | + fixed (byte* bytes = utf8Bytes) | ||
| 225 | { | ||
| 226 | text = Encoding.UTF8.GetString(bytes, utf8Bytes.Length); | ||
| 227 | } | ||
| 228 | @@ -711,7 +711,7 @@ | ||
| 229 | return true; | ||
| 230 | } | ||
| 231 | |||
| 232 | - internal static bool TextEqualsASCII(string text, ReadOnlySpan<byte> ascii) | ||
| 233 | + internal static bool TextEqualsASCII(string text, byte[] ascii) | ||
| 234 | { | ||
| 235 | #if DEBUG | ||
| 236 | for (var i = 0; i < ascii.Length; i++) | ||
| 237 | @@ -736,7 +736,7 @@ | ||
| 238 | return true; | ||
| 239 | } | ||
| 240 | |||
| 241 | - internal static bool TextEquals(string array, ReadOnlySpan<char> text) | ||
| 242 | - => text.Equals(array.AsSpan(), StringComparison.Ordinal); | ||
| 243 | + internal static bool TextEquals(string array, char[] text) | ||
| 244 | + => string.Equals(new string(text), array, StringComparison.Ordinal); | ||
| 245 | } | ||
| 246 | } | ||
| 247 | diff -ruN '--exclude=*.resx' '--exclude=*.xlf' '--exclude=*.xml' '--exclude=*.rsp' '--exclude=srm-src-patched' '--exclude=*.resources' '--exclude=bootstrap-*' '--exclude=*.dll' '--exclude=*.exe' '--exclude=srm-strings.cs' '--exclude=generated' a/src/Compilers/Core/Portable/InternalUtilities/TextKeyedCache.cs b/src/Compilers/Core/Portable/InternalUtilities/TextKeyedCache.cs | ||
| 248 | --- a/src/Compilers/Core/Portable/InternalUtilities/TextKeyedCache.cs 2019-07-09 03:30:24.000000000 +0000 | ||
| 249 | +++ b/src/Compilers/Core/Portable/InternalUtilities/TextKeyedCache.cs 2026-04-08 05:53:11.307139611 +0000 | ||
| 250 | @@ -118,7 +118,7 @@ | ||
| 251 | |||
| 252 | if (text != null && localSlot.HashCode == hashCode) | ||
| 253 | { | ||
| 254 | - if (StringTable.TextEquals(text, chars.AsSpan(start, len))) | ||
| 255 | + if (StringTable.TextEquals(text, new string(chars, start, len).ToCharArray())) | ||
| 256 | { | ||
| 257 | return localSlot.Item; | ||
| 258 | } | ||
| 259 | @@ -155,7 +155,7 @@ | ||
| 260 | |||
| 261 | if (e != null) | ||
| 262 | { | ||
| 263 | - if (hash == hashCode && StringTable.TextEquals(e.Text, chars.AsSpan(start, len))) | ||
| 264 | + if (hash == hashCode && StringTable.TextEquals(e.Text, new string(chars, start, len).ToCharArray())) | ||
| 265 | { | ||
| 266 | break; | ||
| 267 | } | ||
| 268 | diff -ruN '--exclude=*.resx' '--exclude=*.xlf' '--exclude=*.xml' '--exclude=*.rsp' '--exclude=srm-src-patched' '--exclude=*.resources' '--exclude=bootstrap-*' '--exclude=*.dll' '--exclude=*.exe' '--exclude=srm-strings.cs' '--exclude=generated' a/src/Compilers/Core/Portable/MetadataReader/PEModule.cs b/src/Compilers/Core/Portable/MetadataReader/PEModule.cs | ||
| 269 | --- a/src/Compilers/Core/Portable/MetadataReader/PEModule.cs 2019-07-09 03:30:24.000000000 +0000 | ||
| 270 | +++ b/src/Compilers/Core/Portable/MetadataReader/PEModule.cs 2026-04-08 05:53:11.309561450 +0000 | ||
| 271 | @@ -3197,7 +3197,7 @@ | ||
| 272 | |||
| 273 | public unsafe override string GetString(byte* bytes, int byteCount) | ||
| 274 | { | ||
| 275 | - return StringTable.AddSharedUTF8(new ReadOnlySpan<byte>(bytes, byteCount)); | ||
| 276 | + var arr = new byte[byteCount]; System.Runtime.InteropServices.Marshal.Copy((System.IntPtr)bytes, arr, 0, byteCount); return StringTable.AddSharedUTF8(arr); | ||
| 277 | } | ||
| 278 | } | ||
| 279 | |||
| 280 | diff -ruN '--exclude=*.resx' '--exclude=*.xlf' '--exclude=*.xml' '--exclude=*.rsp' '--exclude=srm-src-patched' '--exclude=*.resources' '--exclude=bootstrap-*' '--exclude=*.dll' '--exclude=*.exe' '--exclude=srm-strings.cs' '--exclude=generated' a/src/Compilers/Core/Portable/NativePdbWriter/PdbWriter.cs b/src/Compilers/Core/Portable/NativePdbWriter/PdbWriter.cs | ||
| 281 | --- a/src/Compilers/Core/Portable/NativePdbWriter/PdbWriter.cs 2019-07-09 03:30:24.000000000 +0000 | ||
| 282 | +++ b/src/Compilers/Core/Portable/NativePdbWriter/PdbWriter.cs 2026-04-08 05:53:11.272402967 +0000 | ||
| 283 | @@ -573,8 +573,8 @@ | ||
| 284 | } | ||
| 285 | |||
| 286 | Guid algorithmId; | ||
| 287 | - ReadOnlySpan<byte> checksum; | ||
| 288 | - ReadOnlySpan<byte> embeddedSource; | ||
| 289 | + byte[] checksum; | ||
| 290 | + byte[] embeddedSource; | ||
| 291 | |||
| 292 | DebugSourceInfo info = document.GetSourceInfo(); | ||
| 293 | if (!info.Checksum.IsDefault) | ||
| 294 | diff -ruN '--exclude=*.resx' '--exclude=*.xlf' '--exclude=*.xml' '--exclude=*.rsp' '--exclude=srm-src-patched' '--exclude=*.resources' '--exclude=bootstrap-*' '--exclude=*.dll' '--exclude=*.exe' '--exclude=srm-strings.cs' '--exclude=generated' a/src/Compilers/Core/Portable/Operations/ControlFlowGraphBuilder.cs b/src/Compilers/Core/Portable/Operations/ControlFlowGraphBuilder.cs | ||
| 295 | --- a/src/Compilers/Core/Portable/Operations/ControlFlowGraphBuilder.cs 2019-07-09 03:30:24.000000000 +0000 | ||
| 296 | +++ b/src/Compilers/Core/Portable/Operations/ControlFlowGraphBuilder.cs 2026-04-08 05:58:24.049035340 +0000 | ||
| 297 | @@ -311,7 +311,7 @@ | ||
| 298 | } | ||
| 299 | |||
| 300 | // Returns whether we should proceed to the destination after finallies were taken care of. | ||
| 301 | - static bool stepThroughFinally(ControlFlowRegion region, BasicBlockBuilder destination) | ||
| 302 | + bool stepThroughFinally(ControlFlowRegion region, BasicBlockBuilder destination) | ||
| 303 | { | ||
| 304 | int destinationOrdinal = destination.Ordinal; | ||
| 305 | while (!region.ContainsBlock(destinationOrdinal)) | ||
| 306 | diff -ruN '--exclude=*.resx' '--exclude=*.xlf' '--exclude=*.xml' '--exclude=*.rsp' '--exclude=srm-src-patched' '--exclude=*.resources' '--exclude=bootstrap-*' '--exclude=*.dll' '--exclude=*.exe' '--exclude=srm-strings.cs' '--exclude=generated' a/src/Compilers/Core/Portable/StrongName/CryptoBlobParser.cs b/src/Compilers/Core/Portable/StrongName/CryptoBlobParser.cs | ||
| 307 | --- a/src/Compilers/Core/Portable/StrongName/CryptoBlobParser.cs 2019-07-09 03:30:24.000000000 +0000 | ||
| 308 | +++ b/src/Compilers/Core/Portable/StrongName/CryptoBlobParser.cs 2026-04-08 05:53:11.269852517 +0000 | ||
| 309 | @@ -153,7 +153,7 @@ | ||
| 310 | uint magic, | ||
| 311 | uint bitLen, | ||
| 312 | uint pubExp, | ||
| 313 | - ReadOnlySpan<byte> pubKeyData) | ||
| 314 | + byte[] pubKeyData) | ||
| 315 | { | ||
| 316 | var w = new BlobWriter(3 * sizeof(uint) + s_offsetToKeyData + pubKeyData.Length); | ||
| 317 | w.WriteUInt32(AlgorithmId.RsaSign); | ||
| 318 | @@ -250,7 +250,7 @@ | ||
| 319 | /// Helper for RsaCryptoServiceProvider.ExportParameters() | ||
| 320 | /// Copied from https://github.com/dotnet/corefx/blob/5fe5f9aae7b2987adc7082f90712b265bee5eefc/src/System.Security.Cryptography.Csp/src/System/Security/Cryptography/CapiHelper.Shared.cs | ||
| 321 | /// </summary> | ||
| 322 | - internal static RSAParameters ToRSAParameters(this ReadOnlySpan<byte> cspBlob, bool includePrivateParameters) | ||
| 323 | + internal static RSAParameters ToRSAParameters(this byte[] cspBlob, bool includePrivateParameters) | ||
| 324 | { | ||
| 325 | var br = new LittleEndianReader(cspBlob); | ||
| 326 | |||
| 327 | diff -ruN '--exclude=*.resx' '--exclude=*.xlf' '--exclude=*.xml' '--exclude=*.rsp' '--exclude=srm-src-patched' '--exclude=*.resources' '--exclude=bootstrap-*' '--exclude=*.dll' '--exclude=*.exe' '--exclude=srm-strings.cs' '--exclude=generated' a/src/Compilers/Core/Portable/Syntax/GreenNode.cs b/src/Compilers/Core/Portable/Syntax/GreenNode.cs | ||
| 328 | --- a/src/Compilers/Core/Portable/Syntax/GreenNode.cs 2019-07-09 03:30:24.000000000 +0000 | ||
| 329 | +++ b/src/Compilers/Core/Portable/Syntax/GreenNode.cs 2026-04-08 05:59:21.736658738 +0000 | ||
| 330 | @@ -649,11 +649,11 @@ | ||
| 331 | |||
| 332 | // Separated out stack processing logic so that it does not unintentionally refer to | ||
| 333 | // "this", "leading" or "trailing". | ||
| 334 | - processStack(writer, stack); | ||
| 335 | + processStack_inner(writer, stack); | ||
| 336 | stack.Free(); | ||
| 337 | return; | ||
| 338 | |||
| 339 | - static void processStack( | ||
| 340 | + void processStack_inner( | ||
| 341 | TextWriter writer, | ||
| 342 | ArrayBuilder<(GreenNode node, bool leading, bool trailing)> stack) | ||
| 343 | { | ||
| 344 | diff -ruN '--exclude=*.resx' '--exclude=*.xlf' '--exclude=*.xml' '--exclude=*.rsp' '--exclude=srm-src-patched' '--exclude=*.resources' '--exclude=bootstrap-*' '--exclude=*.dll' '--exclude=*.exe' '--exclude=srm-strings.cs' '--exclude=generated' a/src/Compilers/Shared/DesktopBuildClient.cs b/src/Compilers/Shared/DesktopBuildClient.cs | ||
| 345 | --- a/src/Compilers/Shared/DesktopBuildClient.cs 2019-07-09 03:30:24.000000000 +0000 | ||
| 346 | +++ b/src/Compilers/Shared/DesktopBuildClient.cs 2026-04-08 05:53:11.316016422 +0000 | ||
| 347 | @@ -33,7 +33,7 @@ | ||
| 348 | { | ||
| 349 | // Register encodings for console | ||
| 350 | // https://github.com/dotnet/roslyn/issues/10785 | ||
| 351 | - System.Text.Encoding.RegisterProvider(System.Text.CodePagesEncodingProvider.Instance); | ||
| 352 | + // not available in Mono | ||
| 353 | } | ||
| 354 | |||
| 355 | var client = new DesktopBuildClient(language, compileFunc, analyzerAssemblyLoader); | ||
