Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge from dotnet/runtime #898

Merged
merged 99 commits into from
Apr 1, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
99 commits
Select commit Hold shift + click to select a range
8e690a2
Fix PKCS Crypto tests on Android (#50252)
jkoritzinsky Mar 27, 2021
738cd9a
Resolve remaining Xslt-related warnings (round 2) (#50211)
joperezr Mar 27, 2021
3fc609c
Harden SuperPMI replay against missing data (#50307)
BruceForstall Mar 27, 2021
7795971
[mono] Reduce usage of the domain lock (#50313)
vargaz Mar 27, 2021
4f8be19
Add check for JsonConverterFactory (#50219) (#50329)
SkiFoD Mar 28, 2021
312521f
[main] Update dependencies from dotnet/arcade dotnet/xharness (#50278)
dotnet-maestro[bot] Mar 28, 2021
99f4062
Add documentation on ILLink files (#50302)
eerhardt Mar 28, 2021
6b88f89
Use random file names in the TZ tests (#50339)
tarekgh Mar 29, 2021
508df29
catch exceptions in callbacks from native code on OSX in SafeDeleteSs…
wfurt Mar 29, 2021
21734a4
Increase test coverage for Exception.TargetSite (#50275)
MichalStrehovsky Mar 29, 2021
102d1e8
Always clear the local buffer in ArrayBuffer (#49573)
davidfowl Mar 29, 2021
3b0c4e4
Added LoggerMessage.Define overloads to disable IsEnabled check (#50334)
gfoidl Mar 29, 2021
ff465c7
Reenable threadstart tests. (#50343)
Mar 29, 2021
a55b7e0
JIT: tolerate edge profile inconsistencies better. (#50213)
AndyAyersMS Mar 29, 2021
8fc5789
Do not mutate IEnumerable and null values when formatting (#49228)
pergardebrink Mar 29, 2021
860518b
[main] Update dependencies from mono/linker (#50232)
dotnet-maestro[bot] Mar 29, 2021
473f8f6
Fix typo in comment in BitOperation.cs
stephentoub Mar 29, 2021
93b8e18
Use a NewHolder for pEmitter to avoid memory leak (#50242)
omajid Mar 29, 2021
de867a9
Propagate XUnitMethodName/XUnitClassName properties to Android test r…
elinor-fung Mar 29, 2021
3870c9f
Remove unnecessary delegate/closure allocations from PollForValues (#…
stephentoub Mar 29, 2021
617a18d
[wasm] Wasm.Build.Tests: add support for shared builds (#49398)
radical Mar 29, 2021
c7ab19e
Remove some delegate/closures from X509Pal (#50376)
stephentoub Mar 29, 2021
0124dbc
Fix unintended closure in RsaPaddingProcessor.OpenProcessor (#50377)
stephentoub Mar 29, 2021
98ace7d
Set IsTrimmable on CompilerServices.Unsafe (#50370)
sbomer Mar 29, 2021
d261384
Clean up REGUTIL/CLRConfig system (#50314)
AaronRobinsonMSFT Mar 29, 2021
aece157
Remove unnecessary delegate/closure from NtProcessInfoHelper on Windo…
stephentoub Mar 29, 2021
a0d8826
Don't throw when previous enum mapping is not found. (#49892)
StephenMolloy Mar 29, 2021
857fe5b
Singlefile compression of native files (#49855)
VSadov Mar 29, 2021
29e8a13
Fix SuperPMI handling of missing data for asm diffs (#50309)
BruceForstall Mar 30, 2021
a221324
Several WebProxy-related fixes (#50368)
stephentoub Mar 30, 2021
e830f10
Add CancellationTokenSource.TryReset (#50346)
stephentoub Mar 30, 2021
260397c
Do not fold away double negation if the tree is a CSE candidate (#50373)
SingleAccretion Mar 30, 2021
ec0bb49
Annotate CreateInstanceForAnotherGenericParameter as PublicParameterl…
eerhardt Mar 30, 2021
0b9dcc5
ignore empty domain for digets auth (#50348)
wfurt Mar 30, 2021
82c7051
[WASM] Trim TimeZoneInfo to reduce size (#50266)
mattjohnsonpint Mar 30, 2021
ee0c5a2
Move publishing off hosted ADO machines, again (#50405)
lukas-lansky Mar 30, 2021
ff27f82
More Mono unwind fixes for s390x (#49986)
uweigand Mar 30, 2021
ac21254
s390x: Fixes to tailcall and array parameter fix (#49466)
nealef Mar 30, 2021
06ac81a
Add "Help Wanted" badge (#50352)
benaadams Mar 30, 2021
75d8aae
[main] Update dependencies from dotnet/runtime dotnet/xharness (#50358)
dotnet-maestro[bot] Mar 30, 2021
ddb88a4
[interp] Add a few super instructions (#50361)
BrzVlad Mar 30, 2021
6d707d7
Revert "Fix release builds with latest VS dogfood (#49948)" (#50398)
jkotas Mar 30, 2021
45fbba6
Fix waits on iOS (#50388)
CoffeeFlux Mar 30, 2021
4f62f32
increase timout on ConnectTimeout_TimesOutSSLAuth_Throws test (#50351)
wfurt Mar 30, 2021
2175996
Clean up allocated memory on error in CordbEval::NewParameterizedObje…
omajid Mar 30, 2021
0eb48fe
Update dependencies from https://github.com/mono/linker build 2021033…
dotnet-maestro[bot] Mar 30, 2021
2652995
Fix issues with JitDump (#50395)
BruceForstall Mar 30, 2021
20864e7
FileSystemGlobbing: Allow rootDir paths ending with separator to matc…
jozkee Mar 30, 2021
b23205f
Use OptimizeForSize condition in SPC only on Browser (#50413)
akoeplinger Mar 30, 2021
01081d6
expose alloc data on dbi (#50341)
Maoni0 Mar 30, 2021
a5b829e
Rename the superpmi.py asmdiffs output directory (#50403)
BruceForstall Mar 30, 2021
62ac429
[mono] Move the jit info table definitions into a separate jit-info.h…
vargaz Mar 30, 2021
db7e04d
[mono] Remove domain lock (#50328)
vargaz Mar 30, 2021
6d817d9
Make CLOCK_MONOTONIC handling more precise in pal_threading.c (#50441)
akoeplinger Mar 30, 2021
289757c
Fix handling of array constructors in Crossgen2 (#48557)
trylek Mar 30, 2021
082af35
Added the `ConfigureDefaults` API, as an extension method of `IHostBu…
IEvangelist Mar 31, 2021
99d6215
Merge REGUTIL logic for environment variables into CLRConfig (#50393)
AaronRobinsonMSFT Mar 31, 2021
da23d5a
Specify the Size of List<T> Instances in InvokeTypeInfo (#50438)
brianrob Mar 31, 2021
09f075f
Resolve unknown platform name warnings (#50193)
buyaa-n Mar 31, 2021
f181620
[mono] Address comments from PR #50328. (#50462)
vargaz Mar 31, 2021
4f81910
Dont cache file length when handle has been exposed (#50424)
adamsitnik Mar 31, 2021
bce310d
ensure MetadataReader fast path works with every FileStream on every …
adamsitnik Mar 31, 2021
76a50c6
[tests] Add Mono issue to CallConvMemberFunction tests (#50461)
lambdageek Mar 31, 2021
8cc37cb
Rename Random.LegacyImpl (#50456)
stephentoub Mar 31, 2021
cee9df8
Add tracking a recursion depth in System.IO.FileSystem (#48148)
iSazonov Mar 31, 2021
26a0512
[interp] Fix tracing (#50415)
BrzVlad Mar 31, 2021
76b7dd6
[FileStream] Rename "Legacy" to "Net5Compat" (#50470)
adamsitnik Mar 31, 2021
a913740
Fix typo in `string.Join` (#50467)
xtqqczze Mar 31, 2021
b47094d
Allow bounded channel to be created with drop delegate (#50331)
Temppus Mar 31, 2021
2784aad
Add AsyncMethodBuilderOverride and PoolingAsyncValueTaskMethodBuilder…
stephentoub Mar 31, 2021
72e41f9
Fix a crash in WriteMethodProfileDataLogFile (#50473)
clamp03 Mar 31, 2021
b24c458
Rename CreateInstanceT_StructWithoutDefaultConstructor_ThrowsMissingM…
eerhardt Mar 31, 2021
1ce7460
Update testing-android.md (#50484)
fanyang-mono Mar 31, 2021
ba5323e
[mono] Fix the handling of jit icall wrappers in mono_aot_method_hash…
vargaz Mar 31, 2021
bb4acfb
Add IsWellKnownStringComparer methods (#50312)
GrabYourPitchforks Mar 31, 2021
94bb5d2
Support private SuperPMI MCH file stores (#50268)
BruceForstall Mar 31, 2021
4581290
Refactor missing reference errors to allow not throwing for all cases…
davidwrighton Mar 31, 2021
7677f7d
Add option for building a test exe as single file (#42972)
agocke Mar 31, 2021
74cb83d
Also build bundleproj for PGO (#50434)
agocke Mar 31, 2021
28629d9
[AndroidCrypto] Make SslStreamCertificateContext treat an empty chain…
elinor-fung Mar 31, 2021
3c135c5
Prohibit BF unless the app opts in (#48527)
Mar 31, 2021
d5aeac9
Fix usage of process_vm_readv in createdump (#50477)
hoyosjs Mar 31, 2021
da5dfef
add android scenarios (#50407)
billwert Mar 31, 2021
4249956
Avoid closure in ValidationContext if serviceProvider is null (#50483)
stephentoub Mar 31, 2021
bdadd59
Reenable Android.Device_Emulator.Aot.Test.csproj (#50332)
akoeplinger Mar 31, 2021
ef8c5c7
Fix msquic.dll loading (#50506)
CarnaViire Mar 31, 2021
1adf9ad
[main] Update dependencies from dotnet/arcade dotnet/icu dotnet/xharn…
dotnet-maestro[bot] Mar 31, 2021
13c1b8f
Fix linux test legs (#50518)
billwert Mar 31, 2021
e164551
fix XML tag (#50523)
billwert Mar 31, 2021
9e9fb06
Fix accidental closure in Regex.Replace (#50512)
stephentoub Apr 1, 2021
e5efbd8
Avoid closure in WebSocketHandle.ConnectAsync (#50502)
stephentoub Apr 1, 2021
78acffe
Big-endian fix: Accessing OBJECTHEADER in ImageConverter (#50499)
uweigand Apr 1, 2021
a6d7472
Update dependencies from https://github.com/mono/linker build 2021033…
dotnet-maestro[bot] Apr 1, 2021
c474b6e
Stop skipping entire System.Net.Http functional test suite on Android…
elinor-fung Apr 1, 2021
9064eed
Add ExceptionDispatchInfo.SetRemoteStackTrace (#50392)
GrabYourPitchforks Apr 1, 2021
00d4dd8
Cleanup name of test exclusion itemgroup (#50513)
akoeplinger Apr 1, 2021
ad56f5d
Merge remote-tracking branch 'upstream/runtime-main' into merge-master
jkotas Apr 1, 2021
e9f004b
Fix build breaks
jkotas Apr 1, 2021
de57531
Fix test failure
jkotas Apr 1, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
]
},
"microsoft.dotnet.xharness.cli": {
"version": "1.0.0-prerelease.21175.2",
"version": "1.0.0-prerelease.21180.1",
"commands": [
"xharness"
]
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ This project is successor of RyuJIT CodeGen from [CoreRT](https://github.com/dot
---

# .NET Runtime

[![Build Status](https://dnceng.visualstudio.com/public/_apis/build/status/dotnet/runtime/runtime?branchName=main)](https://dnceng.visualstudio.com/public/_build/latest?definitionId=686&branchName=main)
[![Help Wanted](https://img.shields.io/github/issues/dotnet/runtime/up-for-grabs?style=flat-square&color=%232EA043&label=help%20wanted)](https://github.com/dotnet/runtime/issues?q=is%3Aissue+is%3Aopen+label%3A%22up-for-grabs%22)
[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/dotnet/runtime)
[![Discord](https://img.shields.io/discord/732297728826277939?style=flat-square&label=Discord&logo=discord&logoColor=white&color=7289DA)](https://aka.ms/dotnet-discord)

Expand Down
3 changes: 3 additions & 0 deletions docs/coding-guidelines/project-guidelines.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,9 @@ All libraries should use `<Reference Include="..." />` for all their references

Other target frameworks than .NETCoreApp latest (i.e. `netstandard2.0`, `net461`, `netcoreapp3.0`) should use ProjectReference items to reference dependencies.

### src\ILLink
Contains the files used to direct the trimming tool. See [ILLink files](../workflow/trimming/ILLink-files.md).

### src output
All src outputs are under

Expand Down
1 change: 1 addition & 0 deletions docs/workflow/testing/libraries/testing-android.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ curl https://dl.google.com/android/repository/commandlinetools-${HOST_OS_SHORT}-
mkdir ${ANDROID_SDK_ROOT} && unzip ~/asdk.zip -d ${ANDROID_SDK_ROOT}/cmdline-tools && rm -rf ~/asdk.zip
yes | ${ANDROID_SDK_ROOT}/cmdline-tools/tools/bin/sdkmanager --sdk_root=${ANDROID_SDK_ROOT} --licenses
${ANDROID_SDK_ROOT}/cmdline-tools/tools/bin/sdkmanager --sdk_root=${ANDROID_SDK_ROOT} "platform-tools" "platforms;android-${SDK_API_LEVEL}" "build-tools;${SDK_BUILD_TOOLS}"
```

## Building Libs and Tests for Android

Expand Down
45 changes: 45 additions & 0 deletions docs/workflow/trimming/ILLink-files.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# ILLink Files

There are a few `ILLink.*.xml` files under `src` folders in `dotnet/runtime`. These files are used by the trimming tool for various reasons.

See https://github.com/mono/linker/blob/main/docs/data-formats.md for full documentation on these files.

## ILLink.Descriptors.xml

Descriptors are used to direct the trimming tool to always keep some items in the assembly, regardless of if the trimming tool can find any references to them.

We try to limit the usage of descriptor files as much as possible. Since using a descriptor means the code will always be preserved, even in the final application. Typically the main scenario they are used is when non-IL code (e.g. C/C++, JavaScript, etc.) is calling into IL code. The trimming tool isn't able to see the non-IL code, so it doesn't know which IL methods are necessary.

In some cases it is only necessary to preserve items only during `dotnet/runtime`'s build, but we don't want to unconditionally preserve them in an the final application. Examples of these cases are non-public methods only used by tests, or non-public methods that are called through Reflection by another assembly. To only preserve items during `dotnet/runtime`'s build, use a `ILLink.Descriptors.LibraryBuild.xml` file.

In almost all cases, when using a descriptors file, add a comment justifying why it is necessary.

## ILLink.Substitutions.xml

Substitutions direct the trimming tool to replace specific method's body with either a throw or return constant statements.

These files are mainly used to implement [feature switches](feature-switches.md).

They can also be used to hard-code constants depending on the platform we are building for, typically in `System.Private.CoreLib.dll` since, at this time, that is the only assembly we build specifically for each target architecture. In those cases, there are multiple `ILLink.Substitutions.{arch}.xml` files, which get included depending on the architecture. This is possible through an MSBuild Item `@(ILLinkSubstitutionsXmls)` which can conditionally get added to, and all the .xml files are combined into a final `ILLink.Substitutions.xml`, which is embedded into the assembly.

## ILLink.Suppressions.xml

When we build `dotnet/runtime`, we run the trimming tool to analyze our assemblies for code that is using patterns (like Reflection) that may be broken once the application is trimmed. When the trimming tool encounters code that isn't trim compatible, it issues a warning. Because we haven't addressed all these warnings in the code, we suppress the existing warnings in `ILLink.Suppressions.xml` files, and fail the build when an unsuppressed warning is encountered. This ensures that no new code can introduce new warnings while we are addressing the existing warnings.

If your new feature or bug fix is introducing new ILLink warnings, the warnings need to be addressed before your PR can be merged. No new suppressions should be added to an `ILLink.Suppressions.xml` file. To address the warnings, see [Linking the .NET Libraries](https://github.com/dotnet/designs/blob/main/accepted/2020/linking-libraries.md). Typically, either adding `[DynamicallyAccessedMembers]` or `[RequiresUnreferencedCode]` attributes are acceptable ways of addressing the warnings. If the warning is a false-positive (meaning it is trim compatible, but the trimming tool wasn't able to tell), it can be suppressed in code using an `[UnconditionalSuppressMessage]`.

ILLink warnings that are suppressed by the `ILLink.Suppressions.xml` file will still be emitted when the final application is published. This allows developers to see where their application might be broken when it is trimmed. Warnings that are suppressed by `[UnconditionalSuppressMessage]` attributes in `dotnet/runtime` code will never be emitted, during the `dotnet/runtime` build nor in the final application.

Sometimes it is beneficial to leave an ILLink warning as unsuppressed so the final application's developer sees the warning. An examples of this is using the [`Startup Hooks`](../../design/features/host-startup-hook.md) feature in .NET. By default this feature is disabled when trimming a .NET application. However, the application can re-enable the feature. When they do, an ILLInk warning is emitted when the application is trimmed telling them the feature may not work after trimming.

To suppress a warning only in the `dotnet/runtime` build, but keep emitting it in the final application, add the warning to a `ILLink.Suppressions.LibraryBuild.xml` file, and include a justification why this approach was taken.

## ILLink.LinkAttributes.xml

Attribute annotations direct the trimming tool to behave as if the specified item has the specified attribute.

This is mainly used to tell the trimming tool which attributes to remove from the trimmed application. This is useful because some attributes are only needed at development time. They aren't necessary at runtime. Trimming unnecessary attributes can make the application smaller.

Under the covers, the way this works is that the `ILLink.LinkAttributes.xml` tells the trimming tool to act like a `[RemoveAttributeInstances]` attribute is applied to the attribute type we want to remove. The trimming tool removes any instantiations of the attribute in all the assemblies of the application. However, if the trimming tool encounters code that is trying to read the attribute at runtime, it doesn't trim the attribute instances. For example, if runtime code is reading the `ObsoleteAttribute`, `ObsoleteAttribute` instances won't be trimmed even if it was asked to be removed through this file.

This is also how the above `ILLink.Suppressions.xml` file works under the covers. It injects `[UnconditionalSuppressMessage]` attributes to tell the trimming tool to act as if there was a suppress attribute in code.
1 change: 1 addition & 0 deletions docs/workflow/trimming/feature-switches.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ configurations but their defaults might vary as any SDK can set the defaults dif
| StartupHookSupport | System.StartupHookProvider.IsSupported | Startup hooks are disabled when set to false. Startup hook related functionality can be trimmed. |
| TBD | System.Threading.ThreadPool.EnableDispatchAutoreleasePool | When set to true, creates an NSAutoreleasePool around each thread pool work item on applicable platforms. |
| CustomResourceTypesSupport | System.Resources.ResourceManager.AllowCustomResourceTypes | Use of custom resource types is disabled when set to false. ResourceManager code paths that use reflection for custom types can be trimmed. |
| EnableUnsafeBinaryFormatterInDesigntimeLicenseContextSerialization | System.ComponentModel.TypeConverter.EnableUnsafeBinaryFormatterInDesigntimeLicenseContextSerialization | BinaryFormatter serialization support is trimmed when set to false. |

Any feature-switch which defines property can be set in csproj file or
on the command line as any other MSBuild property. Those without predefined property name
Expand Down
6 changes: 3 additions & 3 deletions eng/Subsets.props
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@
$(CoreClrProjectRoot)crossgen-corelib.proj" Category="clr" />
</ItemGroup>

<ItemGroup Condition="$(_subset.Contains('+clr.packages+'))">
<ItemGroup Condition="$(_subset.Contains('+clr.packages+')) and '$(PgoInstrument)' != 'true'">
<ProjectToBuild Include="$(CoreClrProjectRoot).nuget\coreclr-packages.proj" Pack="true" Category="clr" />
<ProjectToBuild Include="$(CoreClrProjectRoot)tools\dotnet-pgo\dotnet-pgo-pack.proj" Pack="true" BuildInParallel="false" Category="clr" />
</ItemGroup>
Expand Down Expand Up @@ -316,7 +316,7 @@
<ProjectToBuild Include="@(ManagedProjectToBuild)" BuildInParallel="true" Pack="true" Category="host" />
</ItemGroup>

<ItemGroup Condition="$(_subset.Contains('+host.pkg+'))">
<ItemGroup Condition="$(_subset.Contains('+host.pkg+')) and '$(PgoInstrument)' != 'true'">
<PkgprojProjectToBuild Include="$(InstallerProjectRoot)pkg\projects\host-packages.proj" SignPhase="MsiFiles" BuildInParallel="false" />
<ProjectToBuild Include="@(PkgprojProjectToBuild)" Pack="true" Category="host" />
</ItemGroup>
Expand All @@ -342,10 +342,10 @@
<SharedFrameworkProjectToBuild Condition="'$(RuntimeFlavor)' != 'Mono'" Include="$(InstallerProjectRoot)pkg\sfx\installers\dotnet-hostfxr.proj" />
<SharedFrameworkProjectToBuild Condition="'$(RuntimeFlavor)' != 'Mono'" Include="$(InstallerProjectRoot)pkg\sfx\installers\dotnet-runtime-deps\*.proj" />
<SharedFrameworkProjectToBuild Condition="'$(MonoCrossAOTTargetOS)' != ''" Include="$(InstallerProjectRoot)pkg\sfx\Microsoft.NETCore.App\monocrossaot.sfxproj" />
<SharedFrameworkProjectToBuild Condition="'$(RuntimeFlavor)' != 'Mono'" Include="$(InstallerProjectRoot)pkg\sfx\bundle\Microsoft.NETCore.App.Bundle.bundleproj" />
</ItemGroup>
<ItemGroup>
<SharedFrameworkProjectToBuild Condition="'$(BuildMonoAOTCrossCompilerOnly)' != 'true'" Include="$(InstallerProjectRoot)pkg\sfx\Microsoft.NETCore.App\Microsoft.NETCore.App.Runtime.sfxproj" />
<SharedFrameworkProjectToBuild Condition="'$(RuntimeFlavor)' != 'Mono'" Include="$(InstallerProjectRoot)pkg\sfx\bundle\Microsoft.NETCore.App.Bundle.bundleproj" />
<ProjectToBuild Include="@(SharedFrameworkProjectToBuild)" Category="packs" />
</ItemGroup>
</When>
Expand Down
Loading