Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into thays_implement_debug…
Browse files Browse the repository at this point in the history
…ger_proxy_attribute

* origin/main:
  disable token info in traces. (dotnet#56780)
  [debugger] Fix debugger.break behavior (dotnet#56788)
  [mono][wasm] Allow setting env variables with '=' characters in the test runner. (dotnet#56802)
  Ecma edit for `conv.ovf.<to type>.un`. (dotnet#56450)
  Mark HandleProcessCorruptedStateExceptionsAttribute as obsolete (dotnet#56664)
  Enable SxS install of previews on Mac OS (dotnet#56797)
  CoreCLR runtime tests + Mono on the x64 iOS simulator (dotnet#43954)
  [main] Update dependencies from mono/linker (dotnet#56593)
  STJ: Fix deserialization of UInt16 properties (dotnet#56793)
  • Loading branch information
thaystg committed Aug 4, 2021
2 parents 33652d5 + 55cea64 commit f56ef84
Show file tree
Hide file tree
Showing 57 changed files with 2,023 additions and 117 deletions.
33 changes: 32 additions & 1 deletion docs/design/specs/Ecma-335-Augments.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ This is a list of additions and edits to be made in ECMA-335 specifications. It
- [Default Interface Methods](#default-interface-methods)
- [Static Interface Methods](#static-interface-methods)
- [Covariant Return Types](#covariant-return-types)
- [Unsigned data conversion with overflow detection](#unsigned-data-conversion-with-overflow-detection)

## Signatures

Expand Down Expand Up @@ -907,4 +908,34 @@ For this example, the behavior of calls on objects of various types is presented
| D | B::VirtualFunction() | ERROR | A program containing type D is not valid, as B::VirtualFunction would be implemented by D::VirtualFunction which is not *covariant-return-compatible-with* (§I.8.7.1) B::VirtualFunction |
"
### II.22.27
Edit rule 12 to specify that "The method signature defined by *MethodBody* shall match those defined by *MethodDeclaration* exactly if *MethodDeclaration* defines a method on an interface or be *covariant-return-compatible-with* (§I.8.7.1) if *MethodDeclaration* represents a method on a class."
Edit rule 12 to specify that "The method signature defined by *MethodBody* shall match those defined by *MethodDeclaration* exactly if *MethodDeclaration* defines a method on an interface or be *covariant-return-compatible-with* (§I.8.7.1) if *MethodDeclaration* represents a method on a class."

## Unsigned data conversion with overflow detection

`conv.ovf.<to type>.un` opcode is purposed for converting a value on the stack to an integral value while treating the stack source as unsigned. Ecma does not distinguish signed and unsigned values on the stack so such opcode is needed as a complement for `conv.ovf.<to type>`.
So if the value on the stack is 4-byte size integral created by `Ldc_I4 0xFFFFFFFF` the results of different conversion opcodes will be:

* conv.ovf.i4 -> -1 (0xFFFFFFFF)
* conv.ovf.u4 -> overflow
* conv.ovf.i4.un -> overflow
* conv.ovf.u4.un -> uint.MaxValue (0xFFFFFFFF)

However, the source of these opcodes can be a float value and it was not clear how in such case .un should be treated. The ECMA was saying: "The item on the top of the stack is treated as an unsigned value before the conversion." but there was no definition of "treated" so the result of:

```
ldc.r4 -1
conv.ovf.i4.un
```
was ambiguous, it could treat -1 as 0xFFFFFFFF and return 0xFFFFFFFF or it could throw an overflow exception.

### III.3.19, conv.ovf.to type.un (page 354)
(Edit 1st Description paragraph:)
Convert the value on top of the stack to the type specified in the opcode, and leave that converted
value on the top of the stack. If the value cannot be represented, an exception is thrown.

(Edit 2nd Description paragraph:)

Conversions from floating-point numbers to integral values truncate the number toward zero and used as-is ignoring .un suffix. The integral item
on the top of the stack is reinterpreted as an unsigned value before the conversion.
Note that integer values of less than 4 bytes are extended to int32 (not native int) on the
evaluation stack.
1 change: 1 addition & 0 deletions docs/project/list-of-diagnostics.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ The PR that reveals the implementation of the `<IncludeInternalObsoleteAttribute
| __`SYSLIB0029`__ | ProduceLegacyHmacValues is obsolete. Producing legacy HMAC values is no longer supported. |
| __`SYSLIB0030`__ | HMACSHA1 always uses the algorithm implementation provided by the platform. Use a constructor without the useManagedSha1 parameter. |
| __`SYSLIB0031`__ | EncodeOID is obsolete. Use the ASN.1 functionality provided in System.Formats.Asn1. |
| __`SYSLIB0032`__ | Recovery from corrupted process state exceptions is not supported; HandleProcessCorruptedStateExceptionsAttribute is ignored. |

## Analyzer Warnings

Expand Down
8 changes: 4 additions & 4 deletions eng/Version.Details.xml
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>c6a28c81f96d196338b3ea520bc1e6dc7c440ee2</Sha>
</Dependency>
<Dependency Name="Microsoft.DotNet.Build.Tasks.Installers" Version="6.0.0-beta.21373.11">
<Dependency Name="Microsoft.DotNet.Build.Tasks.Installers" Version="6.0.0-beta.21403.2">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>c6a28c81f96d196338b3ea520bc1e6dc7c440ee2</Sha>
<Sha>35a36a8ec705945b20275a7d63478affb396ff89</Sha>
</Dependency>
<Dependency Name="Microsoft.DotNet.Build.Tasks.Workloads" Version="6.0.0-beta.21373.11">
<Uri>https://github.com/dotnet/arcade</Uri>
Expand Down Expand Up @@ -186,9 +186,9 @@
<Uri>https://github.com/dotnet/runtime</Uri>
<Sha>95863758cd16c345d0b8fca067d5db5d6901e498</Sha>
</Dependency>
<Dependency Name="Microsoft.NET.ILLink.Tasks" Version="6.0.100-preview.6.21378.1">
<Dependency Name="Microsoft.NET.ILLink.Tasks" Version="6.0.100-preview.6.21402.2">
<Uri>https://github.com/mono/linker</Uri>
<Sha>0cb9250a903cfc90cbac602ed79c0cbc588d8d3f</Sha>
<Sha>ae18468b8712503aee67911228dd921601bd423a</Sha>
</Dependency>
<Dependency Name="Microsoft.DotNet.XHarness.TestRunners.Xunit" Version="1.0.0-prerelease.21373.1">
<Uri>https://github.com/dotnet/xharness</Uri>
Expand Down
4 changes: 2 additions & 2 deletions eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
<MicrosoftDotNetXUnitExtensionsVersion>6.0.0-beta.21373.11</MicrosoftDotNetXUnitExtensionsVersion>
<MicrosoftDotNetXUnitConsoleRunnerVersion>2.5.1-beta.21373.11</MicrosoftDotNetXUnitConsoleRunnerVersion>
<MicrosoftDotNetBuildTasksArchivesVersion>6.0.0-beta.21373.11</MicrosoftDotNetBuildTasksArchivesVersion>
<MicrosoftDotNetBuildTasksInstallersVersion>6.0.0-beta.21373.11</MicrosoftDotNetBuildTasksInstallersVersion>
<MicrosoftDotNetBuildTasksInstallersVersion>6.0.0-beta.21403.2</MicrosoftDotNetBuildTasksInstallersVersion>
<MicrosoftDotNetBuildTasksPackagingVersion>6.0.0-beta.21373.11</MicrosoftDotNetBuildTasksPackagingVersion>
<MicrosoftDotNetBuildTasksWorkloadsPackageVersion>6.0.0-beta.21373.11</MicrosoftDotNetBuildTasksWorkloadsPackageVersion>
<MicrosoftDotNetRemoteExecutorVersion>6.0.0-beta.21373.11</MicrosoftDotNetRemoteExecutorVersion>
Expand Down Expand Up @@ -166,7 +166,7 @@
<!-- Docs -->
<MicrosoftPrivateIntellisenseVersion>5.0.0-preview-20201009.2</MicrosoftPrivateIntellisenseVersion>
<!-- ILLink -->
<MicrosoftNETILLinkTasksVersion>6.0.100-preview.6.21378.1</MicrosoftNETILLinkTasksVersion>
<MicrosoftNETILLinkTasksVersion>6.0.100-preview.6.21402.2</MicrosoftNETILLinkTasksVersion>
<MicrosoftNETILLinkAnalyzerPackageVersion>$(MicrosoftNETILLinkTasksVersion)</MicrosoftNETILLinkAnalyzerPackageVersion>
<!-- ICU -->
<MicrosoftNETCoreRuntimeICUTransportVersion>6.0.0-rc.1.21369.1</MicrosoftNETCoreRuntimeICUTransportVersion>
Expand Down
10 changes: 7 additions & 3 deletions eng/pipelines/coreclr/templates/helix-queues-setup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,22 @@ jobs:
runtimeFlavorDisplayName: ${{ parameters.runtimeFlavorDisplayName }}
helixQueues:

# iOS/tvOS simulator x64/x86
- ${{ if in(parameters.platform, 'iOSSimulator_x64', 'tvOSSimulator_x64') }}:
- OSX.1015.Amd64.Open

# Android arm64
- ${{ if in(parameters.platform, 'Android_arm64') }}:
- Windows.10.Amd64.Android.Open

# Android x64
- ${{ if in(parameters.platform, 'Android_x64') }}:
- Ubuntu.1804.Amd64.Android.Open

# Browser wasm
- ${{ if eq(parameters.platform, 'Browser_wasm') }}:
- Ubuntu.1804.Amd64.Open

# Linux arm
- ${{ if eq(parameters.platform, 'Linux_arm') }}:
- ${{ if eq(variables['System.TeamProject'], 'public') }}:
Expand Down
42 changes: 42 additions & 0 deletions eng/pipelines/runtime-staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,48 @@ jobs:
creator: dotnet-bot
testRunNamePrefixSuffix: Mono_$(_BuildConfig)

#
# Build the whole product using Mono and run runtime tests with the JIT.
#
- template: /eng/pipelines/common/platform-matrix.yml
parameters:
jobTemplate: /eng/pipelines/common/global-build-job.yml
helixQueuesTemplate: /eng/pipelines/coreclr/templates/helix-queues-setup.yml
buildConfig: Release
runtimeFlavor: mono
platforms:
- iOSSimulator_x64
variables:
- ${{ if and(eq(variables['System.TeamProject'], 'public'), eq(variables['Build.Reason'], 'PullRequest')) }}:
- name: _HelixSource
value: pr/dotnet/runtime/$(Build.SourceBranch)
- ${{ if and(eq(variables['System.TeamProject'], 'public'), ne(variables['Build.Reason'], 'PullRequest')) }}:
- name: _HelixSource
value: ci/dotnet/runtime/$(Build.SourceBranch)
- name: timeoutPerTestInMinutes
value: 60
- name: timeoutPerTestCollectionInMinutes
value: 180
jobParameters:
testGroup: innerloop
nameSuffix: AllSubsets_Mono_RuntimeTests
buildArgs: -s mono+libs -c $(_BuildConfig)
timeoutInMinutes: 240
condition: >-
or(
eq(dependencies.evaluate_paths.outputs['SetPathVars_runtimetests.containsChange'], true),
eq(dependencies.evaluate_paths.outputs['SetPathVars_mono.containsChange'], true),
eq(variables['isFullMatrix'], true))
# Test execution is temporarily disabled because test apps no longer launch
# and the test suite times out after two hours, even if xharness cannot
# successfully launch any tests. Re-enable once these issues have been fixed.
#
# extra steps, run tests
# extraStepsTemplate: /eng/pipelines/common/templates/runtimes/android-runtime-and-send-to-helix.yml
# extraStepsParameters:
# creator: dotnet-bot
# testRunNamePrefixSuffix: Mono_$(_BuildConfig)

#
# Build the whole product using Mono for Android and run runtime tests with Android devices
#
Expand Down
2 changes: 2 additions & 0 deletions eng/testing/linker/SupportFiles/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
<!-- Suppress analyzer and linker warnings as these are tests -->
<EnableTrimAnalyzer>false</EnableTrimAnalyzer>
<SuppressTrimAnalysisWarnings>true</SuppressTrimAnalysisWarnings>
<!-- Can be removed when SDK update picks up https://github.com/dotnet/sdk/pull/18655. -->
<NoWarn>$(NoWarn);IL2111</NoWarn>
</PropertyGroup>

<ItemGroup>
Expand Down
2 changes: 2 additions & 0 deletions eng/testing/tests.mobile.targets
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
<PublishTrimmed>true</PublishTrimmed>
<!-- Suppress linker warnings as these are tests -->
<SuppressTrimAnalysisWarnings>true</SuppressTrimAnalysisWarnings>
<!-- Can be removed when SDK update picks up https://github.com/dotnet/sdk/pull/18655. -->
<NoWarn>$(NoWarn);IL2111</NoWarn>
<!-- https://github.com/dotnet/sdk/issues/18581 tracks needing to set 2 properties to disable warnings. -->
<EnableTrimAnalyzer>false</EnableTrimAnalyzer>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -523,10 +523,10 @@ private sealed class LicenseClassFactory : IClassFactory2
private readonly LicenseInteropProxy _licenseProxy = new LicenseInteropProxy();
private readonly Guid _classId;

[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.Interfaces)]
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.Interfaces | DynamicallyAccessedMemberTypes.PublicConstructors)]
private readonly Type _classType;

public LicenseClassFactory(Guid clsid, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.Interfaces)] Type classType)
public LicenseClassFactory(Guid clsid, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.Interfaces | DynamicallyAccessedMemberTypes.PublicConstructors)] Type classType)
{
_classId = clsid;
_classType = classType;
Expand Down Expand Up @@ -627,6 +627,9 @@ internal sealed class LicenseInteropProxy
private object? _licContext;
private Type? _targetRcwType;

[UnconditionalSuppressMessage("ReflectionAnalysis", "IL2111:ReflectionToDynamicallyAccessedMembers",
Justification = "The type parameter to LicenseManager.CreateWithContext method has PublicConstructors annotation. We only invoke this method" +
"from AllocateAndValidateLicense which annotates the value passed in with the same annotation.")]
public LicenseInteropProxy()
{
Type licManager = Type.GetType("System.ComponentModel.LicenseManager, System.ComponentModel.TypeConverter", throwOnError: true)!;
Expand Down Expand Up @@ -742,7 +745,7 @@ public string RequestLicKey(Type type)
// If we are being entered because of a call to ICF::CreateInstanceLic(),
// "isDesignTime" will be "false" and "key" will point to a non-null
// license key.
public object AllocateAndValidateLicense(Type type, string? key, bool isDesignTime)
public object AllocateAndValidateLicense([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] Type type, string? key, bool isDesignTime)
{
object?[] parameters;
object? licContext;
Expand Down
3 changes: 3 additions & 0 deletions src/libraries/Common/src/System/Obsoletions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -104,5 +104,8 @@ internal static class Obsoletions

internal const string CryptoConfigEncodeOIDMessage = "EncodeOID is obsolete. Use the ASN.1 functionality provided in System.Formats.Asn1.";
internal const string CryptoConfigEncodeOIDDiagId = "SYSLIB0031";

internal const string CorruptedStateRecoveryMessage = "Recovery from corrupted process state exceptions is not supported; HandleProcessCorruptedStateExceptionsAttribute is ignored.";
internal const string CorruptedStateRecoveryDiagId = "SYSLIB0032";
}
}
3 changes: 2 additions & 1 deletion src/libraries/Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,9 @@
SYSLIB0022: Rijndael types.
SYSLIB0023: RNGCryptoServiceProvider.
SYSLIB0025: SuppressIldasmAttribute.
SYSLIB0032: HandleProcessCorruptedStateExceptionsAttribute.
-->
<NoWarn Condition="'$(IsPartialFacadeAssembly)' == 'true'">$(NoWarn);SYSLIB0003;SYSLIB0004;SYSLIB0015;SYSLIB0017;SYSLIB0021;SYSLIB0022;SYSLIB0023;SYSLIB0025</NoWarn>
<NoWarn Condition="'$(IsPartialFacadeAssembly)' == 'true'">$(NoWarn);SYSLIB0003;SYSLIB0004;SYSLIB0015;SYSLIB0017;SYSLIB0021;SYSLIB0022;SYSLIB0023;SYSLIB0025;SYSLIB0032</NoWarn>
<!-- Reset these properties back to blank, since they are defaulted by Microsoft.NET.Sdk -->
<WarningsAsErrors Condition="'$(WarningsAsErrors)' == 'NU1605'" />
<!-- Set the documentation output file globally. -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -824,6 +824,8 @@ Namespace Microsoft.VisualBasic.CompilerServices

<UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026:RequiresUnreferencedCode",
Justification:=IDOBinder.SuppressionJustification)>
<UnconditionalSuppressMessage("ReflectionAnalysis", "IL2111:ReflectionToDynamicallyAccessedMembers",
Justification:=IDOBinder.SuppressionJustification)>
Public Overrides Function FallbackConvert(
ByVal target As DynamicMetaObject,
ByVal errorSuggestion As DynamicMetaObject) As DynamicMetaObject
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,8 @@

namespace System.Data.Common
{
// This coarse suppression silences all RequiresUnreferencedCode warnings in the class.
// https://github.com/mono/linker/issues/2136 tracks making it possible to add more granular suppressions at the member level, and with a different warning code.
[UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026:RequiresUnreferencedCode",
Justification = "The use of GetType preserves members with RequiresUnreferencedCode, but the GetType callsites either "
[UnconditionalSuppressMessage("ReflectionAnalysis", "IL2113:ReflectionToRequiresUnreferencedCode",
Justification = "The use of GetType preserves ICustomTypeDescriptor members with RequiresUnreferencedCode, but the GetType callsites either "
+ "occur in RequiresUnreferencedCode scopes, or have individually justified suppressions.")]
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)]
public class DbConnectionStringBuilder : IDictionary, ICustomTypeDescriptor
Expand Down Expand Up @@ -393,6 +391,9 @@ internal Attribute[] GetAttributesFromCollection(AttributeCollection collection)
return attributes;
}

[UnconditionalSuppressMessage("ReflectionAnalysis", "IL2112:ReflectionToRequiresUnreferencedCode",
Justification = "The use of GetType preserves this member with RequiresUnreferencedCode, but the GetType callsites either "
+ "occur in RequiresUnreferencedCode scopes, or have individually justified suppressions.")]
[RequiresUnreferencedCode("PropertyDescriptor's PropertyType cannot be statically discovered.")]
private PropertyDescriptorCollection GetProperties()
{
Expand All @@ -419,6 +420,9 @@ private PropertyDescriptorCollection GetProperties()
return propertyDescriptors;
}

[UnconditionalSuppressMessage("ReflectionAnalysis", "IL2112:ReflectionToRequiresUnreferencedCode",
Justification = "The use of GetType preserves this member with RequiresUnreferencedCode, but the GetType callsites either "
+ "occur in RequiresUnreferencedCode scopes, or have individually justified suppressions.")]
[RequiresUnreferencedCode("PropertyDescriptor's PropertyType cannot be statically discovered.")]
protected virtual void GetProperties(Hashtable propertyDescriptors)
{
Expand Down Expand Up @@ -526,6 +530,9 @@ protected virtual void GetProperties(Hashtable propertyDescriptors)
}
}

[UnconditionalSuppressMessage("ReflectionAnalysis", "IL2112:ReflectionToRequiresUnreferencedCode",
Justification = "The use of GetType preserves this member with RequiresUnreferencedCode, but the GetType callsites either "
+ "occur in RequiresUnreferencedCode scopes, or have individually justified suppressions.")]
[RequiresUnreferencedCode("The public parameterless constructor or the 'Default' static field may be trimmed from the Attribute's Type.")]
private PropertyDescriptorCollection GetProperties(Attribute[]? attributes)
{
Expand Down
8 changes: 4 additions & 4 deletions src/libraries/System.Data.Common/src/System/Data/DataSet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,6 @@ namespace System.Data
[XmlSchemaProvider(nameof(GetDataSetSchema))]
[XmlRoot(nameof(DataSet))]
[System.Runtime.CompilerServices.TypeForwardedFrom("System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089")]
// This coarse suppression silences all RequiresUnreferencedCode warnings in the class.
// https://github.com/mono/linker/issues/2136 tracks making it possible to add more granular suppressions at the member level, and with a different warning code.
[UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026:RequiresUnreferencedCode",
Justification = "CreateInstanceOfThisType's use of GetType uses only the parameterless constructor, but the annotations preserve all non-public constructors causing a warning for the serialization constructors. Those constructors won't be used here.")]
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicParameterlessConstructor | DynamicallyAccessedMemberTypes.NonPublicConstructors)] // needed by Clone() to preserve derived ctors
public class DataSet : MarshalByValueComponent, IListSource, IXmlSerializable, ISupportInitializeNotification, ISerializable
{
Expand Down Expand Up @@ -231,11 +227,15 @@ protected void GetSerializationData(SerializationInfo info, StreamingContext con

// Deserialize all the tables schema and data of the dataset from binary/xml stream.
[RequiresUnreferencedCode(RequiresUnreferencedCodeMessage)]
[UnconditionalSuppressMessage("ReflectionAnalysis", "IL2112:ReflectionToRequiresUnreferencedCode",
Justification = "CreateInstanceOfThisType's use of GetType uses only the parameterless constructor, but the annotations preserve all non-public constructors causing a warning for the serialization constructors. Those constructors won't be used here.")]
protected DataSet(SerializationInfo info, StreamingContext context) : this(info, context, true)
{
}

[RequiresUnreferencedCode(RequiresUnreferencedCodeMessage)]
[UnconditionalSuppressMessage("ReflectionAnalysis", "IL2112:ReflectionToRequiresUnreferencedCode",
Justification = "CreateInstanceOfThisType's use of GetType uses only the parameterless constructor, but the annotations preserve all non-public constructors causing a warning for the serialization constructors. Those constructors won't be used here.")]
protected DataSet(SerializationInfo info, StreamingContext context, bool ConstructSchema) : this()
{
SerializationFormat remotingFormat = SerializationFormat.Xml;
Expand Down
Loading

0 comments on commit f56ef84

Please sign in to comment.